Show Menu
Cheatography

LaTeX Cheat Sheet (DRAFT) by

A LaTeX cheatsheet/reference guide

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Document Setup

\documentclass{<type>}
sets doc type to
<type>
\documentclass[<param>]{<type>}
\documentclass
but also specified by
<param>
\usepackage{<package>}
allows
<package>
to be used
\title{<document title>}
specifies the document title
\author{<name>}
specifies the author
\thanks{<group>}
goes inside
{}
of
\author

Chapters and sections

\documentclass{book}
sets document type to
book
\part{<partname>}
creates new part called
<part>
\chapter{<chaptername>}
creates new chapter called
<chaptername>
\section{<sectionname>}
creates new section called
<sectionname>
\subsection{<subsectionname>}
creates new subsection called
<subsectionname>
\subsubsection{<subsubsectionname>}
creates new subsub­section called
<subsubsectionname>
\paragraph{<paragraphname>}
creates new paragraph called
<paragraphname>}
\subparagraph{<subparagraphname>}
creates new subpar­agraph called
<subparagraphname>}
\part
and
\chapter
are only available for
report
and
book
document classes

Document Structure

\begin{document}
start of document
\maketitle
typesets the title author and date
\end{document}
end of document

Bold, italics and underl­ining

\textbf{<bolded-text>}
puts
<bolded-text>
in bold
\textit{<italic-text>}
puts
<italic-text>
in italics
\underline{<underlined-text>}
underlines
<underlined-text>
\emph{<emphasized-text>}
emphasizes
<emphasized-text>

Images

\usepackage{graphicx}
allows graphics importing
\graphicspath{{images/}}
sets image directory in
graphicx
to
images/
\includegraphics{<image>}
displays
<image>

Lists

\begin{itemize}
begins an unordered (bullet) list
\end{itemize}
ends unordered list
\begin{enumerate}
begins an ordered (numbered) list
\end{enumerate}
ends an ordered list
\item <en­try>
adds
<entry>
to current list

Paragraphs and new lines

press "­ent­er" twice
new paragraph
\\ 
newline

Tables

 
 

Comments

%
comments out the rest of the line
\usepackage{comment}
allows below comment type to work
\begin{comment}
begins multi-line comment
\end{comment}
ends multi-line comment
\iffalse
starts multi-line comment
\fi
ends multi-line comment
\usepackage{todonotes}
allows todo-note style comments
\todo{<comment>}
makes a todo note of
<comment>
\presetkeys{todonotes}{inline}{}
makes
todonotes
comments inline

Math

$<expression>$
adds
<expression>
as inline math
\[<expression>\]
adds
<expression>
as displa­y-mode math

Abstracts

\begin{abstract}
begins an abstract
\end{abstract}
ends an abstract
abstracts are brief overvi­ews­/su­mmaries of the core topics­/ar­guments of scientific articles.

Table of contents

\tableofcontents
creates table of contents
\addcontentsline{toc}{<type>}{<name>}
manually adds the
<type>
named
<name>
to table of contents