5

The following lines gives me more space below E^2 inside the parentheses. How to reduce this extra space. Also, the square (2) is above enclosing parentheses.

\begin{equation*}
\left[\frac{{\left(\vec{A} - \displaystyle\frac{b}{c} \vec{D} \right)}^2}{E^2} \right]^{1/2}
\end{equation*}

space_brac

  • The extra space in the denominator is answered at this link. http://tex.stackexchange.com/questions/168394/frac-command-height-of-the-numerator-vs-height-of-denominator – James Feb 12 '16 at 20:59
  • i would never use \displaystyle in the middle of an expression. If you must use it then it should almost always be at the start. – David Carlisle Feb 12 '16 at 21:17

2 Answers2

4

Do you mind something like this:

enter image description here

\documentclass{article}
\usepackage{mathtools,array}

% for show equation only
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{equation}
    \setlength\PreviewBorder{1em}

    \begin{document}
\begin{equation}
    \left[\begin{tabular}{@{}>{$}c<{$}@{}}
\dfrac{\left(\vec{A} - \dfrac{b}{c}\vec{D}\right)}{E^2}
    \end{tabular}\right]^{1/2}
\end{equation}
    \end{document}

Addendum: More simple code is, if instead of tabular the environment array is used:

\begin{equation}
    \left[\begin{array}{@{} c @{}
    }
\dfrac{\left(\vec{A} - \dfrac{b}{c}\vec{D}\right)}{E^2}
    \end{array}\right]^{1/2}
\end{equation}

Result is the same ase before.

Zarko
  • 296,517
  • This looks much better but then there are spaces before and after fraction. –  Feb 12 '16 at 21:51
  • Ups, I forgot on this spaces ... see edit of my answer. – Zarko Feb 12 '16 at 21:54
  • Why not an array instead of going in math mode in a tabular? – egreg Feb 12 '16 at 22:04
  • I just prepare addendum with array. With tabular I have on "stock" :-) – Zarko Feb 12 '16 at 22:04
  • @egreg Shouldn't \left[ \right] just encloses what is needed. Why the extra spaces with my approach. –  Feb 12 '16 at 22:10
  • @raj The fences inserted with \left and \right are vertically symmetric with respect to the main fraction line. – egreg Feb 12 '16 at 22:15
  • What is purpose of environment array why does it work? Could you update your post please with some explanations? Thanks! – Yola Apr 16 '18 at 07:02
  • 1
    @Yola, array is for settings arrays (like matrices, tables etc). it benefits over tabular is preserving math environment in cells if it is in it. see http://latex.wikia.com/wiki/Array_(LaTeX_environment) and https://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_and_arrays. – Zarko Apr 16 '18 at 09:24
2

You can do it with delarray, but I think it's much better the second way I propose.

\documentclass{article}
\usepackage{amsmath}
\usepackage{delarray}

\begin{document}

Here's a fraction with very large numerator
\begin{equation*}
\begin{array}\lbrack{@{}c@{}}\rbrack
\dfrac{\left(\vec{A} - \dfrac{b}{c} \vec{D} \right)^2}{E^2}
\end{array}^{1/2}
\end{equation*}
but it's much better to write it in a different way
\begin{equation*}
\left[\frac{1}{E^2}\left(\vec{A} - \frac{b}{c} \vec{D} \right)^2\right]^{1/2}
\end{equation*}
so the terms are better aligned with the formula axis.

\end{document}

enter image description here

egreg
  • 1,121,712