After read this question:

Unnumbered equations: Any difference between \begin{equation*} and [?

which led me to this other:

What are the differences between $$, [, align, equation and displaymath?

which in turn led me to this one:

Why is [ … ] preferable to $$ … $$?

and also this:

align vs equation

I wonder why if using the $ symbol for the equations is as inadvisable, remains this method used in more than one dedicated LaTeX editor?

Beyond the obvious and almost trivial answer: because developers like and they don't care what you think about it and if you don't like, program your own editor.

I think in this site participate many package authors and developers of many of the technical jewels we get in LaTeX. And maybe more than one has to do with the development of one of the many dedicated editors that there are today, so I ask the question here.

I can't ensure that all editors continue to use $ to compose maths because I have not tried them all. But in all I've ever tried, it's the same. Among recent editors that I can mention are Texmaker and its fork TeXstudio, and Sublime Text 2 with LaTeX Tools package.

It's very likely that the people who work with vim or emacs don't have such problem, or has been corrected or can easily change. Nor do I think it's impossible to change. I just curious to know why it is still so popular if it is considered a bad practice or maybe just a not very good practice. Why is still the default setting in those editors?

  • 5
    The undesirable one is $$. However, there's no problem (well, there's a very little problem) with $$…$$ per se. The problem is that, with LaTeX2e it leads to the “raw” displaymath from TeX, which has many disadvantages over \[…\]. – Manuel Sep 3 '14 at 22:30
  • 1
    Because (we're) they're lazy? and use the same oldfashioned template again over and over? ;-) – user31729 Sep 3 '14 at 22:30
  • 1
    @Aradnix: Good question ;-) I have not done so far years now. I even switched to \(... \) for inline math. – user31729 Sep 3 '14 at 22:34
  • 3
    @Aradnix Note that single dollars are considered ok, it's only double dollars that should be replaced by \[...\]. – yo' Sep 3 '14 at 22:38
  • 3
    @Aradnix: Some users use Plain TeX, and need $$…$$. – Bernard Sep 3 '14 at 23:49

The basic reason is surely that $ is the TeX primitive for entering and leaving math-mode. Indeed, the definition of \( is

\relax \ifmmode \@badmath \else $\fi

That is, \( inserts a $ is we are not in math-mode and otherwise gives an error. The definition of \) is slightly more complicated but it essentially inserts a $ too (the complication is that \) has to determine whether LaTeX is in in-line mathematics mode (with \ifinner) or if it is in display mode).

If you check the definitions of \[ and \] you will find that they also insert $$, after doing similar checks. As @tohecz mentions below, \[...\] also significantly adjusts the spacing. In any case, $$ is again the TeX primitive for entering and leaving display math-mode.

So even though the conventional wisdom is that one should use \(...\) and \[...\] in LaTeX we can't disable $...$ and $$...$$ because these are the underlying TeX primitives. (Personally, I don't find the arguments in the links in the questions compelling, so I am happy to miss out on the extra checks provided by LaTeX and use these two TeX primitives directly because they are shorter and, to my eye, more aesthetically pleasing!:)


Btw, there are already many good answers in the comments. I could have put this comment there as well but I didn't because I think that far too many questions on TeX.SX are answers in the comments: currently there are**4368* questions posted on TeX.SX with no answers -- and I suspect that most of these questions actually are answered in the comments!

  • In case you want to keep $$…$$ while making them “more correct” —that is, to behave like \[…\]— you can do this (sorry, my own answer, but I used that to avoid changing $$ to \[, etc.). – Manuel Sep 3 '14 at 23:00
  • \[:macro:->\relax \ifmmode \@badmath \else \ifvmode \nointerlineskip \makebox [.6\linewidth ]{}\fi $$\fi -- This is not just "similar checks". This significantly modifies the spacing! (To the better of course.) – yo' Sep 3 '14 at 23:02
  • @tohecz Yes, you're right, I should have mentioned this. Will edit. – user30471 Sep 3 '14 at 23:04
  • 1
    TeX's "inner" math mode is not the same as its inline math mode. "inner" mode occurs, for instance, inside a \left ... \right pair, which can clearly occur in both inline and display math. – Mico Sep 4 '14 at 0:03
  • 1
    the reason to use \[ ... \] (or \begin ... \end{equation*}) is that it makes things possible (in latex) that are impossible with $$, including the ability to use \qedhere at the end of a proof. the worst thing i can think of that might happen using a single $ for in-line math is to forget the second one, and get out of phase; you could also forget a closing \), and $ is shorter. those are my reasons. (this isn't "meaty" enough for a standalone answer, hence a comment.) – barbara beeton Sep 4 '14 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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