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


2 Answers 2


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.


Using \Large before is doing the trick :


It's not a proper solution and more just a hack since it produces a warning (Font: Size substitution...) and it's has to be manually specified.

Here is a minimal example:



  \item $\frac{1}{10} =\sfrac{1}{10}$
  \item $\displaystyle\frac{1}{10} = \text{\Large$\sfrac{1}{10}$}$


And the corresponding output:

sfrac with and without \Large

You must log in to answer this question.

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