How do I get \nicefrac or \xfrac work in \displaystyle, i.e., without reducing the font size?


As an alternative (since \nicefrac and \sfrac do not seem to be adjustable to representing digits in displaystyle)...

Adjusting my answer from Modifying fraction macro for in-line text and exponents, this will also set numerator and denominator as text if called in text mode, and as math in math mode.



\parindent 0pt
This is \texttt{altfrac:}\qquad
\altfrac{12}{14} \altfrac{31415}{27182} \altfrac{abc}{def} \altfrac{Foo!}{Bar?}
\qquad And here is \altfrac{x}{y} versus $\altfrac{x}{y}$\\


enter image description here

WARNING: if used in inline mode, the size of the / will possibly cause the line spacing to temporarily adjust. While this can be eliminated by \smash'ing the \scalebox, that could result in glyph overlap.

|improve this answer|||||

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.