| 1 |
\usepackage{tcolorbox} |
| 2 |
\tcbuselibrary{listings,breakable} |
| 3 |
%\tcbuselibrary{documentation} |
| 4 |
\usepackage{enumitem} |
| 5 |
\usepackage[tikz]{bclogo} |
| 6 |
\usepackage{mflogo} |
| 7 |
\usepackage{hologo} |
| 8 |
\usepackage{luamplib} |
| 9 |
\mplibtextextlabel{enable} |
| 10 |
\usepackage{biblatex} |
| 11 |
\addbibresource{ctan.bib} |
| 12 |
\usepackage{wrapfig} |
| 13 |
\usepackage{accsupp} |
| 14 |
\usepackage{siunitx} |
| 15 |
\usepackage{imakeidx} |
| 16 |
%\usepackage{csquotes} |
| 17 |
\usepackage{fancyvrb,xparse,xargs} |
| 18 |
\usepackage[sfdefault]{FiraSans} |
| 19 |
\usepackage[mathrm=sym]{firamath-otf} |
| 20 |
\setmonofont{Fira Mono} |
| 21 |
%\setmonofont{FiraCode-Regular.ttf}[BoldFont= FiraCode-Bold.ttf,ItalicFont= FiraCode-RegularItalic.otf,BoldItalicFont= FiraCode-BoldItalic.otf,Ligatures={NoCommon, NoDiscretionary, NoHistoric, NoRequired, NoContextual}] |
| 22 |
|
| 23 |
\usepackage{xspace} |
| 24 |
\usepackage{animate} |
| 25 |
\newcommand{\ctan}{\textsc{ctan}} |
| 26 |
\NewDocumentCommand{\package}{ m }{% |
| 27 |
\href{https://ctan.org/pkg/#1}{#1}\xspace |
| 28 |
} |
| 29 |
|
| 30 |
\definecolor{darkred}{rgb}{0.6,0.1,0.1} |
| 31 |
\definecolor{vert}{rgb}{0.1,0.4,0.1} |
| 32 |
\definecolor{bleu}{rgb}{0.2,0.2,0.6} |
| 33 |
\definecolor{orange}{rgb}{0.6,0.4,0.} |
| 34 |
\colorlet{code}{blue!80!black} |
| 35 |
|
| 36 |
\usepackage[colorlinks=true,urlcolor=orange,linkcolor=orange,menucolor=black,citecolor=orange]{hyperref} |
| 37 |
|
| 38 |
\newcommand \file {\nolinkurl} |
| 39 |
\renewcommand \cmd {\texttt} |
| 40 |
\renewcommand \code [1] {\texorpdfstring {\texttt{\color{code}#1}} {#1}} |
| 41 |
\renewcommand*\cs [1] {\code{\textbackslash #1}} |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
\newcommand*\commande{\par\bigskip\noindent\hspace{-30pt}% |
| 46 |
\SaveVerb[aftersave={% |
| 47 |
\UseVerb{Vitem}% |
| 48 |
}% |
| 49 |
]{Vitem}% |
| 50 |
} |
| 51 |
\newcommand\vitem[1][]{\SaveVerb[% |
| 52 |
aftersave={\item[\textnormal{\UseVerb[#1]{vsave}}]}]{vsave}} |
| 53 |
\newcommand*\textme[1]{\textcolor{black}{\rmfamily\textit{#1}}} |
| 54 |
%\renewcommand*\meta[1]{% % meta |
| 55 |
% \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}} |
| 56 |
\newcommand*\optstar{% % optional star |
| 57 |
\meta{\ensuremath{*}}\xspace} |
| 58 |
\DefineShortVerb{\|} |
| 59 |
\newcommand\R{\mathbf{R}} |
| 60 |
\setlength{\fboxsep}{2pt} |
| 61 |
\fvset{% |
| 62 |
codes={\catcode`\«\active \catcode`\×\active }, |
| 63 |
defineactive={\makefancyog\makefancytimes}, |
| 64 |
formatcom=\color{darkred}, |
| 65 |
frame=single |
| 66 |
} |
| 67 |
% rendre «...» équivalent à \meta{...} |
| 68 |
{\catcode`\«\active |
| 69 |
\newcommandx\makefancyog[0][addprefix=\global]{% |
| 70 |
\def«##1»{\meta{##1}}}} |
| 71 |
% rendre × équivalent à \optstar |
| 72 |
{\catcode`\×\active |
| 73 |
\newcommandx\makefancytimes[0][addprefix=\global]{% |
| 74 |
\def×{\optstar{}}}} |
| 75 |
|
| 76 |
|
| 77 |
\newcommand\mpneural{\texttt{mp-neuralnetwork}\xspace} |
| 78 |
\usepackage{fetamont} |
| 79 |
\def\MO/{\textffm{META\-OBJ}} |
| 80 |
|
| 81 |
%\addbibresource{biblio.bib} |
| 82 |
|
| 83 |
|
| 84 |
\lstset{ |
| 85 |
numberstyle=\footnotesize\color{vert}, |
| 86 |
keywordstyle=\ttfamily\bfseries\color{bleu}, |
| 87 |
basicstyle=\ttfamily, |
| 88 |
commentstyle=\itshape\color{vert}, |
| 89 |
stringstyle=\ttfamily\color{orange}, |
| 90 |
showstringspaces=false, |
| 91 |
language=MetaPost, |
| 92 |
breaklines=true, |
| 93 |
breakindent=30pt, |
| 94 |
defaultdialect=MetaPost, |
| 95 |
classoffset=1,% frame=tb |
| 96 |
morekeywords={colored_layers, |
| 97 |
print_weights, |
| 98 |
drawANN, |
| 99 |
set_connection_color, |
| 100 |
set_hidden_legend, |
| 101 |
set_hspace, |
| 102 |
set_input_legend, |
| 103 |
set_layer_colors, |
| 104 |
set_output_legend, |
| 105 |
set_vspace, |
| 106 |
set_weights_notation, |
| 107 |
show_node_labels, |
| 108 |
framed_hidden, |
| 109 |
framed_input, |
| 110 |
framed_output, |
| 111 |
labelANN, |
| 112 |
mpneural_init_values, |
| 113 |
print_legends, }, |
| 114 |
keywordstyle=\color{darkred}, |
| 115 |
classoffset=2,% frame=tb |
| 116 |
morekeywords={}, |
| 117 |
keywordstyle=\color{vert}, |
| 118 |
classoffset=0,% frame=tb |
| 119 |
morekeywords={ncline}, |
| 120 |
keywordstyle=\color{bleu} |
| 121 |
} |
| 122 |
|
| 123 |
|
| 124 |
\extractcolorspecs{darkred!3}\modelcmd\colorcmd |
| 125 |
\makeatletter |
| 126 |
\tcbset{% |
| 127 |
listing metapost/.code={% |
| 128 |
\def\tcbuselistingtext@input{\begin{mplibcode}[mpneural] verbatimtex |
| 129 |
\leavevmode etex;input mp-neuralnetwork;mpneural_init_values;background:=(\colorcmd); input \jobname.listing; |
| 130 |
\end{mplibcode}}% |
| 131 |
} |
| 132 |
} |
| 133 |
\makeatother |
| 134 |
\newtcblisting[auto counter,]{ExempleMP}[1][]{% |
| 135 |
arc=0pt,outer arc=0pt, |
| 136 |
colback=darkred!3, |
| 137 |
colframe=darkred, |
| 138 |
breakable,fontupper=\small, |
| 139 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 140 |
3pt, toptitle=3pt, |
| 141 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 142 |
0pt, bottomrule at break = 0pt, |
| 143 |
%listing side text, |
| 144 |
listing metapost, |
| 145 |
title=Exemple~\thetcbcounter, |
| 146 |
listing options={breaklines},#1 |
| 147 |
} |
| 148 |
|
| 149 |
\newtcblisting{commandshell}{colback=black,colupper=white,colframe=black, |
| 150 |
arc=0pt, |
| 151 |
listing only,boxsep=0pt,listing |
| 152 |
options={style=tcblatex,language=sh}, |
| 153 |
every listing line={\BeginAccSupp{ActualText={}}\textcolor{red}{\small\ttfamily\bfseries user \$> }}\EndAccSupp{}} |
| 154 |
|
| 155 |
|
| 156 |
\newtcblisting{mpcode}[1][]{ |
| 157 |
arc=0pt,outer arc=0pt, |
| 158 |
colback=darkred!3, |
| 159 |
colframe=darkred, |
| 160 |
breakable, |
| 161 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 162 |
3pt, toptitle=3pt, |
| 163 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 164 |
0pt, bottomrule at break = 0pt, |
| 165 |
listing only,boxsep=0pt,listing |
| 166 |
options={breaklines},#1 |
| 167 |
} |
| 168 |
|
| 169 |
\newtcblisting{latexcode}{ |
| 170 |
arc=0pt,outer arc=0pt, |
| 171 |
colback=darkred!3, |
| 172 |
colframe=darkred, |
| 173 |
breakable, |
| 174 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 175 |
3pt, toptitle=3pt, |
| 176 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 177 |
0pt, bottomrule at break = 0pt, |
| 178 |
listing only,boxsep=0pt,listing |
| 179 |
options={breaklines,language={[LaTeX]TeX}} |
| 180 |
} |
| 181 |
|
| 182 |
|
| 183 |
\newcommand\pdf{\textsc{pdf}} |
| 184 |
|
| 185 |
\usepackage{array,booktabs} |
| 186 |
\usepackage{collcell} |
| 187 |
|
| 188 |
\newcolumntype{H}{>{\collectcell\lstinline}l<{\endcollectcell}} |