表达式中的上标和下标相同的字符
问题描述:
在情节中,我想要一个标题,该标题应具有:
In a plot I would like a title which should have:
字符串我的标题是",后跟由'
引起的caharecter alpha(即alpha素数),alpha也带有下标G.
the string "my title is" followed by the caharecter alpha raised by '
(i.e. alpha prime) with alpha also having the subscript G.
我尝试过:
expression(paste("my title is ",alpha^{"'"}[G],")"))
,但是上面的代码将alpha提升为幂'G
.如何在'
上标而不在G
下标?
but the above code raises alpha to the power 'G
. How do I superscript the '
but subscript the G
?
答
以下任一方法都能解决问题:
Either of the following would do the trick:
alpha[G]^"'"
{alpha^{"'"}}[G]
它们的排版略有不同,因此请选择您喜欢的任何一个.
They are typeset slightly differently, so pick whichever you prefer.