Você está na página 1de 1

J.

Gardner Basic Commands


Notes \\ = line break \bigskip, \medskip, \smallskip to increase size of line break \hangindent=.5in before a paragraph forces a hanging indent % = comment run LaTeX twice if any references, citations or tables of contents are used. Preamble \usepackage[margin=1in]{geometry} for tree-saving margins \usepackage{setspace} \doublespacing for double-spaced documents Document template
\documentclass{article} \usepackage[options]{packagename } \author{Name} \title{Title} \date{Date} \begin{document} \maketitle ... \end{document}

LaTeX Quick Reference


Verbatim
\begin{verbatim} ... \end{verbatim}

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}

\thanks{text} can be used to insert attribution footnote with * at beginning Theorem


\newthoerem{name}[counter]{text} [section] \begin{name}{text} ... \end{name}

lines have hanging indents Quote


\begin{quote} ... \end{quote}

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}

Equation array environment


\begin{eqnarray} a&=&b+c\\ d&=&e+f \label{whatever} \end{eqnarray}

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]

works with BibTeX and \thebibliography Quick bibliography


\begin{thebibliography}{99} \bibitem{cite-key} Citation. \end{thebibliography}

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}

produces a bulleted list use \begin{enumerate} for a numbered list

requires graphicx package

Você também pode gostar