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.

After rea d 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 math 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?

share|improve this question
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 at 22:30
1  
Because (we're) they're lazy? and use the same oldfashioned template again over and over? ;-) –  Christian Hupfer Sep 3 at 22:30
1  
@Aradnix: Good question ;-) I have not done so far years now. I even switched to \(... \) for inline math. –  Christian Hupfer Sep 3 at 22:34
3  
@Aradnix Note that single dollars are considered ok, it's only double dollars that should be replaced by \[...\]. –  tohecz Sep 3 at 22:38
3  
@Aradnix: Some users use Plain TeX, and need $$…$$. –  Bernard Sep 3 at 23:49

1 Answer 1

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!

share|improve this answer
    
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 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.) –  tohecz Sep 3 at 23:02
    
@tohecz Yes, you're right, I should have mentioned this. Will edit. –  Andrew Sep 3 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 at 0:03
1  
the reason to use \[ ... \] (or \begin ... \end{equation*}) is that it makes things possible (in latex) that are *im*possible 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 at 13:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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