Professional Documents
Culture Documents
Introduction To LaTeX
Introduction To LaTeX
Introduction To LaTeX
The Skeleton
This is the basic skeleton of a LaTeX document. For most cases the documentClass will be
article . The space between the \documentClass{article} and \begin{document} is called the
\documentClass{article}
\begin{document}
Hello World
\end{document}
The Title
The title defined can have several attributes. The common ones are:
These are written above the \begin{document} tag. The title is then injected into the document
using:
\begin{document}
\maketitle
\end{document}
Text Decoration
Bold → \textbf{}
Italic → \textit{}
Underline → \underline{}
Lists
Unordered List
\begin{itemize}
\item Item1
\item Item2
\end{itemize}
LaTeX 1
Ordered List
\begin{enumerate}
\item Item1
\item Item2
\end{enumerate}
Math
Several Math symbols require the amsmath package. So be sure to include it in the prologue of
the document:
\usepackage{amsmath}
Inline
Display Block
Numbered Equations
a^b_c gives:
abc
a^{b_c} gives:
abc
And so on.
LaTeX 2
Dots are very important when writing equations with unknown or even infinite terms.
Fractions also show up in several equations and should be represented properly For example:
n(n − 1)
1+2+⋯+n =
2
The above is achieved using the code:
\[1+2+\dots+n=\frac{n(n-1)}{2}\]
Vertical and Diagonal dots can also be introduced using the \vdots and \ddots tags
respectively.
Greek Letters
Greek letters can be used in LaTex by prefixing them with a \ and enclosing them in the
inline syntax, like \(\...\) (replace the dots with the name of the letter. If the name is in all
lowercase, it will get translated into a lowercase letter, while a capitalized name will get
translated into an uppercase letter. For example:
\(\sigma\)\(\Sigma\)
Gets translated to
σΣ
Mathematical Operators
Math Operators are prefixed with a \ and enclosed in the inline syntax, just like the Greek
Letters. For example, \(\log(x) ), \(\sin(\alpha)) . Or, if they are to be in a line of their own,
they can be enclosed with the display block syntax instead.
\[\log(\alpha+\beta)\]
log(α + β)
LaTeX 3
LaTeX 4
LaTeX 5
LaTeX 6
Sums and Products
Sums and Products are also pretty commonly used. These can be achieved in LaTex as:
\[\sum_{i=0}^{\infty}i\]
∞
∑i
i=0
\[\prod_{i=1}^{n}i\]
n
∏i
i=1
Number Sets
The special letters for number sets can also be used in LaTeX. However firstly, add
\usepackage{amsfonts} to the prologue. Now, any number set can be enclosed in \(\mathbb{.}\)
LaTeX 7
(replace the dot with the letter N, Z, R or C for Natural, Integers, Rational or Complex
Numbers respectively).
C is the set of all complex numbers
Matrices
Here, we have several types of matrices, but we'll look at only Square Bracket and Round
Bracket matrices.
\begin{bmatrix}
1 & 2 & 3 \\
a & b & c
\end{bmatrix}
1 2 3
[ ]
a b c
\begin{pmatrix}
1 & 2 & 3 \\
a & b & c
\end{pmatrix}
1 2 3
( )
a b c
\begin{vmatrix}
1 & 2 \\
2 & 1
\end{vmatrix}
∣1 2∣∣
∣
∣2 1∣∣
∣
Matrices can also be made inline using the inline syntax:
)
a b
T his is an inline 2 × 2 matrix : (
c d
LaTeX 8
A new line can be added to the document by physically leaving a line in between the two
lines that you want to break.
This is line 1.
Spaces show up as they are typed in LaTeX. However, inside the inline math block \(\) and
the display math block \[\] , regular spaces don't register, and they must be explicitly
declared using the \space tag.
LaTeX 9