Sie sind auf Seite 1von 192

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

A not so short introduction to LATEX


Hugo Andres Gutierrez Rojas
Hanwen Zhang
Communication Skills for Statisticians
Faculty of Statistics
Universidad Santo Tomas
2014

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Equations

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Equations

Tables

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Contents
1

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

What LATEX is not?

According to Davidian and Luca LATEX is not:


A word processor like MS Word or Pages.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

What LATEX is not?

According to Davidian and Luca LATEX is not:


A word processor like MS Word or Pages.
A WYSIWYG software (What You See Is What You Get).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

What LATEX is not?

According to Davidian and Luca LATEX is not:


A word processor like MS Word or Pages.
A WYSIWYG software (What You See Is What You Get).
Dependent of a specific operating system.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

What LATEX is not?

According to Davidian and Luca LATEX is not:


A word processor like MS Word or Pages.
A WYSIWYG software (What You See Is What You Get).
Dependent of a specific operating system.
A software for typesetting math.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

What LATEX is?

According to Davidian and Luca LATEX is:


A powerful language for typesetting math, chemistry, music
sheets, etc.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

What LATEX is?

According to Davidian and Luca LATEX is:


A powerful language for typesetting math, chemistry, music
sheets, etc.
The standard typesetting language used by major publishers of
books in the sciences (e.g., Springer, CRC Press, Wiley, etc.).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

What LATEX is?

According to Davidian and Luca LATEX is:


A powerful language for typesetting math, chemistry, music
sheets, etc.
The standard typesetting language used by major publishers of
books in the sciences (e.g., Springer, CRC Press, Wiley, etc.).
The standard typesetting language used by most journals in
the sciences (e.g., Journal of the American Statistical
Association, Biometrics, etc.).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

What LATEX is?

According to me LATEX is:


The standard typesetting language used by the Faculty of
Statistics in USTA and its Book Collection on Applied
Statistics.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

What LATEX is?

According to me LATEX is:


The standard typesetting language used by the Faculty of
Statistics in USTA and its Book Collection on Applied
Statistics.
The standard typesetting language used by the journal of the
Faculty of Statistics (Revista Comunicaciones en Estadstica).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

What LATEX is?

According to me LATEX is:


The standard typesetting language used by the Faculty of
Statistics in USTA and its Book Collection on Applied
Statistics.
The standard typesetting language used by the journal of the
Faculty of Statistics (Revista Comunicaciones en Estadstica).
A must-learn language for the student of statistics, economics
and related disciplines who want to get enrolled in a graduate
program.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Why should we use LATEX?

In this class we encourage the use of this language because:


The author focuses mainly in what he must write (the
content).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Why should we use LATEX?

In this class we encourage the use of this language because:


The author focuses mainly in what he must write (the
content).
The output is pretty nice and the quality of text, tables,
equations, etc is outstanding.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Why should we use LATEX?

In this class we encourage the use of this language because:


The author focuses mainly in what he must write (the
content).
The output is pretty nice and the quality of text, tables,
equations, etc is outstanding.
It is free and used by leading professionals in the world.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Why should we use LATEX?

In this class we encourage the use of this language because:


It is multi-platform and portable (the same file could be
compiled in Windows, Mac, UNIX, LINUX, and even in the
internet).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Why should we use LATEX?

In this class we encourage the use of this language because:


It is multi-platform and portable (the same file could be
compiled in Windows, Mac, UNIX, LINUX, and even in the
internet).
You can AUTOMATICALLY cross-reference equations, tables,
figures, bibliography.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Why should we use LATEX?

In this class we encourage the use of this language because:


It is multi-platform and portable (the same file could be
compiled in Windows, Mac, UNIX, LINUX, and even in the
internet).
You can AUTOMATICALLY cross-reference equations, tables,
figures, bibliography.
The statistical software R speaks easily with LATEX. The
statistical reports then are written straightforwardly.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Process

Remember that LATEXis not a WYSIWYG typesetting software. The


following steps are behind the process of the final document:
A .tex file (main file) needs to be created. This file contains
both the necessary commands that allow to compile the
document and the content of the document.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Process

Remember that LATEXis not a WYSIWYG typesetting software. The


following steps are behind the process of the final document:
A .tex file (main file) needs to be created. This file contains
both the necessary commands that allow to compile the
document and the content of the document.
That file is compiled resulting in a .PDF or .PS file that
contains the final document.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Structure of the main file

Basically, the .tex file contains:


The preamble, where you call the necessary packages and
write the proper commands in order to get a clean compiling
process.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Structure of the main file

Basically, the .tex file contains:


The preamble, where you call the necessary packages and
write the proper commands in order to get a clean compiling
process.
The document body, where you only care about writing what
you wanted to write at first (text, figures, equations, tables,
etc.)

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Warning

Note that LATEX is case-sensitive and if you make a mistake in the


preamble or in the document body, you will get an error and the
final document will not be displayed.
This symbol % is used to comment the main file. Every command
in the main file begins with this symbol \.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Structure of an article
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\title{My First Paper}
\author{My name}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
This paper gives an introduction to \LaTeX.
\end{abstract}
\section{My first section}
\subsection{My first sub-section}
\subsubsection{My first sub-sub-section}
\end{document}
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Structure of an article

\documentclass[12pt]{article}
Inside [ ] you must write the options of the document. In
this case, we want to set the size font to 12pt.

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
The first line allows your documents to be typeset in a
language other than english (in this case english).
The second line allows you to write automatically accents
(tildes).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Structure of an article

