user1320502
user1320502

Reputation: 2570

superscript and subscript the same character in an expression

In a plot I would like a title which should have:

the string "my title is" followed by the caharecter alpha raised by ' (i.e. alpha prime) with alpha also having the subscript G.

I tried:

expression(paste("my title is ",alpha^{"'"}[G],")"))

but the above code raises alpha to the power 'G . How do I superscript the ' but subscript the G ?

Upvotes: 4

Views: 7405

Answers (2)

NPE
NPE

Reputation: 500357

Either of the following would do the trick:

alpha[G]^"'"
{alpha^{"'"}}[G]

They are typeset slightly differently, so pick whichever you prefer.

Upvotes: 5

user1320502
user1320502

Reputation: 2570

Changing the syntax to the following works:

expression(paste("my title is ",alpha[G]^{"'"},")")))

Upvotes: 2

Related Questions