我xsim
想将一个question
环境与另一个solution
环境结合起来。我收到一个错误:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! LaTeX 错误:“xparse/environment-already-defined” ! 环境“solution”已定义! ! 有关更多信息,请参阅 LaTeX3 文档。 ! 如需立即获得帮助,请输入 H 。
我以前会命名我的环境question/answer
,但我想使用该名称solution
而不是answer
--- 其余一切都保持不变。可以吗?
这是有效的:
\documentclass{article}
\usepackage{xsim}
\DeclareExerciseType{question}{
exercise-env = question,
solution-env = answer, % would like to rename answer -> solution
exercise-name = Question,
solution-name = Answer,
exercise-template = default,
solution-template = default
}
\xsimsetup{answer/print=true} % would like to rename answer -> solution
\begin{document}
\begin{question}
My Question
\end{question}
\begin{answer}% would like to rename answer -> solution
My Answer
\end{answer}% would like to rename answer -> solution
\end{document}
answer
重命名为后,这是不起作用的solution
:
\documentclass{article}
\usepackage{xsim}
\DeclareExerciseType{question}{
exercise-env = question,
solution-env = solution, % IF NAMED 'solution' throws an error!
exercise-name = Question,
solution-name = Answer,
exercise-template = default,
solution-template = default
}
\xsimsetup{solution/print=true}
\begin{document}
\begin{question}
My Question
\end{question}
\begin{solution}
My Answer
\end{solution}
\end{document}
编辑 简短回答:solution
是包的保留关键字xsim
。不能使用它。谢谢埃格尔。