LaTeX Document System Guide

The LaTeX document creation system provides writers with an alternative to typical word processors. It gives the user control over typesetting through markup tagging conventions that are relatively easy to learn to use. Students and professionals often use LaTeX in academics or math and science, and the free online sources for the software make it widely available for anyone who needs it.

When you write documents in some word processors like Microsoft Word or Apple Pages, what you see is what you get. Those platforms process and format the words and images on the page for you, reducing your workload. But behind that pretty document is some additional code. This backend tells the text when to do certain things like insert a paragraph break or use italics. When it comes to LaTeX, on the other hand, you can learn how to use markup tagging conventions to become an editor of this backend code. If you’ve never done this before, I think you might find a LaTeX tutorial useful. But the idea is relatively simple, and LaTeX gives you the power to have control over the typesetting of the document before you put it through a compiler for the final polished results.

When writing using LaTeX, the writer will use plain text and several markup conventions to define various structures that they wish to add to the document. These structures can include text styles such as italics, bold, underline, and more. They might also involve less stylistic conventions and more practical ones. For example, a LaTeX editor may add cross-references and citations within the text. LaTeX then compiles the writing using typesetting algorithms that create an optimal layout. The documents that a LaTeX editor can produce include letters, articles, books, and more.

Learning how to use the LaTeX system isn’t as hard as it might sound at first. I will go over some tutorials on how to use the system and a compiler to get your final LaTeX document. With a little help, I am confident you’ll be writing up a storm in no time.

The History of LaTeX

Before LaTeX, there was just TeX, pronounced “Tech.” TeX was a computer program made by Donald E. Knuth in the 70s. More specifically, it was a typesetting engine that Knuth used to explore digital printing equipment of the time. This equipment was just starting to come into the publishing industry. Knuth’s goal was to contribute to improving the typographic quality of books and articles. TeX did this by providing a program that would give the same high-quality results on any computer at any time.

In the 80s, Leslie Lamport created LaTeX because he needed to add some capabilities to the original TeX program. However, unlike TeX, LaTeX is not a program. Instead, it is a document preparation system that uses the TeX macro language. Thus, LaTeX is composed of various encoding conventions, and you can use any editor or word processor to write LaTeX documents. However, you can also use the LaTeX preparation software that runs using the original TeX typesetting system. I know it’s a bit confusing, but that means it’s both a programming language and software. But I think that increases its range of applications to an even wider variety of situations.

Lamport eventually made LaTeX into a general format that many people can learn how to use. After creating a user’s manual as a sort of tutorial to show people how to use the new LaTeX, he continued to release new versions of the system. In the late 80s, Lamport finally turned LaTeX over to a new team. Since that time, a few new versions have come onto the market. These are the versions that you and I know today. In general, LaTeX is particularly prevalent in technical areas such as academia, mathematics, economics, and computer science.

How to Get LaTeX

The LaTeX software comes in various packages that bundle together everything you need for regular use, configuration, and maintenance. If you get it from the CTAN servers or TeX distributions, then the software is free. I will go over the central systems here and how to use them with LaTeX.

LaTeX on Linux

If you want to use the system on Linux, then you first need to check your Linux distribution source. There, you need to find a TeX distribution that includes LaTeX. However, sometimes the only available versions are quite old. So I would say it might be better to install the current TeX Live distribution. You can do that here via download or other methods such as burning it onto a DVD or as a large ISO file.

If you want to see LaTeX in action on Linux, I recommend checking out a tutorial with examples. You can use the model problems to follow along and get the hang of using this tool on Linux. I’ll go over more details on putting it to work below.

LaTeX on a Mac

If you have a Mac operating system, then MacTeX is for you. It has a complete TeX system that includes LaTeX as well as editors for writing documents.

For the most current distribution of MacTeX, then I recommend Sierra, Mac OS 10.12, or higher as well as an Intel processor. If that doesn’t fit your needs, then there is another alternative that you can try. You can install TeX Live 2019 using the TeX Live Unix Install Script. This way should work for Snow Leopard, MacOS 10.6, and higher on Intel processors. If that still doesn’t work for you, then you can get your hands on older versions of MacTeX for Mac OS 10.3 through 10.11 here.

Once you install LaTeX, I suggest thinking about an appropriate text editor and a compiler for viewing the document as a PDF. TextMate is a decent text editor for Mac OS X with pretty good support for LaTeX, and you can even customize it a bit. Then there’s Preview, which is part off the Mac OC X and allows you to preview PDF files.

A workflow for Mac users might start with opening LaTeX in MacTex, followed by working on the source code in the text editor and then using the compiler to create the PDF preview. I suggest checking out some tutorials online to help you with the details of both installing and using LaTeX on a Mac.

