This commit is contained in:
2018-10-04 22:32:37 +02:00
parent 4b53e6a1c9
commit c6deffed18
5 changed files with 261 additions and 179 deletions

View File

@@ -33,6 +33,7 @@
\RequirePackage{etoolbox}
\RequirePackage{ifluatex}
\RequirePackage{import}
\RequirePackage{lipsum}
% language
\ifluatex
@@ -103,7 +104,8 @@
\RequirePackage[dash]{dashundergaps}
\RequirePackage{comment}
\RequirePackage{caption}
\RequirePackage[outputdir=./build]{minted}
\RequirePackage{inconsolata}
\makeatletter
@@ -116,8 +118,9 @@
%
%
% \providetoggle{display}
% \toggletrue{display}
% Set the default monospaced font
\setmonofont[StylisticSet=3]{Inconsolatazi4}
%
@@ -128,7 +131,6 @@
% Tableau
% Alignment commands of the content in the column with a defined width.
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
@@ -178,10 +180,10 @@
}
}
% \keystroke{text}
% \kbd{text}
% Boxed text as a keyboard key.
% Why: menukeys and tipfr packages don't really run correctly with beamer.
\newcommand*\keystroke[1]{%
\newcommand*\kbd[1]{%
\tikz[baseline=(key.base)]
\node[%
draw,
@@ -196,6 +198,9 @@
;
}
% \getrandomletter[*]{start}{end}
% Choose a letter between start and end in the alphabetical order.
% Produce a uppercased letter when called with a star.
\NewDocumentCommand \getrandomletter { s G{1} G{26} }{%
\IfBooleanTF { #1 }{
\pgfmathrandominteger{\zzz}{#2}{#3}\csname pgffor@Alpha\endcsname{\zzz}
@@ -204,12 +209,40 @@
}
}
% \@getletter{start}{end}
% Choose a letter between start an end. The letter maybe in uppercase or in lowercase.
\NewDocumentCommand \@getletter{ G{1} G{26} }{
\pgfmathsetmacro{\random}{rnd}
\pgfmathparse{\random >= 0.5 ? "\noexpand\getrandomletter{#1}{#2}" : "\noexpand\getrandomletter*{#1}{#2}"}
\pgfmathresult
}
% NEED COMMENT
\newsavebox{\fminipagebox}
\NewDocumentEnvironment{fminipage}{m O{\fboxsep}}
{\par\kern#2\noindent\begin{lrbox}{\fminipagebox}
\begin{minipage}{#1}\ignorespaces}
{\end{minipage}\end{lrbox}%
\makebox[#1]{%
\kern\dimexpr-\fboxsep-\fboxrule\relax
\fbox{\usebox{\fminipagebox}}%
\kern\dimexpr-\fboxsep-\fboxrule\relax
}\par\kern#2
}
%
%
% MINTED
%
%
\definecolor{friendlybg}{HTML}{F0F0F0}
\newminted[python]{python}{style=bw, fontsize=\small, bgcolor=white, autogobble, frame=lines, breaklines, escapeinside=||, xleftmargin=0em, xrightmargin=0em, numbersep=.2em}
\newmintinline{python}{style=autumn, fontsize=\small, bgcolor=friendlybg, autogobble, encoding=utf8}
\renewcommand{\theFancyVerbLine}{\sffamily\black{\bfseries{\scriptsize\arabic{FancyVerbLine}}}}
%
@@ -224,6 +257,45 @@
%
%
% AMSTHM
%
%
\newtheoremstyle{exostyle1}
{\topsep}% espace avant
{\topsep}% espace apres
{}% Police utilisee par le style de thm
{}% Indentation (vide = aucune, \parindent = indentation paragraphe)
{\bfseries}% Police du titre de thm
{}% Signe de ponctuation apres le titre du thm
{\newline}% Espace apres le titre du thm (\newline = linebreak)
{\thmname{#1}\thmnumber{ #2}\thmnote{ - \normalfont{\textit{#3}}}} % composants du titre du thm : \thmname = nom, \thmnumber = numéro, \thmnote = sous-titre
\newtheoremstyle{exostyle2}
{\topsep}% espace avant
{\topsep}% espace apres
{}% Police utilisee par le style de thm
{}% Indentation (vide = aucune, \parindent = indentation paragraphe)
{\bfseries}% Police du titre de thm
{}% Signe de ponctuation apres le titre du thm
{\newline}% Espace apres le titre du thm (\newline = linebreak)
{%
\if\relax\detokenize{#3}\relax
% no optional argument
\else
\makebox[0pt][l]{\hspace{.9\textwidth}\normalfont\itshape#3}%
\fi
\thmname{#1}\thmnumber{ #2}%
}
\theoremstyle{exostyle2}
\newtheorem{exercice}{Exercice}
\newtheorem{exercice*}[exercice]{\faPencil \ Exercice}
%
%
%
% Captions