## Sunday, July 4, 2010

### Why LaTeX is superior to MS Word

I recently submitted a paper to Interdisciplinary Graduate Conference (IGC) 2010. I prepared well formatted 8 page LaTeX document. However, the conference was organized by humanities students who had never heard of LaTeX. They wanted a .doc file. I then had to go through the painful process of converting my LaTeX document into a Word one. After that painful experience, I could not resist writing a rant on the process. I have experienced both forms of writing: I used word for every (lab) report in my under-grad. Once in my PhD program I was converted to LaTeX and have not looked back since.

1. Speed: Anything that requires a mouse and clicking through menus will be slower than one where you can write it out in a few key strokes. This means that writing characters with accents, special symbols, and especially equations will be much faster to write in LaTeX.

1. MS Word (and even worse open office) can get sluggish when editing large documents with lots of equations and figures.

2. Security: stored in plain text

1. MS Word stores its files in a bloated binary form. If a file gets corrupted for whatever reason you could be locked out of your file and many hours of work. Likewise if some bug in MS Word is causing it to crash when opening your file. With plain text source files, if all else fails you can always open and edit the file in a simple text editor.

3. Separation of context and formatting

1. The plain text style of LaTeX simply using section and subsection etc allows the writer to simply think about the logical flow of the document without worrying about superficial details such as font sizes and styles

2. You know all your sections and subsections headings are in the correct font size. This is much harder to check using MS Word.

4. Integratable with SVN

1. Being plain text it is easier for SVN (and other revision control systems) to merge files being edited

2. It also takes up less space on the server storing revisions

3. It is also possible to use any diff tool to compare revisions

1. You also know the diff tool will show you ALL changes in the state of the file. There is no such guarantee when using features such as track changes in MS Word.

5. Control

1. MS Word often tries to outsmart you. It will automatically capitalize, automatically try to select whole sentences, automatically insert bullet points, and try to infer when you’re done with a sub/superscript when writing equations. Software that tries to out-smart you will often out-dumb you. It tries too hard to infer what you want and often gets it wrong.

1. A good example is the use of - vs. -- vs. ---. Microsoft assumes most users are not smart enough to infer which type of dash to use in which situation. So MS Word tries to figure it out automatically. It can be really annoying when it gets it wrong. With LaTeX you just write what you want in 1 to 3 key strokes!

2. There is also the quote directions  ''. In LaTeX it is specified manually while in word it is automatic, and can be annoying if word infers it wrong.

2. Notion of state: every change in the file is visible. Nothing is hidden from you in a plain text source file.

1. There is no hidden meta information

6. Flexibility

1. It is easy to search for $x^2$ or \footnote in LaTeX the is no easy way to do the analogous searches using CTRL-F in MS Word

2. You can also search the file using regular expressions

3. Macros for a more semantic representation can be written in just 1 line with a few key strokes

1. For example, I often define \field{} using \mathcal{} and then \R using \field{R}

4. In MS Word macros are often full blown VB scripts

1. They should be disabled any way since they are a security risk

7. More easily scriptable

1. For instance, I have MATLAB code that exports a matrix of results in MATLAB to a LaTeX table

2. It would require a full blown C++/VB program in visual studio using all sorts of crazy APIs (and therefore reading tons of documentation) to do the same thing in MS Word

1. Because MS Word has to reformat the document every keystroke it has to use inferior typesetting methods to prevent the GUI from becoming glacially slow

2. Since you only recompile after significant changes in LaTeX, it can afford to use more expensive type-setting algorithms (especially for equations) that might take 10 seconds to run.

9. Interoperable

1. Since things like bibtex are also plain text it is much easier for third parties to create applications such as Jabref. You don't get stuck using one particular reference manager. If you don't like one there are others to use instead. And if all else fails you can always edit it in notepad.

2. Therefore, there is no vendor lock-in and you can't get stuck using one piece of software for backward compatibility reasons that may in the future become inferior to the alternatives.

10. Misc

1. Equations always come out looking crappy

2. Figure captions aren't proper; MS Word will let them cross page boundaries for instance

3. Footnotes are a pain, especially if you have multiple footnotes on the same page

4. Equation numbering is a pain in Word

5. It is possible to embed pdf figures in LaTeX which allows for vector graphics and avoids file bloat

1. However, I beleive new versions of word allow for the insertion of eps figures

11. Cost

1. LaTeX is free while MS Office can cost a few hundred dollars

1. There is open office but that is even worse

2. I am not a "free-tard" so this is not my top concern

1. MS Word has a grammar checker. To my knowledge, none of the LaTeX editors have a grammar checker.

1. Of course, the grammar checker should usually be taken with a grain of salt. However, it is good at catching typos such as interchanging it/is/if and they/then, which a spell checker will not find and are easy to glance over when proof reading.

