Hermit Notebook

LaTeX overview

Reminder: you can left-scroll and right-scroll the long math or code blocks

Introduction

LaTeX is a language and document composition system created by Leslie Lamport in 1983. It is a collection of macro commands designed to make TeX (Donald Knuth’s text processor), easier to use.

LaTeX commands have become the de facto standard for writing mathematics. It is also widely used in academia for writing scientific papers.

Find more on Wikipedia.

The following is an overview of the language for most usages. Please let me know in the comments if I missed important features 😉

LaTeX editors

  • emacs + aucTex
  • TexMaker, TexShop, etc.

Compilation

On the command line:

  • compilation: $ latex file.tex \rightarrow .dvix file
  • display the .dvi file: % xdvi file.dvi
  • Format conversion:
    • postcript: $ dvips file.dvi -o file.ps
    • pdf: $ ps2pdf file.ps file.pdf
    • html: $ latex2html file.tex

General form

LaTeX Commands: \command{parameter}[option]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\documentclass[a4paper 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\title{<document title>}
\author{<Author1> \and <Author2> ...}
\date{[<date text>]}

% this is a comment

\begin{document}
\maketitle
\tableofcontents

\begin{abstract}
<Summary>
\end{abstract}

\section{<first level title>}
\section[<Short text for TOCDM>]{<Title in document>}
\subsection{<second level title>}
\subsubsection{<title level 3 title>}
\paragraph{<highlighted text>}
\subparagraph{<highlighted text>}

\listoffigures % titled figures and tables (usingwith \caption)
\listoftables

\bibliographystyle{<style of bibliography style. example: alpha>}
\bibliography{<file.bib>}
\end{document}

common classes

  • book
  • article
  • report
  • letter
  • slides

Letter and slides differ significantly from book, article and report.

Formatting

Formatting list of authors

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\documentclass[11pt, English]{article}
\dsepackage[T1]{fontenc}
\dsepackage{babel}

\author{
LastName1, FirstName1 \\
\texttt{first1.last1@xxxxx.com}
\and
LastName2, FirstName2 \\
\texttt{first2.last2@xxxxx.com}
}
\title{Usage of the \texttt{\textbackslash author} command}

\begin{document}
\maketitle
\end{document}

Bold, italic, underline, color, alignment…

Effect Command Meaning Other / Macro
Bold \textbf{…} text big font {\bf …}
Italic \textit{…} text italic {\it …}
Underline \underline{…} underline
Color Preamble: \usepackage{xcolor}
Body of doc: \textcolor{color}{…}
background color: \colorbox{color}{…}
{\color{color} …}
Framed box \fbox{…} framed box
Alignment
WithdrawalQuote \begin{quotation} … \end{quotation}
\begin{quote} … \end{quote}
quote
Text Rotation \rotatebox{_angle _}{…}

Formatting commands

  • \\: new line (in text mode)
  • \-: hyphenation (unknown words fromin the LaTeX dictionary., e.g. rou\-tin\-quo\-facte\-pique.

Colors: xcolor module

  • Defining a color object: one of the commands
1
2
3
4
5
6
7
8
\definecolor{macolor}{rgb}{0.20,0.43,0.09} % average gremen

\definecolor{macolor}{RGB}{51,110,23} % medium green

\definecolor{macolor}{HTML}{336E17} % medium green
% uppercase letters in the HTML case

\colorlet{mycolor}{black}
  • Playing on the tones:
1
\textcolor{color1!<percentage_of_color>!color2}

color2 = white by default.

Example:

1
\textcolor{green!60!yellow}{example}

Special character

Character Escaping LaTeX usage
\ \verb<delimiter>\<delimiter> Introduces a LaTeX command
~ \verb<delimiter>\<delimiter> Non-breaking space
{ and } \{ and \} Block delimiters
% \% Commentary
$ \$ Math mode
& \& Table column delimiter
# \# Macro definition
^ \verb<delimiter>^<delimiter> Exhibitor
_ \_ Index
< and > \textless and \textgreater ?

<delimiteur> is any character exception space.

verbatim mode

Text displayed without formatting by LaTeX, with font typewriter (\tt).
\rightarrow Code display LaTeX for example.

  • online mode: \verb<delimiter><literal text><delimiter> or \verb*<delimiter><literal text><delimiter>.
    <delimiter> is any character except space.
    \verb* displays spaces in visual mode.
  • block mode (display): verbatim environment: \begin{verbatim} ...\end{verbatim}

Note:

  • \verb can not be passed as an argument to a command parameter. Unusable with \textit{} or \textbf{}for example.
  • Macros such as \it or \bf can be used to format \verb to certain extend. Example: {\it \verb-\section{<example>}-}

Tabular structures

Lists

  • Flat lists: environment itemize
1
2
3
4
5
\begin{itemize}
\item <elt>
\item <other elt>
...
\end{itemize}
  • Ordered lists: environment enumerate
    • It is necessary to declare: \usepackage{enumerate}
    • Number styles: i, I, i) a, A, 1,1)
