| 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 |
\usepackage[noEnd=false,]{algpseudocodex} |
| 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\wordcloudpkg{\package{wordcloud}} |
| 78 |
|
| 79 |
\def\MO/{{\fontspec{fetamont}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={draw_wordcloud,set_box_margin,set_wordcloud_scale,wordcloud_colors,wordcloud_colors_number,wordcloud_use_color,\wordcloud,\wordcloudFile,\wordcloudIgnoreWords}, |
| 97 |
keywordstyle=\color{darkred}, |
| 98 |
classoffset=2,% frame=tb |
| 99 |
morekeywords={Reds,Greens,Blues,Oranges}, |
| 100 |
keywordstyle=\color{vert}, |
| 101 |
classoffset=0,% frame=tb |
| 102 |
morekeywords={draw}, |
| 103 |
keywordstyle=\color{bleu} |
| 104 |
} |
| 105 |
|
| 106 |
|
| 107 |
\extractcolorspecs{darkred!3}\modelcmd\colorcmd |
| 108 |
\makeatletter |
| 109 |
\tcbset{% |
| 110 |
listing metapost/.code={% |
| 111 |
\def\tcbuselistingtext@input{\begin{mplibcode} verbatimtex \leavevmode etex; |
| 112 |
background:=(\colorcmd); input \jobname.listing; \end{mplibcode}}% |
| 113 |
} |
| 114 |
} |
| 115 |
\makeatother |
| 116 |
\newtcblisting[auto counter,]{ExempleMP}[1][]{% |
| 117 |
arc=0pt,outer arc=0pt, |
| 118 |
colback=darkred!3, |
| 119 |
colframe=darkred, |
| 120 |
breakable,fontupper=\small, |
| 121 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 122 |
3pt, toptitle=3pt, |
| 123 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 124 |
0pt, bottomrule at break = 0pt, |
| 125 |
%listing side text, |
| 126 |
listing metapost, |
| 127 |
title=Exemple \hologo{METAPOST}~\thetcbcounter, |
| 128 |
listing options={breaklines},#1 |
| 129 |
} |
| 130 |
|
| 131 |
\newtcblisting[auto counter,]{ExempleLaTeX}{% |
| 132 |
arc=0pt,outer arc=0pt, |
| 133 |
colback=darkred!3, |
| 134 |
colframe=darkred, |
| 135 |
breakable,fontupper=\small, |
| 136 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 137 |
3pt, toptitle=3pt, |
| 138 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 139 |
0pt, bottomrule at break = 0pt, |
| 140 |
%listing side text, |
| 141 |
title=Exemple \LaTeX~\thetcbcounter, |
| 142 |
listing options={breaklines,language={[LaTeX]TeX}, |
| 143 |
classoffset=1,% frame=tb |
| 144 |
morekeywords={\wordcloud,\wordcloudFile}, |
| 145 |
keywordstyle=\color{darkred}, |
| 146 |
classoffset=2,% frame=tb |
| 147 |
morekeywords={scale,rotate,margin,usecolor,colors}, |
| 148 |
keywordstyle=\color{vert}, |
| 149 |
classoffset=0,% frame=tb |
| 150 |
morekeywords={draw}, |
| 151 |
keywordstyle=\color{bleu} |
| 152 |
} |
| 153 |
} |
| 154 |
|
| 155 |
\newtcblisting{commandshell}{colback=black,colupper=white,colframe=black, |
| 156 |
arc=0pt, |
| 157 |
listing only,boxsep=0pt,listing |
| 158 |
options={style=tcblatex,language=sh}, |
| 159 |
every listing line={\BeginAccSupp{ActualText={}}\textcolor{red}{\small\ttfamily\bfseries user \$> }}\EndAccSupp{}} |
| 160 |
|
| 161 |
|
| 162 |
\newtcblisting{mpcode}[1][]{ |
| 163 |
arc=0pt,outer arc=0pt, |
| 164 |
colback=darkred!3, |
| 165 |
colframe=darkred, |
| 166 |
breakable, |
| 167 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 168 |
3pt, toptitle=3pt, |
| 169 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 170 |
0pt, bottomrule at break = 0pt, |
| 171 |
listing only,boxsep=0pt,listing |
| 172 |
options={breaklines},#1 |
| 173 |
} |
| 174 |
|
| 175 |
\newtcblisting{latexcode}{ |
| 176 |
arc=0pt,outer arc=0pt, |
| 177 |
colback=darkred!3, |
| 178 |
colframe=darkred, |
| 179 |
breakable, |
| 180 |
boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = |
| 181 |
3pt, toptitle=3pt, |
| 182 |
boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = |
| 183 |
0pt, bottomrule at break = 0pt, |
| 184 |
listing only,boxsep=0pt,listing |
| 185 |
options={breaklines,language={[LaTeX]TeX}, |
| 186 |
classoffset=1,% frame=tb |
| 187 |
morekeywords={\wordcloud,\wordcloudFile}, |
| 188 |
keywordstyle=\color{darkred}, |
| 189 |
classoffset=2,% frame=tb |
| 190 |
morekeywords={scale,rotate,margin,usecolor,colors}, |
| 191 |
keywordstyle=\color{vert}, |
| 192 |
classoffset=0,% frame=tb |
| 193 |
morekeywords={draw}, |
| 194 |
keywordstyle=\color{bleu}} |
| 195 |
} |
| 196 |
|
| 197 |
|
| 198 |
\newcommand\pdf{\textsc{pdf}} |
| 199 |
|
| 200 |
\usepackage{array,booktabs} |
| 201 |
\usepackage{collcell} |
| 202 |
|
| 203 |
\newcolumntype{H}{>{\collectcell\lstinline}l<{\endcollectcell}} |
| 204 |
|
| 205 |
\NewDocumentEnvironment{remark}{o}{ |
| 206 |
\tcbset{% |
| 207 |
arc=0pt,outer arc=0pt,colback=black!10,colframe=black, |
| 208 |
boxsep=0pt,left=10pt,right=10pt,top=8pt,bottom=10pt, bottomtitle = 3pt, toptitle=3pt, |
| 209 |
boxrule=0pt |
| 210 |
} |
| 211 |
\smallskip |
| 212 |
\begin{tcolorbox}[fonttitle=\bfseries,title={Remark \IfNoValueF{#1}{(#1)}}]}% |
| 213 |
{\end{tcolorbox}\medskip |
| 214 |
} |