summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-06-27 20:09:29 +0000
committerKarl Berry <karl@freefriends.org>2023-06-27 20:09:29 +0000
commit3fa4c0cfa704d1264d447b2b0482e0071368481d (patch)
tree0ec85dc93cba5e48bbeafb8b89b80825af98b0d8 /Master/texmf-dist/tex/latex
parent400734d83277de1352a2dcd2c35341a22452489d (diff)
rouequestions (27jun23)
git-svn-id: svn://tug.org/texlive/trunk@67494 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty77
1 files changed, 62 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty b/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty
index de436801d51..e3d94f4c0a4 100644
--- a/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty
+++ b/Master/texmf-dist/tex/latex/rouequestions/RoueQuestions.sty
@@ -1,44 +1,85 @@
% 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]
+\ProvidesPackage{RoueQuestions}[2023/06/27 0.0.2 Aide pour générer des roues de questions]
\RequirePackage{tikz}
\RequirePackage{simplekv}
\RequirePackage{listofitems}
+\RequirePackage{ifthen}
\setKVdefault[roueQuestions]{
+ Titre = {},
+ Consigne = {},
+ Conseil = {},
LineWidth = 2pt,
- NbCases = 10,
RayonCentral= 6,
RayonTotal = 8,
- Consigne = {},
- Titre = {},
- Solution = false,
+ BordureCouleur=black,
+ CasesCouleur=white,
+ CentreCouleur=white,
+ Image = {},
+ ImageOpacite= 0.2,
Decoupe = true,
- Pliage = true
+ DecoupeCouleur=blue,
+ Pliage = true,
+ PliageCouleur=green!30!black,
+ Solution = false,
+ EspaceRoues = -0.5cm
}
\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
+ \readlist*\listeequations{#2}%
+ \pgfmathparse{int(\listeequationslen)}\let\nbequations\pgfmathresult%
+ \pgfmathparse{360/\nbequations}\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}}{%
+ \edef\Image{\useKV[roueQuestions]{Image}}
+ \pgfmathparse{\useKV[roueQuestions]{ImageOpacite}}\let\ImageOpacite\pgfmathresult
+ \edef\DecoupeCouleur{\useKV[roueQuestions]{DecoupeCouleur}}
+ \edef\PliageCouleur{\useKV[roueQuestions]{PliageCouleur}}
+ \edef\CasesCouleur{\useKV[roueQuestions]{CasesCouleur}}
+ \edef\CentreCouleur{\useKV[roueQuestions]{CentreCouleur}}
+ \edef\BordureCouleur{\useKV[roueQuestions]{BordureCouleur}}
+%
+ \ifboolKV[roueQuestions]{Solution}{%
+ \vspace{\useKV[roueQuestions]{EspaceRoues}}
+ }{}
+%
+ \begin{tikzpicture}[remember picture]
+ \foreach \n in {1,...,\nbequations}{%
+ %pour masquer ce qui dépasse du scope
+ \filldraw[\CentreCouleur] (0,0) -- (\angle*\n:\RayonCentral) -- (\angle*\n+\angle:\RayonCentral) -- cycle;
+ }
+ %scope
+ \begin{scope}
+ \clip (0,0) circle (\RayonCentral);
+ \ifthenelse{\equal{\Image}{}}{}{%
+ c{}{
+ %\filldraw[blue] (-7,-7) rectangle (7,7);
+ %ajout image
+ \node[opacity=\ImageOpacite] (centre) at(0,0) {\includegraphics[]{\Image}};
+ }
+ }
+ \end{scope}
+
+ \foreach \n in {1,...,\nbequations}{%
+ %pour masquer ce qui dépasse du scope
+ \filldraw[\CasesCouleur] (\angle*\n-\angle:\RayonCentral) -- (\angle*\n-\angle:\RayonTotal) -- (\angle*\n:\RayonTotal) -- (\angle*\n:\RayonCentral) -- cycle;
+ }
+ \foreach \n in {1,...,\nbequations}{%
\ifboolKV[roueQuestions]{Decoupe}{%
- \edef\couleurExt{blue}
+ \edef\couleurExt{\DecoupeCouleur}
}{%
- \edef\couleurExt{black}
+ \edef\couleurExt{\BordureCouleur}
}
\ifboolKV[roueQuestions]{Pliage}{%
- \edef\couleurPli{green!30!black}
+ \edef\couleurPli{\PliageCouleur}
}{%
- \edef\couleurPli{black}
+ \edef\couleurPli{\BordureCouleur}
}
% intérieur vers extérieur
\ifboolKV[roueQuestions]{Solution}{%
@@ -59,3 +100,9 @@
\node[text width=\LargeurTexte cm,text justified] at(0,0) {\useKV[roueQuestions]{Consigne}};
\end{tikzpicture}
}
+\newcommand{\rouesQuestions}[3][]{%
+ \roueQuestions[#1]{#2}
+ \begin{flushright}
+ \roueQuestions[#1,Solution]{#3}
+ \end{flushright}
+}