Intro to LaTeX

History

LaTex is an open-sourced typesetting document developed about 30 years ago by Leslie Lamport and based on the Tex typesetting of Donald Knuth. It is commonly used in the domains of physics and math for producing mathematical equations and other technical documents. Below is a simple example of an equation developed using LaTex

1

LaTex is a document markup language, which means that you indicate the commands and then it is processed to produce the desired effect. This is in contrast to Microsoft Word which utilizes a WYSIWYG (What you see is what you get) approach.

Benefits

Using LaTex provides several benefits. Cross-referencing is easily accomplish especially with the help of BibTex. It is also multi-lingual and able to make glossaries, indexes, and figures/tables with ease. In addition, LaTex is highly portable and opening a file on any computer is not a problem. Sometimes moving to another computer using Microsoft Word can cause issues with formatting.

Another benefit is psychology, using LaTex allows the author to focus on content and not appearance when writing. It is easy to get distracted when using Word to try and make something work through the point and click mechanism we are so used to when writing.

Cons

It takes extensive time to use LaTex. It looks similar to coding which is intimidating for many. However, once a certain mastery is achieved. Producing documents can be faster as everything is text-based and not point click based using a mouse.

Using LaTex

To use LaTex you need to install TexLive and TexWorks. TextLive is a LaTex distribution and TexWorks is one of many LaTex editors. The editor allows you to manipulate the LaTex code that you generate.

Once you have installed both programs you can type the following into TexWorks. Make sure the typeset is set to pdfLaTex. This allows the output to be a pdf file.

\documentclass{article}
\begin{document}
This is an example of what LaTex does
\end{document}

1.png

What happened is as follows

  1. We entered the command \documentclass{article}. All commands begin with a slash followed by the name. The curly braces are required arguments. In this case, we are using the article template which is one of many templates available in LaTex.
  2. The next command is \begin and this command indicates the beginning of the actual text of the document. Everything above the \begin command is part of what we call the preamble.
  3. Next is the actual text that we want to appear in the pdf.
  4. Lastly, we have the \end command which tells LaTex that the document is finished. Everything between \begin and \end command is part of the environment.

Conclusion

There is so much more that can be accomplished with this typesetting software. The possibilities will be explored in the near future.

Leave a Reply