1 \documentclass[t]{beamer}
3 \usefonttheme{professionalfonts}
4 \usefonttheme[stillsansseriflarge, stillsansserifsmall]{serif}
6 \usepackage[T3, T1]{fontenc}
7 \usepackage[utf8]{inputenc}
10 \usepackage[palatino, helvetica, courier, maths=cmr]{mdwfonts}
16 \usetikzlibrary{positioning}
17 \usetikzlibrary{shapes.geometric}
20 \errorcontextlines=999
21 \let\listingsize=\relax
23 \title{Whirlwind Tour of \LaTeX}
28 \atdef<#1>{\textit{#1}}
30 \tikzset{every picture/.style={>=stealth, thick}}
35 \frame{\frametitle{Outline}
36 \tableofcontents[sectionstyle=show/show,
37 subsectionstyle=shaded/show/hide]}
38 \AtBeginSection{\frame{\frametitle{Outline}
39 \tableofcontents[sectionstyle=show/shaded,
40 subsectionstyle=show/show/hide]}}
42 \section{What is \LaTeX?}
44 \subsection{Background and history}
46 \begin{frame}{So what even is this \LaTeX\ thing anyway?}
48 \item \LaTeX\ is a `document preparation system' based on Knuth's \TeX\ and
50 \item You describe the document you want in a plain text file (or several),
51 run some programs, and they generate printable output.
56 [file/.style={draw=black, outer sep=1mm,
57 text height=\ht\strutbox, text depth=\dp\strutbox},
58 input/.style={file, rectangle, fill=blue!30},
59 output/.style={file, rectangle, fill=green!30},
60 program/.style={file, ellipse, fill=yellow!30}]
63 {\node[input] (tex0) at (0, 0) {\phantom{\texttt{foo.tex}}};
64 \node[input] (tex1) at ($(tex0) - (2mm, -2mm)$) {\phantom{\texttt{foo.tex}}};
65 \node[input, outer xsep=5mm, outer ysep=5mm]
66 (texn) at ($(tex1) - (2mm, -2mm)$) {\texttt{foo.tex}};}
69 {\node[program, below=7mm of texn] (latex) {\texttt{latex}};
70 \node[output, right=6mm of latex] (dvi) {\texttt{foo.dvi}};
71 \draw[->] (texn) to (latex);
72 \draw[->] (latex) to (dvi);}
74 {\node[program, right=6mm of dvi] (dvips) {\texttt{dvips}};
75 \node[output, right=6mm of dvips] (ps) {\texttt{foo.ps}};
76 \draw[->] (dvi) to (dvips);
77 \draw[->] (dvips) to (ps);}
79 {\node[program, right=6mm of ps] (ps2pdf) {\texttt{ps2pdf}};
80 \node[output, above=10mm of ps2pdf] (pdf) {\texttt{foo.pdf}};
81 \draw[->] (ps) to (ps2pdf);
82 \draw[->] (ps2pdf) to (pdf);}
84 {\node[program] (pdflatex) at ($(texn)!.5!(pdf)$) {\texttt{pdflatex}};
85 \draw[->] (texn) to (pdflatex);
86 \draw[->] (pdflatex) to (pdf);}
90 \begin{frame}{Where does this stuff come from?}
92 \item Donald E.\ Knuth wrote the original versions of \TeX\ and \MF\ back
93 in the late 1970s because he was dissatisfied with the appearance of the
94 second editions of \emph{The Art of Computer Programming}. He stopped
95 evolving \TeX\ in 1982, and \MF\ in 1984.
97 \item These programs implement \emph{languages}:
99 \item the \MF\ language describes bitmap glyphs in terms of lines and
101 \item the \TeX\ language describes page layouts in terms of text, boxes,
105 \item Both languages have a similar structure:
107 \item a base layer of primitive commands; and
108 \item a macro layer to sequence the commands.
113 \begin{frame}{Writing and saying the names}
114 This is unfortunately tricky.
116 \begin{itemize}[<+->]
117 \item The letters in \TeX\ are \emph{Greek}: capital tau, epsilon, chi. So
118 it should be pronounced as \textipa{/tEx/}. \uncover<+->{`\emph{When you
119 say it corretly to your computer, the terminal may become slightly
121 \item While Knuth was working on \TeX, Honeywell's `Text EXecutive'
122 processor appeared, so it was important that they not be confused.
123 \item In print, ideally the `E' should be lowered. In media that don't
124 allow this, it's usual to write the `E' in lowercase, as `\texttt{TeX}'.
125 \item The name `\LaTeX' is short for `Lamport \TeX', after its initial
127 \item Lamport is not proscriptive about pronunciation: \textipa{/"lA:tEk/},
128 \textipa{/"lEItEk/}, \textipa{/"lA:tEx/}, \textipa{/"lEItEx/},
129 \textipa{/"lA:tEks/}, \textipa{/"lEItEks/} are all fine (but the last
130 risks confusion with dispersons of polymer microparticles in water).
131 \item In writing, the `A' of `\LaTeX' is reduced, raised and kerned over
132 the `L'; in media that can't do this, it's usual to write it in
133 lowercase, as `\texttt{LaTeX}'.
137 \begin{frame}{So, err, again, what's this \LaTeX\ thing?}
138 \begin{itemize}[<+->]
139 \item \LaTeX\ is a \emph{macro package} (called a `format') for \TeX. It
140 provides the machinery to describe \emph{documents} in terms of their
141 \emph{content}, \emph{structure}, and \emph{style}.
142 \item \LaTeX\ was originally written by Leslie Lamport. The moderm
143 version, \LaTeXe\ was extensively reworked by `The \LaTeX~3 Project';
144 \LaTeX~3 is still basically vapourware.
145 \item Other \TeX\ formats exist, notably Hans Hagen's Con\TeX{}t.
149 \subsection{Strengths and weaknesses}
151 \begin{frame}{What \TeX\ is good at}
152 \begin{itemize}[<+->]
153 \item Knuth developed an excellent line-breaking algorithm, which examines
154 whole paragraphs at a time to decide how best to split them into lines.
155 General page layout is excellent.
156 \item Typesetting mathematics well was one of Knuth's primary objectives
157 for \TeX. Knuth studied mathematical typsetting practices of the time
158 carefully; \TeX\ has pretty much taken over as the standard, since it's
159 been used for just about all serious mathematical communication for the
161 \item \LaTeX's \emph{float} machinery, for placing tables and figures at
162 the top or bottom of pages `near' to the right place, generally works
163 rather well, though sometimes it needs some gentle kicking.
167 \begin{frame}{What \TeX\ is bad at}
168 \begin{itemize}[<+->]
169 \item The default fonts (Knuth's Computer Modern family) are widely
170 considered to be rather ugly.
171 \item Cross-references and tables of contents are good; but \TeX\ processes
172 the document strictly start-to-finish, and you must run \texttt{latex}
173 multiple times to get the document to converge.
174 \item Multiline text in tables is annoying: you must specify the column
176 \item Complex layout and graphics are possible using extensions (e.g.,
177 \texttt{pstricks}, Ti\textit{k}Z), but this is something of an acquired
179 \item In particular, trying to place graphics in paragraphs, with the text
180 flowing around them, is extremely difficult and doesn't work well.
181 \item Generally trying to do things off the well-trodden path leaves you
182 having to program \TeX\ to do things the hard way. Alas, \TeX's
183 programming facilities are weird and primitive, and this is widely
184 considered not to be very enjoyable.
188 \section{How do I install \LaTeX?}
190 \begin{frame}{\TeX\ distributions}
191 \begin{itemize}[<+->]
192 \item The \TeX\ system is one of the most widely ported serious programs
193 ever. Ports will be available for every system you might want to run it
195 \item There are \emph{lots} of pieces. Fitting them together is no fun at
197 \item A \TeX\ \emph{distribution} comes will all of the necessary pieces
198 set up for you ready to go.
199 \item The `\TeX\ Live' distribution is free and runs on Unix (including
200 Linux), Windows and Mac\,OS. It's Unixy in flavour. This is what I use.
201 \item If you run Linux, your distribution should provide \TeX\ Live
202 packages. On Debian and Ubuntu, \texttt{apt install texlive-full}.
203 \item For Windows, MiK\TeX\ seems to be the popular choice.
204 \item For Mac\,OS, Mac\TeX seems to be the \TeX\ Live distribution of
209 \section{How do I use \LaTeX?}
211 \subsection{Basic syntax}
213 \begin{frame}[fragile]{A minimal document}
214 The following will give you a single sheet of paper with the text `Hello,
215 world!' printed on it.
217 \documentclass{article}
223 Unfortunately, it will want to give you a sheet of \emph{US letter}-sized
226 \documentclass[a4paper]{article}
233 \begin{frame}[fragile]{Magical characters}
234 The \TeX\ language steals quite a lot of characters for its own purposes.
235 There are more-or-less convenient ways of typesetting them literally.
236 \begin{itemize}[<+->]
237 \item The backslash `@|\\|' introduces \emph{control sequences}.
238 \item Braces `@|\{|\dots@|\}|' surround arguments and group things
240 \item The percent sign `@|\\\%|' starts a comment which continues to the
242 \item The dollar sign `@|\$|' switches into or out of mathematical text.
243 \item The ampersand `@|\&|' separates cells in tables.
244 \item The ampersand `@|\#|' indicates where to substitute argument values
245 in macros and alignments.
246 \item The underscore `@|\_|' and caret `@|\^|' indicate mathematical
247 \emph{subscripts} and \emph{superscripts}.
248 \item The tilde `@|\~|' is like a space, but prevents line breaking.
252 \begin{frame}{Whitespace}
253 Whitespace is somewhat significant to \TeX.
254 \begin{itemize}[<+->]
255 \item Spaces separate words and allow line breaking. Multiple spaces mean
256 the same a single space.
257 \item A single newline acts just like a space, so you can break paragraphs
258 in your source text however you like.
259 \item A \emph{blank line} indicates a paragraph break. (\TeX\ actually
260 synthesizes a @|\\par| command internally when it sees a blank line.)
261 \item A comment, and its terminating newline, are \emph{entirely} ignored.
262 \item White space \emph{also} terminates alphabetic control-sequence
263 names. Use `@|\\ |' to force an actual space to the output.
267 \begin{frame}[fragile]{Example document: Basic structure}
268 (Download the PDF from \url{https://odin.gg/u/VlC}.)
269 \begin{block}<+->{Overview}
271 \documentclass[a4paper]{article}
288 \begin{frame}[fragile]{Example document: Paragraphs}
289 \begin{block}<+->{Paragraphs}
291 This is an initial paragraph ...
293 This is a second paragraph, ...
296 \begin{block}<+->{Lists}
299 \item We can typeset lists of things.
310 \begin{frame}[fragile]{Example document: Font changes}
311 \begin{block}<+->{Font changes}
321 \begin{frame}[fragile]{Example document: Cross-references}
322 \begin{block}<+->{Labelling things}
324 \section{...} \label{sec:...}
331 \begin{block}<+->{Referring to things}
333 ... Section~\ref{sec:...} ...
335 ... item~\ref{en:...} ...
340 \begin{frame}[fragile]{Example document: Tables}
341 \begin{block}<+->{Table}
344 \begin{tabular}{...} \hline
345 ... & ... & ... \\ \hline
347 ... & \multicolumn{2}{...}{...} \\
348 ... & ... & ... \\ \hline
352 \begin{block}<+->{Floating environments}
363 \begin{frame}[fragile]{Example document: Mathematics}
364 \begin{block}<+->{Inline maths; display maths}
370 \begin{block}<+->{More symbols}
375 \begin{block}<+->{General stuff}
378 ... \frac{...}{...} ...
381 \begin{block}<+->{Matrices}
383 \left( \begin{array}{...}
384 ... & ... & ... \\ ...
390 \begin{frame}[fragile]{Example document: Miscellaneous niceties}
391 \begin{block}<+->{Character sets}
393 \usepackage[T1]{fontenc}
394 \usepackage[utf8]{inputenc}
397 \begin{block}<+->{Localization}
399 \usepackage[british]{babel}
402 \begin{block}<+->{Hyperlinking}
404 \usepackage{hyperref}
407 \begin{block}<+->{Non-default fonts}
409 \renewcommand{\rmdefault}{ppl}
410 \renewcommand{\sfdefault}{phv}
411 \renewcommand{\ttdefault}{pcr}
417 \section{What useful packages are there?}
419 \begin{frame}{\LaTeX\ packages}
420 \begin{itemize}[<+->]
421 \item Generally, the answer to `How do I do this thing in \LaTeX?' is
422 `Someone wrote a package to do just that.'
423 \item Trying to do things yourself gets you enmired in raw \TeX\
424 programming. If that sounds like fun then go right ahead.
425 \item The \TeX\ Live distribution comes bundled with \emph{over two
426 thousand} packages, pretty much everything in the Comprehensive \TeX\
427 Archive Network (CTAN). You just need to add the right @|\\usepackage|
428 command to your document preamble.
432 \begin{frame}{The most important packages}
433 My highly individual view:
434 \begin{itemize}[<+->]
435 \item The standard package collection includes \texttt{color},
436 \texttt{dcolumn}, \texttt{graphicx}, \texttt{longtable}, and
438 \item \texttt{babel} supports `foreign' -- i.e., not American English --
439 languages, with many of their distinctive typesetting conventions.
440 \item \texttt{hyperref} does automatic hyperlinking in PDF documents.
441 \item \texttt{tikz} does drawings and diagrams.
442 \item \texttt{beamer} makes presentations like this one.
443 \item \texttt{memoir} is an extremely versatile document class, intended
444 mostly for high-quality books.
448 \section{How do I find out more?}
451 Alas, much basic documentation is in conventionally-published books. \\
452 \begin{itemize}[<+->]
453 \item \emph{The \LaTeX{}book} by Leslie Lamport.
454 \item \emph{The \LaTeX\ Companion} by the \LaTeX\ maintainers.
455 \item \emph{The \TeX book} by Don Knuth.
457 \uncover<+->{(All published by Addison Wesley.)} \medskip
459 \uncover<+->{There is \emph{\LaTeXe: An unofficial reference manual}, by
460 Stephen Gilmore, Torsten Martinsen, and Karl Berry, included with \TeX\
464 \begin{frame}{Online}
465 \begin{block}<+->{Learning}
466 \begin{itemize}[<+->]
467 \item<.-> There is much good information at \url{https://texfaq.org/}.
468 \item \url{https://texfaq.org/FAQ-man-latex} links to many introductions
469 to \LaTeX. \emph{I've not read any of them.}
472 \begin{block}<+->{Asking for help}
473 \begin{itemize}[<+->]
474 \item<.-> Traditionally, Usenet \texttt{comp.text.tex}.
475 \item Now, probably \url{https://tex.stackexchange.com/} looks like your