Skip to content

[Tex:Fraction&Super/Subscript]分数输入与上下标 #1535

Answered by TonyCrane
Acpear asked this question in Q&A
Discussion options

You must be logged in to vote

你使用的是Tex,所以你不用在传入字符串里加入$$
这样使用就没有问题了:

frac = Tex("F=G\\frac{m_{1}m_{2}}{r^{2}}")

TexText是直接的LaTeX环境,编写公式需要$$
Tex是LaTeX的align环境,编写公式不需要$$,但写文字需要\text{}
所以这个和下面使用TexText的效果是一样的:

frac = TexText("$F=G\\dfrac{m_{1}m_{2}}{r^{2}}$") # 使用\dfrac启用display style来达到一样的大小

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@Acpear
Comment options

@TonyCrane
Comment options

@Acpear
Comment options

@Acpear
Comment options

Answer selected by TonyCrane
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants