CSUMS, Wednesday, May. 20

Advanced LaTeX typesetting, a continuation of these two workshops.

Introduction

Occasionally, you will need to go above and beyond the scope of normal paper typesetting. Here are a few of the more advanced typesetting techniques. Note that there is already plenty of documentation that explains these packages much better than I can, which is why I do not really try.

Theorems

In many math papers, it is important to have an easy and good-looking way of presenting Theorems, Results, Conjectures, Lemmas, and so on. LaTeX has a package for doing this, called amsthm. This package requires you to define in the preamble the environments (such as theorem, lemma, etc.) that you will use in your paper. In addition, the proof environment is loaded automatically.

Example.

\newtheorem{thm}{Theorem} In preamble
\begin{thm}[Feit-Thompson]
Every group of odd order is solvable.
\end{thm}

\begin{proof}
255 pages of extremely hard math.
\end{proof}

Note. Another great resource for typesetting theorems is available here.

Exercise 10. Write macros to display an
a. Theorem
b. Lemma
c. Definition
d. Note

When these environments are used, they should look something like this.

Hint. You will need to use the theoremstyle command.

The Xy-pic package

LaTeX is also capable of generating vector graphics. This type of thing is perfect for commutative diagrams, and other things of this nature. Rather than write anything about how to implement this package, I will instead direct you to their superb user's guide, and give a single example.

Example.

\begin{figure}[hbt]
\centering
$\xymatrix{
M \times N \ar[r]^{\otimes} \ar[ddr]^{f}
& M \otimes_{R} N \ar@{-->}[dd]^{\bar{f}} \\ \\
& Z }$
\caption{Universal property of tensor products.}
\end{figure}

Exercise 11. The exercises in the XY-pic user's guide are very good, and the solutions are provided.

The Resume Class

LaTeX is also good for making (in my opinion) great CV's. Much like Beamer, there is a LaTeX class called res that can be used for just this purpose. Unfortunately, there is not a whole lot of official documentation on this class that I have found, but there is a huge number of people who have a tex and pdf copy of their own resume available online, so there is a wealth of examples to learn from.

Exercise 12. Type up your CV in LaTeX. Here is a blank template that I used for my own CV (with a pdf example) but there are many more templates available here. If you need to, you can download the res class here.

Fancy Headers

Another useful package to know is 'fancy header,' or fancyhdr, available here. This package gives more or less complete control over how your headers, margins, page numbers, and so on look. Again, the package user's guide is very extensive, and explains much better than I could.

Example. A good example of how this package is used is given at Art of Problem Solving, which I reproduce here.

\documentclass[12pt]{article}
\usepackage{fancyhdr}

\pdfpagewidth 8.5in
\pdfpageheight 11in

\pagestyle{fancy}
\headheight 35pt

\rhead{Right top}
\chead{Middle top}
\lhead{Left top}
\rfoot{Right bottom}
\cfoot{\thepage}
\lfoot{Left bottom}

\begin{document}
First page

\pagebreak

Second page

\pagebreak

Third page
\end{document}
PDF output

Table of Contents and Appendices

Finally, I would at least like to mention that when writing a long paper, it is very easy in LaTeX to add a table of contents, by simply using the \tableofcontents command. In addition, adding appendices is similarly very simple, using the appendix package. Again, I direct you to their excellent user's guide for help.

Created in 2009 by Taylor Hines. Not for general distribution; some of this content is borrowed from other sources.