11How to compile these materials
22==============================
33
4- First, you may install the packages needed to compile the materials
5- (example on Ubuntu 22.04):
4+ First, you may install the packages needed to compile the materials.
65
6+ For example on Ubuntu 22.04:
7+
8+ ```
79sudo apt install --no-install-recommends git-core inkscape \
810texlive-latex-base texlive-latex-extra texlive-font-utils dia \
911python3-pygments texlive-fonts-recommended \
1012texlive-fonts-extra make texlive-xetex texlive-extra-utils \
1113fonts-inconsolata fonts-liberation \
1214xfonts-scalable lmodern texlive-science texlive-plain-generic \
1315texlive-lang-french ghostscript
16+ ```
17+
18+ Or on ArchLinux:
1419
15- (example on ArchLinux):
20+ ```
1621sudo pacman -S texlive-binextra texlive-fontsextra texlive-fontutils texlive-langfrench \
1722 texlive-latex texlive-latexextra texlive-latexrecommended texlive-mathscience \
1823 texlive-plaingeneric texlive-xetex git make inkscape python-pygments \
1924 ttf-inconsolata ttf-liberation ghostscript otf-latin-modern && yay -S dia-git
25+ ```
2026
2127Then, run 'make help' to see what available targets are.
2228
2329For example:
2430
25- make full-linux-kernel-bbb-slides.pdf
31+ ```
32+ make full-linux-kernel-slides.pdf
2633make full-linux-kernel-bbb-labs.pdf
34+ ```
2735
2836Compiling issues
2937================
@@ -40,63 +48,73 @@ Labs formatting guidelines
4048 * To create a new lab, the chapter must start with a 'subchapter'
4149 command, as in:
4250
51+ ```
4352\subchapter{Bootloader – U-Boot}{Objectives: Set up serial
4453 communication, compile and install the X-Loader and U-Boot
4554 bootloaders, use basic U-Boot commands, set up TFTP communication
4655 with the development workstation.}
56+ ```
4757
48- * You can use \section{} and \subsection{} to create sections in your
58+ * You can use ` \section{} ` and ` \subsection{} ` to create sections in your
4959 lab document.
5060
5161 * To add some fixed-sized font text (function names, file or
5262 directory paths, commands) inside a paragraph of normal text, use
53- the \code macro as follows:
63+ the ` \code ` macro as follows:
5464
65+ ```
5566Blabla. Look in the \code{/usr/bin} directory. Blabla.
67+ ```
5668
57- Note that the \code{} macro doesn't require escaping of $ or _
69+ Note that the ` \code{} ` macro doesn't require escaping of $ or _
5870 signs:
5971
72+ ```
6073You can look for the \code{platform_device_register()} function in the
6174\code{$HOME/linux/blabla.c} file.
75+ ```
6276
63- This macro *MUST* be used instead of {\tt }, because \code{}
77+ This macro * MUST* be used instead of ` {\tt } ` , because ` \code{} `
6478 provides proper line wrapping on dashes, slashes and so on, which
6579 helps in keeping the line of text within the width of the page.
6680
6781 Note that this macro cannot be used in section titles or chapter
68- titles. In this case {\tt } needs to be used (and inside {\tt },
69- the _ or $ signs have to be escaped).
82+ titles. In this case ` {\tt } ` needs to be used (and inside ` {\tt } ` ,
83+ the ` _ ` or ` $ ` signs have to be escaped).
7084
7185 * To add some fixed-size font text as a complete paragraph, use the
7286 'verbatim' environment:
7387
7488In order to build the kernel run:
7589
90+ ```
7691\begin{verbatim}
7792make blabla_defconfig
7893make
7994\end{verbatim}
95+ ```
8096
81- Here as well, it does not require escaping of $ or _ signs.
97+ Here as well, it does not require escaping of ` $ ` or ` _ ` signs.
8298
83- * To add URLs, use the \url{https://foobar.com} macro. This will
99+ * To add URLs, use the ` \url{https://foobar.com} ` macro. This will
84100 create a clickable link in the resulting PDF file.
85101
86102 * If needed, you can locally reduce the size of a
87- \begin{verbatim}...\end{verbatim} environment by doing:
103+ ` \begin{verbatim}...\end{verbatim} ` environment by doing:
88104
89- \small
105+ ```
106+ {\small
90107\begin{verbatim}
91108...
92109\end{verbatim}
93- \normalsize
110+ }
111+ ```
94112
95113 This must be used parsimoniously because changing the font size all
96114 the time is not very pretty. But since the verbatim environment
97115 does not do line wrapping, it may sometimes be necessary.
98116
99- Note that in addition to \small, you can also use other sizes, see
117+ Note that in addition to ` \small ` , you can also use other sizes, see
100118 https://en.wikibooks.org/wiki/LaTeX/Fonts#Built-in_sizes .
101119
102120Slides formatting guidelines
@@ -109,24 +127,24 @@ Slides formatting guidelines
109127
110128 * Every new chapter should be split in order to allow its possible use in
111129 other trainings as well. Each new file should contain only one subsection
112- and should be named <training-name>-<section-name>-<subsection-name>.tex.
113- New sections should be in a separate file named
114- <training-name>-<section-name>-title.tex. All the aggregation would be done
115- by the Makefile
130+ and should be named ` <training-name>-<section-name>-<subsection-name>.tex ` .
131+ The aggregation of all files is done by the Makefile.
116132
117133Syntax Highlighting
118134===================
119135
120136The LaTeX package minted is included to have a nice syntax
121137highlighting and advanced code formatting features. It uses pygments
122138as backend, so in order to use it, one needs to install the
123- debian/Ubuntu package python-pygments.
139+ debian/Ubuntu package ` python-pygments ` .
124140
125141A basic example for C code is:
126142
143+ ```
127144\begin{minted}{c}
128145....
129146\end{minted}
147+ ```
130148
131149Of course, it can take a lot of options that you can find in the
132150minted's documentation present at:
@@ -138,83 +156,89 @@ Emacs usage in LaTeX
138156Install the AUCTex package which contains an improved Emacs
139157environment for editing LaTeX documents:
140158
159+ ```
141160sudo apt install auctex
161+ ```
142162
143- In your ~/.emacs.el file, add the following lines:
163+ In your ` ~/.emacs.el ` file, add the following lines:
144164
165+ ```
145166(load "auctex.el" nil t t)
146167(require 'latex)
147168(add-to-list 'LaTeX-verbatim-macros-with-braces "code")
148169(add-to-list 'LaTeX-verbatim-macros-with-braces "url")
170+ ```
149171
150172The important point here is that this tells Emacs to consider the
151- \code{} and \url{} macros as a verbatim macro, so that even if special
152- characters such as $, _ or % are not escaped inside these macros,
173+ ` \code{} ` and ` \url{} ` macros as a verbatim macro, so that even if special
174+ characters such as ` $ ` , ` _ ` or ` % ` are not escaped inside these macros,
153175Emacs text colorization will not go crazy.
154176
155177Nice keyboard shortcuts with AUCTex:
156178
157- * C-c RET to insert a macro, or embed the selected text into a
158- macro. Very useful to quickly place a few words inside a \code{}
179+ * ` C-c RET ` to insert a macro, or embed the selected text into a
180+ macro. Very useful to quickly place a few words inside a ` \code{} `
159181 macro
160182
161- * C-c C-e to insert an environment, such as verbatim, or embed the
183+ * ` C-c C-e ` to insert an environment, such as ` verbatim ` , or embed the
162184 selected text into such an environment.
163185
164186Diagrams
165187========
166188
167189The recommended program to do diagrams is Dia:
168190
169- apt install dia
191+ ```
192+ apt install dia
193+ ```
170194
171- When saving a file, please make sure to unselect the " Compressed saved
172- files" option, so that the .dia files are raw XML files, and not
195+ When saving a file, please make sure to unselect the * Compressed saved
196+ files* option, so that the .dia files are raw XML files, and not
173197gzipped compressed files. Having raw XML files is much better for
174198version control, and will allow, to some extent, merging .dia diagrams
175199after conflicts.
176200
177- The fonts to be used are " Latin Modern Sans" for normal text and
178- " Inconsolata" for the code/paths.
201+ The fonts to be used are * Latin Modern Sans* for normal text and
202+ * Inconsolata* for the code/paths.
179203
180204Here are some suggested color couples you can use for the border and
181205background of boxes and other elements. Using similar colors for all
182206diagrams will make our training documents much more coherent and nice
183207to look at.
184208
185209 * Blue boxes
186- borders: #5CACFF
187- background: #ADD8E6
210+ - borders: ` #5CACFF `
211+ - background: ` #ADD8E6 `
188212
189213 * Yellowish boxes
190- borders: #D9CB2F
191- background: #FFF8A8
214+ - borders: ` #D9CB2F `
215+ - background: ` #FFF8A8 `
192216
193217 * Grey boxes
194- borders: #868686
195- background: #E5E5E5
218+ - borders: ` #868686 `
219+ - background: ` #E5E5E5 `
196220
197221 * Brownish boxes
198- borders: #A34804
199- background: #FFD192
222+ - borders: ` #A34804 `
223+ - background: ` #FFD192 `
200224
201225 * Purple boxes
202- borders: #2F004A
203- background: #EFB9FF
226+ - borders: ` #2F004A `
227+ background: ` #EFB9FF `
204228
205229 * Green boxes
206- borders: #6A8954
207- background: #C5E387
230+ - borders: ` #6A8954 `
231+ - background: ` #C5E387 `
208232
209233 * Red/pink boxes
210- borders: #CC1F1A
211- background: #FFACAC
234+ - borders: ` #CC1F1A `
235+ - background: ` #FFACAC `
212236
213237If you want to easily add all these colors to Dia, add the following
214- fragment to ~/.dia/persistence (or replace the existing
238+ fragment to ` ~/.dia/persistence ` (or replace the existing
215239role="color-menu" XML tag):
216240
217- ------------------8<-----------------8<-----------------------------
241+ ```
218242<dia:list role="color-menu">
219243 <dia:attribute name="listvalue">
220244 <dia:string>##5CACFF
@@ -233,4 +257,4 @@ role="color-menu" XML tag):
233257#FFACAC#</dia:string>
234258 </dia:attribute>
235259</dia:list>
236- ------------------8<-----------------8<-----------------------------
260+ ```
0 commit comments