TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have:

\usepackage{nicefrac }
&= \frac{2}{\sqrt{2y+1}\sqrt{2 \pi}}  \exp \left( -y-\nicefrac{1}{2} \right)  &&\forall y \in  [-\frac{1}{2} , \infty) \\
&= \frac{2}{\sqrt{2y+1}\sqrt{2 \pi}}  \exp \left( -y-\frac{1}{2} \right)  &&\forall y \in  [-\nicefrac{1}{2} , \infty) 

Both of these seem somewhat unsatisfactory. Could anyone help me get the best display for the 1/2 after the \exp ( and also after the \in [

share|improve this question
up vote 4 down vote accepted


I'd just use the normal \frac or \tfrac. For display style maths they still look the best. I would use \nicefrac (or similar) only (if at all) in text maths.


\def\frstfrac{\frac{2}{\sqrt{2y+1}\sqrt{2 \pi}}} % just a shortcut
  &= \frstfrac       \exp \left(            -y - \frac{1}{2}\right)  && \forall y \in  \left[- \frac{1}{2}, \infty\right) \\
  &= \frstfrac \cdot  e^{                   -y - \frac{1}{2}}        && \forall y \in  \left[-\tfrac{1}{2}, \infty\right) \\
  &= \frstfrac \cdot  e^{           -  \left(y + \frac{1}{2}\right)} && \forall y \in  \left[-\tfrac{1}{2}, \infty\right) \\
  &= \frstfrac \cdot  e^{\textstyle -\!\left(y + \frac{1}{2}\right)} && \forall y \in  \left[-\tfrac{1}{2}, \infty\right) \\
  &= \frstfrac       \exp \left(            -y - 1/2 \right)         && \forall y \in  \left[-       1/ 2 , \infty\right)


different outputs of the fraction


Also, consider using \sqrt{\smash[b]{2y+1}}\sqrt{\smash[b]{2 \pi}} in your denominator for better roots.

To quote from the amsmath documentation:

With the amsmath package \smash has optional arguments t and b, because occasionally it is advantageous to be able to “smash” only the top or only the bottom of something while retaining the natural depth or height.



  \frac{2}{\sqrt{\smash[b]{2y+1}}\sqrt{\smash[b]{2 \pi}}} = \frac{2}{\sqrt{2y+1}\sqrt{2 \pi}}


smash example

The top bar of the root is aligned different and even the lower point is not on equal heights.

LaTeX Companion

The LaTeX Companion has a very elaborated text about \smash and its uses. The first two examples (licensed under the LPPL) are shown here. Take a close look at the root's lower end and the top bar.



$ \sqrt{x} + \sqrt{y}            + \sqrt{z} $ \par
$ \sqrt{x} + \sqrt{\mathstrut y} + \sqrt{z} $ \par
$ \sqrt{x} + \sqrt{\smash{y}}    + \sqrt{z} $ \par
$ \sqrt{x} + \sqrt{\smash[b]{y}} + \sqrt{z} $

   \sqrt{ \frac{a+b}{         x_j   } } \quad
   \sqrt{ \frac{a+b}{  \smash{x_j  }} } \quad
   \sqrt{ \frac{a+b}{{}\smash{x_j  }} } \quad
   \sqrt{ \frac{a+b}{  \smash{x_j+b}} }


square root example fraction example

share|improve this answer
What does the recommended \smash command do? – Benedikt Bauer Oct 13 '12 at 23:05
Thank you. As I see these outputs, I like the \left[-\tfrac{1}{2} , \infty\right) but I don't like either the \left[-\tfrac{1}{2} , \infty\right) (seems clumsy: the 1/2 is too big) or either of the two e^{} (too small). On balance I would perfer the e^{-\left(y+\frac{1}{2}\right)} but I would like to find some middle ground (if possible). Thanks again, much appreciated. – Robert Long Oct 13 '12 at 23:16
@BenediktBauer I expanded my answer. I remember reading a very elaborated text about the use of \smash but can't find it at the moment. – Qrrbrbirlbel Oct 13 '12 at 23:29
@Qrrbrbirlbel: You might be referring to this TUGBoat entry: A complement to \smash, \llap, and \rlap. Even if not, it's a handy reference. – Werner Oct 14 '12 at 2:31
@Werner Well, I wasn't, but it is indeed helpful when we're talking about “best display” (OP). The text I actually meant was a subsection of the LaTeX companion (“Ghostbusters™”). – Qrrbrbirlbel Oct 14 '12 at 3:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.