[Tex/LaTex] If the usage of the $ symbols for typing maths is undesirable why many editors still use them

editorssublime-texttexmakertexstudio

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?

Best Answer

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!