-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
266 lines (186 loc) · 5.57 KB
/
main.tex
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
\documentclass[12pt,french]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Layout
\usepackage[a4paper, portrait, margin=2cm]{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}
% French encoding
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[
left = \flqq~,
right = ~\frqq,
leftsub = \flqq,
rightsub = \frqq
]{dirtytalk}
% Captions, Figures, Tables & Listings/Codes
\usepackage[font=small]{caption}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[edges]{forest}
\usepackage{array}
\usepackage{tabularx}
\usepackage{makecell}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{listings}
\usepackage[cache=false, newfloat]{minted}
% Other stuff
\usepackage{color}
\usepackage{multicol}
% ToC Stuff
\usepackage{titlesec}
\usepackage[nottoc,notbib]{tocbibind}
\usepackage{imakeidx}
\usepackage[toc,page]{appendix}
\usepackage{hyperref} % Should be last imported!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Colors & stuff
\definecolor{warning}{RGB}{204, 0, 0}
\definecolor{note}{RGB}{5, 94, 153}
\definecolor{ilink}{RGB}{78,126,144}
\definecolor{elink}{RGB}{85,0,255}
\definecolor{dirblue2}{RGB}{92,144,192}
\definecolor{dirblue3}{RGB}{125,191,92}
\definecolor{dirblue4}{RGB}{92,191,158}
\hypersetup{
colorlinks=true,
linkcolor=ilink,
filecolor=elink,
urlcolor=elink,
}
\newcommand{\email}[1]{\href{mailto:#1}{\nolinkurl{#1}}}
\newcommand{\cmdref}[1]{\hyperref[cmd:#1]{\texttt{#1}}}
\newcommand{\warning}[1]{\textbf{\textcolor{warning}{#1}}}
\newcommand{\note}[1]{\textbf{\textcolor{note}{#1}}}
\newcommand{\utfcode}[1]{\small{\texttt{\textbf{[U+#1]}}}}
\renewcommand{\tilde}{\raise.17ex\hbox{$\scriptstyle\mathtt{\sim}$}}
\setminted{
frame=single,
fontsize=\footnotesize,
linenos=true,
style=tango,
stripnl=true,
tabsize=4
}
\makeindex[columns=3, title=Liste des commandes, intoc,
options= -s index/idx.ist]
\newcommand{\command}[1]{%
\label{cmd:#1}%
\index{\texttt{#1}}
}
\renewcommand{\listfigurename}{Liste des figures}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Tables
\SetupFloatingEnvironment{table}{name=Tableau}
\newcommand\nocell[1]{
\multicolumn{#1}{c}{}\\[-2ex]\hline
}
\renewcommand{\tabularxcolumn}[1]{m{#1}}
% Column types for header/footer
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% New environments
\renewcommand{\lstlistlistingname}{Liste des codes}
\newenvironment{code}{\captionsetup{type=listing}}{}
\SetupFloatingEnvironment{listing}{name=Code}
\makeatother
\newenvironment{nscenter}
{\parskip=0pt\par\nopagebreak\centering}
{\par\noindent\ignorespacesafterend}
\newenvironment{boxed}
{\begin{nscenter}\begin{tabular}{|p{.95\textwidth}|}\hline \\}
{\\\hline\end{tabular}\end{nscenter}}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Variables
\def\Title{SHELL}
\def\LongTitle{Prise en main de GNU/Linux et de Bash}
\def\Author{Benjamin SÉGAULT}
\def\AuthorEmail{\email{benjamin.segault@telecomnancy.net}}
\def\AuthorSource{\href{https://github.com/bsegault/linux-shell}{\raisebox{-0.2\height}{ \includegraphics[height=0.8\baselineskip]{res/GitHub-Mark.pdf}} \texttt{github.com/bsegault/linux-shell}}}
\def\Date{Juillet 2019}
\def\Module{Module Shell}
\def\Context{TELECOM Nancy 1A}
\def\Version{v2.0.0}
\title{%
\Title{} - \LongTitle{} \\
\large}
\author{\Author{}}
\date{\Date{}}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title - Cover
\input{cover/cover.tex}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ToC
\setlength{\parskip}{0.3em}
\setcounter{tocdepth}{3}
\tableofcontents
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Non title or ToC configuration
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.15}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\footnotesize\nouppercase{\rightmark}}
\fancyhead[R]{\footnotesize\nouppercase{\Title{} - \LongTitle{}}}
\fancyfoot[R]{\footnotesize\thepage/\pageref*{end}}
\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{}{0em}{}
\titlespacing{\paragraph}{15pt}{-5pt}{-12pt}
\titlespacing*{\subsubsection}{0pt}{1ex plus 0ex minus 1ex}{-.5ex plus .1ex minus .5ex}
\fancyfoot[R]{}
\input{sections/0_intro.tex}
\newpage
\fancyfoot[R]{\footnotesize\thepage/\pageref*{end}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/1_gnu_linux.tex}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/2_system_usage.tex}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/3_discover_bash.tex}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/4_programming.tex}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/5_regex.tex}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/6_advanced.tex}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{sections/7_ssh.tex}
\paragraph{}\label{end} % Hack to have last content page number
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{Roman}
\fancyhf{}
\fancyhead[L]{\footnotesize\nouppercase{Index}}
\fancyhead[R]{\footnotesize\nouppercase{\Title{} - \LongTitle{}}}
\fancyfoot[R]{\footnotesize\thepage}
\input{index/index.tex}
\newpage
\appendix
\pagenumbering{Alph}
\fancyhf{}
\fancyhead[L]{\footnotesize\nouppercase{Annexes}}
\fancyhead[R]{\footnotesize\nouppercase{\Title{} - \LongTitle{}}}
\fancyfoot[R]{\footnotesize\thepage}
\input{appendix/A_shortcuts.tex}
\newpage
\input{appendix/B_nano.tex}
\newpage
\input{appendix/C_vim.tex}
\newpage
\input{appendix/D_emacs.tex}
\newpage
\end{document}