I have an
$$y=e^{\frac{a}{2}}$$
But I do not like the fraction line that partially overlaps with the 2. How can I solve it?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityHere's a list of possibilities:
The very first term is from your code. The second one use a \mathstrut
directive inside the denominator to increase the vertical offset at which the entire \frac
term is placed. The third solution uses inline fractional notation instead of \frac
. The final two solutions use \exp(...)
notation, where the material inside the parentheses can be either a \frac
expression (with slightly enlarged parentheses) or an inline fraction expression. The parentheses around the \tfrac{a}{2}
term are optional.
Choose whichever form you like best. Of course, what's "best" should depend in no small part on whether the equation appears in display math or in inline math material.
\documentclass{article}
\usepackage{amsmath} % for "\tfrac" macro
\begin{document}
\[
y = e^{\frac{a}{2}} % original form
= e^{\frac{a}{2\mathstrut}} % \mathstrut method
= e^{a/2} % infix fraction
= \exp\bigl(\tfrac{a}{2}\bigr) % \exp notation with \frac
= \exp(a/2) % \exp notation with infix fraction
\]
\end{document}
You can force displaystyle
although in this case may be a bit too large for your argument. You can try
$$y= e^{\displaystyle\frac{a}{2}}$$
which yields to
But as @egreg said, fractions in exponent are neither usual nor recommended. Perhaps you may want to try something like this
$$y=e^{\displaystyle a/2}$$
with that, you can achieve something like this
that you may like more.
\displaystyle
or \textstyle
. The resulting formula is at least ambiguous. I find the first form appalling, to be honest, the second one is just wrong.
y=e^{a/2}
instead.e^{a/2}
; two story fractions in exponents should be avoided.\exp(\frac{a}{2})
\[...\]
instead of$$...$$