TransWikia.com

Why does frac not produce mathinner atoms?

TeX - LaTeX Asked on May 10, 2021

LaTeX defines frac as

DeclareRobustCommandfrac[2]{{begingroup#1endgroupover#2}}

i.e. the fraction is created using over surrounded by a brace group to contain its effect.
The TeXbook states on page 155

There’s also an eighth classification, mathinner, which is not normally used for individual
symbols; fractions and left...right constructions are treated as “inner” subformulas, which
means that they will be surrounded by additional space in certain circumstances.

This leads me to expect that the result of frac{1}{2} would be a mathinner atom. However, the following MWE shows that it’s not.

documentclass{article}

begin{document}

(frac{1}{2} (3 + 4 + 5))

(mathordfrac{1}{2} (3 + 4 + 5))

(mathinnerfrac{1}{2} (3 + 4 + 5))

end{document}

MWE output

So it seems that the brace group inserted by frac does not create a mathinner atom but rather a mathord one, like any other subformula.

  • Seeing as over needs to be enclosed in a brace group to limit its effect, when does a fraction ever create an "inner" subformula? What are the "certain circumstances" the TeXbook refers to?
  • Is there any harm in prepending mathinner to the definition of frac, making it actually produce mathinner atoms?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP