0% found this document useful (0 votes)
2 views8 pages

New Latex Introduction

LATEX is a document preparation system designed for typesetting documents, particularly those with complex formatting like mathematical equations. It requires specific commands to structure documents, including defining the document class, creating sections, and inserting mathematical typesetting. The document also outlines various LATEX commands for formatting, including page styles, title pages, and mathematical symbols.

Uploaded by

Ningombam Jimson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

New Latex Introduction

LATEX is a document preparation system designed for typesetting documents, particularly those with complex formatting like mathematical equations. It requires specific commands to structure documents, including defining the document class, creating sections, and inserting mathematical typesetting. The document also outlines various LATEX commands for formatting, including page styles, title pages, and mathematical symbols.

Uploaded by

Ningombam Jimson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

MMSE101A:LATEX UNACCO COLLEGE

LATEX
LATEXis a software for typesetting documents. In other words, it’s a document preparation system.
LATEXis not a word processor, but is used as a document markup language. The history of LATEX be-
gins with a program called TEX 1 . In 1978, a computer scientist by the name of Donald Knuth grew
frustrated with the mistakes that his publishers made in typesetting his work. He decided to cre-
ate a typesetting program that everyone could easily use to typeset documents, particularly those
that include formulae, and made it freely available. The result is TEX. LATEXemerged in the early
1980s as a user-friendly extension of Donald Knuth’s complex TeX typesetting system. Created by
Leslie Lamport, LATEXaimed to simplify the process of creating professional-quality documents, es-
pecially those demanding intricate formatting like mathematical equations or scientific notations.
Its ability to handle complex layouts and produce high-quality output has made it a popular choice
among academics, scientists, and engineers. As an open-source project, LaTeX continues to evolve
with new features and improvements, solidifying its position as a leading tool for document cre-
ation.

LATEX Document
Every LaTeX document needs the following parts:

\documentclass{article}:LATEX documents start with a "document class". This tells LATEX what
kind of document we are making (like an article, report, or book). It decides how the doc-
ument looks. LaTeX documents usually use a 10-point font. The default font size for each
class is 10 point. You can use 11 point or 12 point fonts by including this information in
the \documentclass command as \documentclass[11pt]{article}. No need to write 10-
point, as that’s the normal size.
In general, required information is included in LaTeX commands in braces {} while optional
information is included in square brackets []. The \documentclass command must appear
at the very beginning of a LATEX document, before any other LaTeX commands, or we will get
an error message.
If we have commands for LATEX that will affect the whole document, we should include them in
the preamble, which is what the space between the \documentclass and \begin{document}
commands is called.

\begin{document}....\end{document}: The body of the document, where we include all of


our text, must occur between the \begin{document} and \end{document} commands.

Document Structure
1. Page Numbering and Headings: The \pagestyle command sets how page numbers and
headings look. It is placed before the main content of your document, typically between the
\documentclass{article} and \begin{document} commands. It controls page number
and heading placement. It can take the following form.

• The default style is \pagestyle{plain}. This puts the page number in the middle of
the bottom of the page and doesn’t have any headings.
• \pagestyle{empty} provides neither page numbers nor headings.
1
TeX is a tool for precise text formatting, especially for complex math and science.

Page 1
MMSE101A:LATEX UNACCO COLLEGE

• \pagestyle{headings} will provide page numbers and headings from any \section's
that we are using.

2. Creating a Title Page: The title, author, and date of our document are information that var-
ious LATEX commands can make use of, if we provide it.It is a good habit to get into to provide
this information in the preamble 2 . The commands are:

• \title{yourtitlehere}
• \author{yournamehere}
• \date{currentdate}

Given that we have provided this information in the preamble, If we want a title heading, add
a \maketitle command right after the \begin{document} command.

3. Sections: LaTeX is a language used to create well-organized documents. To structure your


document, it’s important to divide it into sections based on different concepts or themes.
You can create sections using two commands:

• \section{sectiontitle}: This command creates a numbered section with a title in


a larger font.
• \section*{sectiontitle}: This command creates a similar section without number-
ing.

Both commands help in organizing the content and can be used to generate a Table of Con-
tents if needed.

4. Cross-References: If we want to create cross-references in a document with numbered sec-


tions, we can label a specific point using the \label{name} command. This label acts like a
bookmark. Later in the document, we can refer to this labeled section using Section \ref{name}.
The \ref{name} will automatically be replaced by the section number where the label is
placed.
To make these references work correctly, we’ll need to run LATEX twice. The first run records
the label locations, and the second run updates the document with the correct section num-
bers for your references.

