

Why TeX and LaTeX are the defacto standard for writing math equations - idle
http://tex.stackexchange.com/q/49208/213

======
cstross
As a rider to the stackexchange discussion: TeX/LaTeX did indeed have
competition in the early days from, for example, troff. However, the eqn
filter for troff was designed to generate troff macros; some knowledge of
troff is required to use it effectively, and (speaking as someone who worked
in a UNIX techpubs team for a few years in his mis-spent youth) troff is not a
terribly elegant or user-friendly language to say the least.

~~~
_delirium
I was curious how troff/eqn and TeX syntaxes compared, and didn't find any
nice side-by-side examples, so here's a quick translation of one from the
troff manual (<http://www.troff.org/prog.html#eqn>):

    
    
        .EQ
        G(z) ~=~ e sup { ln ~ G(z) }
             ~=~ exp left ( sum from k>=1 { S sub k z sup k } over k right )
             ~=~ prod from k>=1 e sup { S sub k z sup k /k }
        .EN
    

In TeX mathematical notation:

    
    
        $$G(z) = e^{\ln G(z)}
               = \exp \left( \sum_{k \geq 1} \frac{S_k z^k}{k} \right)
               = \prod_{k \geq 1} e^{S_k z^k / k}$$
    

The TeX is a bit more terse, especially in using ^ and _ for super/subscript
instead of sup/sub. That can make a big readability difference in things like
simple polynomials; a^2 + b^2 = c^2 is just that in TeX, but a lot more wordy
in eqn. The troff/eqn looks a bit less like line noise, though, especially in
things like "from" in the summation, and >= for \geq.

Though really I'd guess that TeX's math notation caught on as the de-facto
standard for "ASCII math" because TeX as a whole caught on, rather than
because of its ASCII-math representation being better.

~~~
JoshTriplett
> The troff/eqn looks a bit less like line noise

Not necessarily a feature. The eqn syntax does contain more letters and less
symbols, but that gives it very low contrast, making it hard to scan the
equation and "see" the math symbols through the formatting. When writing a
large equation, it helps to have a large contrast between words/symbols and
formatting commands. The TeX punctuation helps with grouping and delineation.

~~~
rrhm
Furthermore, the LaTeX syntax makes it easier for the computer to parse the
document and distinguish actual text from equation symbols.

~~~
JadeNB
It depends on the meaning of 'easier', I think. In both cases, 'the computer'
_can_ do it, meaning the program `troff` or the program `(la)tex`, and I'm not
sure it's reasonable to call one or the other of those programs 'easier' for
the computer; but perhaps you are thinking more of something like syntax
highlighting?

In that case, I would argue that it's not easy at all with (La)TeX. The
obvious difficulty is people mucking about with cat- and char- codes; but,
even if that's not happening, you've got things to worry about like old-style
`$ $` and `$$ $$` delimiters. I've never seen a highlighter handle
`$\text{$math$}$`, or even `\\(\text{\\(math\\)}\\)`, correctly.

------
magnusgraviti
LaTeX is easy to read. I want to write a little story from my life as an
example.

While I was working at one firm I got own department. I wrote LaTeX class for
them to support corporate style. After 1-2 weeks they noticed it was the same
if not better than MS Word for documentation.

------
freyrs3
The same reason a lot of file/language standards become popular. They suck
less than everything else when they were created and then large amounts of
material became tied up in their continued existence ( i.e. academic papers ).

~~~
barumrho
Existing papers do not really force new papers to be typeset in LaTex, since
end products are just PDFs.

I don't know of any alternative solution that is as easy to use and produces a
high quality document.

~~~
meepmorp
Some disciplines wound up having lots of handy LaTeX macros written to handle
things that are common to the kinds of papers that get written, as well as
there formerly being the requirement that papers be submitted as LaTeX
documents. More the first reason, I think, tended to encourage LaTeX usage for
a while. Once you got used to it, LaTeX really made it faster to get what you
want without having to fiddle too much with the formatting.

I know I spent a lot of time with qtree, gb4e, and pstricks.

------
jimhefferon
A big factor was/is the prestige of Knuth.

------
justincormack
A Markdown extension that turned latex formulas to MathML would be nice...

~~~
sidupadhyay
This is one best directions with the available technology. We're trying to do
this at Hoot with what we call "Smart Chat." We've taken the markdown editor
and adapted backticks (`) to wrap a simplified subset of Latex, so that the
language is more accessible to a wider audience by providing immediate
rendering and feedback. In our case the uses are much more simple than the
troff example above (<https://apps.facebook.com/hootapp/?sid=5Yyt797Jg>), but
are still very applicable. I think our most common use is by highschoolers and
college students for calculus, where ideas such as integrals and summations
are easily described in plain english:

`integral cos(x)*e^(2x) dx` or `sum (x^n) / (n!)`

edit: added simpler examples

------
Craiggybear
troff is for me far harder to read by eye ... TeX and LaTeX are far easier to
read and more versatile. Its just a personal thing, I'm sure, but I found
taking to TeX an instantly productive thing to do.

Modern TeX/LaTeX packages for distros these days are _huge_ though, in
comparison to the stuff that came on a single floppy when I first learned to
use it.

