Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by Caramdir, Andrey Vihrov, lockstep, topskip, Loop Space Oct 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.

add comment

2 Answers

up vote 12 down vote accepted

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.

share|improve this answer
add comment

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

See Are \( and \) preferable to $?

share|improve this answer
1  
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
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.