summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-06-26 20:18:40 +0000
committerKarl Berry <karl@freefriends.org>2023-06-26 20:18:40 +0000
commit9c223dbd17ea28e9c3a242eb2ff3c3e220e151a0 (patch)
tree4b73d40a3b79bdd58185c4578975fe5ca13c3e30 /Master/texmf-dist/tex/latex
parent618c6ff514efd50e209633cbb76690da608e9bb1 (diff)
rouequestions (26jun23)
git-svn-id: svn://tug.org/texlive/trunk@67483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty61
1 files changed, 61 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty b/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty
new file mode 100644
index 00000000000..de436801d51
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty
@@ -0,0 +1,61 @@
+% Author : M. Vignal
+% License : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
+\ProvidesPackage{RoueQuestions}[2023/06/25 0.0.1 Aide pour générer des roues de questions]
+\RequirePackage{tikz}
+\RequirePackage{simplekv}
+\RequirePackage{listofitems}
+
+\setKVdefault[roueQuestions]{
+ LineWidth = 2pt,
+ NbCases = 10,
+ RayonCentral= 6,
+ RayonTotal = 8,
+ Consigne = {},
+ Titre = {},
+ Solution = false,
+ Decoupe = true,
+ Pliage = true
+}
+
+\newcommand{\roueQuestions}[2][]{%
+ \restoreKV[roueQuestions] %paramètres par défaut
+ \setKV[roueQuestions]{#1} % lecture des paramètres passés à la macro et remplacement des valeurs
+ \pgfmathparse{360/\useKV[roueQuestions]{NbCases}}\let\angle\pgfmathresult
+ \pgfmathparse{\useKV[roueQuestions]{RayonCentral}}\let\RayonCentral\pgfmathresult
+ \pgfmathparse{\useKV[roueQuestions]{RayonTotal}}\let\RayonTotal\pgfmathresult
+ \pgfmathparse{(2*\RayonCentral+\RayonTotal)/3}\let\RayonTexte\pgfmathresult
+ \pgfmathparse{(4*\RayonCentral)/3}\let\LargeurTexte\pgfmathresult
+ \edef\LineWidth{\useKV[roueQuestions]{LineWidth}}
+ \readlist*\listeequations{#2}%
+ \def\nbequations{\inteval{\listeequations-1}}%
+ \begin{tikzpicture}
+ \foreach \n in {1,...,\useKV[roueQuestions]{NbCases}}{%
+ \ifboolKV[roueQuestions]{Decoupe}{%
+ \edef\couleurExt{blue}
+ }{%
+ \edef\couleurExt{black}
+ }
+ \ifboolKV[roueQuestions]{Pliage}{%
+ \edef\couleurPli{green!30!black}
+ }{%
+ \edef\couleurPli{black}
+ }
+ % intérieur vers extérieur
+ \ifboolKV[roueQuestions]{Solution}{%
+ \draw[line width={\useKV[roueQuestions]{LineWidth}}] (\angle*\n:\RayonCentral) -- (\angle*\n:\RayonTotal) ;
+ }{%
+ \draw[\couleurExt,line width={\useKV[roueQuestions]{LineWidth}},dashed] (\angle*\n:\RayonCentral) -- (\angle*\n:\RayonTotal) ;
+ }
+ % intérieur
+ \ifboolKV[roueQuestions]{Solution}{\draw[line width={\useKV[roueQuestions]{LineWidth}}] (\angle*\n:\RayonCentral) -- (\angle*\n+\angle:\RayonCentral) ; }{\draw[\couleurPli,line width={\useKV[roueQuestions]{LineWidth}}] (\angle*\n:\RayonCentral) -- (\angle*\n+\angle:\RayonCentral) ; }
+ % extérieur
+ \draw[\couleurExt, line width={\useKV[roueQuestions]{LineWidth}}] (\angle*\n:\RayonTotal) -- (\angle*\n+\angle:\RayonTotal) ;
+ % texte de l'onglet
+ % angle de rotation du texte = 180 - \angle/2
+ \pgfmathparse{270 + \angle*\n - \angle/2}\let\angleTexte\pgfmathresult
+ \node[rotate=\angleTexte] at (\angle*\n-\angle/2:\RayonTexte) {\listeequations[\n]};
+ }
+ \node at(0,2*\RayonCentral/3) {\textbf{\useKV[roueQuestions]{Titre}}};
+ \node[text width=\LargeurTexte cm,text justified] at(0,0) {\useKV[roueQuestions]{Consigne}};
+ \end{tikzpicture}
+}