J. Gardner                                             LaTeX Quick Reference                         http://dataninja.word...
Upcoming SlideShare
Loading in...5

Latex cheat sheet


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Latex cheat sheet

  1. 1. J. Gardner LaTeX Quick Reference http://dataninja.wordpress.com Verbatim can use multiple file types – eps, pdf, jpg, Basic Commands begin{verbatim} png ... same rules for referencing and positioningNotes end{verbatim} = line break as table environment use for typesetting codebigskip, medskip, smallskip to increase use verb+stuff here+ for inline verbatim Footnote size of line break environment (any delimiter works) Normal textfootnote{Contents}.hangindent=.5in before a paragraph forces thanks{text} can be used to insert a hanging indent Verse attribution footnote with * at beginning% = comment begin{verse}run LaTeX twice if any references, First line Theorem Second line newthoerem{name}[counter]{text} citations or tables of contents are used. [section] end{verse}Preamble lines have hanging indents begin{name}{text}usepackage[margin=1in]{geometry} for ... tree-saving margins Quote end{name} begin{quote} “text” is what gets printed, “name” is theusepackage{setspace} doublespacing for ... double-spaced documents reference end{quote} Use newtheorem*{…} for unnumberedDocument template Table Precede newtheorem withdocumentclass{article} begin{table}[htbp] theoremstyle{plain, remark, …}usepackage[options]{packagename begin{center} Requires usepackage{amsthm}} begin{tabular}{ccc}author{Name} 0 & 0 & 0 Mathtitle{Title} 0 & 0 & 0date{Date} end{tabular} Inline formulabegin{document} caption{default} $x+y$maketitle end{center}... Display formulas label{defaulttable} [x+y]end{document} end{table}Document structure multicolumn{3}{c}{Column Header} Equation environmentsection{Name} begin{tabular}{|llr|} to put vertical lines begin{equation}subsection{Name} on either side and to make the first x=y label{whatever}subsubsection{Name} columns left-aligned and the thirds right-paragraph{Name} end{equation} alignedsubparagraph{Name} use hline to make a horizontal line Equation array environmentsection*{Name} suppresses numbering [htbp] specifies position preferences – h: begin{eqnarray}tableofcontents generates the TOC here; t:top; b:bottom; p: special page for a&=&b+c just float objects – in order specified d&=&e+fFont styles label{whatever}bold: textbf{stuff} use ref{defaulttable} to reference the table use p{2in} to create a paragraph columns end{eqnarray}italic: emph{stuff} aligns equations at = signstypewriter: texttt{stuff} use [3pt] to adjust spacing between rows nonumber suppresses number on specifiedCite Longtable linecite{cite-key} begin{longtable}{lrr} caption{text} Key mathematical symbolsworks with BibTeX and thebibliography superscript: x^2; subscript: x_2 1 & 2 Quick bibliography endhead fraction: frac{x}{y} = x/ybegin{thebibliography}{99} 3 & 4 Greek letters: alpha, beta, gamma, etc.bibitem{cite-key} Citation. label{text} decorations: hat{x}, bar{x}, tilde{x},end{thebibliography} end{longtable} vec{a}. dot{a}, stackrel{a}{b} puts a Use for multipage tables over bBibTeX bibliography Requires usepackage{longtable}bibliographystyle{plain} rightarrow, leftarrow, Rightarrowbibliography{database} Automatically centered and positioned (double arrow), Leftrightarrowdatabase is a .bib file stored externally Text before endhead is repeated across leq less than or equal to, geqplain, unsrt, abbrev are default pagebreaks fences: left(, right), left[, etc. bibliography styles Graphics Matrix begin{figure}[htbp] left[begin{array}{ccc} Environments begin{center} a&b&c includegraphics{Graphic.pdf} d&e&fLists caption{example caption}begin{itemize} end{array}right] label{fig:example}item Thing end{center}end{itemize} end{figure}produces a bulleted list requires graphicx packageuse begin{enumerate} for a numbered list