0% found this document useful (0 votes)
7 views

TP_LATEX

Uploaded by

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

TP_LATEX

Uploaded by

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

1st Year CPI-Office Automation and Web Higher School of Computer Science

of Sidi Bel Abbès (ESI-SBA)


Lab Sheet No. 4 on LATEX

Exercise 1 (Document Creation, Special Characters, Lists, ...)


1. Type the following in your LATEX editor, save the file, and compile (in TeXstudio, simply press the F5 key).
\documentclass{article}
\begin{document}
Hello World! % Here you will put your text...
\end{document}

2. Practice writing special characters (e.g., accents and structural characters). Take the following text as an
example:
The characters $, #, {, }, and & have special meanings for the LaTeX compiler.
If you want to use them in your text, you must treat them by preceding them with \.
3. Insert into the file the text and commands to obtain:

• an unordered list:
During this first training session on the LATEX software, we observed that it has
– advantages (it has many);

– disadvantages (it has few).

• an ordered list:
During this first training session on the LATEX software, we observed that it has

1. advantages (it has many);


2. disadvantages (it has few).

• a description list:
During this first training session on the LATEX software, we observed that it has
advantages (it has many);
disadvantages (it has few).

• Write the LATEX code to obtain nested lists:


Strengths and weaknesses of LATEX:
1. Advantages:
(a) Typography of the document
(b) Free and open-source software
(c) Installable on all OS:
– UNIX
– LINUX
– Windows
– MacOS
2. Disadvantages:
(a) Up to you to judge
(b) Maybe the numerous commands

4. Structure your document into sections, subsections, paragraphs, etc. And insert a table of contents.
5. Add footnotes to your document.
6. Customize the font of your text using LATEX commands to give it the desired appearance.

Exercise 2 (Insertion of Tables)


• Create the following table representations in LATEX:
Cell 1 Cell 2
Cell 3 Cell 4

Lab Sheet No. 4 on LATEX Page 1/2 October 2024


1st Year CPI-Office Automation and Web Higher School of Computer Science
of Sidi Bel Abbès (ESI-SBA)
Cells
Cell 1 Cell 2
Cell 3 Cell 4
Cells
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6
Cell 7 Cell 8 Cell 9
Cells
Cell 2 Cell 3
Cell 1
Cell 4 Cell 5
Cell 6 Cell 7 Cell 8

Exercise 3 (Mathematical Formulas)


• Write the LATEXcode to obtain the following results (including numbering):
n
X n(n + 1)
i= (1)
i=0
2
x1 − x2 2x1 − 2x2 −x21 − x1 x2 + 2x22
− = (2)
3x1 + x2 5x1 15x21 + 5x1 x2
(x − µ)2
1 −
f (x) = √ e 2σ 2 (3)
2πσ 2

f : Σ →{0, 1}
0 if w ∈
/ L, (4)
w→
1 if w ∈ L.
Exercise 4 (Graph Drawing)
The following LATEX code allows you to draw the graph shown in Figure 1. But first, you need to declare in the
preamble \usepackage{tikz} and \usetikzlibrary{automata,positioning}.
1. Type it in your LATEX editor to see the result.
\begin{tikzpicture}%
[node distance=1.5cm]
\node[state] (b) {$b$}; a
\node[state] (d) [below=of b] {$d$};
\node[state] (c) [below right=of b] {$c$}; 3 5
\node[state] (e) [above right=of c] {$e$};
\node[state,accepting] [red] (f) [below=of e] {$f$}; b e
\node[state] (a) [above right=of b] {$a$};
1
\path[->]
(b) edge[bend left] node {1} (c) 2 7
(d) edge[bend left] node {2} (b) c
(c) edge[bend left] node {} (d)
(a) edge node {3} (b) d f
edge node {5} (e)
(e) edge node {7} (f) Figure 1: An example graph
;
\end{tikzpicture}
2. Similarly, create the drawing of the following graph:
F 6
3

S 2 A 2 C 4 G
1 3 4
B 2 D
4
E

Lab Sheet No. 4 on LATEX Page 2/2 October 2024

You might also like