Latex Quick Reference
Latex Quick Reference
http://dataninja.wordpress.com
can use multiple file types eps, pdf, jpg, png same rules for referencing and positioning as table environment Footnote
Normal text\footnote{Contents}.
use for typesetting code use \verb+stuff here+ for inline verbatim environment (any delimiter works) Verse
\begin{verse} First line \\ Second line \\ \end{verse}
Table
\begin{table}[htbp] \begin{center} \begin{tabular}{ccc} 0 & 0 & 0 \\ 0 & 0 & 0 \end{tabular} \caption{default} \end{center} \label{defaulttable} \end{table}
text is what gets printed, name is the reference Use \newtheorem*{} for unnumbered Precede \newtheorem with \theoremstyle{plain, remark, } Requires \usepackage{amsthm}
Math
Inline formula
$x+y$
Display formulas
\[x+y\]
Document structure
\section{Name} \subsection{Name} \subsubsection{Name} \paragraph{Name} \subparagraph{Name}
\section*{Name} suppresses numbering \tableofcontents generates the TOC Font styles bold: \textbf{stuff} italic: \emph{stuff} typewriter: \texttt{stuff} Cite
\cite{cite-key}
\multicolumn{3}{c}{Column Header} \begin{tabular}{|llr|} to put vertical lines on either side and to make the first columns left-aligned and the thirds rightaligned use \hline to make a horizontal line [htbp] specifies position preferences h: here; t:top; b:bottom; p: special page for just float objects in order specified use \ref{defaulttable} to reference the table use p{2in} to create a paragraph columns use \\[3pt] to adjust spacing between rows Longtable
\begin{longtable}{lrr} \caption{text}\\ 1 & 2 \\ \endhead 3 & 4 \\ \label{text} \end{longtable}
Equation environment
\begin{equation} x=y \label{whatever} \end{equation}
aligns equations at = signs \nonumber suppresses number on specified line Key mathematical symbols superscript: x^2; subscript: x_2 fraction: \frac{x}{y} = x/y Greek letters: \alpha, \beta, \gamma, etc. decorations: \hat{x}, \bar{x}, \tilde{x}, \vec{a}. \dot{a}, \stackrel{a}{b} puts a over b \rightarrow, \leftarrow, \Rightarrow (double arrow), \Leftrightarrow \leq less than or equal to, \geq fences: \left(, \right), \left[, etc. Matrix
\left[\begin{array}{ccc} a&b&c\\ d&e&f \end{array}\right]
BibTeX bibliography
\bibliographystyle{plain} \bibliography{database}
database is a .bib file stored externally plain, unsrt, abbrev are default bibliography styles
Use for multipage tables Requires \usepackage{longtable} Automatically centered and positioned Text before \endhead is repeated across pagebreaks Graphics
\begin{figure}[htbp] \begin{center} \includegraphics{Graphic.pdf} \caption{example caption} \label{fig:example} \end{center} \end{figure}
Environments
Lists
\begin{itemize} \item Thing \end{itemize}