2. The equation editor is better than it used to be. Writing an equation heavy document in word used to be almost impossible. However, it is now doable, but still much slower than LaTeX.

Yaroslav said...

Also, Latex *looks* better. I can usually spot humanities and psychology papers by strange looking word and character spacing
http://nitens.org/taraborelli/latex

lauren said...

I must say that I never used LaTeX and I always used MS Word but from your blog I got to know that this is where I am lacking behind thanks for giving introduction and difference and surely I'll now opt for LaTeX .
digital signature FAQ

your arguments relating to file size are just plain silly; nothing on earth is cheaper then hard drive space; it is very rare for documents to be more then a dozen mega byte each; currently (a year or so after your post) hard drives are about 100 dollars us/terabyte

your argument about word crashing and getting locked out is also silly; surely you know that word has a save as commandthat stores to rtf or even plain text (although to be honest, I've never tried to store a doc withcomplex formatting and embedded pictures as a .tex

the biggestthing in computers is that others in yourfield be able to easily edit and help you wit your document; at least in my field, molecular biology, *NO ONE* uses latex or any variant thereof (most people havn't even heard of it

I'm not sure what to make of your typsetting obsession; on the one hand I admire you; on the other, I wonder if these things matter for documents thatare displayed mostly on computer screens or printed out on cheap printers

Unknown said...

" it is very rare for documents to be more then a dozen mega byte each"

"Only" a dozen megabytes...hell, I remember when the entire operating system, programs, and data could all be wrapped up in a few KILObytes--*including* whatever document you were working on.

I guess it could be okay if a document takes up a thousand times as much space as necessary--if you have it to waste (which I suppose we do), but know that this also translates to slower speeds of loading and trsnferring documents and a much bigger pile of crap to go through if the file gets corrupted (and probably unfixable with the Word doc compared to the LaTeX doc).

Often superiority comes down not to just one big thing, but the culmination of many small advantages. But actually with LaTeX vs. MS Word, there are a fair number of good-sized advantages, for those that value them.

Thomas Browne said...

Unfortunately, LaTeX has a very steep learning curve, whereas Word does not. That is Word's key advantage, and why it is the standard, unfortunately.

Kevin W said...

I've created a lot of latex and a lot of Word documents. Both have pros and cons.

When you criticize Word because you have to "worry about fonts and styles", it sounds like you don't understand styles. In LaTeX you write \section{}, whereas in Word you simply click on the Heading style. Both are simple and both manage the fonts for you.

Mismatched parens, braces, etc are a pain in LaTeX. In general, compiling a tex file is a pain, especially when using bibtex and making changes to the citations.

In Word, trying to use manual formatting (e.g. font changes) with numbered lists is a pain. I often end up with some numbers in a different font than other numbers.

CLS said...

@Thomas LaTeX is the standard in a lot of the technical literature, not MS Word. @Soccer_dad even today sending a 25M pdf file through email is not practical. And it's not just about size, but generally about the ability to handle adequatly large documents, and produce clean pdf with the right quality that you need for the purpose you are trying to achieve. Re typesetting, just look at a document generated through LaTeX and you will get the point, it is *pretty*. It just looks professional, and users spend no time worrying about the style. Really, they just select a template. Re your point that no one uses LaTeX. This is not a problem in maths, stats, or computer science. More the opposite in facts. But I have experienced issues when collaborating with biologists. I think that initiatives such as sharelatex.com are going to make collaboration (and learning) way easier now.

Blogger profile said...

Latex is great.

I wrote my senior thesis using LaTeX, and when my buddies saw how nice it looked (like a real journal article), my buddies, including a Chinese Studies major and an Economics major, decided to use LaTeX too.

To make that work, I did an hour-or-so long session with each of them. I set up a simple "template", and showed them the basic commands like \section{} and \emph{} and so on. I told them that what I showed them wasn't the whole story, but to not get ahead of ourselves. I promised that if they did a few minutes of research and couldn't find solutions for their own problems, I'd help. (I also gave them good pointers to documentation)

My Economics girl-buddy asked for help a few times, but she was also becoming significantly more confident each time. She was excited about LaTeX! She was excited about programming her computer to output cool looking documents!

In fact, all my buddies asked for help a few times. And many commented about how much easier it was to write their thesis (at least, the mechanics of typing and formatting it) than doing significantly shorter papers using Word, like they had been for years. Does Word do automatically self-adjusting tables of contents and indices? LaTeX does. Can you imagine how much of a pain in the butt it is to have to re-number your indexes every time you change the document? This stuff is simple with LaTeX. Microsoft Word only introduced indexes in like 2005 -- LaTeX has done it since the late 80s.

LaTeX has about an hour long learning curve. I remember having to take a semester long class on MS Office in high school, and still couldn't do the things LaTeX could do after an hour of study.