1
2
3
4
5
6
7
8
9
\usepackage{enumerate}

...

\begin{enumerate}[style, ex: i]
\item <elt1>
\item <elt2>
...
\end{enumerate}
  • Description lists: environment description (neither bullets nor numbers)
1
2
3
4
5
\begin{description}
\item <elt: description>
\item <elt: description>
...
\end{description}

Tables

To merge cells, package multirow:

1
2
3
4
5
6
7
8
9
10
11
\usepackage{multirow}

...

\begin{tabular}[c]{|l|l|l|l|}\hline
header1 & header2 & header3 & normal line\\\hline \hline
A & \multicolumn{2}{|c|}{B} & horizontal merge (columns)\\\hline
x & \multirow{2}*{y} & z & vertical merge (lines) \\\cline{1-1}\cline{3-4}
1 & & & integrated line \\\cline{1-2}\cline{4-4}
5 & 6 & \multirow{-2}*{7} & vertical merge negative (upward)\\\hline
\end{tabular}
header1 header2 header3 normal line
A B horizontal merge (columns)
x y z vertical merge (rows)
1 7 integrated line
5 6 negative vertical merge (upward)

Explanations:

  • \begin{tabular}[c]: arguments l, c, r (alignment in a line: left, center, right). Parameter: lcr as many alignment letters as columns - vertical separator line of columns.
  • \multicolumn{2}{|c|}{B}: multicolumn parameters: number of columns, alignment, text
  • hline: horizontal line
  • cline: column line (<begin> - <end>)
  • \multirow{-2}*{7}: we can integrate a line above or below. * takes all the options of the table.

Floating objects, inserting objects

Figures

1
2
3
4
5
6
\begin{figure}[!h]
\begin{center}
\includegraphics[\width=0.1\textwidth]{myImage.jpg}
\end{center}
\caption{My beautiful image}
\end{figure}
  • Anchors can be: h, t, b,p (here, top, bottom, page).
  • ! allows you to force the position (when possible).

Floating tables

1
2
3
4
5
6
\begin{table}[anchor]
\begin{tabular}
...
\end{tabular}
\caption[<caption for TOF>]{<caption>}
\end{table}
  • Anchors can be: h, t, b,p (here, top, bottom, page).
  • ! allows you to force the position (when possible).

Inserting images

1
2
3
4
5
\usepackage{graphicx}

...

\includegraphics[\width=<value in [0,1]>\textwidth]{<file_name>}

References

Internal references

Table Of Contents - TOC

Command

1
\tableofcontent

Double compilation:

  1. first compilation: knowledge of the structure (sections, subsections, etc.)
  2. second compilation: TOC generation

Others commands

1
2
3
1.  \renewcommand{\tableofcontents}{Sommaire}
2. \setcounter{toc depth}{3}
3. \addcontentsline{toc}{section}{Glossaire}

Explanations:

  1. change the display (argument 2) of the command (argument 1)
  2. changes the depth of the CT. toc: table of contents
  3. adding additional content to the TDM. arg1: toc = table of contents, arg2: will appear as a section, arg3: text to display

Table Of Tables - TOT

Command

1
\listoftables

Do not forget the \caption[]{} in the environments table .

Table Of Figures - TOF

Command

1
\listoffigures

Do not forget the \caption[]{} in the environments figure .

Footnotes

Command

1
\footnote{<text, in general a precision for some readers>}

Internal jumps

Two commands: anchor and call. Two compilations.

  1. \label{<unique key>} just above where you want to reference (typically \section{})
  2. \ref{<unique key>} at the location where the reference is made to another part of the article.

Bibliographical references

\rightarrow Creating a bibliography file, .bib extension

Model:

