如何将锻炼放入 ExerciseList 下的 tcolorbox 中?

如何将锻炼放入 ExerciseList 下的 tcolorbox 中?

我想围绕练习(仅用于问题)制作一个颜色框。我曾使用 tcolorbox 进行定理研究,但无法理解如何将其用于所有练习。如能提出建议,我将不胜感激。

\documentclass[a4paper, 11pt]{book}
\usepackage[lastexercise]{exercise}
\begin{document}
\begin{ExerciseList}
\Exercise Investigate convergence of the following integrals:
\end{ExerciseList}
\end{document}

答案1

我不确定是否理解了你到底喜欢什么,但这可能是一个起点:

\documentclass[a4paper, 11pt]{book}
\usepackage{tcolorbox}
\usepackage[lastexercise]{exercise}
\renewcommand{\ExerciseListHeader}{\begin{tcolorbox}\ExerciseHeaderDifficulty%
\textbf{\ExerciseListName\ \ExerciseHeaderNB \ExerciseHeaderTitle}%
\ExerciseHeaderOrigin\end{tcolorbox}}
\BeforeBeginEnvironment{ExerciseList}{\vspace{10pt}\par}
\AfterEndEnvironment{ExerciseList}{\vspace{10pt}\par}
\begin{document}
Something before the list. Something before the list. Something before the list. Something before the list. Something before the list.
\begin{ExerciseList}
\Exercise Investigate convergence of the following integrals:
\Answer An answer.
\Exercise Another question:
\Answer Another answer.
\end{ExerciseList}
Something after the list.
Something after the list.
Something after the list.
Something after the list.
Something after the list.
\end{document}

在此处输入图片描述

相关内容