LaTeX on Windows

Because Windows is by far the most popular operating system for desktops in the world, I am sure that a lot of materials and tutorials you see on LaTeX will focus on it. There are numerous distributions available for Windows, each containing the complete TeX system. These options include LaTeX as well as text editors for writing documents.

The first distribution I recommend is MiKTeX. On its corresponding page, you can find everything you need. The page regularly posts news and developments, as well as updates for the most recent version that’s available. Additionally, you can find a stack exchange and stack overflow where other users ask questions and exchange info. Using these tools, you can learn about LaTeX on the platform, thus providing you with loads of information on editors, compilers, and even step-by-step help with any questions you might have.

Next, I would say to take a look at proTeXt, which is a MiKTeX-based distribution for Windows. One of the primary goals of proTeXt is to provide users with something straightforward to install on Windows. It accomplishes this by using an installation wizard that guides the installation after downloading. You will have the option to complete this process in one of several language options.

I also recommend looking into TeX Live. It will help you get on the ball in terms of the TeX document production system. It comprehensively goes over the TeX system for Windows as well as Linux and macOS. The full package of TeX programs, macros, fonts, and support comes in various languages, so it has you covered.

Using LaTeX Online

There are various reasons that you might not want to commit to a single operating system. Maybe you work on multiple computers throughout the day, and none of them use the same one. Whatever your case may be, the solution is probably to use LaTeX online, where you can also find all the editors, compilers, and anything else you need. I will go over some of the online options for you to consider.

Papeeria

First, I suggest taking a look at Papeeria. It has some convenient tools like an automatic compiler that runs in the background as you work in LaTeX, as well as functionality on both desktop and mobile. Papeeria uses a pre-installed full TeX Live environment, and you can use any web browser you want. It also fosters collaboration with margin discussions, real-time updates, and shared cloud storage. All of these features plus one of the templates from their gallery will put you on the fast track to finishing your first document.

Overleaf and ShareLaTeX

Overleaf is another popular platform that I think is great for beginners. It tailors its content for students and partners with various universities, so it might be the best option if you want to use LaTeX at school. It also has many of the same features as Papeeria in terms of collaboration and ease of use so that you won’t be missing out. The editor ShareLaTeX recently joined forces with Overleaf to offer a built-in LaTeX editing service.

Datazar

If you don’t necessarily need something that entirely focuses on LaTeX, then I think Datazar might be best for you. It helps you investigate data with interactive visualization, analysis, and reporting tools. Other helpful tools include the ability to download, view, and edit LaTeX files and PDFs.

LaTeX Base

Alternatively, if you just need a LaTeX editor, then I suggest checking out LaTeX Base. The editor includes a live preview of the document that changes as you work on it. Once you have your work as you want it, you can export it to other areas like Google Drive or Dropbox.

How to Use LaTeX

Once you have your platform of choice ready for use, I can give you some tips on how to go about using LaTeX and a compiler to make a document. There is undoubtedly a bit of a learning curve, so take your time and go through a few tutorials made for people new to LaTeX.

A First Document

Before starting on the text of the document, you will need to set the paper size. The default size is A4, which will probably be the wrong size if you’re outside of Europe. If you’re in the US, then I suggest changing the setting to “letter” from the settings menu found through the path Start > Maintenance > Settings. However, be sure that you do not choose “letterSize.”

Next, open the text editor that you wish to use with your LaTeX document. Create a new document and insert the following text:

\documentclass{article}
\begin{document}
Hello, world!
\end{document}

Follow this by saving and make sure that the build box has LaTeX => DVI to output a device-independent file. You can then use a compiler to “build” the LaTeX document using Ctrl + F7 or by using the mouse and view it using F5 or the mouse.

The final result should give you a document that says, “Hello, world!”

Errors

But what happens if you do something wrong? Type the following code to see the resulting error:

\documentclass{article}
\begin{document}
\includegraphics{globe.eps}
Hello, world!
\end{document}

This input will give you the following error:

LaTeX-Result: 1 Error(s), 0 Warning(s), 0 Bad Box(es), 1 Page(s)

To address the error, press F9, where you will receive an explanation of it.

This tutorial is pretty simple, but I think it gives you an idea of the necessary steps involved in creating your LaTeX documents through writing code and using a compiler.

Creating an Outline

For longer documents, I highly suggest creating an organized outline. You can do this using sectioning commands that split the structure of the document into units. Otherwise, you would end up with a giant wall of text without any breaks. The following is a list of the sectioning commands:

