How does one use the ' symbol ("apostrophe") in math mode without letting it change the depth of subscripts?

For example the following tex code:

\int_{G^d} \varphi_{\ul,\ui} \varphi_{\ul',\ui'} \varphi_{\ul\prime,\ui\prime}  dx

yields the following result


We notice that using the apostrophe ' looks way better than the overall result from using \prime, but sadly using ' affects the depth below the baseline at which subscripts are placed.

How can one use ' properly in math mode?



  • Welcome! I'm not sure what you mean by “the subscripts do not have the same size”.
    – egreg
    May 12 '19 at 17:58
  • hey. Thanks for the answer. If you look really close you see in the screenshot that the secound $\underline{l}', \underline{i}'$ is a big bigger than the other ones. See the picture I added :)
    – mrmeaaan
    May 12 '19 at 18:12
  • 8
    \prime is a full-size glyph, and is meant to be used only in an explicit superscript, by itself. Hence, instead of \phi_{l\prime}, use \phi_{l^{\prime}}. (The apostrophe is equivalent to ^{\prime} with finagling to allow multiple apostrophes to be input consecutively without triggering a "double superscript" error.) May 12 '19 at 22:49

If you want subscripts to be on the same level, just add \mathstrut to them. A strut is an invisible thin vertical rectangle used in vertical spacing.

\int_{G^d} \varphi_{\mathstrut l,i} \varphi_{\mathstrut l',i'} dx

enter image description here

P.S. In addition to \mathstrut, \strut also works, but @Mico suggests below, using \mathstrut instead of \strut is better in math mode.


They're not smaller, but lowered less than the primed subscripts. Use a phantom, when you have to align subscripts.




\int_{G^d} \varphi_{\ul\vp,\ui\vp} \varphi_{\ul',\ui'}\,dx


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.