![在 LaTeX 包 XSIM 中,如何在问题后面的括号中获取分数?](https://linux22.com/image/441782/%E5%9C%A8%20LaTeX%20%E5%8C%85%20XSIM%20%E4%B8%AD%EF%BC%8C%E5%A6%82%E4%BD%95%E5%9C%A8%E9%97%AE%E9%A2%98%E5%90%8E%E9%9D%A2%E7%9A%84%E6%8B%AC%E5%8F%B7%E4%B8%AD%E8%8E%B7%E5%8F%96%E5%88%86%E6%95%B0%EF%BC%9F.png)
答案1
通过在序言中添加以下内容“解决”:
\DeclareExerciseEnvironmentTemplate{custom}{%
\GetExerciseHeadingF{\subsection*}%
{\XSIMmixedcase{\GetExerciseName}\nobreakspace
\GetExerciseProperty{counter}
\IfInsideSolutionF{%
\GetExercisePropertyT{points}{\normalfont %
(%
\printgoal{\PropertyValue}
\IfExerciseGoalSingularTF{points}
{\XSIMtranslate{point}}
{\XSIMtranslate{points}}%
)%
}}%
}%
\par}
\DeclareExerciseType{problem}{
exercise-env = problem ,
solution-env = answer ,
exercise-name = Problem ,
solution-name = Answer ,
exercise-template = custom ,
solution-template = custom
}
现在输出结果为: