-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathpython_cover4.tex
More file actions
259 lines (230 loc) · 10.6 KB
/
python_cover4.tex
File metadata and controls
259 lines (230 loc) · 10.6 KB
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
%
% A compiler avec xelatex !
% xelatex -output-driver="xdvipdfmx" python_cover4.tex
%
\documentclass[tikz,border=0mm]{standalone}
\usetikzlibrary{calc}
% =====================================================
% For the Python logo (that was in SVG)
% =====================================================
\usetikzlibrary{svg.path}
% =====================================================
% For the Hilbert curve
% =====================================================
\usetikzlibrary{shadings,lindenmayersystems}
\pgfdeclarelindenmayersystem{Hilbert curve}{
\rule{L -> +RF-LFL-FR+}
\rule{R -> -LF+RFR+FL-}}
% =====================================================
% The font
% =====================================================
\usepackage{fontspec}
\newfontfamily\titlefont{AlteDin1451Mittelschrift.ttf}
\newfontfamily\roboto{Roboto}
\setmainfont{Roboto}
%\newfontfamily\authorfont{Times New Roman}
%\newfontfamily\authorfont{Roboto}
\newfontfamily\authorfont{AlteDin1451Mittelschrift.ttf}
% =====================================================
% The colors
% =====================================================
\definecolor{scratchgreen}{rgb}{.43000793,.78393555,.27934265}
\definecolor{scratchviolet}{rgb}{.50601196,.10708618,.55937195}
\definecolor{goldleaf}{HTML}{D1B280}
% 16 Day & Night
\definecolor{darknavy}{HTML}{011A27}
\definecolor{blueberry}{HTML}{073852}
\definecolor{tangerine}{HTML}{F0810F}
\definecolor{daffodil}{HTML}{E7DF44}
% Arnaud
\definecolor{hazelnut}{HTML}{B99A77}
\definecolor{aquablue}{HTML}{31A9B9}
\definecolor{tomato}{HTML}{CF3721}
\definecolor{avocado}{HTML}{258039}
\definecolor{cayenne}{HTML}{AF4425}
\definecolor{cinnamon}{HTML}{662E1C}
\definecolor{caramel}{HTML}{C9A66B}
% Style marron
%\definecolor{coulfond}{HTML}{DDC5A2}
%\definecolor{coulup}{HTML}{301B28}
%\definecolor{couldown}{HTML}{B6452C}
%\definecolor{coulreste}{HTML}{523634}
% Couleur épreuve
\definecolor{coulfond}{HTML}{CCCCCC}
\definecolor{coulup}{HTML}{D01A55}
\definecolor{couldown}{HTML}{C1D208}
\definecolor{coulreste}{HTML}{666666}
% Colors by function
\colorlet{background}{coulfond}
\tikzset{
hilbert/.style = {bottom color=black, top color=white, draw=black, opacity=.14},
spine/.style = {fill, opacity=.1}
}
\colorlet{author}{black}
\colorlet{pythonlogoup}{coulup}
\colorlet{pythonlogodown}{couldown}
\colorlet{titlepython}{white}
\colorlet{titleau}{coulreste}
\colorlet{titlelycee}{white}
\colorlet{subtitlealgo}{coulreste}
\colorlet{spinepython}{coulup}
\colorlet{spineau}{couldown}
\colorlet{spinelycee}{coulup}
\colorlet{spinealgo}{white}
%=======================================================
% The cover size
%=======================================================
% Calculate the splin
\def\numPages{274}
\newlength{\thickCream}\setlength{\thickCream}{0.0025 in}
\newlength{\thickWhite}\setlength{\thickWhite}{0.002252 in}
\newlength{\SpineW}\setlength{\SpineW}{\numPages\thickWhite} % 236*0.0025 = 0.59 (cream), 262*0.002252 = 0.590024 (white)
% The standard bleed
\newlength{\Bleed}\setlength{\Bleed}{.125 in}
% Set the page size
\newlength{\PageW}\setlength{\PageW}{7.5 in}
\newlength{\PageH}\setlength{\PageH}{9.25 in}
% Calculate the total dimensions
\newlength{\TrimW}\setlength{\TrimW}{\dimexpr 2\PageW + \SpineW \relax}
\newlength{\TrimH}\setlength{\TrimH}{\PageH}
\newlength{\CropW}\setlength{\CropW}{\dimexpr \TrimW + 2\Bleed \relax}
\newlength{\CropH}\setlength{\CropH}{\dimexpr \TrimH + 2\Bleed \relax}
\newlength{\LineW}\setlength{\LineW}{2\Bleed}
%=======================================================
% Some PDF specials
%=======================================================
\special{pdf: docinfo <<
/Author (Exo7)
/Title (Python au Lycée - Algorithmes et programmation)
/Keywords (Python, Lycée)
/Subject (manuel de programmation en Python)
>>}
\edef\pwpt{\the\numexpr \dimexpr0.996264009963\CropW\relax/65536 \relax} %paper width in PS points
\edef\phpt{\the\numexpr \dimexpr0.996264009963\CropH\relax/65536 \relax} %paper height in PS points
\expandafter\special\expandafter{pdf: put @thispage <<
/MediaBox [0 0 \pwpt\space\phpt]
/BleedBox [0 0 \pwpt\space\phpt]
/CropBox [0 0 \pwpt\space\phpt]
/TrimBox [0 0 \pwpt\space\phpt]>>}
%=======================================================
% for test
%=======================================================
\usepackage{blindtext}
\newif\ifshowborders\showbordersfalse % to display the security zone (Bleed)
%\showborderstrue
\tikzset{
frame/.style 2 args={inner sep=0, outer sep=0, minimum width=#1, minimum height=#2, node contents=}
}
\begin{document}%
\begin{tikzpicture}
% Clip
\clip (-.5*\CropW,-\Bleed) rectangle +(\CropW,\CropH);
% Set nodes for anchors : Cover, Back, Front and Spine
\path
(0,-\Bleed) node[name=Cover,above,fill=background,frame={\CropW}{\CropH}]
(-\SpineW/2,0) node[name=Back,above left,frame={\PageW}{\PageH}]
(\SpineW/2,0) node[name=Front,above right,frame={\PageW}{\PageH}]
(0,0) node[name=Spine,above,spine,frame={\SpineW}{\PageH}];
% ---------------------------------------------------
% Background
% ---------------------------------------------------
\def\steps{5}
\shadedraw[shift={(Cover.south west)}, hilbert]
[l-system={Hilbert curve, axiom=L, order=5, step={\CropW/31+.01pt}, angle=90}]
lindenmayer system;
% ---------------------------------------------------
% Python logo and title
% ---------------------------------------------------
\begin{scope}[scale=0.7,transform canvas ={yshift=21mm}]
\fill[shift={(Front.center)},pythonlogoup]svg{M 133.72 -122.51 v 52.97 c 0 41.07 -34.81 75.63 -74.52 75.63 h -119.15 c -32.64 0 -59.64 27.93 -59.64 60.61 v 113.59 c 0 32.32 28.11 51.34 59.64 60.61 c 37.76 11.1 73.96 13.12 119.15 0 c 30.03 -8.69 59.64 -26.19 59.64 -60.61 v -45.46 h -119.14 v -15.15 h 119.14 h 59.64 c 34.67 0 47.59 -24.18 59.64 -60.48 c 12.45 -37.37 11.93 -73.3 0 -121.23 c -8.57 -34.51 -24.93 -60.47 -59.64 -60.48 h -44.76 z m -67.01 287.64 c 12.37 0 22.38 10.13 22.38 22.66 c 0 12.57 -10.02 22.8 -22.38 22.8 c -12.32 0 -22.38 -10.23 -22.38 -22.8 c 0 -12.53 10.06 -22.66 22.38 -22.66 z};
\fill[shift={(Front.center)},pythonlogodown]svg{M -2.94 -250 c -20.39 .1 -39.87 1.83 -57 4.87 c -50.48 8.92 -59.64 27.58 -59.65 62.01 v 45.46 h 119.29 v 15.15 h -119.29 h -44.76 c -34.67 0 -65.02 20.84 -74.52 60.48 c -10.95 45.44 -11.44 73.79 0 121.23 c 8.48 35.31 28.73 60.47 63.4 60.48 h 41.01 v -54.51 c 0 -39.37 34.06 -74.1 74.51 -74.1 h 119.15 c 33.17 0 59.64 -27.31 59.64 -60.61 v -113.58 c 0 -32.32 -27.27 -56.61 -59.64 -62.01 c -20.49 -3.41 -41.75 -4.96 -62.14 -4.87 z m -64.51 36.57 c 12.32 0 22.38 10.23 22.38 22.8 c 0 12.53 -10.06 22.66 -22.38 22.66 c -12.37 0 -22.38 -10.13 -22.39 -22.66 c 0 -12.57 10.02 -22.8 22.39 -22.8 z};
% ---------------------------------------------------
\path[every node/.style={scale=5, font=\titlefont, outer sep=0, inner sep=0}]
(Front.center) +(21mm,21mm) node[titlepython]{PYTHON}
(Front.center) +(-21mm,-21mm) node
{\textcolor{titleau}{AU}\textcolor{titlelycee}{LYCÉE}};
\path (Cover.east) +(55mm,-125mm) node[left,scale=1.8,text width=.40\PageW,align=left,fill=white,text=subtitlealgo,inner sep=.3em,font=\authorfont,rounded corners=10pt]{\bf ~~Algorithmes et programmation~~\vphantom{\Large t}};
\path (Cover.east) +(55mm,-145mm) node[left,scale=1.8,text width=.20\PageW,align=left,fill=white,text=subtitlealgo,inner sep=.4em,font=\authorfont,rounded corners=10pt]{\bf ~~tome 1~~\vphantom{.}};
\end{scope}
% ---------------------------------------------------
% Auteur
% ---------------------------------------------------
\path (Front.north) +(0,-21mm) node[author,text=subtitlealgo,scale=2,font=\authorfont]{\bf Arnaud Bodin};
% ---------------------------------------------------
% Spine
% ---------------------------------------------------
\begin{scope}[transform canvas ={yshift=21mm}]
\node[rotate=90,scale=1.8] (tranche) at (Spine.center)
{\textcolor{spinepython}{PYTHON}\textcolor{spineau}{AU}\textcolor{spinelycee}{LYCÉE}\textcolor{spinealgo}{~~~\textemdash~~tome 1}\vphantom{\large y}};
\end{scope}
% ---------------------------------------------------
% Logos Exo7
% ---------------------------------------------------
\path (Spine.south) +(0,14mm) node{\includegraphics[width=11mm]{exo7_logo_white}};
\path (Front.south) +(0,14mm) node{\includegraphics[width=19mm]{exo7_logo_white}};
% ---------------------------------------------------
% Back
% ---------------------------------------------------
\path (Back.center) node[scale=1.6,text width=10.5cm,fill=white,fill opacity=.5,text opacity=.77,align = center]{
\vspace*{2ex}
\footnotesize
\hyphenchar\font=-1 % pas de césure
\emph{Python} est le langage idéal pour apprendre la programmation.
C'est un langage puissant qui vous plongera dans le monde des algorithmes.
\bigskip
Ce livre vous guide pas à pas à travers des activités mathématiques et informatiques originales adaptées au lycée. Il se complète par des ressources en ligne : tous les codes \emph{Python}, des vidéos et des fiches en couleurs.
Vous avez tout en main pour réussir !
\bigskip
\scriptsize
\begin{center}
\begin{minipage}{0.49\textwidth}
\begin{itemize}
\setlength{\itemsep}{-1pt}%
\item Premiers pas
\item Tortue (Scratch avec Python)
\item Si ... alors ...
\item Fonctions
\item Arithmétique -- Boucle tant que -- I
\item Chaînes de caractères% - Analyse d'un texte
\item Listes I
\item Statistique -- Visualisation de données
\item Fichiers
\item Arithmétique -- Boucle tant que -- II
\item Binaire I
\item Listes II
\item Binaire II
\end{itemize}
\end{minipage}
\begin{minipage}{0.49\textwidth}
\begin{itemize}
\setlength{\itemsep}{0pt}%
\item Probabilités -- Paradoxe de Parrondo
\item Chercher et remplacer
\item Calculatrice polonaise -- Piles
\item Visualiseur de texte -- Markdown
\item L-système
\item Images dynamiques
\item Jeu de la vie
\item Graphes et combinatoire de Ramsey
\item Bitcoin
\item Constructions aléatoires
\end{itemize}
\end{minipage}
\end{center}
\vspace*{3ex}
};
% ---------------------------------------------------
\ifshowborders
% --- security zone
\begin{scope}[line width=\LineW,red,opacity=.35]
\draw (-.5*\TrimW,0) rectangle +(\TrimW,\TrimH);
\draw (-.5*\SpineW-\Bleed/3,0) rectangle +(\SpineW+2\Bleed/3,\TrimH);
\end{scope}
% --- guides
\begin{scope}[dashed]
\draw (-.5*\TrimW,0) rectangle +(\TrimW,\TrimH);
\draw (-.5*\SpineW,0) rectangle +(\SpineW,\TrimH);
\end{scope}
\fi
\end{tikzpicture}%
\end{document}