29

What solution do you think is more elegant for a simple fraction that should be displayed in just one line?

My examples are

  1. $x_F \equiv \frac{p_z}{p^{\rm MAX}_{z}} = \frac{p_z}{\sqrt{s}/2}$
  2. $x_F \equiv \frac{p_z}{p^{\rm MAX}_{z}} = \frac{p_z}{\sfrac{\sqrt{s}}{2}}$
  3. $x_F \equiv \frac{p_z}{p^{\rm MAX}_{z}} = \frac{p_z}{^\sqrt{s}/_2}$

This generates the following (using the xfrac package).

enter image description here

I don't like 2, but I also think that 3 is not very elegant.

  • How is \sfrac defined? Do you enable this command by loading a package? – Mico Aug 16 '13 at 12:43
  • Sorry @Mico I should have put the package link – leoredi Aug 16 '13 at 15:01
42

It is nearly always best to use the slashed form for fractions in the text:

Sample output

\documentclass{article}

\begin{document}
\( x_F \equiv p_z^{}/p^{\mathrm{MAX}}_z = p_z/(\sqrt{s}/2) = 2p_z/\sqrt s \)
\end{document}

Note that I have added brackets to the second fraction.

32

There is also nicefrac package which provides \nicefrac{<Nr>}{<Dr>}:

\documentclass{article}
\usepackage{nicefrac}

\begin{document}
\( x_F \equiv \nicefrac{p_z}{p^{\mathrm{MAX}}_z} = \nicefrac{p_z}{(\nicefrac{\sqrt{s}}{2})} = \nicefrac{2p_z}{\sqrt s} \)

\vspace{.5cm}        %% Andrew's method for comparison purpose.
\( x_F \equiv p_z^{}/p^{\mathrm{MAX}}_z = p_z/(\sqrt{s}/2) = 2p_z/\sqrt s \)
\end{document}

enter image description here

  • 5
    I think, the slashed form looks better. In particular, it does not require to reduce the font size. – Konstantin May 2 '16 at 8:35

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.