Feat: listsectionexercise and printsectionexercise
This commit is contained in:
parent
e4b798bb30
commit
d1319d34c8
@ -13,9 +13,10 @@
|
|||||||
\DeclareExerciseTagging{tribe}
|
\DeclareExerciseTagging{tribe}
|
||||||
\DeclareExerciseTagging{difficulty}
|
\DeclareExerciseTagging{difficulty}
|
||||||
\DeclareExerciseTagging{origin}
|
\DeclareExerciseTagging{origin}
|
||||||
|
\DeclareExerciseTagging{mode}
|
||||||
|
|
||||||
\DeclareExerciseTranslations{total}{
|
\DeclareExerciseTranslations{total}{
|
||||||
French = total ,
|
French = total,
|
||||||
}
|
}
|
||||||
|
|
||||||
\DeclareExerciseEnvironmentTemplate{exo}{%
|
\DeclareExerciseEnvironmentTemplate{exo}{%
|
||||||
@ -23,30 +24,31 @@
|
|||||||
{%
|
{%
|
||||||
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}\nobreakspace
|
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}\nobreakspace
|
||||||
\GetExerciseProperty{counter}%
|
\GetExerciseProperty{counter}%
|
||||||
|
\hspace{0.5cm} \GetExercisePropertyT{mode}
|
||||||
|
{{\PropertyValue}}%
|
||||||
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
|
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
|
||||||
\color{exercise}
|
\color{exercise}
|
||||||
\IfInsideSolutionF
|
|
||||||
{%
|
|
||||||
\GetExercisePropertyT{subtitle}
|
\GetExercisePropertyT{subtitle}
|
||||||
{{\PropertyValue}}%
|
{{\PropertyValue}}%
|
||||||
\GetExercisePropertyT{points}
|
\GetExercisePropertyT{points}
|
||||||
{{(/\PropertyValue})}%
|
{{(/\PropertyValue})}%
|
||||||
}%
|
|
||||||
\noindent
|
\noindent
|
||||||
}
|
}
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
\xsimsetup{exercise/template=exo}
|
\xsimsetup{exercise/template=exo}
|
||||||
|
|
||||||
\DeclareExerciseEnvironmentTemplate{sol}{%
|
\DeclareExerciseEnvironmentTemplate{sol}{%
|
||||||
\subsection*
|
\subsection*
|
||||||
{%
|
{%
|
||||||
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}\nobreakspace
|
\color{exercise}\nobreakspace
|
||||||
: Exercice \GetExerciseProperty{counter}%
|
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}
|
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
|
||||||
\color{exercise}
|
\color{exercise}
|
||||||
\IfInsideSolutionF
|
\GetExercisePropertyT{subtitle}
|
||||||
{%
|
{{\PropertyValue}}%
|
||||||
}%
|
|
||||||
\noindent
|
\noindent
|
||||||
}
|
}
|
||||||
}{}
|
}{}
|
||||||
@ -93,3 +95,31 @@
|
|||||||
}%
|
}%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\newcommand\printsectionexercises{%
|
||||||
|
\ForEachUsedExerciseByType{%
|
||||||
|
\ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section}
|
||||||
|
\printexercise{exercise}{##2}
|
||||||
|
\fi
|
||||||
|
}%
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcommand\listsectionexercises{%
|
||||||
|
\begin{itemize}
|
||||||
|
\ForEachUsedExerciseByType{%
|
||||||
|
\ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section}
|
||||||
|
\item
|
||||||
|
\XSIMmixedcase{\GetExerciseName}\nobreakspace
|
||||||
|
\GetExerciseProperty{counter}%
|
||||||
|
{{\PropertyValue}}: %
|
||||||
|
\GetExerciseProperty{subtitle}%
|
||||||
|
{{\PropertyValue}}%
|
||||||
|
|
||||||
|
\fi
|
||||||
|
}%
|
||||||
|
\end{itemize}
|
||||||
|
}
|
||||||
|
|
||||||
|
\xsimsetup{
|
||||||
|
exercise/within = section,
|
||||||
|
exercise/the-counter = \arabic{exercise},
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user