1

I am writing some equations that include exponents. If that exponent term includes a parenthesis or a slash, LaTeX suddenly injects extra space above and below inside of the equation. If there are no parentheses or slashes, it behaves correctly. It also behaves correctly with subscripts.

\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{equation} L_A=10\log \left[ 10^{(B/10)}-10^{(C/10)} \right] \end{equation} %1: exponent with paren/slash
\begin{equation} L_A=10\log \left[ 10_{(B/10)}-10_{(C/10)} \right] \end{equation} %2: subscript with paren/slash
\begin{equation} L_A=10\log \left[ 10^{B}-10^{C} \right] \end{equation} %3: exponent without paren/slash
\end{document}

Output

Equation 3 is the behavior I would expect - the brackets are vertically tight around the equation. Equation 2 shows that it also works correctly with subscript. Equation 1 is the odd one out - the bracket heights have significantly increased.

How can these spaces be removed?

2
  • 1
    \left and \right often produce undesirable results. I suggest using \bigl and \bigr instead to manually size your delimiters.
    – Sandy G
    Sep 30, 2022 at 1:30
  • 1
    Part of the problem is that brackets assume the conterts are symmetrical (vertically centered) and in this case they are not, so a lot uf extras space is added to the bottom. Sep 30, 2022 at 2:11

2 Answers 2

1

Your indiscriminate use (and abuse!) of \left and \right causes not just one issue but, in fact, two issues. The first is the sizing issue which you have noted. The second is the typographically inappropriate insertion of whitespace before (and also after) the square brackets for the situation at hand. In fine math typesetting, there should not be any extra space between \log and the opening square bracket, or round parenthesis, or curly brace. The use of \left[ instead of \bigl[ forces TeX to create this issue.

Using \left and \right is not a panacea, as you have (re)discovered. If you absolutely can't shake the habit, you may at least want to switch to using \mleft and \mright macros provided by the mleftright package. To do so automatically for the entire document without having to learn to replace \left with \mleft and \right with \mright, simply execute \mleftright after loading the mleftright package. This would let you avoid making one type of typographical faux pas.

enter image description here

\documentclass{article}
\usepackage{amsmath}     % for align* environment
\usepackage{mleftright}  % for \mleft and \mright macros
\begin{document}
\begin{align*}
L_A&=10\log \bigl[ 10^{(B/10)}-10^{(C/10)} \bigr]  
     \quad\text{\texttt{\string\bigl} and \texttt{\string\bigr}} \\
   &=10\log \mleft[ 10^{(B/10)}-10^{(C/10)} \mright]
     \quad\text{\texttt{\string\mleft} and \texttt{\string\mright}} \\      
   &=10\log \left[ 10^{(B/10)}-10^{(C/10)} \right]
     \quad\text{\texttt{\string\left} and \texttt{\string\right}} 
\end{align*}
\end{document}
0

This demonstrates the effect of centering the contents of \left and \right.

\documentclass{article}
\usepackage{amsmath}

\newlength{\offset}
\setlength{\offset}{\dimexpr 0.5\ht\strutbox-0.5\dp\strutbox}

\begin{document}
\begin{align*}
  \left( \rule{1em}{1cm} \right) &&
  \raisebox{\dimexpr 0.5cm-\offset}{$\displaystyle \left( \rule[\dimexpr \offset-0.5cm]{1em}{1cm} \right)$}
\end{align*}
\end{document}

demo

You must log in to answer this question.

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