How to use LaTeX on Mac
LaTex
LaTeX is pronounced Lah-tech
or Lay-tech
.
Components to using LaTeX
The major components in using LaTeX:
1. a text editor: To create the TeX source document. TeXshop is quite common on Mac.
2. a TeX Distribution: The distribution on the Mac is called MacTeX. Within Distribution there are numerous engines that can process your source file into a PDF file. Processing a source file with a particular engine is often referred to as compiling the document.
3. a PDF previewer: To view PDF documents. TeXshop can also serves as PDF previewer.
Install MacTex
Visit http://tug.org/mactex/ and click on the MacTex Download link, the on the MacTeX.pkg link to download the installer (if prompted, click Keep). The file is quite large (~4 GB), so be prepared to wait a bit while it downloads. Besides, the MacTeX includes TeXShop, so there is no need to download TeXShop.
Understanding LaTex
Preamble: Every document begins with a
\documentclass
command. The actual text of the document is enclosed with\begin{document} ... \end{document}
. Everything between the\documentclass
command and the\begin{document}
is called the preamble of the document. This is the place where packages are loaded, and extra commands are defined or given values.Packages: In LaTeX, many useful things are implemented as separate packages. Each package is loaded separately in the preamble of the document.
In LaTex, formatting is separated from content.
- For example: Suppose you want your section headings to be in 24 point Helvetica and coloured blue. In Microsoft Word, you may have just manually changed the font and the color of your headings manually. If the next day you decide that all the headings should really be 18 point and orange, you have to change each one manually. Instead, in LaTeX you can just change the definition of the formatting for \section and all sections will change automatically(which is like HTML and CSS).
LaTex Demo
Once you install MacTeX, you can edit your document in TeXShop. Here’s a simple demo:
1 | \documentclass{article} |
Click “Typeset” button at the upper left, then you can see a PDF like this: