# Minion Math font ' and \prime behaves differently

I am using Minion Math to typeset a book. The editor asked if it is possible to lower the position of the ' in equations when it is used with a lowercase p letter.

I noticed that the behaviour of ' and \prime is different if Minion Math is loaded or Latin Modern is used. \prime seem to be a supersuperscrpt.

With Minion Math:

With LM:

I use XeLaTeX, but the same issue is happening with LuaLaTeX.

\documentclass{minimal}

\RequirePackage{amsmath}
\RequirePackage{mathtools}
\usepackage{amsthm}

\RequirePackage{unicode-math}
%%% Copied from the unicode-math documentation
\setmathfont%{Minion Math}%[
[SizeFeatures = {
{Size = -6.01, Font = MinionMath-Tiny},
{Size = 6.01-8.41, Font = MinionMath-Capt},
{Size = 8.41-13.01, Font = MinionMath-Regular},
{Size = 13.01-19.91, Font = MinionMath-Subh},
{Size = 19.91-, Font = MinionMath-Disp}
}]%
{Minion Math}

\RequirePackage{microtype}

\begin{document}
\verb+$T(p)=p'$+:\hspace{1cm}    $T(p)=p'$

\verb+$T(p)=p\prime$+:\hspace{1cm}    $T(p)=p\prime$

\verb+$T(p)=p^{\prime}$+:\hspace{1cm}    $T(p)=p^{\prime}$
\end{document}


SOLUTION PROPOSED BY DAVID:

The solution seems to work fine:

• you have only shown a tiny fragment of code, are you using unicode-math or some other way to access the math font, are other superscripts too high, the superscript raise could be lowered for example. is the \prime character already superscripted in the font, eg does p\prime look right already, but p^{\prime} is too small and high? Jul 4, 2021 at 9:13
• @DavidCarlisle I exprese incorrectly myself. My problem is with ' which is what the author has used in the book. As you can see $p'$ and $p\prime$ aren't equivalent with Minion Math Jul 4, 2021 at 9:53
• p' and p\prime are not usually equivalent, p' is converted to p^{\prime} but in some fonts not designed for TeX the \prime character is already superscript in the font so you need to generate p\prime instead. That is clearly the case here now you have added the image. Jul 4, 2021 at 10:03
• I would expect that {\catcode\'\active\gdef'{\prime}} would do the right thing, but I don't have the font to test Jul 4, 2021 at 10:06
• Please, never use minimal for examples; the class is not meant for them. Jul 4, 2021 at 10:08

p' and p\prime are not usually equivalent, p' is converted to p^{\prime} but in some fonts not designed for TeX, the \prime character is already superscript in the font so you need to generate p\prime instead.

That is clearly the case here now you have added the image.

\catcode\'\active
\AtBeginDocument{\def'{\prime}}
\catcode\'=12


would remove the code that makes ' superscript itself and simply makes it work like ' works in text mode where it is an ordinary character but just has a raised position in the font.

Note that this will not wrok in the presence of large symbols. Normally \left(\frac{1}{2}\right)' would place a TeX-superscript on the closing ), but here you would just get a standard ' after the ) so it is probably too low. However ' is most commonly used with single letters not constructed expressions so this may not matter in practice.

• Your \left...\right' explanation is confusing. Do you mean \left(...\right)'? Jul 4, 2021 at 11:15
• @Gaussler I'll expand it a bit (but yes) Jul 4, 2021 at 11:16
• Also, I never quite understood why everyone wants to delay active character definitions using \AtBeginDocument. Why not just do it immediately? Jul 4, 2021 at 11:31
• @Gaussler blame Will:-) unicode-math delays essentially everything to begin document not just active character definitions so if you want ti adjust anything unicode-math does you need to delay. Jul 4, 2021 at 11:34
• It should also be possible to make a solution that solves that last \left...\right problem. E.g. you could redefine \prime, adjusting its size and vertical position. Then the “old” definition of ' would work as usual. In fact, I think this solution would be preferable. Jul 4, 2021 at 11:36

Do not use "SizeFeatures", everything shows prefectly.

\documentclass{minimal}
\RequirePackage{amsmath}
\RequirePackage{mathtools}
\usepackage{amsthm}
\RequirePackage{unicode-math}
\setmathfont{Minion Math}
\RequirePackage{microtype}
\everymath{\displaystyle}
\begin{document}
\verb+$T(p)=p'-\left(\frac{x}{2}\right)'$+:\hspace{1cm}    $T(p)=p'-\left(\frac{x}{2}\right)'$
\verb+$T(p)=p\prime-\left(\frac{x}{2}\right)\prime$+:\hspace{1cm}    $T(p)=p\prime-\left(\frac{x}{2}\right)\prime$
\verb+$T(p)=p^{\prime}-\left(\frac{x}{2}\right)^{\prime}$+:\hspace{1cm}    $T(p)=p^{\prime}-\left(\frac{x}{2}\right)^{\prime}$
\end{document}
`