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 to a programming language in its approach and structure. In opposition to Microsoft Words, you must edit a source file first and then compile it in a .pdf file. In Words, what you see is what you get. In LaTeX what you see can be a hell of coding.

Therefore, someone needs to ask himself if he needs to use LaTeX or not. 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). For those who wish to pursue, it is a good advice to start on small files in order to get used to LaTeX before starting a thesis.

The term "compiled" may obfuscate readers but it 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 the source file into 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, this part is a easy. However, writing the source file in order to be understood clearly by the computer can be an hard task. Computers obey 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 asked, it does what you have typed. And if you write something wrong, the computer will just not understand 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 coding. 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 require a particular 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 do such conversions before compilation and therefore, writing accents can be done by typing normally accents 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, we don't have to bother about pagination or pagesetting. LaTeX is taking care of this part.

With this small example, we can understand why getting acquainted with this word processor is hard in the beginning. It is necessary to learn all conventions and write syntax correctly. In order to learn those conventions, it is necessary to read a manual. There are many, but I prefer this one (in french).

For the software, this one is worth mentionning since it works on every platform. That being said, I never tried it. Being a Mac user, I prefer Tex-Shop.

Like I said in the beginning, 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 you write vector defined files (.eps or .pdf). 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.

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. Fortunatelay, 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 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).

Learn any new software requires time in the beginning. 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.