我正在尝试为我所在部门用于高中数学竞赛的一系列问题创建一个简单而极简的布局。我希望练习按连续顺序编号,练习编号以粗体打印,后面跟着句号和空格。我创建了一个xsim.style.math-contest.code.tex
如下所示的文件。
\xsimstyle{math-contest}
\DeclareExerciseEnvironmentTemplate{prob}
{\par\noindent\textbf{\GetExerciseProperty{counter}. }}{}
\DeclareExerciseEnvironmentTemplate{soln}
{\par\noindent\textbf{Solution: }}{}
以下示例 LaTeX 生成的输出生成了粗体句号和空格,但缺少练习编号。内容xsim.*.tex
需要声明练习的计数器属性吗?
\documentclass[10pt]{article}
\usepackage[use-files]{xsim}
\loadxsimstyle{math-contest}
\xsimsetup{%
path = exercises,
print-collection/print = both,
exercise/template = prob,
solution/template = soln
}
\DeclareExerciseCollection{shortanswer}
\DeclareExerciseCollection{team}
\DeclareExerciseTagging{mode}
\begin{document}
\collectexercises{shortanswer}
\xsimsetup{mode=short}
\begin{exercise}
What is $1 + 1$?
\end{exercise}
\begin{solution}
The answer is $2$.
\end{solution}
\collectexercisesstop{shortanswer}
%
\collectexercises{team}
\xsimsetup{mode=team}
\begin{exercise}
What is $1 + 2 + \cdots + 100$?
\end{exercise}
\begin{solution}
The answer is $5050$.
\end{solution}
\collectexercisesstop{team}
\section*{Short Answer Exercises}
\printcollection{shortanswer}
\section*{Team Exercises}
\printcollection{team}
\end{document}