5. Table of Contents: In a large document, it’s helpful for our reader to have a Table of Contents.
If we’ve used \section commands to organize our document, LATEX already has the necessary
information to create one. To include a Table of Contents, just add the \tableofcontents
command right after the \begin{document} command. LATEX will automatically generate a
Table of Contents for us, listing all the sections in our document.

6. Abstracts: To create an abstract in our document, place the abstract text between the
\begin{abstract} and \end{abstract} commands. The abstract should appear right af-
ter the \maketitle command (which generates the title of our document) and before any
\tableofcontents command (which generates the Table of Contents). This placement en-
sures that the abstract is properly formatted and positioned at the beginning of our docu-
ment.
2
the preamble refers to any commands between the documentclass command and the begin{document} com-
mand of our document.

Page 2
MMSE101A:LATEX UNACCO COLLEGE

Mathematical Typesetting
In LaTeX, we can insert mathematical formulas into our document in two ways:

• Inline with Text: This method places the formula within a paragraph of text. When we do
this, the formula is compressed to fit within the line of text. For example, limits for integrals
and summations will appear beside the symbol rather than above or below it.

• Displayed Separately: This method places the formula in its own paragraph, separate from
the surrounding text. When done this way, the formula is given more vertical space, allowing
for proper placement of elements like limits above and below symbols.

Using the appropriate method depends on how we want the formula to be presented in your doc-
ument.
For formulas that appear in a paragraph, surround them with $’s. For example,
$\alpha$ is the first letter of Greek alphabet.
becomes
α is the first letter of Greek alphabet.
To make math look bigger and have its own space, put it between two double dollar signs ($$). For
example:$$ x^{2} + y^{2} = r^{2} $$ becomes

x2 + y 2 = r 2

To provide automatic numbering to an equation, the equation is to be written inside an equa-


tion environment i.e. \begin{equation} and \end{equation}. For example the code

\begin{equation}
y=mx+c
\end{equation}

produce a numbered equation


y = mx + c (1)
To write multiple numbered equations together, use the \eqnarray environment. This envi-
ronment surrounds each equation with a pair of \begin{eqnarray} and \end{eqnarray} com-
mands. For example:

\begin{eqnarray}
E = mc^2 \\
F = ma \\
v = d/t
\end{eqnarray}
This will create three numbered equations, each on its own line.

E = mc2 (2)
F = ma (3)
v = d/t (4)

To align the equal signs in a set of equations, use the & symbol before and after the equal sign
within the eqnarray environment.
For example:

Page 3
MMSE101A:LATEX UNACCO COLLEGE

\begin{eqnarray}
E &=& mc^2 \\
F &=& ma \\
v &=& d/t
\end{eqnarray}
produce

E = mc2 (5)
F = ma (6)
v = d/t (7)

In case numbering is not desired, the respective commands are to be replaced by \begin{equation*}
and \end{equation*}. For example, the code

\begin{equation*}
y = mx + c
\end{equation*}
will result in
y = mx + c
similarly, the code

\begin{eqnarray*}
y &=& mx + c \\
ax^2 + bx + c &=& 0 \\
x &=& \dfrac{-b\pm \sqrt{b^2-4ac}}{2a}
\end{eqnarray*}
produces

y = mx + c
axˆ2 + bx + c = 0 √
−b ± bˆ2 − 4ac
x =
2a

Page 4
MMSE101A:LATEX UNACCO COLLEGE

Mathematical Symbol
Some of the common mathematical symbols are shown in the table below:

Table 1: List of familiar mathematical symbols, which are to be enclosed in math-mode i.e. $ $.

Symbol Command Symbol Command

≤, ≥ \leq, \geq ≪, ≫ \ll, \qq

̸=, ≡ \neq, \equiv ∼, ≈ \sim, \approx

≃, ∼
= \simeq, \cong ∥, ∦ \parallel, \nparallel

⊥, ⊢ \perp, \vdash ±, ∓ \pm, \mp

×, ÷ \times, \div ∗, ⋆ \ast, \star

†, ‡ \dagger, \ddagger ·, ⊙ \cdot, \odot

⊕, ⊖ \oplus, \ominus ∈, ∈
/ \in, \notin

→, ← \rightarrow, \leftarrow 7→, ↔ \mapsto, \leftrightarrow

=⇒ , ⇐⇒ \implies, \iff ↑, ↓ \uparrow, \downarrow

∧, ∨ \land, \lor ⇑, ⇓ \Uparrow, \Downarrow

Tex-mode Equivalence
Some of the symbols can be written without math-mode. Table below shows the text-mode equiv-
alence of some symbols.

Symbol Math-mode Text-mode

| $|$ \textbar

< $<$ \textless

> $>$ \textgreater

– $-$ \textendash

— $-$ \textemdash

† $\dagger$ \dag

