8

I was wondering if it was possible to lower the exponent on a variable in the numerator or a fraction (like the one in the image below) to make it consistent with the height of one in the denominator. What is the best way to do this?

enter image description here

2
  • Excuse me to have deleted my answer...but sincerely I have not understood your question. I vote up your question.
    – Sebastiano
    Sep 6, 2021 at 17:21
  • 2
    If you look closely at the index on the p in the numerator, it is higher than the corresponding one in the denominator (look at the height of the '1' relative to the parenthesis). How do I lower the index in the numerator to match the lower version in the denominator?
    – wrb98
    Sep 6, 2021 at 17:22

2 Answers 2

7

TeX uses the “cramped” style in denominators, but the normal style in numerators. Use \cramped, available with mathtools.

\documentclass{article}
\usepackage{mathtools}

\newcommand{\crampedfrac}[2]{\frac{\cramped{#1}}{#2}}

\begin{document}

\[
\frac{(p^{x_j+1})}{(p^{x_j+1})}\crampedfrac{(p^{x_j+1})}{(p^{x_j+1})}
\]

\end{document}

enter image description here

2
  • If it's TeX style, why does changing the font make the two exponents the same? Sep 7, 2021 at 13:52
  • @SimonDispa That depends on font parameters; you have to look at Appendix G in the TeXbook to learn the full story and to check the relevant font parameters in those fonts.
    – egreg
    Sep 7, 2021 at 13:57
5

It solves the discrepancy between the two exponents, without additional commands, by changing the math font (although it is not an answer to the question as it was asked).

For example, using the new version of Computer Modern fonts (needs lualatex or xelatex):

a

\documentclass[a4paper,12pt]{article}

\usepackage{amsmath,amssymb}

\usepackage{newcomputermodern} % added <<<

\begin{document}
    \[\frac{(p^{x_j +1})}{(p^{x_j +1})}\]
\end{document}

Search https://tug.org/FontCatalogue/mathfonts.html for other available math fonts.

If you are using pdflatex the font kpfonts also works fine.

k

% !TeX TS-program = pdflatex

\documentclass[a4paper,12pt]{article}

\usepackage{amsmath,amssymb}

\usepackage{kpfonts}
\usepackage[T1]{fontenc}
\begin{document}
    \[\frac{(p^{x_j +1})}{(p^{x_j +1})}\]
\end{document}
3
  • 1
    I think -- though I could be wrong -- that the OP is looking to achieve the exact opposite of what your solution does: Rather than un-cramp the denominator superscript position, he/she wants to cramp the numerator superscript position.
    – Mico
    Sep 6, 2021 at 20:38
  • @Mico It is difficult to read minds. Myself would be worried by the discrepancy between the two exponents. Sep 6, 2021 at 20:57
  • @SimonDispa: It hardly needs mind-reading; the question says “I was wondering if it was possible to lower the exponent on a variable in the numerator”. I personally agree your suggestion is just as good as a solution to the actual problem — but it seems worth a disclaimer that this isn’t quite what OP asked for. Sep 7, 2021 at 11:47

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.