c66db97408bc2ab2ae4663549187269db6e78487
[gapil.git] / gapil.tex
1 %% gapil.tex
2 %%
3 %% Copyright (C) 2000-2018 Simone Piccardi.  Permission is granted to
4 %% copy, distribute and/or modify this document under the terms of the GNU Free
5 %% Documentation License, Version 1.3 or any later version published by the
6 %% Free Software Foundation; with the Invariant Sections being "Un preambolo",
7 %% with no Front-Cover Texts, and with no Back-Cover Texts.  A copy of the
8 %% license is included in the section entitled "GNU Free Documentation
9 %% License".
10 %%
11 %% GaPiL : Guida alla Programmazione in Linux
12 %%
13 %% S. Piccardi Oct. 2000
14 %% 
15 %% gapil.tex: file principale, gli altri vanno inclusi da questo.
16 %%
17 \documentclass[10pt,twoside]{book}
18 \usepackage[paperwidth=18.91cm,paperheight=24.589cm,
19 inner=2.5cm,outer=1.8cm,bottom=3.3cm,top=2.3cm]{geometry}
20
21 % encodings
22 \usepackage[T1]{fontenc}
23 \usepackage[utf8]{inputenc}
24 \usepackage{ae,aecompl}
25
26 %
27 % New header style
28 %
29 \usepackage{fancyhdr}
30 \pagestyle{fancy}
31 \fancyhf{}
32 \fancyhead[RE]{\slshape \rightmark}
33 \fancyhead[RO,LE]{\thepage}
34 \fancyhead[LO]{\slshape \leftmark}
35
36 \renewcommand{\chaptermark}[1]{% 
37 \markboth{\thechapter.% 
38 \ #1}{}} 
39
40 \renewcommand{\sectionmark}[1]{% 
41 \markright{\ \thesection% 
42 \ #1}{}}
43
44
45 % more fonts
46 \usepackage{inconsolata}
47
48 % fancy verbatim
49 \usepackage{fancyvrb}
50 \DefineVerbatimEnvironment{Example}{Verbatim}
51 {xleftmargin=1cm,xrightmargin=1cm}
52
53 \DefineVerbatimEnvironment{FileExample}{Verbatim}
54 {frame=lines,framerule=0.5mm,framesep=2mm,xleftmargin=1cm,xrightmargin=1cm,fontsize=\footnotesize}
55
56 \DefineVerbatimEnvironment{Terminal}{Verbatim}
57 {xleftmargin=\parindent,xrightmargin=\parindent,fontsize=\footnotesize}
58
59 \DefineVerbatimEnvironment{Command}{Verbatim}
60 {xleftmargin=\parindent,xrightmargin=\parindent,fontseries=b,
61 fontsize=\footnotesize}
62
63 \DefineVerbatimEnvironment{Console}{Verbatim}
64 {commandchars=\\\{\},xleftmargin=\parindent,xrightmargin=\parindent,fontsize=\footnotesize}
65
66
67 \usepackage[bookmarks=true,plainpages=false,pdfpagelabels,
68 hyperfootnotes=false]{hyperref}
69
70 \usepackage{makeidx}
71 \usepackage{pst-node}
72 \usepackage{eso-pic}
73 \usepackage{graphicx}
74 \usepackage[italian]{babel}
75 \usepackage{cite}
76 \usepackage{amsmath}
77 \usepackage{amsfonts}
78 \usepackage[hang,bf,footnotesize,it]{caption}
79 \usepackage{listings}
80 \lstloadlanguages{C++}
81 \usepackage{color} 
82
83 \providecommand{\defaultdesc}{%
84 \desclabelstyle{\pushlabel}%
85 \renewcommand{\makelabel}[1]{##1}%
86 \setlength{\labelwidth}{0pt}%
87 }
88 \usepackage{mdwlist}
89
90 \usepackage{boxedminipage}
91 \usepackage{multirow}
92 \usepackage{longtable}
93 \usepackage{varwidth}
94 %\usepackage{footnote} 
95 %\usepackage{mdwtab} 
96
97 \usepackage{tikz}
98 \usetikzlibrary{shapes}
99
100 \frenchspacing
101
102 %\includeonly{macro,pref,intro,fdl}
103
104 \title{\Huge \textbf{\textsl{G}a\textsl{P}i\textsl{L}}\\
105 \huge Guida alla Programmazione in Linux} 
106
107 \author{Simone Piccardi}
108
109 \makeindex
110
111 % Solo prima parte, scommentare 
112 % \includeonly{macro,preambolo,pref,intro,process,prochand,filedir,
113 %   fileunix,filestd,system,signal,session,fileadv,ipc,errors,
114 %   ringraziamenti,fdl}
115
116 % Solo seconda parte e appendici, scommentare
117 %\includeonly{macro,preambolo,network,socket,tcpsock,sockctrl,othersock,
118 %  sockadv,netlayer,trasplayer,errors,ringraziamenti,fdl}
119
120 \begin{document}
121
122 \frontmatter
123
124 \maketitle
125
126 \newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}
127 \cleardoublepage}}
128
129 \begin{quote}
130   
131   Copyright \copyright\ 2000-2018 Simone Piccardi.  Permission is granted to
132   copy, distribute and/or modify this document under the terms of the GNU Free
133   Documentation License, Version 1.3 or any later version published by the
134   Free Software Foundation; with the Invariant Sections being ``Un preambolo''
135   in ``Prefazione'', with no Front-Cover Texts, and with no Back-Cover Texts.
136   A copy of the license is included in the section entitled ``GNU Free
137   Documentation License''.
138
139 \end{quote}
140 \clearemptydoublepage
141
142 %\ifx\hcode\undefined\else
143 \tableofcontents
144 %\fi
145
146 \clearemptydoublepage
147 \include{macro}
148 \include{preambolo}
149 \include{pref}
150 \clearemptydoublepage
151 \mainmatter
152
153 \lstset{language=C++} 
154
155 \lstset{basicstyle=\small,
156   numbers=left,
157   numberstyle=\tiny,
158   stepnumber=1,
159   numbersep=2pt, 
160   frame=TB,
161   framesep=5pt,
162 %  xleftmargin=0.3cm,
163   basicstyle=\ttfamily,
164   keywordstyle=\color{blue}\ttfamily,
165   ndkeywordstyle=\color{yellow}\ttfamily,
166 %  rdkeywordstyle=\ttfamily,
167   identifierstyle=\ttfamily,
168   commentstyle=\color{red}\ttfamily,
169   stringstyle=\color{green}\ttfamily,
170 %  texcsststyle=\ttfamily,
171   directivestyle=\color{magenta}\ttfamily
172
173
174 % distance from margins for boxedminipage
175 %\fboxsep=6pt
176
177 \part{Programmazione di sistema}
178 \label{part:progr-di-sist}
179 \include{intro}
180 \include{process}
181 \include{prochand}
182 \include{filedir}
183 \include{fileio}
184 %\include{fileunix}
185 %\include{filestd}
186 \include{system}
187 \include{signal}
188 \include{session}
189 \include{fileadv}
190 \include{ipc}
191 %\include{thread}
192
193 % Commentare sotto se si genera la prima parte
194 \part{Programmazione di rete}
195 \label{part:progr-di-rete}
196
197 \include{network}
198 \include{socket}
199 \include{tcpsock}
200 \include{sockctrl}
201 \include{othersock}
202 \include{sockadv}
203 \appendix
204
205 \part{Appendici}
206 \label{part:appendici}
207 \include{errors}
208 \include{netlayer}
209 \include{trasplayer}
210 \include{build}
211 \include{ringraziamenti}
212 \include{fdl-1.3}
213
214 % at the end put the bibliography
215 \backmatter
216 \printindex
217 %\bibliographystyle{phaip}
218 %\bibliographystyle{ieeetr}
219 \bibliographystyle{abstract}
220 \bibliography{biblio}
221
222 \end{document}