Chapter 1: Getting Started with LaTeX
You are familiar with word processing software: you type something, and the software prints it as it is on screen. In contrast, LaTeX, as typesetting software, receives instructions and text from you, and then creates the output. It produces high-quality output based on sophisticated algorithms for justification, text alignment, whitespace balancing, figure placement, and more, such as predefined formatting styles for headings and general page layout, which you can customize.
Are you ready to leave those "what you see is what you get" word processors behind and to enter the world of accurate, reliable, and high-quality typesetting? Yes? Then let's go together!
It's great that you decided to learn LaTeX. This book will guide you along the way to help you get the most out of it. Let's speak briefly about LaTeX's benefits and the challenges, and then we shall prepare our tools.
In this chapter, we will get to know LaTeX, as well as how to install and use it. Specifically, our topics will be as follows:
- What is LaTeX?
- Installing and using LaTeX
- Working with LaTeX online using Overleaf
- Accessing documentation
At the end of this chapter, you will have working LaTeX software, and you will know how to edit and typeset a document and how to obtain further documentation.
So, let's get started.
Technical requirements
We will focus on the Windows operating system here, but you can also install LaTeX on Mac OS X, Linux, and other systems.
A complete installation takes about 8 GB of disk space.
If you have an internet connection, you don't have to install LaTeX. You can use online LaTeX software, such as Overleaf. We will look at Overleaf at the end of this chapter.
All code examples of this book are available on GitHub at https://github.com/PacktPublishing/LaTeX-Beginner-s-Guide.
On the book's website, https://latexguide.org, you can read, edit, and compile every code example in this book online without installing anything. An internet browser with JavaScript enabled is all you need for this, and a PC, laptop, tablet, or smartphone.
What is LaTeX?
LaTeX is free, open source software for typesetting documents. In other words, it's a document preparation system. LaTeX is not a word processor, but it's a document markup language.
It was initially written by Leslie Lamport and is based on the TeX typesetting engine by Donald Knuth. People often refer to it as just TeX, meaning LaTeX. It has a long history; you can read about it at https://tug.org/whatis.html.
For now, let's continue by looking at how we can make the most of LaTeX.
Benefits of LaTeX
LaTeX is especially well suited for scientific and technical documents. LaTeX's superior typesetting of mathematical formulas is legendary. Suppose you are a student or a scientist. In that case, LaTeX is by far the best choice, and even if you don't need its scientific capabilities, there are other uses—it produces very high-quality output and is incredibly stable. It handles complex documents easily, no matter how large they are.
Some more remarkable strengths of LaTeX are its cross-referencing capabilities, the ability for automatic numbering, and the generation of lists of contents, figures and tables, indexes, glossaries, and bibliographies. It is multilingual with language-specific features, and it can use PostScript and PDF features.
Apart from being perfect for scientists, LaTeX is incredibly flexible—there are templates for letters, presentations, bills, philosophy books, law texts, music scores, and even chess game notation. Hundreds of LaTeX users have written thousands of templates, styles, and valuable tools for every possible purpose. It is collected and categorized online on archiving servers.
You could benefit from its impressive high quality by starting with its default styles and relying on its intelligent formatting, but you are free to customize and modify everything. People of the TeX community have already written a lot of extensions addressing nearly every formatting need.
Virtues of open source
The code of LaTeX is entirely open source, free, and readable for everyone. This enables you to study and change everything, from the core of LaTeX to the latest extension packages. But what does this mean for you as a beginner? There's a huge LaTeX community with a lot of friendly, helpful people. Even if you cannot benefit from the open source code directly, they can read the source and assist you. Just join a LaTeX web forum and ask your questions there. Helpers will, if necessary, dig into LaTeX sources and, in all probability, find a solution for you, sometimes by recommending a suitable package, often providing a redefinition of a default command.
Today, we're already profiting from about 30 years of development by the LaTeX community. The open source philosophy made it possible, as every user is invited to study and improve the software and develop it further. Chapter 14, Using Online Resources, will point the way to the community.
Separation of form and content
A fundamental principle of LaTeX is that the author should not be distracted too much by formatting issues. Usually, the author focuses on the content and formats logically. For example, instead of writing a chapter title in big, bold letters, you just tell LaTeX that it's a chapter heading. You can let LaTeX design the heading or decide in the document's settings what the headings will look like—just once for the whole document. LaTeX extensively uses style files called classes and packages, making it easy to design and modify the entire document's appearance and all of its details.
Portability
L...