# Fix equation superscript squishing

Because isentropic fluid flow is beautiful, I have these wonderful equations to deal with:

Notice how the superscripts have been squished vertically to fit. Is is possible to prevent this from happening? Or at least make the squishing effect square up instead of distorting the characters? I understand that they really need to be shorter, but I would love to have some control over how much smaller and at what aspect ratio it changes the sizing at.

Here's the code for the example:

    $$M=\sqrt{\frac{2}{\gamma-1} {\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\frac{\gamma-1}{\gamma}}-1\Bigg]}}$$

$$\frac{\dot{m}}{A}= \frac{p_0}{\sqrt{T_0}} \sqrt{\frac{\gamma}{R}}M \Bigg(1+\frac{\gamma-1}{2}M^2\Bigg)^{-\frac{\gamma+1}{2(\gamma-1)}}$$

$$\frac{\dot{m}}{A}= \frac{p_0}{\sqrt{T_0}} \sqrt{\frac{\gamma}{R}}\sqrt{\frac{2}{\gamma-1}{\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\frac{\gamma-1}{\gamma}}-1\Bigg]}} \Bigg(1+\frac{\gamma-1}{2}\Bigg(\frac{2}{\gamma-1}{\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\frac{\gamma-1}{\gamma}}-1\Bigg]}\Bigg)^2\Bigg)^{-\frac{\gamma+1}{2(\gamma-1)}}$$

