4

Please look at the following code:

\documentclass{article}

\usepackage{amsmath}
%\usepackage{fontspec,unicode-math}

\begin{document}

\Huge

\begin{equation}
\frac{x^{2}}{x^{2}}
\end{equation}

\begin{equation}
x^{2} / x^{2}
\end{equation}

\end{document}

enter image description here

As usual the denominator is printed ugly in the cramped style. With pdfTeX it is possible to switch off the cramped style as shown here:

Bad spacing of exponents in denominator

(Look at Gustavo Mezzetti's post.)

I would like to find such a solution for LuaLaTeX, so I read its manual (pages 84ff.):

http://www.luatex.org/svn/trunk/manual/luatex.pdf

I found some hints:

\Umathsupshiftup\crampeddisplaystyle=\the\Umathsupshiftup\textstyle
\Umathsupshiftup\crampedtextstyle=\the\Umathsupshiftup\textstyle

I added these lines, but the result is still the same. What do I make wrong?

1 Answer 1

2

You don't mention this explicitly, but I'm assuming that you want to disable cramped style mainly for fraction terms. If that's the case, here's a solution that works with pdfLaTeX, XeLaTeX, and LuaLaTeX: define variant forms of the dfrac and \tfrac macros that use uncramped math style for the denominators.

In the following screeshot, output of the "regular" forms of \dfrac and \tfrac are shown on the left, and output of the variant forms is shown on the right. Speaking for myself, I very much prefer the output of the "regular" forms; your opinion may differ...

enter image description here

\documentclass{article}
\usepackage{amsmath} 
\newcommand{\mydfrac}[2]{{\dfrac{#1}{\textstyle #2}}}
\newcommand{\mytfrac}[2]{{\tfrac{#1}{\scriptstyle #2}}}

\begin{document}
\begin{gather*}
\dfrac{x^{2}}{x^{2}} + \mydfrac{x^{2}}{x^{2}} \\
\tfrac{x^{2}}{x^{2}} + \mytfrac{x^{2}}{x^{2}}
\end{gather*}
\end{document}

You must log in to answer this question.

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