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.

LaTex_components

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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
\documentclass{article}

% You can use packages here:
\usepackage[margin=1in]{geometry}

\title{Down By the Salley Gardens}
\author{WILLIAM BUTLER YEATS}
\date{Spring 1889}
\begin{document}

\maketitle

\begin{center}

Down by the salley gardens

my love and I did meet;

She passed the salley gardens

with little snow-white feet.

She bid me take love easy,

as the leaves grow on the tree;

But I, being young and foolish,

with her would not agree.

\end{center}

\end{document}

Typeset_Button

Click “Typeset” button at the upper left, then you can see a PDF like this:

LaTeXDemo001