1.1.1 Your LaTeX
Are you sitting in front of your computer, your LaTeX implementation up and running? If you use a UNIX computer, you surely are. If you are in front of a PC (with the Windows operating system) or a Mac, point your Internet browser at tug.org . Choose to download MikTeX for a PC and MacTeX for a Mac. Follow the easy instructions (and be patient, these are big downloads) and you are done.
Even better, find a friend who can help.
On a PC, work\test refers to the subfolder test of the folder work . On a UNIX computer and on a Mac, work/test designates this subfolder. To avoid having to write every subfolder twice, we use work/test , with apologies to our PC readers.
1.1.2 Sample files
We work with a few sample documents. Download them from CTAN.org , search for Practical LaTeX , or go to the Springer page for this book, and click on the link:
http://extras.springer.com/2014/978-3-319-06424-6+
I suggest you create a folder, samples , on your computer to store the downloaded sample files, and another folder called work , where you will keep your working files. Copy the documents from the samples to the work folder as needed. In this book, the samples and work folders refer to the folders you have created.
One of the sample files is sample.sty . Make sure it is in the work folder when you typeset a sample document.
1.1.3 Editing cycle
Watch a friend type a document in LaTeX and learn the basic steps.
A text editor is used to create a LaTeX source file . A source file might look like this:
\documentclass{amsart}
\begin{document}
Then $\delta$ is a congruence relation. I can type formulas!
\end{document}
Note that the source file is different from a typical word processor file. All characters are displayed in the same font and size.
Your friend typesets the source file ( tells the application to produce a typeset version ) and views the result on the monitor :
Then is a congruence relation. I can type formulas!
The editing cycle continues. Your friend goes back and forth between the source file and the typeset version, making changes and observing the results of these changes.
The file is viewed/printed. View the typeset version as a pdf file, print it if necessary, to create a paper version.
If LaTeX finds a mistake when typesetting the source file, it records this in the log file . The log window (some call it console ) displays a shorter version.
Various LaTeX implementations have different names for the source file, the text editor, the typeset file, the typeset window, the log file, and the log window. Become familiar with these names, so you can follow along with our discussions.
1.1.4 Typing the source file
A source file is made up of text , formulas , and instructions ( commands ) to LaTeX.
For instance, consider the following variant of the first sentence of this paragraph:
A source file is made up of text, formulas (e.g.,
$\sqrt{5}$), and \emph{instructions to} \LaTeX.
This typesets as
A source file is made up of text, formulas (e.g.,
), and instructions to LaTeX.
In this sentence, the first part
A source file is made up of text, formulas (e.g. ,
is text. Then
$\sqrt{5}$
is a formula
), and
is text again. Finally,
\emph{instructions to} \LaTeX.
are instructions. The instruction \emph is a command with an argument , while the instruction \LaTeX is a command without an argument. Commands, as a rule, start with a backslash ( \ ) and tell LaTeX to do something special. In this case, the command \emph emphasizes its argument (the text between the braces). Another kind of instruction to LaTeX is called an environment. For instance, the commands
\begin{center} \end{center}
enclose a center environment; the contents (the text typed between these two commands) are centered when typeset.
In practice, text, formulas, and instructions (commands) are mixed. For example,
My first integral: $\int \zeta^{2}(x) \, dx$.
is a mixture of all three; it typesets as
My first integral: 2 ( x ) dx .
Creating a document in LaTeX requires that we type in the source file. So we start with the keyboard, proceed to type a short note, and learn some simple rules for typing text in LaTeX.