• \part
• \chapter
• \section
• \subsection
• \subsubsection
• \paragraph
• \subparagraph
• \subsubparagraph
• \subsubsubparagraph

The general form that all of these sectioning commands use is \chapter[optional]{title}

When you create a section using one of these commands, it won’t just change the text itself. Additionally, it will add the section to the table of contents, and it will also add it to the running head found at the top of the page. If you don’t want thee heading to appear in those two places, you can use an optional argument in the sectioning commands. To do this, you will use the asterisk, *, as I do in the following example command:

\subsection*{Example subsection}

This input will print the title without including a number or making a table of contents entry.

You will need to know the basics of the language before you can become a pro editor in LaTeX. The characters \, {, }, $, -, _, %, ^, and # each have a special meaning with which I recommend becoming very familiar. When used in conjunction with alphabetic characters, they control sequences and create changes in the post-compiler LaTeX document. First, the backlash typically indicates the beginning of a sequence, such as a formula or a symbol. For example, \begin and \end are vital for essential articles. Then, the dollar sign switches between standard and mathematical formula text. Brackets group characters together, while the underscore and carat make sub- and super-scripts. Combining these symbols with simple words creates commands which define the way elements display. For example, I can use \textbf to make any following text boldfaced. I can also create personalized versions by setting \newcommand. This tactic is particularly useful when I have a repetitive or complex task that regular commands don’t already cover. Environments There are various types of commands you can use in LaTeX. One important task they can accomplish is creating environments. You may not have realized, but I talked about doing so in the section “First Document.” That is, I discussed and gave examples for the document environment, which is one of the most complicated in LaTeX. Therefore, I recommend taking looking at some of the others while you’re getting the hang of the system. But what are environments? An environment is a concept that LaTeX adds to the original TeX. While TeX only makes provisions for commands, LaTeX creates environments that perform actions on a whole block of words rather than just one spot in the text. The environment works by putting its content inside a TeX group where specific commands are applied. But those commands only work on that group, and not anywhere else. Within the example from the “First Document” section, \begin{document}  is the beginning of the environment, while \end{document}  is the end of it. Any text between those two commands is the text that will be within and affected by the environment. Another example of an environment that is simpler than “document” is that of “center.” If you start with \begin{center}  and stop with \end{center}  then any text between the two will be centered after it goes through the LaTeX compiler. The \begin and \end are called opening and closing tags, respectively. Sometimes they require more inputs, but then give more advanced results. For example, the environment {tabular} requires some more steps that I encourage you to take a look at, and it can give you a matrix with rows and columns. Math Symbols One of the reasons that a lot of people I know use LaTeX in math and science is that it is much better when it comes to writing mathematical formulas than typical word processors. It requires fewer menus of symbols, and you can be sure that the formatting will stay constant. There is a massive list of math symbols available in LaTeX editors, although some of them require special packages. However, the more common ones are all easily accessible. The list includes Greek and Hebrew letters, delimiters, math constructs, function names, variable-sized symbols, binary operations, and quite a bit more. You can even put the various symbols into array environments or change their styles into different fonts and sizes. Because the list of symbols is so long, you might have a little trouble finding the one you want. But, of course, there’s an app for that! I recommend checking out Detexify, which lets you physically draw the symbol you’re thinking of, and in return, it will tell you the LaTeX code that you can use in the editor. Test the symbols in your LaTeX document by running everything through a compiler to see your final results. Math Equations When you want to write about math topics, I encourage you to use one of three environments. The first is the math environment that’s great for formulas that run in-line with other text rather than standing alone. It will start with \begin{math}  and end with \end{math}  Additionally, you can use$ . . . $to do the same thing. Of course,$ . . . \$ is the most common due to how easy and simple it is to type.

The second option is the displaymath environment that I recommend to help you display longer formulas more easily. Because the equations are longer and often more complex, it’s better to have them set apart from other running text. This environment will indent the formula and insert whitespace both above and below it. You can start the environment using

\begin{displaymath} ... \end{displaymath} 

or by using \[ . . . ]\ or $$. . .$$. The most common is \[ . . . ]\, and $$. . .$$ is not fit for use with LaTeX2e.

Finally, there is an equation environment that can allow for cross reference and numbering. The only way to use it is by starting with

$$...$$ 

This environment will help you deal with multiple equations by assigning a number to each one. You can even create labels to reference them in the text without needing to know the assigned numbers.

What to Do With Your New LaTeX Document

