3

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?

4
  • 5
    You can write y=e^{a/2} instead.
    – sodd
    Dec 18, 2016 at 14:48
  • 6
    Use e^{a/2}; two story fractions in exponents should be avoided.
    – egreg
    Dec 18, 2016 at 14:49
  • 3
    or \exp(\frac{a}{2})
    – percusse
    Dec 18, 2016 at 14:56
  • 2
    Use \[...\]instead of $$...$$
    – Sebastiano
    Dec 18, 2016 at 17:29

2 Answers 2

6

Here's a list of possibilities:

enter image description here

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}
3
  • 1
    An empty subscript does nothing; it's an empty superscript that pushes the subscript a bit down.
    – egreg
    Dec 18, 2016 at 21:22
  • 1
    I think you don't need parenthesis in \exp \tfrac{a}{2}.
    – yo'
    Dec 18, 2016 at 21:23
  • @yo' - I've added a sentence to mention that the parentheses may be omitted when using \exp notation.
    – Mico
    Dec 18, 2016 at 21:43
1

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

enter image description here

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

enter image description here

that you may like more.

2
  • 4
    Please, why do you believe the font size change is any useful? I ask sincerely, I want to know the source of this belief so that I can help getting rid of it.
    – yo'
    Dec 18, 2016 at 21:22
  • 4
    I would heartily discourage ever setting an exponent in \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.
    – egreg
    Dec 18, 2016 at 21:39

You must log in to answer this question.

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