Should I Use LaTeX ?

LaTeX (pronouce Latek) is a free typesetting language intended to give a good scientific pagination. Amongst its numerous advantages, the most interesting one is that it can handle mathematical equations with a smooth, unblurry finish like we are used to see in exams or academic papers. As a mater of fact, all academic publications are published in LaTeX or one of its cousins.

Writing in LaTeX is not easy for the profane. Even if LaTeX is not a programming language, it is similar in approach and structure. In opposition to standard text processing software, you must edit a source file first and then compile it in a .pdf file. In a standard software, what you want is what you type. In LaTeX what you want can be a hell of coding.

Therefore, someone needs to ask himself if he needs to use LaTeX or not. In short, I suggest it to everyone who begins a masters degree in any field that includes statistical analysis, high mathematical content or aim for a publishable article. If you write some equations from time to time, Words or OpenOffice will remain more useful tools (and you can cease reading this text). That being said, those who wish to pursue should start on small files in order to get used to LaTeX before starting a bigger work such as a thesis.

The term "compiled" may obfuscate readers but can be easily substituded for "translated" or "converted" for the purpose of understanding. In fact, compiling a text is nothing less than asking the computer to transform what you have typed in your source file into the typographical result, a .pdf file. In short, writing a LaTeX article is done by writing a source file and then asking a computer to "convert" it in a .pdf file.

Since the computer does the compilation, there is nothing more to learn about it. However, writing the source file that has to be compiled can be an hard task. Computers obey to formal logic and in order to be understood, your file must respect LaTeX conventions. In other words, the computer does not do what you think you have typed, it does what you have typed. And if you write something wrong, the computer will just not understand it and generate some errors.

Writing plain text, particularly in english, is quite easy since it is exactly the same thing as writing on programs like notepad. Writing equations requires study but over time, it becomes as fast as plain writing. Here is an example in french :


\begin{document}
Un exemple de texte bidon \'ecrit en LaTeX. On remarque d\'ej\`a que les accents requi\`erent une attention particuli\`ere. Pour \'ecrire une \'equation, on fait comme suit :
\begin{equation}
e^{i\pi} = -1
\end{equation}

Un nouveau paragraphe. Etc...
\end{document}

The result is then the following :




(click to enlarge)

Some comments can already be made with this simple file. First, every ".tex" file begin with \begin{document} and ends with \end{document}. These are the indications for the compilator (the software responsible for converting the source file into the pdf file) for where it should begin to "read". More generally, similar instructions like \begin{[something]} and \end{[something]} are, like they suggest, there to tell the compilator the beginning and the end of some object in the text.

Second, french accents requires caution. An “é” must be written like “\'e”. Likewise, “î” is written like “\^i” and other accents are written with the following structure : \[accent][letter]. Even if it does not have much utility, it is possible to put some accents on every letter like a "circonflex t" by writing \^t. Most of the LaTeX editors offer environment with latin encoding and therefore, writing accented letters can be done by typing normally on the keyboard.

Third, mathematical equations are embedded inside markers telling that they are equations. This is how the compilator understands that the ugly text e^{i\pi} = -1 must be converted in a nice typo. The convention for writing Pi (3.1415…) is \pi. LaTeX includes conventions for every mathematical symbol. One can also note that equations are automatically numbered and so is page numbering. It is however possible to change such automatisms.

Fourth, no need to bother about pagination or pagesetting. LaTeX is taking care of it.

Even with such a small example, we can understand why getting acquainted with this word processor is hard at first. One must learn all conventions and write syntax correctly. In order to learn those conventions, it is necessary to read a manual. There are many and I prefer this one (in french).

There are also many free LaTeX editors. This one here is worth mentionning since it is supposed to work on every platform. That being said, I never tried it. Being a Mac user, I use Tex-Shop.

Writing in LaTeX gives many advantages. It allows easy pagination of long tables of datas directly from the output of specialised software like Stata. Anyone doing regressions from time to time will understand how much time this can save.

Also, LaTeX allows to write references automatically. Anyone who did a long list of references knows it can be long and borin to make sure every reference is conform to university specifications. With LaTeX, such things are done automatically ! Aside from Latex, it is a good thing to have a reference managing software like BibDesk (free) or EndNote to ease such operation.

Another advantage is that LaTeX works with vector defined files. A vector file, as opposed to "binary" files does always have a good resolution, no matter how big you zoom in. The trivial use is for images. A vector defined image does not lose in definition as opposed to JPEG or GIF images. This is possible because images are defined in terms of mathematical parameters (a vector describing a curve, for instance) rather than only pixels with a position and a color. Specialised softwares like Octave, Matlab, Maple or Stata generate vector images automatically. So by using LaTeX, you can embed vector defined images that remains sharp and well defined. You can also ask LaTeX to generate images or graphs for you by typing in the equations!

Another complementary software worth mention is LaTeXit (mac only, but there should be equivalents). This software is a “mini-editor” specialised for equations in powerpoint from LaTeX code (the example above was generated with LaTeXit). It is also useful for writing long mathematical formulas to verify if syntax is correct before putting it in a bigger file.

It is also possible to “convert” LaTeX source files in .rtf files. This is interesting because .rtf files are readable by Word so it can be edited by someone who does not know LaTeX. Those conversions necessitate deeper understandings of UNIX (or LINUX) and will not be discussed here.

Once used to LaTeX writing, it is common to wish for some add ons. For instance, one might want to have the pagination of theorems and demonstrations done differently. Fortunately, there exists a plethor of extensions (named packages) that allows more functionnalities. A rationale here is to think that if you need some kind of modification or add on to the original LaTeX compilator, there is probably someone who thought about it before and wrote a package about it. A good source of packages (and answers to questions) is FAQ from Lille's University (in french). A good way to reach this site is by typing "FAQ LaTeX" in google (Canada).

Learning any new software requires time at first. Latex is no exception. Mastering it comes then with practice and it is only a matter of two or three articles before it becomes a part of you. If you are someone who have to write with a lot of mathematical equations, there is no doubt in my mind that benefits of LaTeX are greater than its costs. If you are not sure, it might be a good thing to ask your collegues about it. LaTeX is not a necessity, but it is certainly a good thing to know at least a little about it.