11

Here is the MWE:

\documentclass{article}
\begin{document}
\[
\hat{R}^2\quad\frac{1}{\hat{R}^2}
\]
\end{document}

which give (I highlight with red for better see the lower "2" in the second expression): enter image description here

5
  • 6
    That's the standard behavior. In denominators, TeX use the “cramped” style, that raises exponents less than in the “normal” style.
    – egreg
    Commented Jul 6, 2021 at 10:18
  • 1
    You could use \displaystyle to set the denominator in the normal style. Commented Jul 6, 2021 at 10:21
  • 1
    @IanThompson \textstyle, but yes. Commented Jul 6, 2021 at 10:35
  • @IanThompson and David Carlisle: great advice! Thanks.
    – quark67
    Commented Jul 6, 2021 at 10:36
  • @DavidCarlisle --- I'd forgotten about that. Commented Jul 6, 2021 at 10:54

2 Answers 2

16

Just to follow-up on @DavidCarlisle's answer: One can undo cramped-textstyle mode in the denominator of a \dfrac expression by issuing the directive \textstyle. Conversely, one can force cramped displaystyle by loading the mathtools package and making use of its \cramped macro.

enter image description here

\documentclass{article}
\usepackage{mathtools}  % for 'cramped' macro
\begin{document}
\[
R^2 \quad                     % uncramped displaystyle
\cramped{R^2} \quad           % cramped   displaystyle
\frac{1}{R^2 R^2} \quad       % cramped   textstyle
\frac{1}{\textstyle R^2 R^2}  % uncramped textstyle
\]
\end{document}

If you look really closely, you'll notice that the exponent isn't set quite as high in uncramped textstyle math mode as it is in uncramped displaystyle math mode.

1
  • 2
    I hesitate which answer I will accept. Your answer give a useful workaround, David Carlisle answer give a explanation.
    – quark67
    Commented Jul 6, 2021 at 10:57
13

Not really a bug just a perhaps unfortunate combination of features.

enter image description here

\documentclass{article}
\begin{document}
\[
\hat{R}^2R^2\quad\frac{1}{\hat{R}^2 R^2}\quad\frac{1}{R^2 R^2}
\]
\end{document}

The superscript on the accented base is positioned to match that on an unaccented base, not raised higher.

denominators are set in "cramped mode" to avoid opening up the fraction.

But with the accented R the fraction is opened up in any case.

This behaviour is really set in the tex core layout rules and the font parameters of the font being used, not directly by LaTeX.

5
  • Good explanation. I never heard about "cramped mode" in LaTeX. Neither in Guide to LaTeX, Fourth Edition, nor in the LaTeX Companion, 2th edition (the later in French translation). Perhaps I forgot to read the good section?
    – quark67
    Commented Jul 6, 2021 at 10:37
  • @quark67 - To learn more about cramped math styles, I would start with pp. 140f. of The TeXbook.
    – Mico
    Commented Jul 6, 2021 at 10:40
  • Your answer and the answer from Mico are equally useful. I hesitate which answer I will accept. You give explanation, he give workaround.
    – quark67
    Commented Jul 6, 2021 at 10:57
  • 4
    @quark67 general advice is to accept the one you use, so Mico's I guess:-) (I have no objection to people accepting competing answers, as long as they are not one of egreg's :-) Commented Jul 6, 2021 at 11:04
  • 1
    I would've accepted this answer, because it answers the question in the title (rather than the implied "how do I work around this")
    – qwr
    Commented Jul 7, 2021 at 6:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .