|
| 1 | +% |
| 2 | +% A compiler avec xelatex ! |
| 3 | +% xelatex -output-driver="xdvipdfmx" python_cover4.tex |
| 4 | +% |
| 5 | +\documentclass[tikz,border=0mm]{standalone} |
| 6 | +\usetikzlibrary{calc} |
| 7 | +% ===================================================== |
| 8 | +% For the Python logo (that was in SVG) |
| 9 | +% ===================================================== |
| 10 | +\usetikzlibrary{svg.path} |
| 11 | +% ===================================================== |
| 12 | +% For the Hilbert curve |
| 13 | +% ===================================================== |
| 14 | +\usetikzlibrary{shadings,lindenmayersystems} |
| 15 | +\pgfdeclarelindenmayersystem{Hilbert curve}{ |
| 16 | + \rule{L -> +RF-LFL-FR+} |
| 17 | + \rule{R -> -LF+RFR+FL-}} |
| 18 | +% ===================================================== |
| 19 | +% The font |
| 20 | +% ===================================================== |
| 21 | +\usepackage{fontspec} |
| 22 | +\newfontfamily\titlefont{AlteDin1451Mittelschrift.ttf} |
| 23 | +\newfontfamily\roboto{Roboto} |
| 24 | +\setmainfont{Roboto} |
| 25 | +%\newfontfamily\authorfont{Times New Roman} |
| 26 | +%\newfontfamily\authorfont{Roboto} |
| 27 | +\newfontfamily\authorfont{AlteDin1451Mittelschrift.ttf} |
| 28 | + |
| 29 | +% ===================================================== |
| 30 | +% The colors |
| 31 | +% ===================================================== |
| 32 | +\definecolor{scratchgreen}{rgb}{.43000793,.78393555,.27934265} |
| 33 | +\definecolor{scratchviolet}{rgb}{.50601196,.10708618,.55937195} |
| 34 | + |
| 35 | +\definecolor{goldleaf}{HTML}{D1B280} |
| 36 | +% 16 Day & Night |
| 37 | +\definecolor{darknavy}{HTML}{011A27} |
| 38 | +\definecolor{blueberry}{HTML}{073852} |
| 39 | +\definecolor{tangerine}{HTML}{F0810F} |
| 40 | +\definecolor{daffodil}{HTML}{E7DF44} |
| 41 | + |
| 42 | +% Arnaud |
| 43 | +\definecolor{hazelnut}{HTML}{B99A77} |
| 44 | +\definecolor{aquablue}{HTML}{31A9B9} |
| 45 | +\definecolor{tomato}{HTML}{CF3721} |
| 46 | +\definecolor{avocado}{HTML}{258039} |
| 47 | + |
| 48 | +\definecolor{cayenne}{HTML}{AF4425} |
| 49 | +\definecolor{cinnamon}{HTML}{662E1C} |
| 50 | +\definecolor{caramel}{HTML}{C9A66B} |
| 51 | + |
| 52 | +% Style marron |
| 53 | +%\definecolor{coulfond}{HTML}{DDC5A2} |
| 54 | +%\definecolor{coulup}{HTML}{301B28} |
| 55 | +%\definecolor{couldown}{HTML}{B6452C} |
| 56 | +%\definecolor{coulreste}{HTML}{523634} |
| 57 | + |
| 58 | +% Couleur épreuve |
| 59 | +\definecolor{coulfond}{HTML}{CCCCCC} |
| 60 | +\definecolor{coulup}{HTML}{D01A55} |
| 61 | +\definecolor{couldown}{HTML}{C1D208} |
| 62 | +\definecolor{coulreste}{HTML}{666666} |
| 63 | + |
| 64 | +% Colors by function |
| 65 | +\colorlet{background}{coulfond} |
| 66 | +\tikzset{ |
| 67 | + hilbert/.style = {bottom color=black, top color=white, draw=black, opacity=.14}, |
| 68 | + spine/.style = {fill, opacity=.1} |
| 69 | +} |
| 70 | + |
| 71 | +\colorlet{author}{black} |
| 72 | + |
| 73 | +\colorlet{pythonlogoup}{coulup} |
| 74 | +\colorlet{pythonlogodown}{couldown} |
| 75 | +\colorlet{titlepython}{white} |
| 76 | +\colorlet{titleau}{coulreste} |
| 77 | +\colorlet{titlelycee}{white} |
| 78 | + |
| 79 | +\colorlet{subtitlealgo}{coulreste} |
| 80 | + |
| 81 | +\colorlet{spinepython}{coulup} |
| 82 | +\colorlet{spineau}{couldown} |
| 83 | +\colorlet{spinelycee}{coulup} |
| 84 | +\colorlet{spinealgo}{white} |
| 85 | + |
| 86 | + |
| 87 | +%======================================================= |
| 88 | +% The cover size |
| 89 | +%======================================================= |
| 90 | +% Calculate the splin |
| 91 | +\def\numPages{264} |
| 92 | +\newlength{\thickCream}\setlength{\thickCream}{0.0025 in} |
| 93 | +\newlength{\thickWhite}\setlength{\thickWhite}{0.002252 in} |
| 94 | +\newlength{\SpineW}\setlength{\SpineW}{\numPages\thickWhite} % 236*0.0025 = 0.59 (cream), 262*0.002252 = 0.590024 (white) |
| 95 | +% The standard bleed |
| 96 | +\newlength{\Bleed}\setlength{\Bleed}{.125 in} |
| 97 | +% Set the page size |
| 98 | +\newlength{\PageW}\setlength{\PageW}{7.5 in} |
| 99 | +\newlength{\PageH}\setlength{\PageH}{9.25 in} |
| 100 | +% Calculate the total dimensions |
| 101 | +\newlength{\TrimW}\setlength{\TrimW}{\dimexpr 2\PageW + \SpineW \relax} |
| 102 | +\newlength{\TrimH}\setlength{\TrimH}{\PageH} |
| 103 | +\newlength{\CropW}\setlength{\CropW}{\dimexpr \TrimW + 2\Bleed \relax} |
| 104 | +\newlength{\CropH}\setlength{\CropH}{\dimexpr \TrimH + 2\Bleed \relax} |
| 105 | +\newlength{\LineW}\setlength{\LineW}{2\Bleed} |
| 106 | +%======================================================= |
| 107 | +% Some PDF specials |
| 108 | +%======================================================= |
| 109 | +\special{pdf: docinfo << |
| 110 | +/Author (Exo7) |
| 111 | +/Title (Python au Lycée - Algorithmes et programmation) |
| 112 | +/Keywords (Python, Lycée) |
| 113 | +/Subject (manuel de programmation en Python) |
| 114 | +>>} |
| 115 | +\edef\pwpt{\the\numexpr \dimexpr0.996264009963\CropW\relax/65536 \relax} %paper width in PS points |
| 116 | +\edef\phpt{\the\numexpr \dimexpr0.996264009963\CropH\relax/65536 \relax} %paper height in PS points |
| 117 | +\expandafter\special\expandafter{pdf: put @thispage << |
| 118 | + /MediaBox [0 0 \pwpt\space\phpt] |
| 119 | + /BleedBox [0 0 \pwpt\space\phpt] |
| 120 | + /CropBox [0 0 \pwpt\space\phpt] |
| 121 | + /TrimBox [0 0 \pwpt\space\phpt]>>} |
| 122 | +%======================================================= |
| 123 | +% for test |
| 124 | +%======================================================= |
| 125 | +\usepackage{blindtext} |
| 126 | +\newif\ifshowborders\showbordersfalse % to display the security zone (Bleed) |
| 127 | +%\showborderstrue |
| 128 | + |
| 129 | +\tikzset{ |
| 130 | + frame/.style 2 args={inner sep=0, outer sep=0, minimum width=#1, minimum height=#2, node contents=} |
| 131 | +} |
| 132 | + |
| 133 | +\begin{document}% |
| 134 | + \begin{tikzpicture} |
| 135 | + % Clip |
| 136 | + \clip (-.5*\CropW,-\Bleed) rectangle +(\CropW,\CropH); |
| 137 | + % Set nodes for anchors : Cover, Back, Front and Spine |
| 138 | + \path |
| 139 | + (0,-\Bleed) node[name=Cover,above,fill=background,frame={\CropW}{\CropH}] |
| 140 | + (-\SpineW/2,0) node[name=Back,above left,frame={\PageW}{\PageH}] |
| 141 | + (\SpineW/2,0) node[name=Front,above right,frame={\PageW}{\PageH}] |
| 142 | + (0,0) node[name=Spine,above,spine,frame={\SpineW}{\PageH}]; |
| 143 | + % --------------------------------------------------- |
| 144 | + % Background |
| 145 | + % --------------------------------------------------- |
| 146 | + \def\steps{5} |
| 147 | + \shadedraw[shift={(Cover.south west)}, hilbert] |
| 148 | + [l-system={Hilbert curve, axiom=L, order=5, step={\CropW/31+.01pt}, angle=90}] |
| 149 | + lindenmayer system; |
| 150 | + % --------------------------------------------------- |
| 151 | + % Python logo and title |
| 152 | + % --------------------------------------------------- |
| 153 | + \begin{scope}[scale=0.7,transform canvas ={yshift=21mm}] |
| 154 | + \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}; |
| 155 | + \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}; |
| 156 | + % --------------------------------------------------- |
| 157 | + \path[every node/.style={scale=5, font=\titlefont, outer sep=0, inner sep=0}] |
| 158 | + (Front.center) +(21mm,21mm) node[titlepython]{PYTHON} |
| 159 | + (Front.center) +(-21mm,-21mm) node |
| 160 | + {\textcolor{titleau}{AU}\textcolor{titlelycee}{LYCÉE}}; |
| 161 | + |
| 162 | + \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}}; |
| 163 | + |
| 164 | + \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{.}}; |
| 165 | + |
| 166 | + \end{scope} |
| 167 | + % --------------------------------------------------- |
| 168 | + % Auteur |
| 169 | + % --------------------------------------------------- |
| 170 | + \path (Front.north) +(0,-21mm) node[author,text=subtitlealgo,scale=2,font=\authorfont]{\bf Arnaud Bodin}; |
| 171 | + % --------------------------------------------------- |
| 172 | + % Spine |
| 173 | + % --------------------------------------------------- |
| 174 | + \begin{scope}[transform canvas ={yshift=21mm}] |
| 175 | + \node[rotate=90,scale=1.8] (tranche) at (Spine.center) |
| 176 | + {\textcolor{spinepython}{PYTHON}\textcolor{spineau}{AU}\textcolor{spinelycee}{LYCÉE}\textcolor{spinealgo}{~~~\textemdash~~tome 1}\vphantom{\large y}}; |
| 177 | + \end{scope} |
| 178 | + % --------------------------------------------------- |
| 179 | + % Logos Exo7 |
| 180 | + % --------------------------------------------------- |
| 181 | + \path (Spine.south) +(0,14mm) node{\includegraphics[width=11mm]{exo7_logo_white}}; |
| 182 | + \path (Front.south) +(0,14mm) node{\includegraphics[width=19mm]{exo7_logo_white}}; |
| 183 | + % --------------------------------------------------- |
| 184 | + % Back |
| 185 | + % --------------------------------------------------- |
| 186 | + \path (Back.center) node[scale=1.6,text width=10.5cm,fill=white,fill opacity=.5,text opacity=.77,align = center]{ |
| 187 | + \vspace*{2ex} |
| 188 | + |
| 189 | + \footnotesize |
| 190 | + |
| 191 | + \hyphenchar\font=-1 % pas de césure |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + \emph{Python} est le langage idéal pour apprendre la programmation. |
| 196 | +C'est un langage puissant qui vous plongera dans le monde des algorithmes. |
| 197 | + |
| 198 | +\bigskip |
| 199 | + |
| 200 | +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. |
| 201 | +Vous avez tout en main pour réussir ! |
| 202 | + |
| 203 | +\bigskip |
| 204 | +\scriptsize |
| 205 | + |
| 206 | +\begin{center} |
| 207 | +\begin{minipage}{0.49\textwidth} |
| 208 | +\begin{itemize} |
| 209 | +\setlength{\itemsep}{-1pt}% |
| 210 | +\item Premiers pas |
| 211 | +\item Tortue (Scratch avec Python) |
| 212 | +\item Si ... alors ... |
| 213 | +\item Fonctions |
| 214 | +\item Arithmétique -- Boucle tant que -- I |
| 215 | +\item Chaînes de caractères% - Analyse d'un texte |
| 216 | +\item Listes I |
| 217 | +\item Statistique -- Visualisation de données |
| 218 | +\item Fichiers |
| 219 | +\item Arithmétique -- Boucle tant que -- II |
| 220 | +\item Binaire I |
| 221 | +\item Listes II |
| 222 | +\item Binaire II |
| 223 | +\end{itemize} |
| 224 | +\end{minipage} |
| 225 | +\begin{minipage}{0.49\textwidth} |
| 226 | +\begin{itemize} |
| 227 | +\setlength{\itemsep}{0pt}% |
| 228 | +\item Probabilités -- Paradoxe de Parrondo |
| 229 | +\item Chercher et remplacer |
| 230 | +\item Calculatrice polonaise -- Piles |
| 231 | +\item Visualiseur de texte -- Markdown |
| 232 | +\item L-système |
| 233 | +\item Images dynamiques |
| 234 | +\item Jeu de la vie |
| 235 | +\item Graphes et combinatoire de Ramsey |
| 236 | +\item Bitcoin |
| 237 | +\item Constructions aléatoires |
| 238 | +\end{itemize} |
| 239 | +\end{minipage} |
| 240 | +\end{center} |
| 241 | + |
| 242 | + \vspace*{3ex} |
| 243 | + |
| 244 | + }; |
| 245 | + % --------------------------------------------------- |
| 246 | + \ifshowborders |
| 247 | + % --- security zone |
| 248 | + \begin{scope}[line width=\LineW,red,opacity=.35] |
| 249 | + \draw (-.5*\TrimW,0) rectangle +(\TrimW,\TrimH); |
| 250 | + \draw (-.5*\SpineW-\Bleed/3,0) rectangle +(\SpineW+2\Bleed/3,\TrimH); |
| 251 | + \end{scope} |
| 252 | + % --- guides |
| 253 | + \begin{scope}[dashed] |
| 254 | + \draw (-.5*\TrimW,0) rectangle +(\TrimW,\TrimH); |
| 255 | + \draw (-.5*\SpineW,0) rectangle +(\SpineW,\TrimH); |
| 256 | + \end{scope} |
| 257 | + \fi |
| 258 | + \end{tikzpicture}% |
| 259 | +\end{document} |
0 commit comments