Escolar Documentos
Profissional Documentos
Cultura Documentos
Typesetting Math
Floats
Introduction to LATEX
Aleksandar Petrov
EUROAVIA Delft
October 8, 2015
EUROAVIA
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Contents
1
2
What is LATEX
The Basics of the Basics
Document Layout
Sectioning
Line Breaks
Table of contents
Big project management
Special characters
Typesetting Math
Math environments
Typing symbols
Bracketing
Equation numbering
Floats
Figures
Tables
Referencing & Citing
Referencing
Citing
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Contents
1
2
What is LATEX
The Basics of the Basics
Document Layout
Sectioning
Line Breaks
Table of contents
Big project management
Special characters
Typesetting Math
Math environments
Typing symbols
Bracketing
Equation numbering
Floats
Figures
Tables
Referencing & Citing
Referencing
Citing
Additional resources
What is LATEX
Typesetting Math
Floats
Document Layout
Additional resources
What is LATEX
Typesetting Math
Document Layout
A report class example:
\ documentclass { report }
% T i t l e Page
\ t i t l e { Report T i t l e }
\ a u t h o r { A u t h o r name}
\ b e g i n { document }
\ maketitle
\ begin { abstract }
Sum up what i t i s
\ end { a b s t r a c t }
a l l about
\ chapter { Introduction }
Ba ck gr oun d i n f o r m a t i o n
\ end { document }
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Sectioning
What is LATEX
Typesetting Math
Floats
Additional resources
Line Breaks
This is the first paragraph, contains some text to show how amazing an author I am. I know it is
magnificent, you dont need to tell me this.
We are continuing with the fancy stuff. As you can see, the line of my thought has not changed. \par
Indeed, I am still wondering if you are impressed enough...\newline
For sure this
what it is. \\
text
What is LATEX
Typesetting Math
Floats
Additional resources
Line Breaks
To sum up:
empty line - new paragraph without adding an empty line
(keeping the topic the same)
\par - new paragraph without adding an empty line (keeping
the topic the same)
\\ - new paragraph with adding an empty line (introducing
new topic)
\newline - new paragraph with adding an empty line
(introducing new topic)
What is LATEX
Typesetting Math
Floats
Additional resources
Table of contents
What is LATEX
Table of contents
\begin{document}
\maketitle
\tableofcontents
\newpage
\chapter{Introduction}
\chapter{Literature study}
\section{Historical remarks}
\section{Modern development}
\chapter{Design propsal}
\appendix
\chapter{Additional information}
\end{document}
Typesetting Math
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Sometimes LATEX source code can get pretty huge. That is why it
is handy to separate it over several files. Then these files can be
linked to the main file. The way to do this is the
\input{filename} command. When the compiler sees it, it first
processes the external file and then continues with the main file as
if it is one whole thing. Meaning that no breaks in page and
section numbering, referencing and labeling will occur.
When interested in previewing only one part of the document, you
can comment the \input commands for the others. That will
reduce the building time significantly.
What is LATEX
Typesetting Math
Floats
Additional resources
Special characters
Note
There are some reserved characters and using them in your text
will most probably result in an error message from the compiler.
# $ % ^ & _ { } \
If you still want to use any of them, just put a backslash before it.
1
#, $, %, , &, , {, }, \
What is LATEX
Typesetting Math
Floats
Additional resources
Contents
1
2
What is LATEX
The Basics of the Basics
Document Layout
Sectioning
Line Breaks
Table of contents
Big project management
Special characters
Typesetting Math
Math environments
Typing symbols
Bracketing
Equation numbering
Floats
Figures
Tables
Referencing & Citing
Referencing
Citing
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Typesetting Math
The mathematical typesetting capabilities of LATEX are extremely
advanced. They present one of the main strengths of LATEX.
However, in order to unlock the full capability we need to use
the AMS-LATEX package.
Adding the AMS-LATEX package to your file can be done in the
same way as adding any other extension package. Just use the
\usepackage{amsmath} in the preamble.
\documentclass{report}
\usepackage{amsmath}
% Title Page
\title{Report Title}
\author{Author name}
\begin{document}
\maketitle
...
What is LATEX
Typesetting Math
Floats
Additional resources
For example, a2 + b 2 = c 2
What is LATEX
Typesetting Math
Floats
Additional resources
(2)
(3)
(4)
What is LATEX
Typesetting Math
Floats
Additional resources
Lets compute 7 =
21
3
21
.
3
X1 + X2 + X3
3
r
2
a + b2
c=
4
sin x
lim
=1
x0 x
Xavg =
(5)
(6)
(7)
What is LATEX
Typesetting Math
Floats
Additional resources
Greek letters
$\alpha, \beta, \gamma, \omega, \psi, \eta, \theta, \mu, \nu, \delta$
, , , , , , , , ,
Some of the capital Greek letters can also be typed in LATEX:
1
, , , ,
What is LATEX
Typesetting Math
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
k=0
(1)k z 2k+1
(2k+1)!
= sin z
X
(1)k z 2k+1
k=0
= sin z
(2k + 1)!
Z
M
dx
x
0
5
Y
n
n=1
n1
(8)
(9)
(10)
What is LATEX
Typesetting Math
Floats
Dots
$$ 216\pi = 32\pi $$
2 16 = 32
2 16 = 32
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Dots
$$ X n = \{ x 1, ... , x n \} $$
Xn = {x1 , ..., xn }
$$ X n = \{ x 1, \ ldots , x n \} $$
$$ S n = x 1 + \cdots + x n $$
Xn = {x1 , . . . , xn }
Sn = x1 + + xn
What is LATEX
Typesetting Math
Floats
Additional resources
or
cos ?
$$\sin , \cos, \tan, \cot, \log , \ln , \arccos , \ arcsin , \arctan , \exp, \min, \
max, \ldots$$
sin, cos, tan, cot, log, ln, arccos, arcsin, arctan, exp, min, max, . . .
What is LATEX
Typesetting Math
Floats
Additional resources
Bracketing
These brackets dont look good:
1
x2 + 1
f (x) = ( )(7 x)
x
f (x) =
x2 + 1
(7 x)
hai nao a
,
,
b
b
b
What is LATEX
Typesetting Math
Floats
Additional resources
Equation numbering
Did you notice that some of the equations above had numbers on the
right?
\begin{equation}
f (x) = \sqrt{x}(x2 + 1)
3 \end{equation}
f (x) =
x(x 2 + 1)
(11)
This numbering makes referencing easy as we will see later. Note also
that only display equations can have numbering.
Removing the numbering of a given equation can be made in two ways:
Use equation* (or any other starred) environment instead of
equation
Put the \nonumber tag right after the equation (on the same line)
What is LATEX
Typesetting Math
Floats
Additional resources
Contents
1
2
What is LATEX
The Basics of the Basics
Document Layout
Sectioning
Line Breaks
Table of contents
Big project management
Special characters
Typesetting Math
Math environments
Typing symbols
Bracketing
Equation numbering
Floats
Figures
Tables
Referencing & Citing
Referencing
Citing
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Floats
Floats are content that is considered separate from the main text.
As such they can float around the pages and position themselves
at a suitable place. Another important aspect of floats is that (in
the general case) they cannot be broken over two or more pages.
Two types of objects are considered floats:
Figures
Tables
What is LATEX
Typesetting Math
Floats
Additional resources
Figures
The basic code structure for including a figure (image) into a LATEX
document is the following:
\begin{figure}[position preference]
\centering
\includegraphics[width=somewidth]{path to image}
\caption{Some caption}
\end{figure}
What is LATEX
Typesetting Math
Floats
Additional resources
Figures
position preference
Although LATEX positions the figure at a place it considers optimal,
you can still specify a preference. However, keep in mind that this
is only a preference and LATEX might not follow it.
Specifier
h
t
b
p
!
H
Permission
Place the float here, i.e., approximately at the same point it occurs
in the source text (however, not exactly at the spot)
Position at the top of the page.
Position at the bottom of the page.
Put on a special page for floats only.
Override internal parameters LATEX uses for determining good float positions.
Places the float at precisely the location in the LATEX code.
Requires the float package, e.g., \usepackage{float}.
This is somewhat equivalent to h!.
Taken from https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
What is LATEX
Typesetting Math
Floats
Additional resources
Figures
width
This can be measured in any of the units LATEX understands (e.g.
cm, px, in). However, for many cases it is most convenient to
specify the width of the picture as a percentage of the text width.
For example:
\includegraphics[width=0.5\textwidth]{path to image}
What is LATEX
Typesetting Math
Floats
Additional resources
Figures
Here we present an example of imported picture:
EUROAVIA
\begin{ figure }
2 \ centering
3 \ includegraphics [width=0.7\linewidth
]{./ logo}
4 \caption{EUROAVIA logo}
5 \end{figure}
1
The caption of the figure can be above the image if the \caption
tag is placed before the \includegraphics tag.
What is LATEX
Typesetting Math
Floats
Additional resources
Tables
What is LATEX
Typesetting Math
Floats
Tables
An example table generated with TablesGenerator.com.
\begin{table }[b]
\ centering
3 \caption{My caption}
4 \begin{tabular }{| ll |c|}
5 \ hline
6 Column A & Column B & Column C \\ \hline
71
&2
& abc
\\
84
&5
& def
\\
97
&8
& ghi
\\ \ hline
10 \end{tabular}
11 \end{table}
1
2
Table : My caption
Column A
1
4
7
Column B
2
5
8
Column C
abc
def
ghi
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Tables
What is LATEX
Typesetting Math
Floats
Additional resources
Contents
1
2
What is LATEX
The Basics of the Basics
Document Layout
Sectioning
Line Breaks
Table of contents
Big project management
Special characters
Typesetting Math
Math environments
Typing symbols
Bracketing
Equation numbering
Floats
Figures
Tables
Referencing & Citing
Referencing
Citing
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Making sure that all the referencing and citing within your report
is correct can be quite a tedious task if you type your document in
a typical word processor. LATEX incorporates a powerful, yet simple
and flexible methodology to keep track of all the references and
citations.
What is LATEX
Typesetting Math
Floats
Referencing
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Labels
What is LATEX
Typesetting Math
Floats
Additional resources
References
What is LATEX
Typesetting Math
References
Floats
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Citing
Citing to external sources can be done in a similar way. The most simple
way to do this is to create a list with sources between
\begin{thebibliography} and \end{thebibliography} tags. Then,
wherever in the main text referencing to this source is needed use the
\cite{cite_label} in the same way as \ref.
\LaTeX{} is widely used for scientific papers. \cite{lamport94}
\begin{thebibliography}{9}
\bibitem{lamport94}
Leslie Lamport,
\emph{\LaTeX: a document preparation system},
Addison Wesley, Massachusetts,
2nd edition,
1994.
\end{thebibliography}
What is LATEX
Typesetting Math
Floats
Additional resources
Citing
What is LATEX
Typesetting Math
Floats
Additional resources
Contents
1
2
What is LATEX
The Basics of the Basics
Document Layout
Sectioning
Line Breaks
Table of contents
Big project management
Special characters
Typesetting Math
Math environments
Typing symbols
Bracketing
Equation numbering
Floats
Figures
Tables
Referencing & Citing
Referencing
Citing
Additional resources
What is LATEX
Typesetting Math
Floats
Additional resources
Additional resources
Wikipedia.org
CTAN.org
The Not So Short Introduction to LATEX2, Tobias Oetiker,
https://tobi.oetiker.ch/lshort/lshort.pdf
Google
tex.stackexchange.com