1
2
3
4
5
6
7
@Inproceedings{<unique indexing key>,
author={<author1> and <author2>...},
title={<title de l'article / chapitre>},
booktitle={<type de document / livre>},
pages={<numero_page_debut> - <numero_page_fin>},
year=2002
}

Tip: To know the fields \rightarrow creation of a .bib file in auctex or bibTex, Menu “entry-types”

Commands:

Inserting a quote:

1
\cite{<indexing key>}

Generation of the list:

1
2
\bibliographystyle{<biblio. style ex: alpha>}
\bibliography{<file.bib>}

Requires 4 compilations:

  1. link creation with a bibliography file (external): Latex compiler
  2. preparation of the .bib file: bibTex compiler
  3. knowledge of the structure: Latex compiler
  4. file generation: Latex compiler

Some bibliography classes

Article:

1
2
3
4
5
6
7
8
9
10
11
12
@Manual{art:CECS,
author = {Mauro Gaio},
title = {Design and development of scientific content},
year = {2011},
organization = {University of Pau and Pays de l'Addour (UPPA)},
OPTkey = {},
OPTaddress = {},
OPTedition = {},
OPTmonth = {},
OPTnote = {},
OPTannote = {}
}

Book:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@Book{book:latex,
author = {},
editor = {},
title = {},
publisher = {},
year = {},
OPTkey = {},
OPTvolume = {},
OPTnumber = {},
OPTseries = {},
OPTaddress = {},
OPTedition = {},
OPTmonth = {},
OPTnote = {},
OPTannote = {}
}

Web site:

1
2
3
4
5
6
7
8
9
10
@Misc{web:mcclinews,
author = {},
title = {Beamer discovery},
howpublished = {\url{http://mcclinews.free.fr/latex/introbeamer.php}},
OPTkey = {},
OPTmonth = {},
OPTyear = {},
OPTnote = {},
OPTannote = {}
}

href link
hyperlink and hypertarget anchors
module hyperref

1
\hyperlink{<target>}{<clickable text>}

Appendices: appendix

Command:

1
\appendix

Tells LaTeX that we are starting the appendices.

The symbolic mode (math)

The math environments

Inline mode Display mode
$...$ $$...$$
\begin{math}...\end{math} \[...\]
\begin{displaymath}...\end{displaymath}
\begin{equation}...\end{equation}

The math environments

NB:

  • \equation numbers the different entries.
  • In inline mode, \displaystyle allows to display the formula as in display mode (no contraction of the formula).

Symbols

Operators

Analytical operators:

×\times \times %\% \% ÷\div \div \cdot \cdot
\neq \neq \leq \leq \geq \geq \gg \gg
\ll \ll \approx \approx ±\pm \pm \sim \sim
\simeq \simeq \wedge \wedge \vee \vee ¬\neg \neg
    \implies (amsmath) \implies     \iff \iff \in \in \notin \notin
\exists \exists \nexists \nexists \forall \forall \bullet \bullet
\sum \sum \prod \prod \int \int lim\lim \lim

Analytical operators

Sets

Notaions and operators on sets:

\varnothing \varnothing \emptyset \emptyset \infty \infty \complement \complement
\in \in \notin \notin \setminus \setminus \oplus \oplus
\ominus \ominus \otimes \otimes \bullet \bullet \cup \cup
\bigcup \bigcup \cap \cap \bigcap \bigcap \subset \subset
\supset \supset \subseteq \subseteq \supseteq \supseteq P(E)\mathcal{P}(E) \mathcal{P}(E)
N\mathbb{N}, Z\mathbb{Z} \mathbb{N} \bowtie \bowtie

Sets

Notes:

  • The \mathbb{N} command requires the ams font module: \usepackage{amsfont}
  • The \mathcal{P}(E) command requires the euler calligraphics module: \usepackage{eucal}

Diacritic signs (accents, parentheses)

xˊ\acute{x} \acute{x} xˋ\grave{x} \grave{x} xˉ\bar{x} \bar{x} x\vec{x} \vec{x}
xyz\overrightarrow{xyz} \overrightarrow{xyz} xyz^\widehat{xyz} \widehat{xyz} x+...+x\overbrace{x+...+x} \overbrace{x+...+x} 1,...,n\underbrace{1,...,n} \underbrace{1,...,n}
ff^\prime f^\prime {xy}\displaystyle\left\{x \atop y\right\} \left\{x \atop y\right\} {xy\displaystyle\left\{x \atop y\right. \left\{x \atop y\right. argmaxk{1,  , K}\underset{k \in \{1,\ \dots\ ,\ K\}}{\operatorname{argmax}} \underset{k \in \{1,\ \dots ,\ K\}}{\operatorname{argmax}}
X\Vert\overrightarrow{X}\Vert \Vert\overrightarrow{X}\Vert  x\vert\ x \vert \vert x \vert

Accents, parentheses

Functions

Notation, symbols and operators on the functions:

xy\frac{x}{y} \frac{x}{y} x(x+1)\sqrt{x(x+1)} \sqrt{x(x+1)} \to \to \mapsto \mapsto
\nearrow \nearrow \searrow \searrow \nwarrow \nwarrow \swarrow \swarrow
cos(x+y)\cos(x+y) \cos(x+y) sin(2α)\sin(2\alpha) \sin(2\alpha) log(n)\log(n) \log(n) ln(2x)\ln(2x) \ln(2x)

Functions

Notes:

  • \nearrow: north east arrow
  • \searrow: south east arrow
  • \nwarrow: north west arrow
  • \swarrow: south west arrow

Arrows

Arrows:

\rightarrow \rightarrow \Rightarrow \Rightarrow \leftarrow \Leftarrow \leftrightarrow \leftrightarrow
\Leftrightarrow \Leftrightarrow \uparrow \uparrow \downarrow \downarrow \updownarrow \updownarrow
\Uparrow \Uparrow \Downarrow \Downarrow \Updownarrow \Updownarrow

Arrows

Formatting

Spacing, raw text, framing

Elementary formatting:

Spacing \!, \:, \;, \(space), \quad, \qqaud
raw text \text{...}
\mbox{...}
framing \boxed{..} (inline)
\fbox{...}

Spacing, raw text, framing

NB:

  • with \mbox, you sometimes have to encapsulate the equation in $$.
  • \text vs. \mbox: \text{...} used in a product index of the text in subscript size (unlike mbox)

The array environment

example 1

1
2
3
4
5
6
\[
\left( \begin{array}{ccc}
a & b & c \\
d & e & f \\
g & h & i \end{array} \right)
\]

Result:

(abcdefghi)\left( \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right)

example 2

1
2
3
4
5
6
7
\[
\chi(\lambda) = \left| \begin{array}{ccc}
\lambda - a & -b & -c \\
-d & \lambda - e & -f \\
-g & -h & \lambda - i
\end{array} \right|.
\]

Result:

χ(λ)=λabcdλefghλi.\chi(\lambda) = \left| \begin{array}{ccc} \lambda - a & -b & -c \\ -d & \lambda - e & -f \\ -g & -h & \lambda - i \end{array} \right|.

The align environment

Note: It is not recommended to use the environment eqnarray

example:

1
2
3
4
\begin{align*} 
2x - 5y &= 8 \\
3x + 9y &= -12
\end{align*}

2x5y=83x+9y=12\begin{array}{ll} 2x - 5y &= 8 \\ 3x + 9y &= -12 \end{array}

Note: The star is used to not display equation numbers.

The theorem environment

In preamble, declare an order:

1
\newtheorem{theorem}{Théorème}
  1. First parameter: word that will be used for the command.
  2. Second parameter: title to display when creating each environment (before the number)

In the body of the document:

1
2
3
4
\begin{theorem}
Let $f$ be a function whose derivative exists in every point, then $f$
is a continuous function.
\end{theorem}

Slides with the beamer class

Beamer is based on a page environment (frame) that represents a “transparent”, which can be displayed in several stages by a succession of layers (slides).

Note: Beamer names frame what other modules name slide and slide what others call overlay.

Special features of slide documents

  • 2 hierarchical structures
    • of the whole document (summary
    • by slide (title + subtitles)
  • Each slide is understood as a paragraph (\section)
  • The default font is sans serif (unlike the article class)
  • xcolor package is built into Beamer by default

Overview

General form

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
\documentclass[t,12pt]{beamer}

% Packages for French
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\documentclass[t,12pt]{beamer}

% Packages for French
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[frenchb]{babel}

% for a readable pdf on the screen
% there are other possible choices
\usepackage{pslatex}

% for style and colors
\usetheme{Boadilla}

% for starting right away in full screen
\hypersetup{pdfpagemode=FullScreen}

% A logo
\logo{\includegraphics[height=0.5cm]{tuxwhite}}

% title page
\title{Title of the presentation}
\subtitle{Subtitle of the presentation}
\author{J. ARON}
\date{\oldstylenums{May 2007}}

\begin{document}

\frame{\titlepage}

% --------- Summary ---------
\section*{Summary} %facultatif
\begin{frame}[label=summary]
\tableofcontents[option, option, ...]
\end{frame}
% ----------------------------

\section{a section}
% the \thesection{} command gives the number of the current section,
% the \secname command gives the name of the current section

\begin{frame}[label=pagesimple]
\frametitle{Page template: normal}
\framesubtitle{subtitle}
\bigskip % large spacing
\pause[6]
% freeze the display; will start at layer 6
\end{frame}

\end{document}

Remarks:

  • \begin{frame}[label=pagesimple], the option label=\<key> has the same role as \label{<unique key>}

Beamer class options:

  • [10pt] : font size: 10pt (or smaller), 11pt (default), 12pt (or bigger)
    8pt, 9pt, 14pt, 17pt or 20pt with the extsize package.
  • [t] : vertical alignment, default centered.[t] =top, [b] =(bottom), [c] (center, by default).
    Can intervene on a single page in the \begin{frame}[t]
  • [color=list of options] : switch options to color (because automatically loaded by Beamer).
  • [xcolor\itempst] : pass options to xcolor (loaded automatically by Beamer),
    If we use \textcolor{orange}{PStricks}, we need to use [xcolor=pst] or [xcolor\itempst]depending on the version of xcolor or nothing at all with the latest version of PStricks. In case of problems, test the different solutions!
  • [hyperref=list of options] : pass options to hyperref (automatically loaded by Beamer).
    Same command \hypersetup
  • [usepdftitle=false] : deletes the title and author information from the pdf file: by default, the commands \title et \author inserts their content into the information area of the resulting pdf file. If these commands include frills (boxes or arguments), this will create problems, it is better to delete the insertion of their content in the file information.
  • [compress] : headers that take up less space.
  • [draft] : faster compilation in draft mode (headers, footers and side panel are represented by a simple gray rectangle).
  • [trans] : Removing all overlay effects or text overlay (to create transparencies quickly)
    Attention, does not seem to like the overprint environment.
    - [handout] : create a copyable version quickly. Same note for the overprint environment.
    - [ucs] : to use Unicode.
    Loads the ucs package and passes the correct Unicode options to hyperref.
    - [utf8] : same as [ucs] and also allows to encode his text in utf8 in an equivalent way to \usepackage[utf8]{inputenc}
    - [envcountsect] : numbering the theorems with respect to each section.
    - [notheorems] : no longer uses the predefined environment blocks.
    - [noamsthm] : no longer load amsthm and amsmath packages.

TOC: tableofcontents

When you have too many sections, think about doing the summary in two columns.

Options:

  • \tableofcontents[currentsection] Current section in values, the others grise light.
  • \tableofcontents[currentsubsection] Current sub-section highlighted, the others grayed.
  • \tableofcontents[firstsection=xx] Starting section of the numbering (previous negative section).
  • \tableofcontents[hideallsubsections] no longer displays subsections.
  • \tableofcontents[hideothersubsections] displays subsections only for the current section.
  • \tableofcontents[part=xx] summary of part number xx (instead of the current part).
  • \tableofcontents[pausesections] causes a \pause command before displaying each section. Allows you to present each section one by one.
  • \tableofcontents[pausesubsections] causes a \pause command before displaying each subsection, but not before sections.
  • \tableofcontents[sections=xx] summary of section number xx (title section and subsections).
  • \tableofcontents[sections={xx-yy}] only displays the summary of section xx to yy.
  • \tableofcontents[sections={xx,yy}] only displays the summary of section xx and yy.
  • Some of the commands above are shortcuts of:
    • \tableofcontents[sectionstyle=<visibility of current sec.>/<vis. others sec.>]
    • \tableofcontents[subsectionstyle=<vis. current subsection>/vis. others ss/vis. non-current ss]
    • example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
\begin{frame}{Plan : \thesection{} -  \secname}  
\tableofcontents[sectionstyle=hide/hide,subsectionstyle=show/shaded/hide ]
\end{frame}
```

**Automation**:
If summary identical throughout the slideshow, in the **preamble**:

```latex
\AtBeginSection[]{
\begin{frame}{Summary}
\small \tableofcontents[currentsection, hideothersubsections]
\end{frame}
}
```

#### Logo

examples:

```latex
\logo{\includegraphics[height=0.5cm]{tuxwhite}}

\logo{\insertframenumber/\inserttotalframenumber}
% inserts the page number on the total number of pages
```

Insert in the body of the page: command ```\insertlogo```.

#### Verbatim modes

- **containsverbatim:** `\begin{frame}[containsverbatim]`. Still works, but prefer the option `fragile`.
- **fragile:** `\begin{frame}[fragile]`

example:

```latex
\begin{frame}[fragile]
\frametitle{Diaop title}
\framesubtitle{diapo Subtitle}
Some verbatim :
\begin{verbatim}
...
\end{verbatim}
\end{frame}
```


Remarks:

- We can not put labels with these options
- with brittle options, `\end{frame}` must be alone on his line

#### Plain et frame breaks modes

**Plain:** Removing headers, footers and miscellaneous menu bars (full screen, full screen) <br> For example:

- display a (very large) image in full screen
- apply on this page a different header (drawing for example).

This does not prohibit adding a title (`\frametitle{}`) on the page.

```latex
\begin{frame}[plain]
```

**frame breaks:** Content on several pages, same title and numbering in Roman numerals.

```latex
\setbeamertemplate{frametitlecontinuation}{\insertcontinuationcount}
% number Arabic numerals (Roman numerals: \insertcontinuationcountroman)
\begin{frame}[allowframebreaks=<taux de remplissage, ex: 0.70>]
% default, <fill rate = 0.95>
% We can not indicate a label
```

#### Block environments

Element framed, with a title (in a bar). By default, text on background color (depends on the chosen theme). <br>

```latex
\begin{block}{<title>}
.
.
.
\end{block}
```

**The styles of blocks:**

`\setbeamertemplate{<hierarchy_level>}[<option1>][<option2>]`

- Standard: default
- rounded: option `\textcolor{red}{rounded}` without shadow
- rounded and shaded: options `{\color{red} rounded}` and `\textcolor{red}{shadow}`

```latex
\setbeamertemplate{blocks}[default]
\begin{block}{standard block}...\end{block}

\setbeamertemplate{blocks}[rounded][shadow=false]
\begin{block}{round block without shading}...\end{block}

\setbeamertemplate{blocks}[rounded][shadow=true]
\begin{block}{rounded and shaded block}...\end{block}
```

**The predefined block environments:**We can cite:<br>

`\begin{alertblock}, \begin{exampleblock}, \begin{definition}`...

- alertblock, exampleblock
- definition, theorem, example, proof

### Style of text

#### Block level environment

- **Quotation:**
- **Quote:**
- **Semiverbatim:** we can put some LaTeX commands
- **verse:**

example:

```latex
\begin{quotation}...\end{quotation}

Text enhancement

  • \structure{<text in relief>}
  • \alert{<highlighted elt>}

Customizing the predefined theme (overload)

  1. Setting a beamerFont object.

example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
\setbeamercolor{myAlert}{fg=blue}  
\setbeamerfont{myAlert}{size=\huge}
\setbeamerfont{myAlert}{shape=\itshape}
```

2. assigning the created object to the predefined element

```latex
\setbeamercolor{alerted text}{use=myalert, fg=myAlert.fg}
\setbeamerfont{alerted text}{parent=myAlert}
```


**NB:** `parent=myAlert`: make it inherits all the definitions of myAlert

#### Themes

Commands in the preamble. <br> The different themes are placed in the subdirectories of `\textbf{beamer/themes}`.

- theme of the whole presentation: `\usetheme{<theme name>}`. `<theme name>`: in general, city names (ex: warsaw)<br>
- theme color: `\usecolortheme[color]{structure}`<br>example: One of the commands

```latex
\usecolortheme[RGB={115,90,110}]{structure}
\usecolortheme[named=macolor]{structure}
% object color that we defined
```

- Theme font: `\usefonttheme{font theme name}`<br>
- default theme settingt. ex:
- `\useinnertheme[shadow]{rounded}`: default, rounded and shaded theme
- `\useoutertheme{infolines}`: by default, displays the status bar
- `\useoutertheme[left ou right]{sidebar}`: sidebar (by default `\usetheme{Goettingen}`)<br>The side panel is described in the file beamerouterthemesidebar.sty
- Dimensions: `\setbeamersize{sidebar right width=2.5cm}`
- Background color: `\setbeamercolor{sidebar right}{bg=color, fg=color}`


**Note:** it is possible to modify this value as of the class declaration: **obsolete**. Possible options: blue, red, brown, blackandwhite.


### Multi-column: columns environment

`columns` environment encapsulating an environment `column` for each column.<br>example of a summary:

```latex
\begin{frame}{Plan}
\begin{columns}[t]
\begin{column}{5cm}
\tableofcontents[sections={1-4},currentsection, hideothersubsections]
\end{column}
\begin{column}{5cm}
\tableofcontents[sections={5-8},currentsection,hideothersubsections]
\end{column}
\end{columns}
\end{frame}
```
**NB:** The blocks make it easier to see the columns.

### Les recouvrements

Allow to display content in place of another. Factoring content.

- **altenv:**
> `\begin{altenv}<slide number>{text before}{text after}`<br>`{other text before}{other text after}`
> It allows to insert a text before and after the contents of the environment, on the indicated layers.

```latex
\begin{altenv}<2,4,6,8>{\texttt{\textbf{***} }}%
{\texttt{ ***}}{\texttt{~~~}}{\texttt{~~~}}
\texttt{text of the environment altenv}
\end{altenv}
```

-**overprint:** `\begin{overprint}{width}` allows you to replace some of the content of the page with an other, the height of the area is adjusted to the highest necessary height.<br>

example:

```latex
\begin{overprint}
\onslide<1> ... text
\onslide<2> ...{\color{red} colored ext}
.
.
.
\end{overprint}
```

-**overlayarea:** `\begin{overlayarea}{width}{height}`
> Similar to overprint, contained in a fixed rectangular area.

```latex
\begin{overlayarea}{4cm}{3cm}
text commun
\only<1> {\color{black} <equation>}
\only<3-7> ...
.
.
.
\end{overlayarea}
```

### Listes

#### Liste style

- Flat lists: `itemize`

```latex
\setbeamertemplate{itemize item}[<style>]
\setbeamertemplate{itemize subitem}[<style>]
\setbeamertemplate{itemize subsubitem}[<style>]
% <style>: default, triangle, circle, square et ball
  • Ordered lists: enumerate
1
2
3
4
\setbeamertemplate{enumerate item}[<style>]  
\setbeamertemplate{enumerate subitem}[<style>]
\setbeamertemplate{enumerate subsubitem}[<style>]
%<style>: default, circle, square ou ball

Delayed display

Local modification of an element of the list: to dynamize the presentation (appearance / disappearance of elements of the list, colorization, etc.)
example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
\begin{itemize}  
\item<1-> the list item will appear from layer number 1.
\item<2-> \textbf<2>{the list item will appear in bold on layer 2 and then normally.}
\item<3-4> the list item will appear from layer number 2.
\end{itemize}
```

We can automate the process (LaTeX itself counts what changes):<br>
> `\begin{itemize}[<+->]`

example:

```latex
\begin{itemize}[<+->]
\item the list item will appear from layer number 1.
\item \textbf<.>{the list item will appear in bold
on layer 2 and then normally.}
\item the list item will appear from layer number 3.
\end{itemize}
```

**Note:** This type of indication can be applied to many Beamer commands :

- `\only<2>{blabla}` content only on layer 2.
- `\textbf<2>{blabla}` in bold on layer 2 only, normally after.
- `\color<2-4>[rgb]{1,0,0}{blabla}` in red from layer 2 to layer 4, normally after.
- `\item<1->blabla` will appear from layer number 1.
- `\item<2->blabla` will appear from layer 2.
- `\onslide<2->blabla` will appear from layer 2 to the end of the page.
- `\alert<3>{blabla}` in alert style on layer 3.
- `\onslide<2-3,5-7>blabla` will appear on layers 2,3,5,6,7

### Navigation

The command

```latex
\setbeamertemplate{navigation symbols}[vertical]

to put the navigation icons in vertival position.

Hypertext links can be buttons.

example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
\hyperlink{<target>}{\beamerbutton{<Button text>}}
```

Useful: this link `go back` predefined Acrobat

```latex
\Acrobatmenu{GoBack}{\beamerreturnbutton{retour}}
```

### The `canvas`

- **background color:**

```latex
\setbeamercolor{background canvas}{bg=color}
```

- \textbf{Gradient background:}

```latex
\setbeamertemplate{background canvas}[vertical shading]%
[top=color1,bottom=color2]+
```

our

```latex
\setbeamertemplate{background canvas}[vertical shading]%
[top=color1,middle=color2,midpoint=valeur,bottom=color3]
```

Back in monochrome:

```latex
\setbeamertemplate{background canvas}[default]
\setbeamercolor{background canvas}{bg=color}
```

- **Background picture:**

```latex
\setbeamertemplate{background canvas}{
\includegraphics[width=\paperwidth,height=\paperheight]{12286.jpg}}

Appendix

Concept of document

A document is ny source of information and knowledge directly available to humans.

Characteristics of a document

  • Logical structure / physical structure physical
    • Logical structure:
      • Hierarchical: titles of \neq levels, paragraph (in the logical sense = grouping of ideas).
        • Extraction of all or part of the logical structure (content + position): summary, notices, etc.
        • A too hierarchical summary is not legible: simplify the hierarchical structure (2 levels of titles).
      • Tabular: series of information of the same type and whose number is fixed.
        • Lites: flat (dashes, bullets) or sequential (numbered)
        • Figures
      • By references: structure allowing non-sequential reading. Pointer.
        • Internal references
        • Bibliographical references
        • Hypermedia
    • Physical structure: projection of the logical structure on a support (obtaining a visual)
  • Document support (paper / electronic [all symbols are numerically encoded])
  • Content type:
    • Form (text, static / dynamic image, sound, video, etc.)
    • State (static / dynamic)
  • Life cycle (end of cycle [trash], new version [correction, renewal], design, development, update ?, publication, distribution, archiving, etc.)

Some issues in creating documents

  • Creation: editor alone, several, synchronously / asynchronously, remotely, etc. (annotations, modification follow-up, writing with several hands …)
  • Publication: editorial team, moderator, validation, constraints (style sheets, editorial line)
  • Usage for scientific publications:
    • Form: text, formula, images, graphs, schemas
    • State: static .
  • \vdots

Contents

  1. 1. Introduction
    1. 1.1. LaTeX editors
  2. 2. Compilation
  3. 3. General form
    1. 3.1. common classes
  4. 4. Formatting
    1. 4.1. Formatting list of authors
    2. 4.2. Bold, italic, underline, color, alignment…
    3. 4.3. Colors: xcolor module
    4. 4.4. Special character
    5. 4.5. verbatim mode
    6. 4.6. Tabular structures
      1. 4.6.1. Lists
      2. 4.6.2. Tables
    7. 4.7. Floating objects, inserting objects
      1. 4.7.1. Figures
      2. 4.7.2. Floating tables
      3. 4.7.3. Inserting images
  5. 5. References
    1. 5.1. Internal references
      1. 5.1.1. Table Of Contents - TOC
      2. 5.1.2. Table Of Tables - TOT
      3. 5.1.3. Table Of Figures - TOF
      4. 5.1.4. Footnotes
      5. 5.1.5. Internal jumps
    2. 5.2. Bibliographical references
      1. 5.2.1. Some bibliography classes
    3. 5.3. Hyperlinks
  6. 6. Appendices: appendix
  7. 7. The symbolic mode (math)
    1. 7.1. The math environments
    2. 7.2. Symbols
      1. 7.2.1. Operators
      2. 7.2.2. Sets
      3. 7.2.3. Diacritic signs (accents, parentheses)
      4. 7.2.4. Functions
      5. 7.2.5. Arrows
    3. 7.3. Formatting
      1. 7.3.1. Spacing, raw text, framing
      2. 7.3.2. The array environment
      3. 7.3.3. The align environment
      4. 7.3.4. The theorem environment
  8. 8. Slides with the beamer class
    1. 8.1. Special features of slide documents
    2. 8.2. Overview
      1. 8.2.1. General form
      2. 8.2.2. TOC: tableofcontents
      3. 8.2.3. Text enhancement
      4. 8.2.4. Customizing the predefined theme (overload)
      5. 8.2.5. Delayed display
  9. 9. Appendix
    1. 9.1. Concept of document
    2. 9.2. Characteristics of a document
    3. 9.3. Some issues in creating documents