• Are you willing to rewrite the superscript terms using inline-fraction notation, e.g., (\gamma-1)/\gamma? That would take care of the “squishing” very effectively. – Mico Apr 23 '18 at 4:30
• the characters are not distorted by tex, just taken form the designed subscript font. unlrelated, but never put one equation enviornment after another use a multi-line display, and don't use \Bigg( use \Biggl( and \Biggr at the other side. – David Carlisle Apr 23 '18 at 9:36
• @DavidCarlisle What is the difference between \Bigg( and {\Biggl( ,\Biggr)? TBH, I didn't really know the \left and \right commands until my friend pointed it out to me a few minutes ago. – u2berggeist Apr 23 '18 at 13:10
• \bigl gives correct spacing for an opening delimiter and \bigr the spacing for a close (\big shouldn't be used it is the internal shared code for \bigl and \bigr) – David Carlisle Apr 23 '18 at 13:36
• @DavidCarlisle Cool! Thanks for the tip. I'm finding more and more random LaTeX rules everywhere... lol – u2berggeist Apr 23 '18 at 13:44

Note that scripts aren’t squished to save space; they’re squished to be more legible at small sizes. Still, you can turn them off.

With unicode-math, script-style and script-script-style are OpenType font features that are active for superscripts and subscripts by default. You can turn them off by setting script-features and sscript-features to empty when you load the math font.

I’ve taken the liberty of rewriting the sample to use \left, \right, align and split.

\documentclass[preview,varwidth]{standalone}

\usepackage[leqno]{amsmath}
\usepackage{unicode-math}

\setmainfont{TeX Gyre Pagella}
\setmathfont[script-font={Latin Modern Math},
script-features={},
sscript-font={Latin Modern Math},
sscript-features={}
]{Latin Modern Math}

\begin{document}

\begin{align}
M &= \sqrt{\frac{2}{\gamma-1}
{\left[\left(\frac{p_0}{p}\right)^{\frac{\gamma-1}{\gamma}}-1\right]}} \\
\frac{\dot{m}}{A} &=
\frac{p_0}{\sqrt{T_0}}
\sqrt{\frac{\gamma}{R}}M
\left(1+\frac{\gamma-1}{2}M^2\right)^{-\frac{\gamma+1}{2(\gamma-1)}} \\
\begin{split}
\frac{\dot{m}}{A} &=
\frac{p_0}{\sqrt{T_0}}
\sqrt{\frac{\gamma}{R}}\sqrt{\frac{2}{\gamma-1}{\left[\left(\frac{p_0}{p}\right)^{\frac{\gamma-1}{\gamma}}-1\right]}} \cdot\\
\end{split}
\end{align}

\end{document}


You probably do not need to do this with Latin Modern Math, however. Here is the same code with the default settings:

Those are not especially good rasterizations, but the PDFs look better.

You can set other options on the scripts as well, including optical sizes, or even substitute another font for them entirely.

If you feel that the fractional terms in the superscript positions are too small (they're rendered in scriptscript-style, in case you're curious), I suggest you switch from \frac to inline-fraction notation. That way, the elements in the superscript positions will be rendered in script-style, which is about 42% larger than script-script style.

A separate suggestion: Employing \Bigg to size the round parentheses and square brackets makes these "fences" unnecessarily large. Use \Big instead. Don't worry: your readers will still notice the "fences". However, they will now find it much easier to notice and process the material that's inside the fences.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
M    &= \sqrt{\frac{2}{\gamma-1}
\Bigl[\Bigl(\frac{p_0}{p}\Bigr)%
^{\!(\gamma-1)/\gamma}\!-1
\Bigr]}  \\
\frac{\dot{m}}{A}
&= \frac{p_0}{\sqrt{T_0}}
\sqrt{\frac{\gamma}{R}}\,M
\Bigl(1+\frac{\gamma-1}{2}M^2\Bigr)%
^{\!-(\gamma+1)/(2(\gamma-1))} \\
\frac{\dot{m}}{A}
&= \frac{p_0}{\sqrt{T_0}}
\sqrt{\frac{\gamma}{R}}\sqrt{\frac{2}{\gamma-1}\,
\Bigl[\Bigl(\frac{p_0}{p}\Bigr)%
^{\!(\gamma-1)/\gamma}\!-1 \Bigr]} \notag\\
\Bigl(\frac{2}{\gamma-1}
\Bigl[\Bigl(\frac{p_0}{p}\Bigr)%
^{\!(\gamma-1)/\gamma}\!-1 \Bigr]
\Bigr)^{\!2}\,\Bigr)^{\!-(\gamma+1)/(2(\gamma-1))}
\end{align}
\end{document}

• Incidentally, I think there's a mistake in your formula, which I chose not to fix in order to make the output conform to what you posted in your query. Specifically, the squared term in the final row seems to be incorrect: Since M=\sqrt{...} according to the first equation, M^2 in the final row should simply do away with the \sqrt "wrapper" in the final row rather than include a {...}^2 term, right? – Mico Apr 23 '18 at 8:15
• Haha. Yeah, I caught that mistake a minutes after I put that up there. I updated my paper but forgot to fix it hear. Thanks for double checking though! – u2berggeist Apr 23 '18 at 13:04
• In regards to the actual answer, this actually works really well except for the longer fraction. So I'd definitely use it if I only had to do equation (4), but I really like continuity. I'll definitely keep that in mind though. – u2berggeist Apr 23 '18 at 13:07
• @u2berggeist - You need to make a trade-off and decide which method constitutes the lesser of two evils: Either use math-fraction notation for the terms in the exponents, which gives a "squished" look while not taking up a lot of space, or use inline-fraction notation, which avoids squishiness -- but at the expense of taking up more space. Only you can decide which form represents the less or two (typographic) evils. – Mico Apr 23 '18 at 13:13
• Yep, that's what I figured. After staring at these equations long enough, my distaste for the squished look is starting to wane... lol – u2berggeist Apr 23 '18 at 13:26

Here are some options. There are four math styles: \displaystyle, \textstyle, \scriptstyle and \scriptscriptstyle. To change text font sizes, you have to get out of math mode first.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

{A\small A\footnotesize A\scriptsize A}

$$M=\sqrt{\frac{2}{\gamma-1} {\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\frac{\gamma-1}{\gamma}}-1\Bigg]}}$$

$$M=\sqrt{\frac{2}{\gamma-1} {\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\mbox{\footnotesize\frac{\gamma-1}{\gamma}}}-1\Bigg]}}$$

$$M=\sqrt{\frac{2}{\gamma-1} {\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\mbox{\small\frac{\gamma-1}{\gamma}}}-1\Bigg]}}$$

$$M=\sqrt{\frac{2}{\gamma-1} {\Bigg[\Bigg(\frac{p_0}{p}\Bigg)^{\textstyle \frac{\gamma-1}{\gamma}}-1\Bigg]}}$$
\end{document}