After putting everything through the compiler and getting your final LaTeX document, you might ask what exactly you can accomplish with it? The answer is, pretty much anything. I believe that one of the primary drivers for people turning to LaTeX is that the editor makes everything look better. The typesetting algorithms determine perfect layouts of images and text that word processors typically aren’t capable of doing. And once you’re able to get used to it, it’s easier to make everything look exactly how you want. That way, you don’t need to fiddle with the finicky hidden formatting of other word processors. After writing your LaTeX code, you know how it should look when it comes out of the compiler.

But if you’re learning how to use LaTeX for a specific purpose, I would venture to guess that you’re doing it for academic writing. LaTeX is a hugely popular editor in the field due to its straightforward formatting of mathematical text. If you find yourself needing it for this purpose, then you can find various tutorials and other information on how to apply your LaTeX knowledge to scholarly publications and other writing.

I think one of the most useful tools you can use in such a situation is real-time collaboration. This ability is standard on online platforms such as Overleaf and can help you work with your team of peers and supervisors to optimize your work. There are even publishers and journals linked directly to Overleaf. This connection can help you be sure that you’re meeting the standards of your publisher throughout the process of writing the document. You can even find publisher templates that show you exactly what they’re looking for in the final version of submissions.

For a quick rundown of the main topics I discuss here, check out these summaries. You’ll find additional info on each of them that goes more in-depth in the sections above.

What is LaTeX?

LaTeX is a system for document preparation that uses conventions different from those of conventional word processors. The user writes in plain text using certain markup tagging conventions to create the material, and LaTeX uses typesetting algorithms to format the words through the use of a compiler.

How to Get LaTeX?

It is both free and straightforward to get LaTeX for any operating system. Search for LaTeX on your desired operating system to find downloads, or read the above sections for more guidance on finding the sources. You can also use LaTeX on various online platforms that do not require downloads and can offer additional online features.

Is LaTex free?

Yes, LaTeX and associated tools like compilers and tutorials are available for free via the internet. The appropriate version for all operating systems are available for free, as well as online platforms. All versions also have extra capabilities that other processors do not include for free such as bibliography tools.

Is LaTeX a programming language?

LaTeX is a document creation system that consists of both the LaTeX language and software or program. It is a software in the sense that it is a command which the user calls from a terminal. But, it is also a language in that it consists of coding and tagging conventions that the software uses to create documents.

Who Created LaTeX?

Leslie Lamport created LaTeX in the early 80s as a way to use the original TeX macros created by Donald E. Knuth a decade earlier. Lamport created the user’s manual for LaTeX as well as various versions in the 80s before turning over maintenance and development to Frank Mittelbach.

LaTeX Resources

Because LaTeX is so popular and widely available, there are countless resources online where you can find editors, compilers, tutorials, and more. Some are informal settings like stack exchanges. Others are orderly websites put together by universities or groups that frequently use the tool. If you are part of a university or other research institution, I suggest checking to see if it provides you with access to online resources.

Alternatively, if you’re not part of an organization that will help you out, then I know of some who are willing to help everyone out. For example, Kent State University provides some online materials that don’t require a login or other credentials. It provides links to resources for everything from beginner LaTeX tutorials to guidelines for writing a dissertation with it. You can find short courses for math and links to editors like WinEdt that should make using LaTeX a breeze.

Additionally, you can find converters online to help you accommodate your tasks in LaTeX with other formats. You can find converters that change between various document formats, word processors, and even code. Thus you can quickly turn your LaTeX documents into different files, Microsoft Word documents, or HTML language.

But maybe you’re looking for some reading to get you into a LaTeX editor, compiler, or follow-along tutorial. If so, I suggest checking out some books on the subject. Books can help you learn the basics or delve deep into the more complex topics such as original TeX code and advanced LaTeX editor tools.

Conclusion

Using LaTeX and an associated compiler or other tools might sound intimidating at first. But I can assure you that it’s just a matter of learning a couple of new things and getting accustomed to a different way of working. If you can get your hands on additional materials such as those I discussed above, then I highly recommend taking advantage of it.

There are also many packages you can get online through other means, but you will often need to pay for access to them. Tutorials and online resources provide a practically endless amount of help along your journey to mastering LaTeX, so before you know it, I am sure it will be your default tool for many tasks.

If you’re unsure where to begin, just start by finding the best LaTeX version and tools like compilers for your operating system. Then, check out some tutorials to get you on the right track for starting a simple LaTeX project. Once you’ve mastered something simple, start adding new skills and abilities to your repertoire until you can easily create any document you need.

What piqued your interest in learning LaTeX? Let us know if there are specific documents or assignments for which you need more information!

David Smith (Dave) has a B.S. and M.S. in Mathematics and has enjoyed teaching precalculus, calculus, linear algebra, and number theory at both the junior college and university levels for over 20 years. David is the founder and CEO of Dave4Math.