\title{}
The title of your paper.

\author{}
Your name.

\date{\today}
Date when you compiled the file by last time.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Structure of an article

\begin{document}

One of the most important instructions. This one initializes the


document.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Structure of an article

\maketitle
This command generates a proper title for your article.

\begin{abstract}
Your first abstract of your first article.
\end{abstract}
The abstract gives a brief review of the whole paper.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Structure of an article

\section{My first section}


\subsection{My first sub-section}
\subsubsection{My first sub-sub-section}

The body of the document is organized in sections, sub-sections and


sub-sub-sections.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Structure of an article

10

\end{document}

One of the most important instructions. This one finishes the document.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Taking advantage from LATEX

Users of MS Word find a lot of difficulties when it comes to crete


lists. It seems that one can be lost in trying to do a simple list. LATEX
users will find the environment for creating lists very convenient.
LATEX allows you to nest the list up to four levels. There are three
simple kinds of list environment to create lists: itemize, enumerate,
and description.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Environments

itemize creates non-numbered lists.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Environments

itemize creates non-numbered lists.

enumerate creates numbered lists.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Environments

itemize creates non-numbered lists.

enumerate creates numbered lists.

description creates non-numbered definitions.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Taking advantage from LATEX


LATEX is an environment-driven language. This way, everything you
want to put in the document will need to respect the rules of this
language. To me, the first and most important rule is: Begin with
\begin{} and do not forget to end with \end{}.
As a rule of thumb, you always end what you begin.
\begin{document}
...
\end{document}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Itemize

The basic structure of this bulleted list is as follows:


\begin{itemize}
\item My first item.
\item My second item.
\item My thrid item.
\end{itemize}
Note that the command \item allows you to start with a new bullet
in the list.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Itemize

My first item.
My second item.
My thrid item.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Enumerate

The basic structure of this bulleted list is as follows:


\begin{enumerate}
\item My first item.
\item My second item.
\item My thrid item.
\end{enumerate}
Note that the command \item allows you to start with a new numbered item.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Enumerate

My first item.

My second item.

My thrid item.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Description

The basic structure of this bulleted list is as follows:


\begin{description}
\item[First definition] My first item.
\item[Second definition] My second item.
\item[Third definition] My thrid item.
\end{description}
Note that the command \item allows you to start with a new numbered item.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Description

First definition My first item.


Second definition My second item.
Third definition My third item.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Customization
\hfill \\ allows you to begin a definition from a new line in your
text.
\begin{description}
\item[First definition] \hfill \\
My first item.
\item[Second definition] \hfill \\
My second item.
\end{description}
First definition
My first item.
Second definition
My second item.
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Customization

Consider the following code:


\begin{enumerate}[\bfseries Exerc{i}se 1:]
\item My first item.
\item My second item.
\item My thrid item.
\end{enumerate}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Customization

Exercise 1: My first item.


Exercise 2: My second item.
Exercise 3: My thrid item.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Customization

Within the enumerate environment, you can modify the style of the
counters. For example, consider the following instruction:
[\bfseries Exerc{i}se 1:]
Note that the command [] allows to define different options inside the environment. Also, \bfseries makes bold the font of
the counter. The text of the counter is replaced by the word
Exerc{i}se and finally, the counter itself is defined to be arabic
followed by a colon.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Customization

In LATEXthere are two declarations that changes the style of a text


1) the series: it can be \mdseries or \mdseries and 2) the family:
it can be \rmfamily, \sffamily or \ttfamily. Now, try this:
[\mdseries Exerc{i}se 1:]
[\mdseries \ttfamily Exerc{i}se 1:]
[\rmfamily Exerc{i}se a:]

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Customization

Why should we need to write Exerc{i}se, instead


of Exercise?

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Customization

To begin the list in a different number other than 1. :


\begin{enumerate}
\setcounter{enumi}{4}
\item My fifth element
\end{enumerate}
5

My fifth element

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork

Create a nested list of your most likely actors and actresses


(in order of importance). Consider different bullets for films
and TV shows. Separate your list into local and foreign. Give
details of movies or TV shows where actors have been part of.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork

Create a nested list of your most likely actors and actresses


(in order of importance). Consider different bullets for films
and TV shows. Separate your list into local and foreign. Give
details of movies or TV shows where actors have been part of.

Define and describe: random variable, probability and


distribution function.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork

Create a nested list of your most likely actors and actresses


(in order of importance). Consider different bullets for films
and TV shows. Separate your list into local and foreign. Give
details of movies or TV shows where actors have been part of.

Define and describe: random variable, probability and


distribution function.

Formulate and write three exercises to practice what you have


learned today.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Equations and math

In this section we focus on the beauty of LATEX when generating


equations and symbols. Now, you will see how this language overtakes (exceeds, surpasses and beats) common word processors by
far!

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

The required package

The package amsmath provides a large number of useful symbols for


mathematical (and related stuff) writing.
\usepackage{amsmath}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

The greek alphabet


If you study statistics, it is imperative for you to memorise the following symbols:

\Gamma
\Delta

\Theta

\Lambda

\alpha
\beta
\gamma
\delta
\epsilon
\zeta
\eta
\theta
\iota
\kappa
\lambda
\mu

Andr
es Guti
errez - Hanwen Zhang

\Pi

\Sigma

\Psi
\Omega

\nu
\xi

