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.

1
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

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}
1
  • (+1) The first is exactly what I was working on, but you were faster :-)
    – Bernard
    Jul 27 '18 at 19:04
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}
1
  • My apologies, sir, you are so right! It just fits nicely with 10pt.
    – nox
    Jul 27 '18 at 18:58

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.