It is not always preferable to use \[..\]
!
The source2e.pdf
file contains the documented source of LaTeX2e
. Therein, one sees that \[..\]
is essentially a wrapper for $$ .. $$
checking if the construct is used when already in math mode (which is then an error).
Produces $$...$$ with checks that \[
isn’t used in math mode, and that
\]
is only used in math mode begun with \]
.
There seems to be a typo there \[
was meant. Besides, the sentence should not be taken to mean that
\[ a^n + b^n= c^n $$
$$ a^n + b^n= c^n \]
create errors, they don't, only things like \( a^n + b^n= c^n \]
or $a^n + b^n= c^n \]
do.
However the detailed source code shows that it contains something which will interfere in some cases with correct vertical spacing:
170 \def\[{%
171 \relax\ifmmode
172 \@badmath
173 \else
174 \ifvmode
175 \nointerlineskip
176 \makebox[.6\linewidth]{}%
177 \fi
178 $$%%$$ BRACE MATCH HACK
179 \fi
180 }
181 \def\]{%
182 \relax\ifmmode
183 \ifinner
184 \@badmath
185 \else
186 $$%%$$ BRACE MATCH HACK
187 \fi
188 \else
189 \@badmath
190 \fi
191 \ignorespaces
192 }
The \makebox[.6\linewidth]{}
which is executed when the display is opened in vertical mode has the effect of disabling the TeX
use of \abovedisplayshortskip
(hence of \belowdisplayshortskip
). The problem is that immediately after \[..\]
TeX
is in horizontal
mode (not vertical
) hence if two or more equations are typeset using \[..\]
without anything in-between, the second and next ones will use the short skips. This leads to incoherent vertical spacing:
\documentclass{article}
\begin{document}
The rules are smashed so take no vertical space, and are only there to
illustrate the issue (extra vertical space only between the first and the second
equation and not between the next ones).
Using \verb|\[..\]|:
\[
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
\]
\[
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
\]
\[
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
\]
Using \verb|$$..$$|:
$$
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
$$
$$
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
$$
$$
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
$$
There is no issue if we use \verb|\[..\]| but start within a paragraph:\newline
\[
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
\]
\[
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
\]
\[
\vartheta=2\pi\smash{\rule{.4pt}{4ex}}
\]
The issue arises only if the chain of \verb|\[..\]| is initiated in vertical
mode. The issue never arises when using the original \verb|$$..$$| input syntax.
\end{document}
\begin{equation*}
over\[
, because it feels more semantic and makes the source more human-readable. But I really don't know, is there any difference between these two?lineno
, there is a difference... why doesnt lineno number a paragraph when it is followed by an indented equation