BEFORE WE START: Get a ShareLaTeX or Overleaf account.
Overview: The TeX typesetting system originated with Don Knuth in 1970s, prompted by his work on "The Art of Computer Programming." It first ran on a PDP-10 in 1978. TeX uses a versioning system w/ increasing digits of π; lastest is 3.14159265. It was extended to LaTeX by Leslie Lamport (@ SRI International) in 1980s, and is now a full document preparation system. The latest version is LaTeX 2e. LaTeX is widely used in CS, Math, Engineering, and other scientific fields.
Introduce concepts:
- Compiled typesetting (composing documents like C/Java programs)
- Document description language (markup, like HTML)
- Philosophy of separate content and form/presentation (like CSS)
Note: LaTeX is pronounced "lah-tech" or "lay-tech", NOT "lay-techs"!
- First thing:
\documentclass{article|IEEEtran|proc|report|book|beamer}
- For smaller margins:
\usepackage[margin=1in]{geometry}
- For UTF-8 support:
\usepackage[utf8]{inputenc}
- For smaller margins:
- Document info:
\title
,\author
,\date
,\maketitle
- Page numbers:
\pagenumbering{roman}
,\thispagestyle{empty|plain}
,\pagestyle{empty|plain}
- Organization:
\section
,\subsection
,\subsubsection
- Others:
\tableofcontents
,\label
,\ref
- Use asterisk to toggle numbering
- Others:
- Comments w/
%
- Lists:
\begin{enumerate|itemize}
,\item
- Common font/color formatting
\textbf
,\textit
,\texttt
,\underline
, quotes,--
,---
\usepackage{xcolor}
,\textcolor{color}{text}
\begin{tiny|small|large|huge}
\begin{verbatim}
,\verb!
- International formatting: UTF-8 or
\’
,\”
,\~
, etc.
- Footnotes:
\footnote
- Images:
\includegraphics{file.png}
- Requires
\usepackage{graphicx}
- Options:
[scale=0.5]
,[width=1in]
,\begin{center}
- Requires
- Floating figures:
\figure
- Options:
\caption
,\label
(needs to go at the end) - Works for verbatims or graphics, too
- Options:
- Tables:
\tabular
,\hline
,[l|c|r]
,\multicolumn{n}{cols}{text}
- Math mode:
\begin{equation}
,$
,$$
- Sub/superscript, common operators (
\cdot
,\leq
,\approx
,\times
,\pm
) - Greek letters (e.g.,
\omega
,\Omega
) - Common functions:
\log
,\sin
,\cos
,\tan
,\min
,\max
- More complex operators:
\frac{}{}
,\sqrt[]{}
,\sum
,\prod
,\int
- Delimiters:
\left([{<
,\lfloor
,\lceil
- Logic symbols:
\in
,\subset
,\forall
,\exists
,\rightarrow
- Spacing:
\;
\:
\,
\!
- Fun:
\flat
,\sharp
,\clubsuit
,\heartsuit
,\pitchfork
- AMS (American Mathematical Society) packages
\usepackage{amsmath, amssym}
\begin{align*}
,\noindent
- Theorems, lemmas, etc.
- Declaration:
\def\name{texthere}
- Examples:
\def\topK{\textsf{\textbf{topK}}}
\def\red#1{\textcolor{red}{#1}}
Fun fact: LaTeX is Turing-complete!
- Special BibTeX file format (
.bib
) - Download references from ACM Digital Library and/or IEEE Xplore
\bibliographystyle{plain}
,\bibliography{fname}
\cite
- Custom
.sty
files and ShareLaTeX/Overleaf templates - Multiple files:
\include
- Importance of unique labels & bibliography management
- Build frameworks (e.g., Makefiles) -- need to rebuild multiple times!
- Careful with underscores and other symbols
- E.g.:
$
and#
must be escaped
- E.g.:
- Spacing:
\hspace
,\vspace
,\newpage
- Units:
in
,cm
,pt
- Units:
- Table positioning:
[t|h|b|p]
- Finding typos and syntax errors
- Q&A and experimentation
- StackExchange
- Windows - use MiKTeX
- Mac OS X - use MacTeX
- Linux Mint -
sudo apt install texlive-latex-base
- IDEs: LyX, TeXnicCenter, TeXShop
- Plugins: AUCTeX (Emacs), TeXlipse (Eclipse), Vim-LaTeX (Vim)
- ShareLaTeX tutorial
- TEXbook
- Quick-reference cards:
- Lilypond - LaTeX-like language for musical notation
- LaTeX math jokes
- Coffee stains and the Simpsons
- Beamer slides
- Algorithm and inference packages