3

I am using amsmath in a two-column IEEEtran document class and at a certain point I typed this equation:

\begin{equation}
    A = \sum_{j=1}^{J} \frac{\left[ e^{-\left( \frac{x_1^a}{2\sigma^2} \right)^2} - e^{-\left( \frac{x_2^a}{2\sigma^2} \right)^2} \right]^2}{\Phi\left( \frac{x_1^a}{\sigma} \right) - \Phi\left( \frac{x_2^a}{\sigma} \right)}
\end{equation}

The issue is that this code produces the following result: enter image description here

As you see, as the exponential is centralized in the brackets of the fraction numerator, there is a strange blank space above the fraction bar. Is there a way to vertically move the content inside the brackets, so I can make this blank space disappear?

Considerations: 1- I cannot use \exp instead of e^{}, as the former makes the equation longer and it does not fit the linewidth. 2- If I use manually sized delimiter \Big, etc, I can adjust this space, but the result does not look good either.

Cbraz
  • 31
  • 1
    maybe related: https://tex.stackexchange.com/questions/131385/improper-display-of-parentheses-in-fraction-of-fraction or https://tex.stackexchange.com/questions/59747/proper-display-of-fractions – samcarter_is_at_topanswers.xyz Jul 27 '18 at 17:28

3 Answers3

2

You can correct that by lowering that part:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
A = \sum_{j=1}^{J}
  \frac{\left[ \raisebox{-1ex}{$e^{-\left( \frac{x_1^a}{2\sigma^2} \right)^2} -
                                e^{-\left( \frac{x_2^a}{2\sigma^2} \right)^2}$} \right]^2}
  {\Phi\left( \frac{x_1^a}{\sigma} \right) - \Phi\left( \frac{x_2^a}{\sigma} \right)}
\end{equation*}

\end{document}

result

nox
  • 4,160
  • 12
  • 26
1

enter image description here

\documentclass[11pt]{book}
\usepackage{nccmath}

\begin{document}
    \begin{equation}
A = \sum_{j=1}^{J} \frac{\begin{bmatrix}
        \mathrm{e}^{-\Bigl(\mfrac{x_1^a}{2\sigma^2}\Bigr)^2} - \mathrm{e}^{-\Bigl(\mfrac{x_2^a}{2\sigma^2}\Bigr)^2}
        \end{bmatrix}^2}
                        {\Phi\Bigl(\mfrac{x_1^a}{\sigma}\Bigr) - \Phi\Bigl(\mfrac{x_2^a}{\sigma}\Bigr)}
    \end{equation}
or better
    \begin{equation}
    A = \sum_{j=1}^{J}
    \frac{\biggl[\exp\Bigl(-\Bigl(\mfrac{x_1^a}{2\sigma^2}\Bigr)^2\Bigr)
                            - \exp\Bigl(-\Bigl(\mfrac{x_2^a}{2\sigma^2} \Bigr)^2\Bigr)\biggr]^2}
         {\Phi\Bigl(\mfrac{x_1^a}{\sigma}\Bigr) - \Phi\Bigl(\mfrac{x_2^a}{\sigma}\Bigr)}
    \end{equation}
\end{document}
Zarko
  • 296,517
1

How about using (a) inline-fraction notation instead of \frac{..} for the "inner" fraction expression and (b) \exp notation instead of e^{...} notation? Observe that, contrary to the concern you expressed in the posting, the \exp notation does not make the math expression exceed the available width.

enter image description here

A side benefit of these notational choices is that the summation symbol to the left of the single remaining \frac{}{} term doesn't look all puny and forlorn.

By the way, the summation expression looks odd: the summation is supposed to run over items indexed by the letter j, yet there seem to be no terms in the equation that are indexed by j.

\documentclass{IEEEtran}

\begin{document}
\begin{equation}
A = \sum_{j=1}^{J} 
    \frac{\bigl\{ \exp[-( x_1^a/(2\sigma^2))^2] 
           -\exp[-(x_2^a/(2\sigma^2))^2] \bigr\}^2}{%
          \Phi(x_1^a/\sigma) - \Phi( x_2^a/\sigma)}
\end{equation}
\end{document}
Mico
  • 506,678