2022-07-25 14:25:38 +00:00
|
|
|
\NeedsTeXFormat{LaTeX2e}
|
|
|
|
% extensions
|
|
|
|
|
|
|
|
\RequirePackage{colorscheme}
|
|
|
|
\RequirePackage{base}
|
|
|
|
\RequirePackage{myhdr}
|
|
|
|
\RequirePackage{notbeamer}
|
|
|
|
|
|
|
|
\RequirePackage{xsim}
|
|
|
|
|
|
|
|
\DeclareExerciseTagging{step}
|
|
|
|
\DeclareExerciseTagging{type}
|
|
|
|
\DeclareExerciseTagging{tribe}
|
|
|
|
\DeclareExerciseTagging{difficulty}
|
|
|
|
\DeclareExerciseTagging{origin}
|
|
|
|
\DeclareExerciseTagging{mode}
|
|
|
|
|
|
|
|
\DeclareExerciseTranslations{total}{
|
|
|
|
French = total,
|
|
|
|
}
|
|
|
|
|
|
|
|
\DeclareExerciseEnvironmentTemplate{exo}{%
|
|
|
|
\subsection*
|
|
|
|
{%
|
|
|
|
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}\nobreakspace
|
|
|
|
\GetExerciseProperty{counter}%
|
|
|
|
\hspace{0.5cm} \GetExercisePropertyT{mode}
|
|
|
|
{{\PropertyValue}}%
|
|
|
|
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
|
|
|
|
\color{exercise}
|
|
|
|
\GetExercisePropertyT{subtitle}
|
|
|
|
{{\PropertyValue}}%
|
|
|
|
\GetExercisePropertyT{points}
|
|
|
|
{{(/\PropertyValue})}%
|
|
|
|
\noindent
|
|
|
|
}
|
|
|
|
}{}
|
|
|
|
|
|
|
|
\xsimsetup{exercise/template=exo}
|
|
|
|
|
|
|
|
\DeclareExerciseEnvironmentTemplate{sol}{%
|
|
|
|
\subsection*
|
|
|
|
{%
|
|
|
|
\color{exercise}\nobreakspace
|
|
|
|
Exercice \GetExerciseProperty{counter}%
|
|
|
|
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
|
|
|
|
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}
|
|
|
|
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
|
|
|
|
\color{exercise}
|
|
|
|
\GetExercisePropertyT{subtitle}
|
|
|
|
{{\PropertyValue}}%
|
|
|
|
\noindent
|
|
|
|
}
|
|
|
|
}{}
|
|
|
|
\xsimsetup{solution/template=sol}
|
|
|
|
|
|
|
|
|
|
|
|
\DeclareExerciseTableTemplate{DNB}{%
|
|
|
|
\XSIMputright\ExerciseTableCode{%
|
|
|
|
\hline
|
|
|
|
\XSIMifblankTF{\ExerciseType}
|
|
|
|
{}
|
|
|
|
{\XSIMmixedcase{\GetExerciseParameter{exercise-name}}}
|
|
|
|
&
|
|
|
|
\XSIMmixedcase{\XSIMtranslate{points}} \\
|
|
|
|
\hline
|
|
|
|
}%
|
|
|
|
\ForEachUsedExerciseByType{%
|
|
|
|
\XSIMifeqTF{#1}{\ExerciseTableType{#1}}
|
|
|
|
{%
|
|
|
|
\XSIMifblankTF{\ExerciseType}
|
|
|
|
{%
|
|
|
|
\XSIMputright\ExerciseTableCode{%
|
|
|
|
\XSIMmixedcase{\ExerciseParameterGet{#1}{exercise-name} }%
|
|
|
|
}%
|
|
|
|
}
|
|
|
|
{}%
|
|
|
|
\XSIMputright\ExerciseTableCode
|
|
|
|
{#3 & \XSIMifblankTF{#5}{\printgoal{0}}{\printgoal{#5}}\\ }%
|
|
|
|
}
|
|
|
|
{}%
|
|
|
|
}
|
|
|
|
\XSIMputright\ExerciseTableCode{%
|
|
|
|
\hline
|
|
|
|
\XSIMmixedcase{\XSIMtranslate{total}} &
|
|
|
|
\XSIMifblankTF{\ExerciseType}
|
|
|
|
{\TotalExerciseGoal{points}{}{}}
|
|
|
|
{\TotalExerciseTypeGoal{\ExerciseType}{points}{}{}} \\
|
|
|
|
\hline
|
|
|
|
}%
|
|
|
|
\XSIMexpandcode{%
|
|
|
|
\noexpand\begin{tabular}{|\XSIMifblankTF{\ExerciseType}{l}{c}|c|}
|
|
|
|
\noexpand\ExerciseTableCode
|
|
|
|
\noexpand\end{tabular}%
|
|
|
|
}%
|
|
|
|
}
|
|
|
|
|
2022-08-23 06:47:47 +00:00
|
|
|
% Annexes
|
|
|
|
\DeclareExerciseProperty{annexe}
|
|
|
|
\NewDocumentEnvironment{annexe}{+b}
|
|
|
|
{%
|
|
|
|
\edef\ExerciseType{\csname g_xsim_exercise_type_tl\endcsname}%
|
|
|
|
\edef\ExerciseID{\csname g_xsim_exercise_id_tl\endcsname}%
|
|
|
|
\SetExerciseProperty{annexe}{#1}%
|
|
|
|
}
|
|
|
|
{}
|
|
|
|
\newcommand\printannexes{%
|
|
|
|
\ForEachUsedExerciseByType{%
|
|
|
|
\GetExercisePropertyT{annexe}
|
|
|
|
{\subsection*{Annexe de l'exercice ##3}
|
|
|
|
|
|
|
|
####1
|
|
|
|
}%
|
|
|
|
}%
|
|
|
|
}
|
|
|
|
|
|
|
|
% Coup de pouces
|
|
|
|
\DeclareExerciseProperty{hint}
|
|
|
|
\NewDocumentEnvironment{hint}{+b}
|
|
|
|
{%
|
|
|
|
\edef\ExerciseType{\csname g_xsim_exercise_type_tl\endcsname}%
|
|
|
|
\edef\ExerciseID{\csname g_xsim_exercise_id_tl\endcsname}%
|
|
|
|
\SetExerciseProperty{hint}{#1}%
|
|
|
|
}
|
|
|
|
{}
|
|
|
|
\newcommand\printhints{%
|
|
|
|
\ForEachUsedExerciseByType{%
|
|
|
|
\GetExercisePropertyT{hint}
|
|
|
|
{\subsection*{Coup de pouce pour Ex:##3}
|
|
|
|
|
|
|
|
####1
|
|
|
|
}%
|
|
|
|
}%
|
|
|
|
}
|
|
|
|
|
2022-07-25 14:25:38 +00:00
|
|
|
\newcommand\printsectionexercises{%
|
|
|
|
\ForEachUsedExerciseByType{%
|
|
|
|
\ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section}
|
|
|
|
\printexercise{exercise}{##2}
|
|
|
|
\fi
|
|
|
|
}%
|
|
|
|
}
|
|
|
|
|
2022-08-24 08:30:51 +00:00
|
|
|
\newcommand\selfevaluation{%
|
2022-08-23 06:47:47 +00:00
|
|
|
\begin{tikzpicture}
|
|
|
|
\foreach \k in {0,1,...,4}{
|
|
|
|
\draw (\k*0.5, 0) node[draw, star, star points=5, star point ratio=0.5]{};
|
|
|
|
}
|
|
|
|
\end{tikzpicture}
|
|
|
|
}
|
2022-07-25 14:25:38 +00:00
|
|
|
\newcommand\listsectionexercises{%
|
|
|
|
|
|
|
|
\begin{itemize}[label={$\square$}]
|
|
|
|
\ForEachUsedExerciseByType{%
|
|
|
|
\ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section}%
|
|
|
|
\item %
|
|
|
|
\GetExerciseProperty{mode}%
|
|
|
|
{{\PropertyValue}}\;%
|
|
|
|
\XSIMmixedcase{\GetExerciseName}\nobreakspace
|
|
|
|
\GetExerciseProperty{counter}%
|
|
|
|
{{\PropertyValue}}%
|
|
|
|
: %
|
|
|
|
\GetExerciseProperty{subtitle}%
|
|
|
|
{{\PropertyValue}}%
|
|
|
|
\dotfill
|
2022-08-23 06:47:47 +00:00
|
|
|
\selfevaluation
|
2022-07-25 14:25:38 +00:00
|
|
|
\fi
|
|
|
|
}%
|
|
|
|
\end{itemize}
|
|
|
|
}
|
|
|
|
|
|
|
|
\xsimsetup{
|
|
|
|
exercise/within = section,
|
|
|
|
exercise/the-counter = \arabic{exercise},
|
|
|
|
}
|
|
|
|
|
|
|
|
\newcommand\searchMode{\faIcon{search}}
|
|
|
|
\newcommand\groupMode{\faIcon{users}}
|
|
|
|
\newcommand\trainMode{\faIcon{tools}}
|
|
|
|
\newcommand\projectMode{\faIcon{sitemap}}
|
2022-08-18 08:44:27 +00:00
|
|
|
\newcommand\infoMode{\faIcon{desktop}}
|
2022-10-29 09:04:25 +00:00
|
|
|
\newcommand\computerMode{\faIcon{desktop}}
|
|
|
|
\newcommand\paperMode{\faIcon{leanpub}}
|
2022-07-25 14:25:38 +00:00
|
|
|
|
|
|
|
\newcommand\legendMode{%
|
2022-08-21 07:12:40 +00:00
|
|
|
\textbf{Légende:} \hfill
|
2022-07-25 14:25:38 +00:00
|
|
|
\searchMode: pour découvrir quelque chose
|
|
|
|
\hfill
|
|
|
|
\groupMode: à faire en groupe
|
|
|
|
\hfill
|
|
|
|
\trainMode: pour s'entrainer
|
|
|
|
}
|