\pi
\rho
\sigma
\tau
\upsilon
\phi
\chi
\psi
\omega

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Common symbols

To write fractions, we use \frac{}{} and dfrac{}{}.


For example, the syntax \frac{x}{y} gives yx , and
x
\dfrac{x}{y} gives
y
Exponential and logarithm functions are obtained with \exp
and \ln.
For example, 5\exp\{-5x\} gives 5 exp{5x}.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Common symbols
One single dot is obtained by \ldot and \cdot.
Dots are obtained by \ldots and \cdots.
The summatory and productory are very common in the
statistical theory.
For example
\sum_{i=1}^na_i+\sum b_i+\prod_{j=1}^mc_j
gives the expression
n
X

ai +

i=1

bi +

m
Y

cj

j=1

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Common symbols
The integral operator can be obtained with \int.
For example,
\int \ldots \int f(x_1,\cdots,x_k)dx_1\cdots dx_k=1
gives the expression
Z
Z
. . . f (x1 , , xk )dx1 dxk = 1
.
\frac{\partial F_X(x)}{\partial x}=f_X(x)
gives the expression
FX (x)
= fX (x)
x
.
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Detexify web

How to write a mathematical symbol when you dont know


the proper syntax?

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Detexify web

How to write a mathematical symbol when you dont know


the proper syntax?
Just draw the symbol in the web of Detexify

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Detexify web

How to write a mathematical symbol when you dont know


the proper syntax?
Just draw the symbol in the web of Detexify
Select the right symbol and copy the code in LATEX

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Power and indices

The caret ^ character is used to raise something (like power in


a polynom).
The underscore _ is for lowering.
Use { } when more than one expression is raised or lowered.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Power and indices

For example,
(a_n+b_{n+1})^2=a_n^2+b_{n+1}^2+2a_nb_{n+1}
results in the following expression:
2
(an + bn+1 )2 = an2 + bn+1
+ 2an bn+1

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Nested power and indices

For more complex situations, just write the expression inside of


^{...} and _{...}. For example,
\omega^{r_{i,j}+1}_{m_i+n_j}
gives the following expression:
r +1

mi,ji +nj

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Mathematical environment

Note that math symbols and equations are different than text. So,
a different environment must be used to properly write equations.
The math environment has a very simple form: $...$.
Observe the difference between y (y) and y ($y$).
Using $$...$$ yields a centered expression.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Mathematical environment
For example, if you type:
The sum between $x=2$ and $y=3$ is
$$x+y=5$$
Then, the following expression is shown:

The sum between x = 2 and y = 3 is


x +y =5

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

The equation environment


This environment is used to write math seriously:
\begin{equation}\label{EQ_name}
...
\end{equation}
Within this environment we can enumerate and
cross-reference equations.
If we dont need to enumerate the equation, the appropriate
syntax is:
\begin{equation*}
...
\end{equation*}
Use \ref{EQ_name} to call the corresponding equation.
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Reference

For example, type this:


\begin{equation}\label{Prob}
\int_{-\infty}^{infty}f(x)dx=1
\end{equation}
(\ref{Prob}) remains if $f(x)$ is a density function.
Gives:

f (x)dx = 1.

(1) remains if f (x) is a density function.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

(1)

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

The align environment

This environment allows us to align several equations.


Each line will be counted as a different equation, and each
equation will be enumerated.
Use \notag to remove enumeration.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

The align environment


For example,
\begin{align}
x&=2\\
y&=4\notag
\end{align}
gives the following expression:
x =2
y =4

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

(2)

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

The cases environment

We can use this environment to write functions or any expression


