R latex2exp切换回非下标

问题描述 投票:0回答:2

尝试使用R latex2exp软件包,语法有问题。尝试使用文本Z(u +下标字母符号然后)创建标签。无法解决如何获得字母的下标以中括号未下标的原因而终止。

R代码示例

require(latex2exp)
plot(1,2)
text(1,2,TeX('Z(u$_\\alpha$)'),cex = 4)
r latex
2个回答
1
投票

用括号括起来就可以了:

plot(1, 2, pch = 19)
text(1, 2.4, latex2exp::TeX('$Z(u_{\\alpha})$'), cex = 4)

TeX

另请参阅latex2exp::latex2exp_examples()

© www.soinside.com 2019 - 2024. All rights reserved.