# Is $…$ okay to use, while $$…$$ is not recommended? [duplicate]

Possible Duplicate:
Are $$and$$ preferable to $? According to Why is $...$ preferable to $$...$$?, $$...$$ should not be used. My understanding is, it is because $$...$$ is not supported by amsmath, so using it may cause inconsistent spacing. But, what about $ ... $, shouldn't it be avoided as well? Is $ ... $ supported by amsmath? ## marked as duplicate by Caramdir, Andrey Vihrov, lockstep, topskip, Loop SpaceOct 6 '11 at 7:04 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. ## 2 Answers Both display math $$...$$ and inline math $...$ is valid in LaTeX. In fact, their accepted counterparts $...$ and $$...$$ are defined in terms of the former. However, $...$ just adds a little flair in term of spacing around the environment by performing some checks. The use of $$...$$ is almost exactly like using $...$. To see why this is the case, view their definitions in latex.ltx: \def$${\relax\ifmmode\@badmath\else\fi} \def$${\relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi}


Of course, you can also use more contextual phrases to do the same thing: \math...\endmath is an environment pair (similarly, \begin{math}...\end{math}) that is defined as equivalent to $$...$$, and also \displaymath...\enddisplaymath (similarly, \begin{displaymath}...\end{displaymath}):

\let\math=$$\let\endmath=$$
\def\displaymath{$} \def\enddisplaymath{$\@ignoretrue}


In answer to your question: Both forms are usable by amsmath, but it actually only supports the use of $...$, since it redefines these to mean something different:

\DeclareRobustCommand{$}{\begin{equation*}} \DeclareRobustCommand{$}{\end{equation*}}


Convention, over the years, has shifted to using $...$ for display math and a mixture of using $$...$$ or $...$ for inline math.

Yes, $...$ is perfectly fine to use for inline math.

• According to a comment by Joseph Wright (to the accepted answer in the linked thread) “perfectly fine” isn’t quite right. If (when) LaTeX3 ever comes out, the $…$ may no longer be supported. So in the interest of future compatibility, $$…$$ should be preferred. – Konrad Rudolph Oct 6 '11 at 9:48