logo

johzu

About

LaTeX \LaTeX{} Guide

Document classes

Class Effect
book\texttt{book} Default is two sided
report\texttt{report} No \part divisions
article\texttt{article} No \part or \chapter divisions
letter\texttt{letter} Letter
slides\texttt{slides} Large sans-serif font

Used at the very beginning of a document:
\documentclass{class}. Write \begin{document} to start contents and \end{document} to end the document.

Common documentclass options

Effect Code
Font size 10pt / 11pt / 12pt
Paper size letterpaper / a4paper
Use two columns twocolumn
Set margins for two-sided twoside
Landscape orientation
Must use dvips-t landscape
landscape
Double-space lines draft

Usage: \documentclass[opt,opt]{class}.

Packages

Effect Package
Use 1 inch margins fullpage
Set margins with \marginsize{l}{r}{t}{b} anysize
Use nn columns with \begin{multicols}{n} multicol
Use LaTeX\LaTeX{} symbol font latexsym

Use before \begin{document}. Usage: \usepackage{package}.

If using MathJax for html write \require{package}.

Title

Effect Package
Author of document \author{text}
Title of document \title{text}
Date \date{text}

These commands go before \begin{document}. The declaration \maketitle goes at the top of the document.

Miscellaneous documents classes

Use \pagestyle{empty} for an empty header, footer and no page numbers.


Document Structure

\part{title}
\chapter{title}
\section{title}
\subsection{title}
\subsubsection{title}
\paragraph{title}
\subparagraph{title}

Section commands can be followed with an *, like \section*{title} , to suppress heading numbers. \setcounter{secnumdepth}{x} supresses heading numbers of depth >x> x, where chapter has depth 00.

Text environments

Code Description
\begin{comment} Comment block (not printed)
\begin{quote} Indented quotation block
\begin{quotation} with indented paragraphs
\begin{verse} Quotation block for verse

Lists

Code Description
\begin{enumerate} Numbered list
\begin{itemize} Bulleted list
\begin{description} Description list
\itemtext Add an item
\item[x]text Use xx instead of normal bullet or number
Required for descriptions

Examples for enumerate versions

Code Description
\begin{enumerate}[a] a,b,c,a,b,c, \ldots
\begin{enumerate}[(a)] (a),(b),(c),(a),(b),(c), \ldots
\begin{enumerate}[a)] a),b),c), a),b),c), \ldots
\begin{enumerate}[a.] a.,b.,c., a.,b.,c., \ldots
\begin{enumerate}[i] i,ii,iii, i,ii,iii, \ldots

References

Code Description
\label{marker} Set a marker for cross-reference,
often of the form \label{sec:item}
\ref{marker} Give section/body number of marker
\pageref{marker} Give page number of marker
\footnote{text} Print footnote at bottom of page

Floating bodies

Code Description
\begin{table}[place] Add numbered table
\begin{figure}[place] Add numbered figure
\begin{equation}[place] Add numbered equation
\caption{text} Caption for the body

The place is a list valid placements for the body. t=top, h=here, b=bottom, p=separate page, !=place even if ugly. Captions and label markers should be within the environment.


Text properties

Font face

Code Declaración Effect
\textrm{text} {\rmtext} Serif family\textrm{Serif family}
\textsf{text} {\sftext} Sans serif family\textsf{Sans serif family}
\texttt{text} {\tttext} Typewriter family\texttt{Typewriter family}
\textmd{text} {\mdtext} Medium series\textmd{Medium series}
\textbf{text} {\bftext} Bold series\textbf{Bold series}
\textup{text} {\uptext} Upright shape\textup{Upright shape}
\textit{text} {\ittext} Italic shape\textit{Italic shape}
\textsl{text} {\sltext}
\textsc{text} {\sctext}
\emph{text} {\emtext}
\textnormal{text} {\normalfonttext} Document font\textnormal{Document font}
\underline{text} Underline\underline{Underline}

Font size

Size Example
\tiny tiny{\tiny tiny}
\scriptsize scriptsize{\scriptsize scriptsize}
\footnotesize footnotesize{\footnotesize footnotesize}
\small small{\small small}
\normalsize normalsize{\normalsize normalsize}
\large large{\large large}
\Large Large{\Large Large}
\LARGE LARGE{\LARGE LARGE}
\huge huge{\huge huge}
\Huge Huge{\Huge Huge}

These are declarations and should be used in the form {small...} or without braces to affect the entire document.

Verbatim text

Code Description
\begin{verbatim} Verbatim environment
\begin{verbatim*} Spaces are shown as \(\textvisiblespace\)
\verb!text! Text between the delimiting characters (in this case ! is verbatim)

Justification

Environment Declaración
\begin{center} \centering
\begin{flushleft} \raggedright
\begin{flushright} \raggedleft

Miscellaneous text properties

\linespread{x} changes the line spacing by the multiplier xx.

Use \boxed{a} or \Aboxed{a} to enclose in a box any text or equation.

a

This does not work in Katex but you can use CSS instead:

.katex {
 border: 0.0625em solid currentcolor;
 padding: 0.5em;
}

Text color

To use colors from xcolor package write \usepackage{xcolor}. To define new color names use \definecolor{new name}{RGB}{r,g,b}. Then \textcolor{blue}{a_{n}} renders as an\color{blue}{a_{n}}. If using Katex for html \color{blue}{a_{n}} renders as an\color{blue}{a_{n}}.

Accessing additional named colours

Additional named colours can be accessed via the following xcolor package options:

  • dvipsnames: loads 68 named colours (CMYK)
  • svgnames: loads 151 named colours (RGB)
  • x11names: loads 317 named colours (RGB)

As an example: \usepackage[dvipsnames]{xcolor}.

Import the package hyperref to hyperlink your references. Typically, it should be the last package imported to avoid problems. The link formatting can be done after the package declaration like the following example:

\hypersetup{
  colorlinks=true,
  linkcolor=blue,
  filecolor=magenta,
  urlcolor=cyan,
  pdftitle={Example},
  pdfpagemode=FullScreen,
}
\urlstyle{same}

