我想在使用 xsim 包的练习标题中指出其难度级别。
以下是 MWE:
\documentclass[10pt,a4paper,twoside,french]{article}
\usepackage{xsim}
\usepackage{babel}
\usepackage[most]{tcolorbox}
\DeclareExerciseTagging{difficulty}
\DeclareExerciseEnvironmentTemplate{custom}{%
\begin{tcolorbox}[
width=\textwidth,
enhanced,
breakable,
colbacktitle=\IfInsideSolutionTF{olive}{red},
colframe=\IfInsideSolutionTF{olive}{red},
coltitle=black,
colback=white,
sharp corners,
beforeafter skip=\baselineskip,
title={\bfseries\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}\qquad\IfExerciseTagSetTF{difficulty=1}{\normalfont(Niveau 1)}{}}
]
}
{\end{tcolorbox}}
\xsimsetup{
exercise/template=custom,
solution/template=custom,
solution/print=true
}
\xsimsetup{solution/print=true}
\begin{document}
\begin{exercise}[difficulty=1]
Exercice niveau 1
\end{exercise}
\begin{solution}
Solution de l'exercice 1
\end{solution}
\begin{exercise}[difficulty=2]
Exercice niveau 2
\end{exercise}
\begin{solution}
Solution de l'exercice 2
\end{solution}
\begin{exercise}[difficulty=3]
Exercice niveau 2
\end{exercise}
\begin{solution}
Solution de l'exercice 1
\end{solution}
\end{document}
所以我尝试了这行\qquad\IfExerciseTagSetTF{difficulty=1}{\normalfont(Niveau 1)}{}
(当然,我会为难度=2 和 3 添加相同的内容),但什么都没有出现。文本“Niveau 1”仅用于 MWE。在最终版本中,我想我会为难度=1 使用 1 个表情符号思考脸...我想我的测试\IfExerciseTagSetTF{difficulty=1}
不正确。