‡ $\ddagger$ \ddag

â $\hat{a}$ \^a

ã $\tilde{a}$ \~a

ȧ $\dot{a}$ \.a

Page 5
MMSE101A:LATEX UNACCO COLLEGE

ä $\ddot{a}$ \"a

ā $\bar{a}$ \=a

a2 $a^2$ a\textsuperscript 2

a2 $a_2$ a\textsubscript 2

a12 $a^{12}$ a\textsuperscript {12}

a12 $a_{12}$ a\textsubscript {12}

Greek Letters
Some of the Greek letters ans their respective commands are shown in the table below:

Symbol Command Symbol Command Symbol Command

α \alpha β \beta γ \gamma

Γ \Gamma π \pi Π \Pi

ϕ \phi φ \varphi Φ \Phi

ϵ $\epsilon$ ε $\varepsilon$ σ $\sigma$

ς $\varsigma$ Σ $\Sigma$ ϱ \varrho

δ \delta ∆ $\Delta$ θ \theta

ϑ \vartheta Θ \Theta µ \mu

ν \nu ξ \xi Ξ \Xi

η \eta ζ \zeta ι \iota

χ \chi τ \tau ℏ \hbar

κ \kappa ∂ \partial λ \lambda

Λ \Lambda ψ \psi Ψ \Psi

ω \omega Ω \Omega ∇ \nabla

∞ \infty ℜ \Re ℑ \Im

Page 6
MMSE101A:LATEX UNACCO COLLEGE

Power and Indices


To write power, the code $$x^n$$ produces

xn

. Similarly, the code $$a_n$$ produces


an
. If power or index is more than one number, curly brackets are used as, $x^{10}$ and $a_{11}$
produces x10 and a11 , respectively. If both subscript are associated with a letter, then it can be writ-
ten both ways as; $x_n^2$ or x^2_n produce x2n . As an example, the code $n_1 + n^2 = k_{n+1} + k_n^2 -
produces n1 + n2 = kn+1 + kn2 − k n−1 . Similarly, the code f (x) = x5 + 4x2 |x=0 + 2|x=12 generate

f (x) = x5 + 4x2 |x=10 + 2|x=12

Fractions and Binomial


The common \frac{}{} and \binom{}{} are used for fraction and binomial, respectively. The
code $$ \frac{a}{b} produces
a
b
.
For example, the following code $$\frac{n!}{k!(n-k)!} = \binom{n}{k}$$ generates
 
n! n
=
k!(n − k)! k

If the same command is used as in-line with text as k!(n−k)!


n!
= nk , it seems as collapsed. To


resolve this, another command \dfrac{}{} is used as the command $\dfrac{n!}{k!(n-k)!}$


n!
will generate . It is to be noted for \frac{}{} no extra package is required while for
k!(n − k)!
\dfrac{}{} the package \usepackage{amsmath} must be used.

Roots

Square root symbols are inserted using the command \sqrt{} as $\sqrt{x}$ produces x.For
the specfication of magnitude, the command is used with optional square brackets as $$\sqrt[y]{x}$$
produces √y
x
.

Sum and Integral


The command \sum and \int are used for sum and integral, respectively. The code $$\sum_{n=1}^3 x^n$$
produces
X 3
xn
n=1

However, if the same command is written in-line $\sum_{n=1}^3 x^n$ it will look like xn .
P3
n=1

Page 7
MMSE101A:LATEX UNACCO COLLEGE

The in-line look can be changed by using the command $\displaystyle\sum_{n=1}^3 x^n$
X3
which produce xn . Similarly, the product can be written as $$\prod_{n=1}^{3}x^n$$ which
n=1
produce
3
Y
xn
n=1

However, if the same is written in-line $\prod_{n=1}^{3}x^n$ it will look like 3n=1 xn then the
Q
in-line look can be changed by using the command $\displaystyle\prod_{n=1}^{3}x^n$ pro-
Y 3
duces xn
n=1
In case of integration, the command $$\int f(x)$$ produces
Z
f (x)

For definite integral, the code $$\int_a^b f(x)$$ produce


Z b
f (x)
a

To write the limits above the integral, the code is to be changed as $$\int\limits_a^b f(x)$$
produce
Zb
f (x)
a

For a close loop integral, the code $$\oint f(x)$$ produces


I
f (x)

For double and triple integrals, the codes $$\iint f(x)$$ and $$\iiint f(x)$$ produces
ZZ
f (x)
ZZZ
f (x)

Some complex integral are$$\int \limits_0^R \int \limits_0^\pi \int \limits_0^{2\pi}f(x)$$


result in
ZR Zπ Z2π
f (x)
0 0 0

Page 8

You might also like