Cours LaTeX IN ENGLISH
Cours LaTeX IN ENGLISH
Cours LaTeX IN ENGLISH
26/11/2023 1
Latex
26/11/2023 3
Latex
Source code.tex Document . dvi
Ps2pdf
26/11/2023 4
• A distribution contains useful programs
(compilers, converters, etc.) and packages.
• An editor allows you to write documents.
26/11/2023 5
Export format
• dvi .
• PS.
• Pdf .
• xml, html ……
26/11/2023 6
Beginning and end of document
Tag
• Marking the beginning and end of the
document is mandatory.
• \begin{document}
• \end{document}
26/11/2023 7
Basic structure of a document
• The document is divided into two parts:
• Header and Body .
\ documentclass {article}
\ begin {document}
Text
\end {document}
26/11/2023 8
First LaTex document
1. Save .tex file
2. At least
\documentclass {article}
\begin {document}
Text
\end {document}
3. We have to compile it
26/11/2023 9
Extensions
Syntax
• \ usepackage [options]{extension}
26/11/2023 10
• The addition of extensions is necessary, they
allow for example to have a document entirely
in French.
Syntax:
\ usepackage [ frenchb ] { babel }
26/11/2023 11
Text Format
• \ textit {italic}
• \ textbf {bold}
• \ textsc {small cap}
26/11/2023 12
Title of a document
• The main title usually has three fields: the
title, the author and the date.
• It is prepared in the header and placed in the
body of the document.
26/11/2023 13
Title, subtitles and structuring
26/11/2023 14
Table of contents
• Just insert the command \ tableofcontents at
the desired location in the document.
26/11/2023 15
Simple list
\ begin { itemize }
\item Chapter 01
\item chapter 02
\item chapter 03
\end { itemize }
• Chapter 01
• Chapter 02
• Chapter 03
26/11/2023 16
Enumerated list
\ begin { enumerate }
\item Chapter 01
\item chapter 02
\item chapter 03
\end { enumerate }
1. Chapter 01
2. Chapter 02
3. Chapter 03
26/11/2023 17
List with keywords
\ begin {description}
\item [Director] Mr….
\item [Deputy Director] Mr …..
\end{description}
26/11/2023 18
Combinations of lists
• Sub levels available:
• It is possible to combine several types of lists.
• Just enshrine them.
• This process works in principle up to 04 levels.
26/11/2023 19
Line and page breaks
• \ newline
• \ newpage
26/11/2023 20
• You have to define the different parts of the
document and the style depends on the
document class.
\part{….}
\chapter {….}
\section{…..} ; \subsection{…….}
\paragraph{……} ; \subparagraph{….}
26/11/2023 21
Syntax arrays
The basic environment for tables in LaTeX is
tabular , it takes a required argument that
specifies the number of columns in the table:
\ begin { tabular }[options]{columns}
Text
\end { tabular }
26/11/2023 22
<columns> argument is a sequence of characters which can be:
• an l for a left-aligned column ( left ) ;
• an r for a column aligned to the right (right) ;
• a c for a centered column .
• a p{ width } for a column with a block paragraph (i.e. justified, but
without an indent); the width is indicated in the usual way, for
example p{3cm} or p{10em }.
If you want to separate the columns by vertical lines (lines), you will
add tubes | at the desired location in the environment argument.
You can also add horizontal lines with the command \ hline
26/11/2023 23
26/11/2023 24
Merge Columns
To merge columns, we use the \multicolumn
statement . This is placed where the first of the
merged cells is. Its syntax is:
\multicolumn {<number>}{<column>}{<text>}
26/11/2023 25
Example
26/11/2023 26
Merge Rows
If you want to merge the rows, you have to use
the multirow extension , and therefore add
\ usepackage { multirow } in the preamble. This
then provides the command required to wrap
lines:
\ multirow { row_number }{ width }{ content }
26/11/2023 27
Example
26/11/2023 28