2017-2018/tools/style/shortcuts.sty

259 lines
6.9 KiB
Plaintext
Raw Normal View History

\NeedsTeXFormat{LaTeX2e}
%%%%%%%%%%%%%%%%%
% Raccourcis %
%%%%%%%%%%%%%%%%%
% Ensembles
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
%\newcommand{\D}{\mathbb{D}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
% intervalles ouvert ouvert
\newcommand{\intOO}[2]{\left]{#1}\,{;}\,{#2}\right[}
% intervalles ouvert fermé
\newcommand{\intOF}[2]{\left]{#1}\,{;}\,{#2}\right]}
% intervalles fermé ouvert
\newcommand{\intFO}[2]{\left[{#1}\,{;}\,{#2}\right[}
% intervalles fermé fermé
\newcommand{\intFF}[2]{\left[{#1}\,{;}\,{#2}\right]}
%% Vecteurs
% représentation d'un vecteur
\renewcommand{\vec}[1]{\overrightarrow{#1}}
% Norme d'un vecteur
\newcommand{\norme}[1]{||\vec{#1}||}
% Produit scalaire
\newcommand{\scal}[2]{\vec{#1} \cdot \vec{#2}}
\newcommand{\vectCoord}[2]{%
{\renewcommand{\arraystretch}{1}%
\left(\begin{array}{c} #1 \\ #2 \end{array} \right)%
}%
}
%% Proba
\newcommand{\coefBino}[2]{\vectCoord{#1}{#2}}
%% Logique
\renewcommand{\equiv}{\Leftrightarrow}
%% Calculatrice
\usepackage{listings}
\newcommand{\calc}[1]{\Ovalbox{\lstinline|#1|}}
%\newcommand{\calc}[1]{\verb!#1!}
%% Autres
\newcommand{\TODO}[1]{\textcolor{red}{note(#1)}}
%% Poser des opérations
% \RequirePackage[letterspace=500]{microtype}
% \newcommand{\poseOP}[3]{%
% \textls{
% $\begin{array}{cr}
% & #1 \\[-0.3cm]
% #2 & #3 \\
% \hline
% &
% \end{array}$}
% }
% Icones
\newcommand{\icon}[2][scale=0.4]{%
\includegraphics[#1]{icons/#2.png}%
}
% Icones des compétences
\newcommand{\iconScale}{0.3}
\newcommand{\Cher}[1][scale=\iconScale]{%
\icon[#1]{card-pick}
}
\newcommand{\Mod}[1][scale=\iconScale]{%
\icon[#1]{processor}
}
\newcommand{\Rep}[1][scale=\iconScale]{%
\icon[#1]{chart}
}
\newcommand{\Rai}[1][scale=\iconScale]{%
\icon[#1]{brain}
%\icon[#1]{gears}
}
\newcommand{\Cal}[1][scale=\iconScale]{%
\icon[#1]{computing}
}
\newcommand{\Com}[1][scale=\iconScale]{%
\icon[#1]{conversation}
}
\newcommand{\Con}[1][scale=\iconScale]{%
\icon[#1]{book-cover}
}
2017-09-10 15:41:11 +00:00
% Pour l'évaluation par compétence
\usepackage{tikzsymbols}
\usetikzlibrary{babel}
\RequirePackage{xstring}
\newcommand{\RepLevel}[1]{%
\IfEqCase{#1}{%
{.}{\Xey[2]}%
{0}{\Changey[2]{-1}}%
{1}{\Changey[2][black!20]{0}}%
{2}{\Changey[2][black!40]{1}}%
{3}{\Cooley[2][black!60]}%
}[\PackageError{Rep}{Undefinded type of answer: #1}{}]%
}
\newcommand{\RepT}{\Cooley[2][black!70]}
\newcommand{\RepD}{\Changey[2][black!40]{1}}
\newcommand{\RepU}{\Changey[2][black!10]{0}}
\newcommand{\RepZ}{\Changey[2]{-1}}
\newcommand{\NoRep}{\Xey[2]}
2017-09-20 06:38:18 +00:00
\newcommand{\EmptySignalBar}{%
\draw (0, 0) rectangle ++(0.8, 1);
\draw (1, 0) rectangle ++(0.8, 2);
\draw (2, 0) rectangle ++(0.8, 3);
\draw (3, 0) rectangle ++(0.8, 4);
}
\newcommand{\filledSignalBar}[1]{%
\IfEqCase{#1}{%
{e}{%
}
2017-09-20 06:38:18 +00:00
{3}{%
\filldraw[fill=green] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=green] (1, 0) rectangle ++(0.8, 2);
\filldraw[fill=green] (2, 0) rectangle ++(0.8, 3);
\filldraw[fill=green] (3, 0) rectangle ++(0.8, 4);
2017-09-20 06:38:18 +00:00
}
{2}{%
\filldraw[fill=green] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=green] (1, 0) rectangle ++(0.8, 2);
\filldraw[fill=green] (2, 0) rectangle ++(0.8, 3);
2017-09-20 06:38:18 +00:00
}
{1}{%
\filldraw[fill=yellow] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=yellow] (1, 0) rectangle ++(0.8, 2);
}
{0}{%
\filldraw[fill=red] (0, 0) rectangle ++(0.8, 1);
}
}[\PackageError{Assesment}{Undefinded type of answer: #1}{}]%
}
2017-09-20 14:27:12 +00:00
\newcommand{\SignalBar}[1]{%
2017-09-20 06:38:18 +00:00
\begin{tikzpicture}[scale=0.15]
\EmptySignalBar
\filledSignalBar{#1}
\end{tikzpicture}
2017-09-20 14:27:12 +00:00
}
\newcommand{\Assesment}[1]{%
\SignalBar{#1}
\IfEqCase{#1}{%
2017-09-20 06:38:18 +00:00
{3}{%
Très bonne maîtrise%
}%
{2}{%
Maîtrise satisfaisante
}%
{1}{%
Maîtrise fragile%
}%
{0}{%
Maîtrise insufisante%
}%
}[\PackageError{Assesment}{Undefinded type of answer: #1}{}]%
}
2017-09-10 15:41:11 +00:00
\newcommand{\competencesStatement}{%
\begin{multicols}{3}
\noindent
Nom: \dotfill \\[0.5cm]
Prénom: \dotfill \\
\vfill\none
\columnbreak
\noindent
\Cher Chercher \hfill \SignalBar{e}\\
\Mod Modélser \hfill \SignalBar{e}\\
\Rep Représenter \hfill \SignalBar{e}\\
\vfill\none
\columnbreak
\noindent
\Rai Raisonner \hfill \SignalBar{e}\\
\Cal Calculer \hfill \SignalBar{e}\\
\Com Communiquer \hfill \SignalBar{e}\\
\end{multicols}
}
% ##########################
% Tikz shortcuts
% ##########################
% Les dessins
\RequirePackage{tikz}
%% le cercle trigo
\newcommand{\cercleTrigo}%
{%
\draw[->, very thick] (-1.2,0) -- (1.3, 0);
\draw[->, very thick] (0,-1.2) -- (0,1.3);
\draw[very thick] (0,0) circle (1);
\draw (0,0) node[below left] {$O$};
\draw (1,0) node[below right] {$I$};
\draw (0,1) node[above left] {$J$};
}
%% Le repère orthonormé avec la grille
%%% \repere{xmin}{xmax}{ymin}{ymax}
\newcommand{\repere}[4]%
{%
\draw[very thin, gray] (#1,#3) grid (#2,#4);
\draw[->, very thick] (#1,0) -- (#2,0);
\draw[->, very thick] (0,#3) -- (0,#4);
\draw (0,0) node[below right, scale=0.7 ] {$O$};
\draw (0,1) node {-} node[left] {$J$};
\draw (1,0) node[rotate=90] {-} node[below] {$I$};
}
\newcommand{\repereNoGrid}[4]%
{%
\draw[->, very thick] (#1,0) -- (#2,0);
\draw[->, very thick] (0,#3) -- (0,#4);
}
%% Diagramme boite
%%% \boxplot{Vertical Center}{min}{Q1}{Me}{Q3}{Max}
\newcommand{\boxplot}[6]%
{%
\filldraw[color=highlightbg, draw=text] (#3, {#1 - 0.5}) rectangle (#5, {#1 + 0.5});
\draw (#2, {#1 - 0.5}) -- (#2, {#1 + 0.5}) node[above] {$Min$};
\draw (#3, {#1 - 0.5}) -- (#3, {#1 + 0.5}) node[above] {$Q_1$};
\draw (#4, {#1 - 0.5}) -- (#4, {#1 + 0.5}) node[above] {$Me$};
\draw (#5, {#1 - 0.5}) -- (#5, {#1 + 0.5}) node[above] {$Q_3$};
\draw (#6, {#1 - 0.5}) -- (#6, {#1 + 0.5}) node[above] {$Max$};
\draw (#2, #1) -- (#3, #1);
\draw (#5, #1) -- (#6, #1);
%\draw ({(#2 +#3)/2}, #1) node[above] {25\%};
%\draw ({(#3 +#4)/2}, #1) node[above] {25\%};
%\draw ({(#4 +#5)/2}, #1) node[above] {25\%};
%\draw ({(#5 +#6)/2}, #1) node[above] {25\%};
}
\newcommand{\boxplotNoNames}[6]%
{%
\filldraw[color=highlightbg, draw=text] (#3, {#1 - 0.5}) rectangle (#5, {#1 + 0.5});
\draw (#2, {#1 - 0.5}) -- (#2, {#1 + 0.5});
\draw (#3, {#1 - 0.5}) -- (#3, {#1 + 0.5});
\draw (#4, {#1 - 0.5}) -- (#4, {#1 + 0.5});
\draw (#5, {#1 - 0.5}) -- (#5, {#1 + 0.5});
\draw (#6, {#1 - 0.5}) -- (#6, {#1 + 0.5});
\draw (#2, #1) -- (#3, #1);
\draw (#5, #1) -- (#6, #1);
}