involving cases. For example, it is useful to write discrete probability
functions. Cases environment must be typed inside of an equation
environment, $...$ or $$...$$.
( 
n y
ny
for y = 0, 1, . . . , n
x p (1 p)
Pr (Y = y ) =
(3)
0
otherwise

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

The cases environment


Consider the following code:
\begin{equation}
f(x)=
\begin{cases}
x&\text{if $x>2$}\\
x+1&\text{else}
\end{equation}
\end{cases}
that results in the following expression:
(
x
if x > 2
f (x) =
x + 1 else
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

(4)

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Matrices

As you should know, matrices are very common and useful in mathematics, statistics and related disciplines.
Different elements in a row are separated by & (ampersand
symbol) and the rows are separated by \\
The matrix environment must be typed inside of an equation
environment, $...$ or $$...$$.

A=

Andr
es Guti
errez - Hanwen Zhang

2 3
1 0

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Matrices

\begin{equation}
A=
\begin{pmatrix}
2 & 3\\
1 & 0
\end{pmatrix}
\end{equation}
gives the expression

A=

Andr
es Guti
errez - Hanwen Zhang

2 3
1 0

A not so short introduction to LATEX

(5)

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Classwork

Remember the following rules when writing math:


Equations are sentences composed by subject, verb and,
predicate.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork

Remember the following rules when writing math:


Equations are sentences composed by subject, verb and,
predicate.
You must make sure than the former parts of a sentence are
present in your equation.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork

Remember the following rules when writing math:


Equations are sentences composed by subject, verb and,
predicate.
You must make sure than the former parts of a sentence are
present in your equation.
Respect the grammar: do not forget punctuation marks in
your entire paper! Even equations must respect grammar (if
need, use colon, semicolon and period).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork
Reproduce the following expressions:

jt

X
(jt )
(j )
xt |xt1 , , x1 , z tn p
+ a0 t +
xti
n/(n 2)
i=1

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

(6)

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork
Reproduce the following expressions:

jt

X
(jt )
(j )
xt |xt1 , , x1 , z tn p
+ a0 t +
xti
n/(n 2)
i=1

(6)

f (x|z, x ) = f (xk+1 |xk , , x1 , z, x ) f (xT |xT 1 , , x1 , z, x )


"
#T k T

 n+1
T
i1 Y
Y h
2
( n+1
)
et2
(jt )
2
=
h
1
+
n
n( n2 )
t=k+1

Andr
es Guti
errez - Hanwen Zhang

t=k+1

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Tables

Tables are very important to report results of analysis or represent


ideas in a simpler form. We use the environment tabular inside of
the environment table to create a table.
As you should know, a table is an array composed by rows and
columns.
Note that a table is different from a matrix, because we can customize it. You can insert horizontal lines, vertical lines, text, headers, etc.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Tables

We use \\ to separate different rows and & to separate


different elements in a row (similar to the writing of a matrix).
We use c, l or r to indicate that each column is centred,
aligned to the left or right.
We use \hline to inset a horizontal line between rows.
We use \cline to inset a horizontal line between determined
columns.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Tables

Consider the following nice table.


Coefficient
1
2

Estimation
0.5
-1.5

Standard error
0.23
0.43

Tabla 1 : A very interesting table

Did you notice the label?

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Structure of a table

Consider the following code generating the previous table:


\begin{table}
\label{Table1}\centering
\begin{tabular}{c|cc}\hline
Coefficient & Estimation & Standard error\\\hline
$\theta_1$ &0.5 &0.23\\
$\theta_2$ &-1.5 &0.43\\\hline
\end{tabular}
\caption{A very interesting table}
\end{table}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Merging rows and columns

Sometimes we need to merge columns or rows. To do so, we must


use the package multirow.
The usage is:
To merge columns:
\multicolumn{number of columns}{justification}{text}
To merge rows:
\multirow{number of rows}{*}{text}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Merging rows and columns

Consider the following table: it merges both columns and rows.

Coefficient
1
2

Estimation
Bayesian Classic
0.5
0.43
-1.5
-1.43

Tabla 2 : A very tricky table

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Merging rows and columns


The previous table was created with the following code:
\begin{table}
\label{Table1}\centering
\begin{tabular}{|c|cc|} \hline
\multirow{2}{*}{Coefficient} &\multicolumn{2}{c|}
{Estimation} \\ \cline{2-3}
&Bayesian&Classic\\ \hline
$\theta_1$&0.5&0.43\\
$\theta_2$&-1.5&-1.43\\ \hline
\end{tabular}
\caption{A very tricky table}
\end{table}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Classwork

Call the multirow package and reproduce the following table:


Density
Binomial
Poisson

Link function
log{/(1 )}
1 ()
log

Name
Logit
Probit
Log

Tabla 3 : Selected GLM families and corresponding link functions.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Shorcut

Yeah right!!!
Doing tables in LATEX is a little
tricky!!!

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

We used to write and customise our tables in MS Excel. There is


a complement called Excel2Latex that allows you to export the
table that you create the tables in Excel and translate them to LATEX
code.
http://www.ctan.org/tex-archive/support/excel2latex/

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

Before doing anything you must call the booktabs package. Then:
Install the complement.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

Before doing anything you must call the booktabs package. Then:
Install the complement.
Create your table.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

Before doing anything you must call the booktabs package. Then:
Install the complement.
Create your table.
Select your table.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

Before doing anything you must call the booktabs package. Then:
Install the complement.
Create your table.
Select your table.
Go to format and click on export table to LATEX.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

Before doing anything you must call the booktabs package. Then:
Install the complement.
Create your table.
Select your table.
Go to format and click on export table to LATEX.
Copy the code and paste it in LATEX.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Using Excel2Latex

Before doing anything you must call the booktabs package. Then:
Install the complement.
Create your table.
Select your table.
Go to format and click on export table to LATEX.
Copy the code and paste it in LATEX.
Enjoy.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Figures in LATEX

Firstly, we load the package graphicx.


We use the commando
\includegraphics[options]{file name} in the
environment figure to insert images.
In options we specify the size, width, height and others
features.
We can insert images in format .jpg and .eps (Encapsulated
PostScript).
For simplicity, we paste the image file in the same folder as
the .tex file.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Figures in LATEX

The following instructions


\begin{figure}
\centering
\includegraphics[scale=0.45]{densidad_Weibull.eps}
\caption{The Weibull distribution density.}
\label{fig1}
\end{figure}
produce the following figure

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Figures in LATEX

Tables

Bibliographic standards

beamer

2.0

Equations

1.5

Weibull(3,0.5)
Weibull(1,1)
Weibull(2,1)

1.0

Lists

0.5

Basics

0.0

Intro

Figure 1 : The Weibull distribution density.


Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Figures in LATEX

The following instructions

\begin{figure}
\centering
\includegraphics[width=3cm,height=8cm]{densidad_Weibull.eps
\caption{The Weibull distribution density.}
\label{fig1}
\end{figure}
produce the figure

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Figures in LATEX

Tables

Bibliographic standards

beamer

2.0

Equations

1.5

Weibull(3,0.5)
Weibull(1,1)
Weibull(2,1)

1.0

Lists

0.5

Basics

0.0

Intro

not so short introduction


to LATEX
Figure 2 : The Weibull Adistribution
density.

Andr
es Guti
errez - Hanwen Zhang

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Figures in LATEX
In order to insert a image in format .jpg, we need to introduce the
dimensions of the file in options.
The following instructions
\begin{figure}
\centering
\includegraphics[bb=0 0 1200 1200, scale=0.15]{Votar.jpg}
\caption{We will vote.}
\end{figure}
produce the following figure

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Figure 3 : We will vote.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Figures in LATEX
We can insert figures with more that one image using the package
subfigure. For example
\begin{figure}[h]
\centering
\subfigure[Weibull density.]{
\includegraphics[scale=0.25]{densidad_Weibull.eps}}
\subfigure[F density.]{
\includegraphics[scale=0.25]{densidad_F.eps}}
\caption{Two important densities.}
\end{figure}
produce the following figure

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

0.8

2.0

1.0

Lists

F(2,2)
F(2,5)
F(10,5)
F(10,10)

y
0.4

1.0

0.6

1.5

Weibull(3,0.5)
Weibull(1,1)
Weibull(2,1)

0.2

0.5

0.0

Basics

0.0

Intro

(a) Weibull density.

(b) F density.

Figure 4 : Two important densities.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Figures in LATEX
We can also combine a table with figures with the package espfig,
the following instruction
\begin{table}[h!]
\centering\caption{Four interesting densities}
\begin{tabular}{|c|c|} \hline
Weibull density & Beta density \\
\epsfig{file=densidad_Weibull.eps,scale=0.15}
& \epsfig{file=densidad_beta.eps,scale=0.15} \\ \hline
F density & Binomial density \\
\epsfig{file=densidad_F.eps,scale=0.15}
& \epsfig{file=densidad_binomial.eps,scale=0.15} \\\hline
\end{tabular}
\end{table}
produce the following table with figures.
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

Figures in LATEX
Tabla 4 : Four interesting densities

Beta density
Beta(0.5,1)
Beta(0.5,0.3)

f(x)

2.0

Weibull(3,0.5)
Weibull(1,1)
Weibull(2,1)

Weibull density
1.5

0.01

0.12

0.23

0.34

0.45

0.56

0.67

0.78

0.56

0.67

0.78

0.89

1.0

Beta(2,1)
Beta(2,3)

0.0

0.0

f(x)

0.5

2.0

1.0

0.01

0.12

0.23

0.34

0.45

0.89

Binomial density

0.8

0.20

1.0

0.25

F density

0.15

0.0

0.00

0.2

0.05

0.4

0.10

f(x)

0.6

F(2,2)
F(2,5)
F(10,5)
F(10,10)

Andr
es Guti
errez - Hanwen Zhang

10

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

The correct writing of the bibliography is very important in


essays, articles, books or any scientific documents.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

The correct writing of the bibliography is very important in


essays, articles, books or any scientific documents.
We use the bibliographic references to

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

The correct writing of the bibliography is very important in


essays, articles, books or any scientific documents.
We use the bibliographic references to
1

resume the background of the investigation.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

The correct writing of the bibliography is very important in


essays, articles, books or any scientific documents.
We use the bibliographic references to
1
2

resume the background of the investigation.


cite results that we need in our investigation.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

There are many different bibliographic styles such as Harvard, Chicago,


Turabian, APA (America Psychological Association), AMA (American Medical Association), ACS (American Chemical Society).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

Author - year format.


One of the most used styles.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

Author - year format.


One of the most used styles.
Journals that use this format include: JASA, Journal of
Forecasting, American Statistician, Biometrika.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

Author - year format.


One of the most used styles.
Journals that use this format include: JASA, Journal of
Forecasting, American Statistician, Biometrika.
For example, Zhang & Gutierrez (2010) claim that ...

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

Author - year format.


One of the most used styles.
Journals that use this format include: JASA, Journal of
Forecasting, American Statistician, Biometrika.
For example, Zhang & Gutierrez (2010) claim that ...
In the bibliography list, the references are in alphabetical order
(according to the last name of the first author).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

Author - year format.


One of the most used styles.
Journals that use this format include: JASA, Journal of
Forecasting, American Statistician, Biometrika.
For example, Zhang & Gutierrez (2010) claim that ...
In the bibliography list, the references are in alphabetical order
(according to the last name of the first author).
In case that you cite more than one reference of some authors,
the order is chronological.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Numeric format
Journals as Pattern Analysis & Applications, Statistical
Methodology and Statistics use reference citations in the text
identified by numbers in parenthesis or square brackets.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Numeric format
Journals as Pattern Analysis & Applications, Statistical
Methodology and Statistics use reference citations in the text
identified by numbers in parenthesis or square brackets.
For example: This result was first demonstrated by Fisher in
1943 (see [2]).

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Numeric format
Journals as Pattern Analysis & Applications, Statistical
Methodology and Statistics use reference citations in the text
identified by numbers in parenthesis or square brackets.
For example: This result was first demonstrated by Fisher in
1943 (see [2]).
In the bibliography list, the references may be displayed in
order of appearance or in alphabetical order.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Alternative format
Journals as Significance use the reference citations in
superscript.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Alternative format
Journals as Significance use the reference citations in
superscript.
For example: see Buckland et al.1 for further details.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Alternative format
Journals as Significance use the reference citations in
superscript.
For example: see Buckland et al.1 for further details.
In the bibliography list, the references may be displayed in
order of appearance or in alphabetical order.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

The basic rule for citing bibliographic references is:


Every item included in the bibliography must be cited in the
document.
Every citation in the document must be in the bibliography.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

The bibliographic references we could cite include


1

Books

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

The bibliographic references we could cite include


1

Books

Articles published in journals

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

The bibliographic references we could cite include


1

Books

Articles published in journals

Doctoral or masters thesis

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

The bibliographic references we could cite include


1

Books

Articles published in journals

Doctoral or masters thesis

Conference proceedings

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

The bibliographic references we could cite include


1

Books

Articles published in journals

Doctoral or masters thesis

Conference proceedings

Technical reports

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

The bibliographic references we could cite include


1

Books

Articles published in journals

Doctoral or masters thesis

Conference proceedings

Technical reports

Technical manual

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

What information do we need to include in a bibliographic reference?


When we cite a book, the basic information are title, authors,
year of publication, publisher, edition.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

What information do we need to include in a bibliographic reference?


When we cite a book, the basic information are title, authors,
year of publication, publisher, edition.
In the case of an article, we need to include title, authors,
journal, year of publication, volume, number and pages.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliographic standards

What information do we need to include in a bibliographic reference?


When we cite a book, the basic information are title, authors,
year of publication, publisher, edition.
In the case of an article, we need to include title, authors,
journal, year of publication, volume, number and pages.
In the case of a thesis, we need to include title, authors,
educational institute, year and type (doctoral or master)

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

When we cite a conference proceeding, we need to include


title, authors, name of the conference, year of publication,
organization or publisher, among others.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

When we cite a conference proceeding, we need to include


title, authors, name of the conference, year of publication,
organization or publisher, among others.
In the case of a technical report, we need to include title,
authors, year of publication and institution.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Bibliographic standards

When we cite a conference proceeding, we need to include


title, authors, name of the conference, year of publication,
organization or publisher, among others.
In the case of a technical report, we need to include title,
authors, year of publication and institution.
In the case of a technical manual, we need to include title,
authors, year of publication and the organization.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliography in LATEX
The structure in LATEX is as following:

\begin{thebibliography}{9}
\bibitem{Nieto2005} Nieto, F. H. (2005). Modeling
bivariate threshold autoregressive processes in the
pressence of missing data,
\textit{Communications in Statistics: Theory and Methods}
\bibitem{Carli1995} Carlin, B.P. and Chib, S. (1995).
Bayesian model choice via Markov chain Montecarlo methods,
\textit{Journal of the Royal Statistical Society Series B},
\textbf{57}, 473-484.
\end{thebibliography}
produce the following bibliography
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliography in LATEX

Nieto, F. H. (2005). Modeling bivariate threshold


autoregressive processes in the pressence of missing data,
Communications in Statistics: Theory and Methods
Carlin, B.P. and Chib, S. (1995). Bayesian model choice via
Markov chain Montecarlo methods, Journal of the Royal
Statistical Society Series B, 57, 473-484.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Bibliography in LATEX

To cite one of the references, we use \cite{Name}. For example,


This algorithm was firstly proposed by \cite{Nieto2005}
produces
This algorithm was firstly proposed by [1]

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

For more flexible and more organised bibliography writing, we use


BIBTEX.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

BibTex

The usage of BibTex provides a unified format for


bibliographical references and is particularly useful when we
have a big number of references.
All you need to do is
1
2
3

4
5

Create a file of all references with extension .bib


Save the file in the same folder of the file .tex
Include the references with the instruction
\bibliography{Name} and
\usepackage[full]{harvard}in the tex document.
Specify the bibliographic style with \bibliographystyle{}
Run BibTex and then run tex as usual.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

BibTex

When you need to cite a reference, distinguish between


\cite{} and \citeasnoun{}.
When the reference forms part of the sentence, you use
\citeasnoun{}, otherwise you use \cite{}.
Use \nocite{*} if you want the complete list of references,
even those not cited in the document.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Beamer

Beamer is specially designed to create presentations in LaTex.


With Beamer you can reproduce easily complicated equations
and have many styles for animation and presentation.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Beamer
The usage of Beamer is as follows
\documentclass[12pt]{beamer}
\mode<presentation>{\usetheme{Antibes}}
\usecolortheme{dove}
\title{}
\author{}
\begin{document}
\frame{\titlepage}
\begin{frame}[option]
\frametitle{Name}
\end{frame}
\end{document}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Beamer

Visit http://deic.uab.es/~iblanes/beamer_gallery/
for different themes.
Some common color themes are albatross, beaver, beetle,
crane, dolphin, dove, fly, lily, orchid, seahorse, whale and
wolverine
In the option of \begin{frame}, we can use t (top), c
(center) or b (bottom) to specify the ubication of text.
You can use different colors in the presentation, for example,
\textcolor{red}{Text in red} prodeces Text in red.
The block exampleblock and alertblock environment is
useful when we want to highlight some content.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Beamer

\begin{block}{Funny theorem}
This is important!
\end{block}
\begin{exampleblock}{Not so funny theorem}
This is very important!
\end{exampleblock}
\begin{alertblock}{Not funny at all}
Pay attention!
\end{alertblock}
produce the following

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Beamer

Funny theorem
This is important!
Not so funny theorem
This is very important!
Not funny at all
Pay attention!

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

The basic instruction for animation is \pause introducing a pause


in the text. For example
$$\int_0^3 f(x)dx\pause=\int_0^2f(x)dx\pause
+\int_2^3 f(x)dx\pause=1$$
produces
Z

f (x)dx
0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Animation in presentations

The basic instruction for animation is \pause introducing a pause


in the text. For example
$$\int_0^3 f(x)dx\pause=\int_0^2f(x)dx\pause
+\int_2^3 f(x)dx\pause=1$$
produces
Z

Z
f (x)dx =

f (x)dx
0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Animation in presentations

The basic instruction for animation is \pause introducing a pause


in the text. For example
$$\int_0^3 f(x)dx\pause=\int_0^2f(x)dx\pause
+\int_2^3 f(x)dx\pause=1$$
produces
Z

Z
f (x)dx =

Z
f (x)dx +

Andr
es Guti
errez - Hanwen Zhang

f (x)dx
2

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Animation in presentations

The basic instruction for animation is \pause introducing a pause


in the text. For example
$$\int_0^3 f(x)dx\pause=\int_0^2f(x)dx\pause
+\int_2^3 f(x)dx\pause=1$$
produces
Z

Z
f (x)dx =

Z
f (x)dx +

Andr
es Guti
errez - Hanwen Zhang

f (x)dx = 1
2

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
We can give different colours to specific parts using \color for
equation and \textcolor for text
$$\color<1>{red}{\int_0^3f(x)dx}\pause=\color<2>{purple}
{\int_0^2f(x)dx}\pause+\color<3>{green}{\int_2^3f(x)dx}
\pause=\color<4>{1}$$
produces
Z

f (x)dx
0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Animation in presentations
We can give different colours to specific parts using \color for
equation and \textcolor for text
$$\color<1>{red}{\int_0^3f(x)dx}\pause=\color<2>{purple}
{\int_0^2f(x)dx}\pause+\color<3>{green}{\int_2^3f(x)dx}
\pause=\color<4>{1}$$
produces
Z

Z
f (x)dx =

f (x)dx
0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Animation in presentations
We can give different colours to specific parts using \color for
equation and \textcolor for text
$$\color<1>{red}{\int_0^3f(x)dx}\pause=\color<2>{purple}
{\int_0^2f(x)dx}\pause+\color<3>{green}{\int_2^3f(x)dx}
\pause=\color<4>{1}$$
produces
Z

Z
f (x)dx =

Z
f (x)dx +

Andr
es Guti
errez - Hanwen Zhang

f (x)dx
2

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Figures in LATEX

Tables

Bibliographic standards

beamer

and software

Animation in presentations
We can give different colours to specific parts using \color for
equation and \textcolor for text
$$\color<1>{red}{\int_0^3f(x)dx}\pause=\color<2>{purple}
{\int_0^2f(x)dx}\pause+\color<3>{green}{\int_2^3f(x)dx}
\pause=\color<4>{1}$$
produces
Z

Z
f (x)dx =

Z
f (x)dx +

Andr
es Guti
errez - Hanwen Zhang

f (x)dx = 1
2

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

Another basic instruction is \onslide<range>{text}, where in


<range> we specify the order of appearen of text. For example,
In \onslide<3->{text}, text will be visible from step 3
onwards
In \onslide<-3>{text}, text will be visible to step 3
In \onslide<2-3>{text}, text will be visible from step 2 to
step 3

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations
The most common usage of \onslide is as follows
Probability density function\\
\onslide<1>{$f(x)\geq0$}\\
\onslide<2> {$P(X=x)=0$}\\
\onslide<3> {$P(1<X<2)=\int_1^2f(x)dx$}
gives:
Probability density function
f (x) 0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations
The most common usage of \onslide is as follows
Probability density function\\
\onslide<1>{$f(x)\geq0$}\\
\onslide<2> {$P(X=x)=0$}\\
\onslide<3> {$P(1<X<2)=\int_1^2f(x)dx$}
gives:
Probability density function
P(X = x) = 0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations
The most common usage of \onslide is as follows
Probability density function\\
\onslide<1>{$f(x)\geq0$}\\
\onslide<2> {$P(X=x)=0$}\\
\onslide<3> {$P(1<X<2)=\int_1^2f(x)dx$}
gives:
Probability density function

P(1 < X < 2) =

R2
1

f (x)dx

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

The following instruction


Probability density function\\
\onslide<1->{$f(x)\geq0$}\\
\onslide<2-3>{$P(X=x)=0$}\\
\onslide<-3>{$P(1<X<2)=\int_1^2f(x)dx$}\\
\onslide<-4>{$f(x)=\frac{\partial F(x)}{\partial x}$}
give the results

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations

Probability density function


f (x) 0
P(1 < X < 2) =
f (x) = Fx(x)

R2
1

f (x)dx

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations

Probability density function


f (x) 0
P(X = x) = 0
R2
P(1 < X < 2) = 1 f (x)dx
f (x) = Fx(x)

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations

Probability density function


f (x) 0
P(X = x) = 0
R2
P(1 < X < 2) = 1 f (x)dx
f (x) = Fx(x)

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations

Probability density function


f (x) 0

f (x) =

F (x)
x

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

The instruction \only<> is useful to make replacemenet. For example,


Probability density function\\
\only<1>{$f(x)\geq0$}
\only<2>{$P(X=x)=0$}
\only<3>{$P(1<X<2)=\int_1^2f(x)dx$}
gives
Probability density function
f (x) 0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

The instruction \only<> is useful to make replacemenet. For example,


Probability density function\\
\only<1>{$f(x)\geq0$}
\only<2>{$P(X=x)=0$}
\only<3>{$P(1<X<2)=\int_1^2f(x)dx$}
gives
Probability density function
P(X = x) = 0

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

The instruction \only<> is useful to make replacemenet. For example,


Probability density function\\
\only<1>{$f(x)\geq0$}
\only<2>{$P(X=x)=0$}
\only<3>{$P(1<X<2)=\int_1^2f(x)dx$}
gives
Probability densityR function
2
P(1 < X < 2) = 1 f (x)dx

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
We can show the items of itemize and enumerate progressively.
\begin{itemize}
\item<1-> Property 1
\item<2-> Property 2
\item<3-> Property 3
\end{itemize}
gives
Property 1

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
We can show the items of itemize and enumerate progressively.
\begin{itemize}
\item<1-> Property 1
\item<2-> Property 2
\item<3-> Property 3
\end{itemize}
gives
Property 1
Property 2

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
We can show the items of itemize and enumerate progressively.
\begin{itemize}
\item<1-> Property 1
\item<2-> Property 2
\item<3-> Property 3
\end{itemize}
gives
Property 1
Property 2
Property 3

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Animation in presentations

We get the same result using


\begin{itemize}[<+->]
\item Property 1
\item Property 2
\item Property 3
\end{itemize}

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
With the following instruction we can emphasize the actual item
\begin{itemize}[<+-|alert@+>]
\item Property 1
\item Property 2
\item Property 3
\end{itemize}
gives
Property 1

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
With the following instruction we can emphasize the actual item
\begin{itemize}[<+-|alert@+>]
\item Property 1
\item Property 2
\item Property 3
\end{itemize}
gives
Property 1
Property 2

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
With the following instruction we can emphasize the actual item
\begin{itemize}[<+-|alert@+>]
\item Property 1
\item Property 2
\item Property 3
\end{itemize}
gives
Property 1
Property 2
Property 3

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
With the following instruction we can give other formats to the
actual item
\begin{itemize}
\item<1-> \textbf{Property 1}
\item<2-> \textcolor{green}{Property 2}
\item<3-> \textbf{\textcolor{blue}{Property 3}}
\end{itemize}
gives
Property 1

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
With the following instruction we can give other formats to the
actual item
\begin{itemize}
\item<1-> \textbf{Property 1}
\item<2-> \textcolor{green}{Property 2}
\item<3-> \textbf{\textcolor{blue}{Property 3}}
\end{itemize}
gives
Property 1
Property 2

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations
With the following instruction we can give other formats to the
actual item
\begin{itemize}
\item<1-> \textbf{Property 1}
\item<2-> \textcolor{green}{Property 2}
\item<3-> \textbf{\textcolor{blue}{Property 3}}
\end{itemize}
gives
Property 1
Property 2
Property 3
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Animation in presentations

Homework: Elaborate a presentation with animation and figures!

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Writing books with

When the document we wanto to create is quite large (book, thesis), we can divide it in separate chapters. This way, we can work
individually on each chapter and save time in compilation process.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

Writing books with


The basic components of a book include
Title page: title, authors, dedicatory, editorial information,
among others.
Preface
Table of contents
Chapters
Possible apprendix
Bibliography
List of figures
List of tables
Subject index
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

and software

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Writing books with


We need a main .tex file with
\documentclass[options]{book} where we include all
parts of the book. In this file we compile the book.
Parts as title page, preface and chapters are included in the
document using \include{portada},\include{preface},
\include{Chapter}. At the beginning of the document, use
\chapter{name} and then just write the text without
\bocumentclass, \begin{document}.
Other parts can be included by \tableofcontents,
\bibliography{ref}, \listoffigures, \listoftables
and \printindex.
In order to create the subject index, we use
\index{Intervalo de confianza!bilateral} throughout
the document.
Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Poster

Conference poster are used to exhibit investigation results in


academic events.
Usually the poster is printed in paper bigger than letter paper,
such as A3.
Multiple columns are used to improve the appearence.
We use a small amount of text and more figures, tables and
equations to attact attention.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Poster

Use
\usepackage[a3paper,landscape,centering]{geometry}
to establish A3 as the paper size and orizontal orientation.
Use \begin{minipage} to insert the title of the poster.
Use another \begin{minipage} to insert the authors
information.
Use \begin{multicols}{3} to divide the mai text in 3
columns.
Visit http://www.latextemplates.com/cat/conference-posters for various poster templates.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

Computational codes in La Tex

In statistical articles, is common to include computational


codes in the document.
We need to distinguish between the font for the code and the
text.
When the code is not too long such as softwares names,
package, functions, we use \verb .
When the codes are too long, we use the verbatim
environment.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

knitr package in R

With the knitr package we can produce easily pdf document with
our codes and graphs in R.
We use Rstudio to ilustrate the usage.
First, we install and call the knitr package.
In the option Tools, Global options, choose the options
for Sweave and specify knitr for Weave Rnw files using.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Intro

Basics

Lists

Equations

Tables

Figures in LATEX

Bibliographic standards

beamer

and software

To write a new document, just choose New file and


R Sweave.
Create your tex document as usual
The R codes should be between <<>>= and @.
To create the pdf document, choose Compile PDF and see
how knitr convert your codes in wonderful outputs.

Andr
es Guti
errez - Hanwen Zhang

A not so short introduction to LATEX

Das könnte Ihnen auch gefallen