Code Description
\hypersetup{ ... } Setting these options configures the behavior of links within the document. Each parameter should be separated by commas, following the syntax of parameter=value
colorlinks=true The links will display a color, with red as the default
linkcolor=blue Blue indicates internal links, which are generated by cross-referenced elements
filecolor=magenta Links to local files will be shown in magenta colour
urlcolor=cyan Links to web sites are set to cyan colour
urlstyle{same} By default, links are printed in monospaced fonts. This command alters their appearance to match the rest of the text style
\href{https://johzu.com}{Something Linky} This command accepts two parameters: the URL for the link (http://www.overleaf.com in this instance) and the text to be displayed as the clickable link (in this case, 'Something Linky')
\url{https://johzu.com} This command displays the passed parameter URL as an active link, particularly helpful for document printing purposes
\href{run:./file.txt}{File.txt} The \href{run:./file.txt}{File.txt} command outputs the text 'File.txt' as a clickable link that directs to a local file named 'file.txt' within the present working directory. Observe the 'run:' prefix preceding the file path.
\hyperlink{thesentence}{any sentence} The function generates a clickable element with the text "any sentence," linking to the location identified by "thesentence."
\hypertarget{thesentence}{this sentence} The command takes two parameters enclosed in braces. The initial parameter serves as a distinct identifier for this sentence, while the second parameter, "this sentence," will be printed in its usual format.

Text-mode symbols

Use \ as an escape character:

Symbol Code
&\& \&
%\% \%
$\$ \$
#\# \#
_\_ \_
{}\{ \} \{ \}

Symbols

Symbol Code Name
&\& \& ampersand
\checkmark \checkmark check mark
ˆ\^{} \^{}, \textasciicircum{} circumflex
\dag \dag dagger
obelisk
obelus
$\$ \$ dollar sign
\ddag \ddag double dagger
diesis
\ldots \ldots ellipsis
#\# \# number sign
primorial
%\% \% percent sign
\P \P pilcrow
£\pounds \pounds pound sign
\(\qedsymbol\),
\(\qedhere\),
\( \qed \)
\(\qedsymbol\),
\(\qedhere\),
\(\qed\)
quod erat demonstrandum
§\S \S section sign
˜\~{} \~{}, \textasciitilde{} tilde
_\_ \_ underscore
\mid \|, \mid, \textpipe, \textbar vertical bar (pipe)
\(\textvisiblespace\) \textvisiblespace open box
\clubsuit \clubsuit clubs
\diamondsuit \diamondsuit diamonds
\heartsuit \heartsuit hearts
\spadesuit \spadesuit spades
\flat \flat flat
\natural \natural natural
\sharp \sharp sharp

Accents

Symbol Code Name
oˋ\textnormal{\`o} \‘o grave accent
oˊ\textnormal{\'o} \’o acute accent
oˆ\textnormal{\^{o}} \^{o} circumflex
o˜\textnormal{\~{o}} \~{o} tilde
oˉ\textnormal{\={o}} \={o} macron
o˙\textnormal{\.{o}} \.{o} overdot
o¨\textnormal{\"{o}} \"{o} diaeresis
umlaut
oˇ\textnormal{\v{o}} \v{o} caron
cˇ\textsf{\v{c}}ek
o˝\textnormal{\H{o}} \H{o} double acute accent
hungarumlaut
c¸\textnormal{\c{c}}
o¸\textnormal{\c{o}}
\c{c}
\c{o}
cedilla
\(\textnormal{\d{o}}\) \d{o} underdot
\(\textnormal{\b{o}}\) \b{o} bar under the letter
o˘\textnormal{\u{o}} \u{o} breve
o˚\textnormal{\r{o}} \r{o} overring
\(\textnormal{\t{oo}}\) \t{oo} tie
tie bar
top ligature
Œ\textnormal{\OE} \OE uppercase ethel
œ\textnormal{\oe} \oe lowercase ethel
Æ\textnormal{\AE} \AE uppercase ash
æ\textnormal{\ae} \ae lowercase ash
A˚\textnormal{\AA} \AA uppercase a with overring
a˚\textnormal{\aa} \aa lowercase a with overring
Ø\textnormal{\O} \O uppercase o with slash
ø\textnormal{\o} \o lowercase o with slash
\(\textnormal{\k}\) \k ogonek
\(\textnormal{\L}\) \L uppercase l with bar
\(\textnormal{\l}\) \l lowercase l with bar
ı\textnormal{\i} \i, \imath dotless i (untittled)
ȷ\textnormal{\j} \j, \jmath dotless j (untittled)
ß\textnormal{\ss} \ss eszett
a\sout{a} \sout{a} strikethrough

Dashes

Name Source Example Usage
hyphen - X -\textnormal{-} ray In words
en-dash - 1 -\textnormal{-} 5 Between numbers
em-dash Yes \textnormal{—} or no? Punctuation

Line and page breaks

Code Description
\\ Begin new line without new paragraph
\\* Prohibit pagebreak after linebreak
\kill Don’t print current line
\pagebreak Start new page
\noindent Do not indent current line

Spaces

Code Description
\quad space equal to the current font size (= 18 mu)
\, 3/18 of \quad (= 3 mu)
\: 4/18 of \quad (= 4 mu)
\; 5/18 of \quad (= 5 mu)
\! -3/18 of \quad (= -3 mu)
"\ " equivalent of space in normal text
\qquad twice of \quad (= 36 mu)

Miscellaneous text-mode symbols

Code Description
\today February 17, 2023
\sim Prints \sim instead of \~{}, which makes  ˜\textnormal{\~{ }}.
˜ Space, disallow linebreak (W.J. ˜Clinton)\texttt{(W.J.\~{ }Clinton)}.
\@. Indicate that the .\texttt{.} ends a sentence when following an uppercase letter.
\hspace{l} Horizontal space of length ll (Ex: l = 20pt\texttt{20pt}).
\vspace{l} Vertical space of length ll.
\vspace{w}{h} Line of width ww and height hh.

Tabular environments

Tabbing environment

\= Set tab stop.
\> Go to tab stop.
Tab stops can be set on “invisible” lines with \kill at the end of the line. Normally \\ is used to separate lines.

Tabular environment

\begin{array}[pos]{cols}
\begin{tabular}[pos]{cols}
\begin{tabular*}{width}[pos]{cols}

Tabular column specification

Code Description
l left-justified column.
c centered column.
r right-justified column.
p{width} paragraph column with text vertically aligned at the top
m{width} paragraph column with text vertically aligned in the middle (requires array package)
b{width} paragraph column with text vertically aligned at the bottom (requires array package)
@{decl} Insert decldecl instead of inter-column space.
| Inserts a vertical line between columns
|| Inserts a double vertical line between columns

Tabular elements

\hline Horizontal line between rows.
\cline {x-y Horizontal line across columns xx through yy.
\multicolumn{n}{cols}{text} A cell that spans nn columns, with cols column specification.


Math mode

Inline math Displayed math
\(...\) \[...\]
$...$ $$...$$
\begin{equation}
...
\end{equation}
\begin{equation*}
...
\end{equation*}

Mathematical font face

Code Package Effect
\mathrm{text} Serif family \mathrm{Serif\ family}
\mathit{text} Italic shape \mathit{Italic\ shape}
\mathbf{text} Boldface series \mathbf{Boldface\ series}
\mathsf{text} Sans serif family \mathsf{Sans\ serif\ family}
\mathtt{text} Typewriter family \mathtt{Typewriter\ family}
\bm{text} Mathematical boldface \bm{Mathematical\ boldface}
\boldmath{text} amssymb Mathematical boldface \bm{Mathematical\ boldface}
\mathnormal{text} Mathematical normal \mathnormal{Mathematical\ normal}
\mathcal{text} Calligraphic \mathcal{Calligraphic}
\Bbb{TEXT} amsfonts/amssymb OPEN \Bbb{OPEN}
\mathbb{TEXT} amsfonts, amssymb OPEN \mathbb{OPEN}
\frak{text} Fraktur \frak{Fraktur}
\mathfrak{text} eufrak, amsfonts, amssymb Fraktur \mathfrak{Fraktur}
\mathscr{text} mathrsfs RSFS FONT \mathscr{RSFS\ FONT}
\mathds{text} dsfont

Sensible size examples

Inline Displayed Code Name
xy\frac{x}{y} xy\frac{x}{y} \frac{x}{y} fraction
\int \int \int integral
\iint \iint \iint surface integral
\iiint \iiint \iiint volume integral
\oint \oint \oint contour integral
\oiint \oiint \oiint closed surface integral
k=1n\prod_{k=1}^{n} k=1n\prod_{k=1}^{n} \prod_{k=1}^{n} product
xn\sqrt[n]{x} xn\sqrt[n]{x} \sqrt[n]{x} radical symbol
sxs_{x} sxs_{x} s_{x} subscript
k=1n\sum_{k=1}^{n} k=1n\sum_{k=1}^{n} \sum_{k=1}^{n} summation
sxs^{x} sxs^{x} s^{x} superscript

Letters

Greek alphabet

Name Code Uppercase Variant Lowercase Variant
alpha \Alpha, \alpha A\Alpha α\alpha
beta \Beta, \beta B\Beta β\beta
gamma \Gamma, \varGamma, \gamma Γ\Gamma Γ\varGamma γ\gamma
delta \Delta, \varDelta, \delta Δ\Delta Δ\varDelta δ\delta
epsilon \Epsilon, \epsilon, \varepsilon E\Epsilon ϵ\epsilon ε\varepsilon
zeta \Zeta, \zeta Z\Zeta ζ\zeta
eta \Eta, \eta H\Eta η\eta
theta \Theta, \varTheta, \theta, \vartheta Θ\Theta Θ\varTheta θ\theta ϑ\vartheta
iota \Iota, \iota I\Iota ι\iota
kappa \Kappa, \kappa, \varkappa K\Kappa κ\kappa ϰ\varkappa
lambda \Lambda, \varLambda, \lambda Λ\Lambda Λ\varLambda λ\lambda
mu \Mu, \mu M\Mu μ\mu
nu \Nu, \nu N\Nu ν\nu
xi \Xi, \varXi, \xi Ξ\Xi Ξ\varXi ξ\xi
omicron \Omicron, \omicron O\Omicron ο\omicron
pi \Pi, \pi, \varPi, \varpi Π\Pi Π\varPi π\pi ϖ\varpi
rho \Rho, \rho, \varrho P\Rho ρ\rho ϱ\varrho
sigma \Sigma, \varSigma, \sigma, \varsigma Σ\Sigma Σ\varSigma σ\sigma ς\varsigma
tau \Tau, \tau T\Tau τ\tau
upsilon \Upsilon, \varUpsilon, \upsilon Υ\Upsilon Υ\varUpsilon υ\upsilon
phi \Phi, \varPhi, \phi, \varphi Φ\Phi Φ\varPhi ϕ\phi φ\varphi
chi \Chi, \chi X\Chi χ\chi
psi \Psi, \varPsi, \psi Ψ\Psi Ψ\varPsi ψ\psi
omega \Omega, \varOmega, \omega Ω\Omega Ω\varOmega ω\omega

Archaic Greek

Name Code Uppercase Lowercase Variant
digamma \digamma ϝ\digamma

Hebrew letters

Name Code Symbol
aleph \aleph \aleph
beth \beth \beth
gimel \gimel \gimel
daleth \daleth \daleth

Other letters

Symbol Code Name
\backepsilon \backepsilon backepsilon
k\Bbbk \Bbbk blackboard-bold lowercase k
®\circledR \circledR registered trademark symbol
\circledS \circledS
©\copyright \copyright copyright symbol/sign
\ell \ell cursive l
ð\eth \eth eth
\Game \Game
\hbar \hbar h-bar
reduced Plancks’s constant
\hslash \hslash
\Im \Im imaginary part
ı\imath \imath
δ\delta, dˉd\hspace*{-0.08em}\bar{}\hspace*{0.1em} \delta,
d\hspace*{-0.08em}\bar{}\hspace*{0.1em}
inexact diferential
\infty \infty infinity
ȷ\jmath \jmath
\mho \mho
\nabla \nabla nabla,
del
\partial \partial partial derivative
\Re \Re real part
\wp \wp power set,
Weierstrass elliptic functions

Degree ^{\circ} Ex: 22^{\circ}\mathrm{C}: 22C22^{\circ}\mathrm{C}.

Other symbols

Agrupations

Symbol Code Name
i=ab\bigcap_{i=a}^{b} \bigcap_{i=a}^{b} set intersection
i=ab\bigcup_{i=a}^{b} \bigcup_{i=a}^{b} set union
i=ab\biguplus_{i=a}^{b} \biguplus_{i=a}^{b} disjoint/discriminated union
i=ab\bigwedge_{i=a}^{b} \bigwedge_{i=a}^{b}
i=ab\bigvee_{i=a}^{b} \bigvee_{i=a}^{b}
i=ab\bigsqcup_{i=a}^{b} \bigsqcup_{i=a}^{b} disjoint/discriminated union
i=ab\prod_{i=a}^{b} \prod_{i=a}^{b} product
i=ab\coprod_{i=a}^{b} \coprod_{i=a}^{b} coproduct
i=ab\sum_{i=a}^{b} \sum_{i=a}^{b} summation
i=ab\bigodot_{i=a}^{b} \bigodot_{i=a}^{b} Hadamard product
i=ab\bigoplus_{i=a}^{b} \bigoplus_{i=a}^{b} direct sum
i=ab\bigotimes_{i=a}^{b} \bigotimes_{i=a}^{b} Kronecker product

Bars

Symbol Code Name Symbol Code Name
\smallsetminus \smallsetminus set diference
\setminus \setminus set diference // /
\\backslash \backslash ̸\not \not
\diagdown \diagdown \diagup \diagup

Symbol Code Name
\mid \mid divides
\nmid \nmid non-divisibility
\vert \vert
\Vert \Vert
\lVert \lVert
\rVert \rVert
\parallel \parallel is parallel with
\nparallel \nparallel is not parallel with
\| \\|

Symbol Code Name
\shortmid \shortmid
\nshortmid \nshortmid
\shortparallel \shortparallel
\nshortparallel \nshortparallel

Operations

Symbol Code Name
\surd \surd root
\dotplus \dotplus
±\pm \pm plus-minus sign
\mp \mp minus-plus sign
\prime \prime prime symbol
\backprime \backprime
\ast \ast asterisk,
Khatri-Rao product
×\times \times cross/vector product
\ltimes \ltimes semidirect product of normal factor to the left
\rtimes \rtimes semidirect product of normal factor to the right
\leftthreetimes \leftthreetimes semidirect product to the left
\rightthreetimes \rightthreetimes semidirect product to the right
\star \star
\bigstar \bigstar
\circ \circ circle, Hadamard product of matrices
\sout{\circ} \sout{\circ} plimsoll, thermodynamic quantity in the standard state
\bullet \bullet
\cdot \cdot scalar/dot product
\centerdot \centerdot
÷\div \div division
\divideontimes \divideontimes
\oplus \oplus direct sum, exclusive disjunction, astronomical Earth, symbol
\ominus \ominus symmetric difference
\circledast \circledast
\circledcirc \circledcirc
\odot \odot Hadamard product of power series, astronomical Earth symbol, vector out of the page
\otimes \otimes Kronecker product, tensor product, dyadic product,vector into the page
\circleddash \circleddash
\oslash \oslash Hadamard division
\bigcirc \bigcirc
\Box \Box
\boxplus \boxplus
\boxminus \boxminus
\boxdot \boxdot
\boxtimes \boxtimes
\frown \frown cap product
\smile \smile cup product
\smallfrown \smallfrown cap product
\smallsmile \smallsmile cup product
⨿\amalg \amalg disjoint union
\Join \Join
\lhd \lhd
\rhd \rhd
\unlhd \unlhd
\unrhd \unrhd
\wr \wr wreath product
\intercal \intercal Transposed matrix

Geometry

Symbol Code Name
\vartriangleleft \vartriangleleft
\blacktriangleleft \blacktriangleleft
\vartriangleright \vartriangleright
\blacktriangleright \blacktriangleright
\vartriangle \vartriangle
\blacktriangle \blacktriangle
\triangledown \triangledown
\blacktriangledown \blacktriangledown
\square \square it is necessary that, it is probable that, it is obligatory that, it is believed that, D’Alembert operator
\blacksquare \blacksquare end of proof
\lozenge \lozenge it is possible that, it is not necessary that, it is not probable that
\blacklozenge \blacklozenge
\triangle \triangle triangle
\bowtie \bowtie
\bigtriangleup \bigtriangleup
\bigtriangledown \bigtriangledown
\Diamond \Diamond it is possible that, it is not necessary that, it is not probable that
\diamond \diamond
\triangleleft \triangleleft
\triangleright \triangleright
\ntriangleleft \ntriangleleft
\ntriangleright \ntriangleright
\ntrianglelefteq \ntrianglelefteq
\ntrianglerighteq \ntrianglerighteq
\angle \angle angle symbol
\measuredangle \measuredangle
\sphericalangle \sphericalangle
\vdash \vdash turnstile, proves
\dashv \dashv
\vDash \vDash double turnstile, models
\Vdash \Vdash
\Vvdash \Vvdash
\nvdash \nvdash does not prove
\nvDash \nvDash not true
\nVdash \nVdash
\nVDash \nVDash
\perp \perp is perpendicular with
⊥̸\not\perp \not\perp is not perpendicular with
\parallel \parallel is parallel with
\nparallel \nparallel is not parallel with
\asymp \asymp is asymptotic to
\models \models models

Logic

Symbol Code Name
\exists \exists existential quantification
!\exists! \exists! uniqueness quantification
\nexists \nexists there is no
\Finv \Finv
\forall \forall universal quantification
\land \land logical conjunction
\wedge \wedge logical conjunction
\lor \lor logical (inclusive) disjunction
\vee \vee logical (inclusive) disjunction
\barwedge \barwedge sheffer stroke, NOT AND, NAND
\doublebarwedge \doublebarwedge conjunction with double bar
\veebar \veebar logical (exclusive) disjunction
¬\neg, ¬\lnot \neg, \lnot negation
\top \top tautology
\bot \bot contradiction
\because \because because
\therefore \therefore therefore

Relations

Symbol Code Name
== = is equal to
:=:= := defines to
\triangleq \triangleq defines to
=def\overset{\mathrm{def}}{=} \overset{\mathrm{def}}{=} defines to
=\overset{\frown}{=} \overset{\frown}{=} corresponds to
\bumpeq \bumpeq
\Bumpeq \Bumpeq
\eqcirc \eqcirc
=˙\dot= \dot= approaches the limit
\doteq \doteq approaches the limit
\circeq \circeq
\cong \cong is congruent to, is isomorphic to
\doteqdot \doteqdot
\risingdotseq \risingdotseq approximately equal to or the image of
\fallingdotseq \fallingdotseq image of or approximately equal to
\equiv \equiv is equivalent to
\neq, \ne \neq, \ne is not equal to

Proportion

Symbol Code Name
\propto \propto is proportional to
\varpropto \varpropto is proportional to

Similarity or approximation

Symbol Code Name
\approx \approx is approximately
\thickapprox \thickapprox is approximately
\approxeq \approxeq
\cong \cong is congruent/isomorphic to
\simeq \simeq is similar or equal to, asymptotically equal to
\eqsim \eqsim
\sim \sim is similar to
\thicksim \thicksim is similar to
\backsim \backsim
\backsimeq \backsimeq
\nsim \nsim is not similar to
\ncong \ncong is not congruent/isomorphic to

Comparison

Symbol Code Name
\lessdot \lessdot
\gtrdot \gtrdot
<< < is less than
>> > is greater than
\leq, \le \leq, \le is less than or equal to
\geq, \ge \geq, \ge is greater than or equal to
\leqq \leqq
\geqq \geqq
\leqslant \leqslant is less than or equal to
\geqslant \geqslant is greater than or equal to
\eqslantless \eqslantless
\eqslantgtr \eqslantgtr
\lesssim \lesssim
\gtrsim \gtrsim
\lessapprox \lessapprox less-than or approximate
\gtrapprox \gtrapprox greater-than or approximate
\lessgtr \lessgtr
\gtrless \gtrless
\lesseqgtr \lesseqgtr
\gtreqless \gtreqless
\lesseqqgtr \lesseqqgtr
\gtreqqless \gtreqqless
\ll \ll much less than
\gg \gg much greater than
\lll, \llless \lll, \llless
\ggg, \gggtr \ggg, \gggtr
\nless, \not< \nless, \not< is not less than
\ngtr, \not> \ngtr, \not> is not greater than
\lnsim \lnsim
\gnsim \gnsim
\lnapprox \lnapprox
\gnapprox \gnapprox
\lneq \lneq
\gneq gneq
\lneqq \lneqq
\gneqq \gneqq
\lvertneqq \lvertneqq
\gvertneqq \gvertneqq
\nleq \nleq is not less than or equal to
\ngeq \ngeq is not greater than or equal to
\nleqq \nleqq
\ngeqq ngeqq
\nleqslant \nleqslant is neither less than nor equal to
\ngeqslant \ngeqslant is neither greater than nor equal to

Order

Symbol Code Name
\curlywedge \curlywedge
\curlyvee \curlyvee
\prec \prec precedes
\succ \succ succeeds
\preceq \preceq precedes or equals
\succeq \succeq succeeds or equals
\precsim \precsim
\succsim \succsim
\precapprox \precapprox
\succapprox \succapprox
\curlyeqprec \curlyeqprec
\curlyeqsucc \curlyeqsucc
\preccurlyeq \preccurlyeq
\succcurlyeq \succcurlyeq
\nprec \nprec does not precede
\nsucc \nsucc does not succeed
\npreceq \npreceq neither precedes nor equals
\nsucceq \nsucceq neither succedes nor equals
\precnsim \precnsim
\succnsim \succnsim
\precnapprox \precnapprox
\succnapprox \succnapprox
\precneqq \precneqq
\succneqq \succneqq

Sets

Symbol Code Name
\empty \empty empty set
\emptyset \emptyset empty set
\varnothing \varnothing empty set
\uplus \uplus multiset addition
disjoint union
\cap \cap set intersection
\cup \cup set union
\in \in is member of
\ni, \owns \ni, \owns has member
owns
\notin \notin is not member of
\pitchfork \pitchfork transversal intersection
\subset \subset is a proper subset of
\supset \supset is a proper superset of
\subseteq \subseteq is a subset of
\supseteq \supseteq is a superset of
\subseteqq \subseteqq
\supseteqq \supseteqq
⊄\not\subset \not\subset is not a proper subset of
⊅\not\supset \not\supset is not a proper superset of
\nsubseteq \nsubseteq is not a subset of
\nsupseteq \nsupseteq is not a superset of
\nsubseteqq \nsubseteqq
\nsupseteqq \nsupseteqq
\subsetneq \subsetneq
\supsetneq \supsetneq
\varsubsetneq \varsubsetneq
\varsupsetneq \varsupsetneq
\subsetneqq \subsetneqq
\supsetneqq \supsetneqq
\varsubsetneqq \varsubsetneqq
\varsupsetneqq \varsupsetneqq
\sqcap \sqcap
\sqcup \sqcup disjoint/discriminated union
\sqsubset \sqsubset
\sqsupset \sqsupset
\sqsubseteq \sqsubseteq
\sqsupseteq \sqsupseteq
\doublecap, \Cap \doublecap, \Cap double intersection
\doublecup, \Cup \doublecup, \Cup double union
\Subset \Subset
\Supset \Supset
\between \between
\complement \complement complement

Most relations can be negated by prefixing them with \not.

Symbol Code Name
≢\not\equiv \not\equiv is not equivalent
\notin \notin is not member of
\ne \ne is not equal

Arrows

Symbol Code Name
\leftarrow, \gets \leftarrow, \gets
\longleftarrow \longleftarrow
\rightarrow, \to \rightarrow, \to material implication, yield(s), produce(s), net forward reaction
\longrightarrow \longrightarrow
\nleftarrow \nleftarrow
\nrightarrow \nrightarrow
\uparrow \uparrow substance in a gaseous state
\downarrow \downarrow substance in a solid state
\leftrightarrow \leftrightarrow material equivalence, resonance, mesomerism
\longleftrightarrow \longleftrightarrow
\updownarrow \updownarrow
\nleftrightarrow \nleftrightarrow
\leftleftarrows \leftleftarrows
\rightrightarrows \rightrightarrows uniform convergence
\upuparrows \upuparrows
\downdownarrows \downdownarrows
\leftrightarrows \leftrightarrows
\rightleftarrows \rightleftarrows reaction in both directions
\twoheadleftarrow \twoheadleftarrow
\twoheadrightarrow \twoheadrightarrow
\dashleftarrow \dashleftarrow
\dashrightarrow \dashrightarrow
\leftarrowtail \leftarrowtail
\rightarrowtail \rightarrowtail
\leftrightsquigarrow \leftrightsquigarrow
\rightsquigarrow, \leadsto \rightsquigarrow
\leadsto
\mapsto \mapsto maplet
\longmapsto \longmapsto maplet
\nearrow \nearrow
\searrow \searrow
\nwarrow \nwarrow
\swarrow \swarrow
\circlearrowleft \circlearrowleft
\circlearrowright \circlearrowright
\curvearrowleft \curvearrowleft
\curvearrowright \curvearrowright
\looparrowleft \looparrowleft
\looparrowright \looparrowright
\hookleftarrow \hookleftarrow
\hookrightarrow \hookrightarrow
\Lsh \Lsh
\Rsh \Rsh
\Leftarrow \Leftarrow
\Longleftarrow \Longleftarrow
\Rightarrow \Rightarrow material implication
\Longrightarrow
    \implies
\Longrightarrow
\implies
\Uparrow \Uparrow
\Downarrow \Downarrow
\Leftrightarrow \Leftrightarrow material equivalence
\Longleftrightarrow \Longleftrightarrow
\nLeftarrow \nLeftarrow
\nRightarrow \nRightarrow
\Updownarrow \Updownarrow
\nLeftrightarrow \nLeftrightarrow
\Lleftarrow \Lleftarrow
\Rrightarrow \Rrightarrow
\leftharpoonup \leftharpoonup
\leftharpoondown \leftharpoondown
\rightharpoonup \rightharpoonup
\rightharpoondown \rightharpoondown
\upharpoonleft \upharpoonleft
\upharpoonright, \restriction \upharpoonright
\restriction
\downharpoonleft \downharpoonleft
\downharpoonright \downharpoonright
\leftrightharpoons \leftrightharpoons
\rightleftharpoons \rightleftharpoons equilibrium arrows, equilibrium
\multimap \multimap

The \buildrel macro puts one symbol over another. The format is \buildrel⟨superscript⟩\over⟨relation⟩.

\buildrel\alpha\beta\over\longrightarrow \(\buildrel\alpha\beta\over\longrightarrow\)

f(x) \; {\buildrel\rm def\over=} \; x + 1
\(f(x) \; {\buildrel\rm def\over=} \; x + 1\)

Delimiters

Symbol Code Name
[\lbrack, [[ \lbrack, [ left square bracket
left bracket
]\rbrack, ]] \rbrack, ] right square bracket
right bracket
{\lbrace, {\{ \lbrace, \{ left curly bracket
left brace
}\rbrace, }\} \rbrace, \} right curly bracket
right brace
\langle \langle left angle bracket
left chevron
\rangle \rangle right angle bracket
right chevron
\vert,  \ \vert, \| boxed text
\Vert, \| \Vert, \\|
\lceil \lceil left ceiling
\rceil \rceil right ceiling
\lfloor \lfloor left floor
\rfloor \rfloor right floor
\ulcorner \ulcorner top left corner, Gödel number (left)
\urcorner \urcorner top right corner, Gödel number (right)
\llcorner \llcorner bottom left corner
\lrcorner \lrcorner bottom right corner
[ ⁣[[\![ [\![ mathematical left
white square bracket
] ⁣]]\!] ]\!] mathematical right
white square bracket
( ⁣((\!( (\!( left double
parenthesis
) ⁣))\!) )\!) right double
parenthesis

Left and right delimiters will be enlarged if they are prefixed with \left or \right. Each \left must have a matching \right, one of which may be an empty delimiter \left. or \right.. For example \int_{a}^{b} x^{2} dx = \left. \frac{1}{3} x^{3} \right\vert_{a}^{b} = \left\lbrack \frac{1}{3}b^{3}\right\rbrack - \left\lbrack \frac{1}{3}a^{3}\right\rbrack produces:

abx2dx=13x3ab=[13b3][13a3] \int_{a}^{b} x^{2} dx = \left. \frac{1}{3} x^{3} \right\vert_{a}^{b} = \left\lbrack \frac{1}{3}b^{3}\right\rbrack - \left\lbrack \frac{1}{3}a^{3}\right\rbrack

To specify a particular size, use the following:

  • \bigl(, \bigr), ()\bigl( \bigr)
  • \Bigl(, \Bigr),()\Bigl( \Bigr)
  • \biggl(, \biggr),()\biggl( \biggr)

You can also write \bigm for a large delimiter in the middle of a formula, or just \big for one that acts as an ordinary symbol. For example:

\biggl\lbrace\Bigl[\bigl( a\bigm\vert^{c}_{b} \bigr)\Bigr]\biggr\rbrace {[(abc)]} \biggl\lbrace\Bigl[\bigl( a\bigm\vert^{c}_{b} \bigr)\Bigr]\biggr\rbrace

Accents

Code Symbol Name
\acute aˊ\acute{a} acute
\bar aˉ\bar{a} bar
\breve a˘\breve{a} breve
\check aˇ\check{a} check
\dot a˙\dot{a} dot
\ddot a¨\ddot{a} double dot
\grave aˋ\grave{a} grave
\hat a^\hat{a} hat, circumflex
\mathring{x} x˚\mathring{x} ring
\tilde a~\tilde{a} tilde
\vec a\vec{a} vector
\overset{*}{X} X\overset{*}{X}
\underset{*}{X} X\underset{*}{X}
\sideset{}{'}\sum \sum^{\prime}
\sideset{_1^2}{_3^4}\sum 12 ⁣34_1^2\!\sum_3^4
\widehat abc^\widehat{abc} expanding hat
\widetilde abc~\widetilde{abc} expanding tilde
\overline{abc} abc\overline{abc} overline
\underline{abc} abc\underline{abc} underline
\overbrace{abc} abc\overbrace{abc} overbrace
\underbrace{abc} abc\underbrace{abc} underbrace
\overleftarrow{abc} abc\overleftarrow{abc}
\overrightarrow{abc} abc\overrightarrow{abc}
\overleftrightarrow{abc} abc\overleftrightarrow{abc}
\underleftarrow{abc} abc\underleftarrow{abc}
\underrightarrow{abc} abc\underrightarrow{abc}
\underleftrightarrow{abc} abc\underleftrightarrow{abc}
\xleftarrow[under]{over} underover\xleftarrow[under]{over}
\xrightarrow[under]{over} underover\xrightarrow[under]{over}

The \skew⟨number⟩ command shifts accents for proper positioning,the larger the ⟨number⟩, the more right the shift. Compare

\hat{\hat{A}} gives A^^\hat{\hat{A}}, skew6\hat{\hat{A}} gives \(\skew6\hat{\hat{A}}\).

Elementary Math Control Sequences

Example Code Name
x+y\overline{x + y} \overline{x + y} overline a formula
x+y\underline{x + y} \underline{x + y} underline a formula
x+y\sqrt{x + y} \sqrt{x + y} square root
x+yn\sqrt[n]{x + y} \root [n]\of{x + y},
\sqrt[n]{x + y}
higher degree roots
n+13{n + 1\over 3} {n + 1\over 3} fraction
n+13{n + 1\atop 3} {n + 1\atop 3} no line fraction
(n+13){n + 1\choose 3} {n + 1\choose 3} binomial coefficient
{n+13}{n + 1\brace 3} {n + 1\brace 3} braced fraction
[n+13]{n + 1\brack 3} {n + 1\brack 3} bracketed fraction

The following code specify a style for typesetting formulas.
\displaystyle, \textstyle, \scriptstyle, \scriptscriptstyle

Non-Italic Function Names

Example Code Name
arccos\arccos \arccos arccosine
arcsin\arcsin \arcsin arcsine
arctan\arctan \arctan arctangent
arg\arg \arg argument of complex number
cos\cos \cos cosine
cosh\cosh \cosh hyperbolic cosine
cot\cot \cot cotangent
coth\coth \coth hyperbolic cotangent
csc\csc \csc cosecant
deg\deg \deg degree
det\det \det determinant
dim\dim \dim dimension
exp\exp \exp exponential function
gcd\gcd \gcd greatest common divisor
hom\hom \hom hom-class
inf\inf \inf infimum of a set
ker\ker \ker kernel
lg\lg \lg common logarithm (log10\log_{10}, log2\log_{2})
lim\lim \lim limit (sequence, function)
lim\varinjlim \varinjlim
lim\varprojlim \varprojlim
lim\varliminf \varliminf
lim\varliminf \varliminf
lim\varlimsup \varlimsup
lim inf\liminf \liminf limit inferior
lim sup\limsup \limsup limit superior
ln\ln \ln natural logarithm (loge) \left(\log_{e}\right)
log\log \log logarithm (log10)\left(\log_{10}\right), (loge)\left(\log_{e}\right)
max\max \max maximum of a set
min\min \min minimum of a set
Pr\Pr \Pr projection (linear algebra)
sec\sec \sec secant
sgn\operatorname{sgn} \operatorname{sgn} sign/signum function
sin\sin \sin sine
sinh\sinh \sinh hyperbolic sine
sup\sup \sup supremum of a set
tan\tan \tan tangent
tanh\tanh \tanh hyperbolic tangent
zzz01\operatorname{zzz}_{0}^{1} \operatorname{zzz}\_{0}^{1} generic operator

mod with parentheses a \pmod{m}: a(modm)a \pmod{m}

mod without parentheses a \bmod m: amodma \bmod m


The following examples use \mathop to create function names.

Example Code Plain TeX\TeX{} Definition
\def\lim{\mathop{\rm lim}} \lim_{x\to2} limx2\lim_{x\to2}
\def\log{\mathop{\rm log}\nolimits} \log_2 log2\log_{2}

Fills, Leaders and Ellipses

Text or Math mode: \dots \dots

Math mode:

Example Code
\centerdot \centerdot
\dotsb \dotsb
\dotsc \dotsc
 ⁣\dotsi \dotsi
\dotsm \dotsm
\dotso \dotso
\ldots \ldots
\cdots \cdots
\vdots \vdots
\ddots \ddots

The following fill space with the indicated item.
\hrulefill, \rightarrowfill, \leftarrowfill, \dotfill

The general format for constructing leaders is:
\leaders⟨boxorrule⟩\hskip⟨glue⟩ repeat box or rule.
\leaders⟨boxorrule⟩\hfill fill space with box or rule.

Useful environments

Name Code Example
cases f(n) = \begin{cases}
  n/2 & n \text{ is even} \\
  3n + 1 & n \text{ is odd}
\end{cases}
f(n)={n/2n is even3n+1n is odd f(n) = \begin{cases} n/2 & n \text{ is even} \\ 3n+1 & n \text{ is odd} \end{cases}
split \begin{equation}
  \begin{split}
    e^{x} & = \sum^{\infty}_{n = 0}\frac{x^{n}}{n!} \\
    &= 1 + x + \frac{x^{2}}{2!} + \frac{x^{3}}{3!} + ...
  \end{split}
\end{equation}
ex=n=0xnn!=1+x+x22!+x33!+... \begin{equation}\begin{split} e^{x} & = \sum^{\infty}_{n = 0} \frac{x^{n}}{n!} \\ &= 1 + x + \frac{x^{2}}{2!} + \frac{x^{3}}{3!} + ... \end{split}\end{equation}
gather \begin{gather}
  a_1=b_1+c_1\\
  a_2=b_2+c_2-d_2+e_2
\end{gather}
a1=b1+c1a2=b2+c2d2+e2 \begin{gather} a_1=b_1+c_1\\ a_2=b_2+c_2-d_2+e_2 \end{gather}
align \begin{align}
  a_1& =b_1+c_1\\
  a_2& =b_2+c_2-d_2+e_2
\end{align}
a1=b1+c1a2=b2+c2d2+e2\begin{align} a_1& =b_1+c_1\\ a_2& =b_2+c_2-d_2+e_2 \end{align}
matrix (parentheses) \begin{pmatrix}
  a_{1} & a_{2} \\
  a_{3} & a_{4}
\end{pmatrix}
(a1a2a3a4)\begin{pmatrix} a_{1} & a_{2} \\ a_{3} & a_{4} \end{pmatrix}
matrix (brackets) \begin{bmatrix}
  a_{1} & a_{2} \\
  a_{3} & a_{4}
\end{bmatrix}
[a1a2a3a4]\begin{bmatrix} a_{1} & a_{2} \\ a_{3} & a_{4} \end{bmatrix}
matrix (vertical line) \begin{vmatrix}
  a_{1} & a_{2} \\
  a_{3} & a_{4}
\end{vmatrix}
a1a2a3a4\begin{vmatrix} a_{1} & a_{2} \\ a_{3} & a_{4} \end{vmatrix}

Arrays can be used to create matrices, columns with several equations or calculate the least common multiple.

\left(
  \begin{array}{rrr|r}
   -1 & 2 & 3 & 3 \\
   4 & -5 & 6 & 2 \\
   7 & 8 & -9 & 1
  \end{array}
\right)

(123345627891)\left( \begin{array}{rrr|r} -1 & 2 & 3 & 3 \\ 4 & -5 & 6 & 2 \\ 7 & 8 & -9 & 1 \end{array} \right)


\left(
  \begin{array}{rclc}
   -1 & 2 & 3 & 3 \\
   4 & -5 & 6 & 2 \\
   7 & 8 & -9 & 1
  \end{array}
\right)

(123345627891)\left( \begin{array}{rclc} -1 & 2 & 3 & 3 \\ 4 & -5 & 6 & 2 \\ 7 & 8 & -9 & 1 \end{array} \right)


\left\lbrace
  \begin{array}{rr}
   -x+2y-3z & = 3 \\
   4x+5y+6z & = 2 \\
   7x+8y+9z & = 1
  \end{array}
\right.

{x+2y3z=34x+5y+6z=27x+8y+9z=1\left\lbrace \begin{array}{rr} -x+2y-3z & = 3 \\ 4x+5y+6z & = 2 \\ 7x+8y+9z & = 1 \end{array} \right.


\begin{array}{rllr}
  5x &=& 10 & 8y &=& 24 \\
  x &=& 2 & y &=& 3
\end{array}

5x=108y=24x=2y=3\begin{array}{rllr} 5x &=& 10 & 8y &=& 24 \\ x &=& 2 & y &=& 3\end{array}


\begin{array}{r|lr|l}
  56 & 2 & 104 & 2 \\
  28 & 2 & 52 & 2 \\
  14 & 2 & 26 & 2 \\
  7 & 7 & 13 & 13 \\
  1 & & 1
\end{array}

562104228252214226277131311\begin{array}{r|lr|l} 56 & 2 & 104 & 2 \\ 28 & 2 & 52 & 2 \\ 14 & 2 & 26 & 2 \\ 7 & 7 & 13 & 13 \\ 1 & & 1 \end{array}


\begin{array}{|r|r|}
  \hline 1 & 2 \\
  \hline 3 & 4 \\
  \hline
\end{array}

1234\begin{array}{|r|r|} \hline 1 & 2 \\ \hline 3 & 4 \\ \hline \end{array}



Bibliography and citations

When using BIBTeX\mathrm{B\scriptstyle IB}\TeX{}, you need to run LaTeX\LaTeX{}, BIBTeX\mathrm{B\scriptstyle IB}\TeX{}, and LaTeX\LaTeX{} twice more to resolve dependencies.

Citation Types

Entry Description
\cite{key} Full author list and year. (Watson and Crick 1953)
\citeA{key} Full author list. (Watson and Crick)
\citeN{key} Full author list and year. Watson and Crick (1953)
\shortcite{key} Abbreviated author list and year.
\shortciteA{key} Abbreviated author list.
\shortciteN{key} Abbreviated author list and year.
\citeyear{key} Cite year only. (1953)

All the above have an NP\texttt{NP} variant without parentheses; Example: \citeNP.

Bibtex entry types

Entry Description
@article Journal or magazine article
@book Book with publisher
@booklet Book without publisher
@conference Article in conference proceedings
@inbook A part of a book and/or range of pages
@incollection A part of book with its own title
@manual Technical documentation
@mastersthesis Master’s thesis
@misc If nothing else fits
@phdthesis PhD. thesis
@proceedings Proceedings of a conference
@techreport Tech report, usually numbered in series
@unpublished Unpublished

Bibtex fields

Entry Description
address Address of publisher, not necessary for major publishers
author Names of authors
booktitle Title of book when part of it is cited
chapter Chapter or section number
edition Edition of a book
editor Names of editors
institution Sponsoring institution of tech report
journal Journal name
key Used for cross reference when no author
month Month published. Use 3-letter abbreviation
note Any additional information
number Number of journal or magazine
organization Organization that sponsors a conference
pages Page range (2,6,9-12)
publisher Publisher’s name
school Name of school (for thesis)
series Name of series of books
title Title of work
type Type of tech report, example: "Research Note"
volume Volume of a journal or book
year Year of publication

Not all fields need to be filled.

Common BibTeX style files

Entry Description
abbrv Standard
alpha Standard
plain Standard
abstract alpha\texttt{alpha} with abstract
apa APA
unsrt Unsorted

The LaTeX\LaTeX{} document should have the following two lines just before \end{document}, where bibfile.bib\texttt{bibfile.bib} is the name of the BIBTeX\mathrm{B\scriptstyle IB}\TeX{} file.

\bibliographystyle{plain}
\bibliography{bibfile}

BibTeX example

The BIBTeX\mathrm{B\scriptstyle IB}\TeX{} database goes in a file called file.bib\texttt{file.bib}, which is processed with bibtex file\texttt{bibtex file}.

@String{N = {Nature}}
@Article{WC:1953,
  author = {James Watson and Francis Crick},
  title = {A structure for Deoxyribose Nucleic Acid},
  journal = N,
  volume = {171},
  pages = {737},
  year = 1953
}