[Tex/LaTex] Why is \[ … \] preferable to $$ … $$


I've heard that you should use \[ ... \] for displayed equations instead of $$ ... $$, but why is that?

I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols.

Is there any reason for this suggestion?

Best Answer

$$ is TeX primitive syntax, which, as others have commented is hard to redefine (in classic TeX there is no command name which triggers entering or leaving display math).

LaTeX doesn't officially support $$. The most noticeable failure if you use the syntax is that the fleqn option will no longer affect the display of the mathematics, it will remain centered rather than being set flush left.

However if you are using \[ it is best to use the amsmath package (it is best to load this package if doing any serious mathematical layout with LaTeX).

\[ is a short form of \begin{displaymath} which one might expect to act like an un-numbered form of \begin{equation}. The amsmath package redefines \[ to be \begin{equation*} which is exactly an un-numbered form of the equation environment as defined by that package. In the core LaTeX definition \[ has the definition


which means that the spacing if used between paragraphs is better that a primitive $$ (which causes a blank paragraph just consisting of the indentation and parfillskip glue to be inserted before the display) but it is inconsistent with equation and always uses \abovedisplayskip rather than \abovedisplayshortskip. In the AMS versions the spacing is more consistent,