答案1
默认样式定义如下:
\DeclareExerciseEnvironmentTemplate{default}{%
\subsection*
{%
\XSIMmixedcase{\GetExerciseName}\nobreakspace
\GetExerciseProperty{counter}%
\IfInsideSolutionF
{%
\GetExercisePropertyT{subtitle}
{ {\normalfont\itshape\PropertyValue}}%
}%
}
\GetExercisePropertyT{points}
{%
\marginpar
{%
\IfInsideSolutionF{\rule{1.2cm}{1pt}\slash}%
\printgoal{\PropertyValue}
\GetExercisePropertyT{bonus-points}{~(+\printgoal{\PropertyValue})}%
~\XSIMtranslate {point-abbr}%
}%
}%
}
{}
如您所见,练习标题排版为\subsection*
。如果给出了点,则将其排版为\marginpar
。这意味着点的位置由文档的尺寸控制(textwidth、marginparsep 等)。恕我直言,您的问题在于,对于\rule{1.2cm}{1pt}
您的边距来说太宽,或者点写在规则后面而不是规则下面。
一种可能性是:
\documentclass{article}
\usepackage{geometry}
\geometry{
hmargin = 1in ,
showframe
}
\usepackage{xsim}
\xsimsetup{
exercise/template = custom
}
\DeclareExerciseEnvironmentTemplate{custom}{%
\subsection*
{%
\XSIMmixedcase{\GetExerciseName}\nobreakspace
\GetExerciseProperty{counter}%
\IfInsideSolutionF
{%
\GetExercisePropertyT{subtitle}
{ {\normalfont\itshape\PropertyValue}}%
}%
}
\GetExercisePropertyT{points}
{%
\marginpar
{%
\IfInsideSolutionF{\rule{1.2cm}{1pt}/\\}% <<<< NEW
\printgoal{\PropertyValue}
\GetExercisePropertyT{bonus-points}{~(+\printgoal{\PropertyValue})}%
~\XSIMtranslate {point-abbr}%
}%
}%
}
{}
\begin{document}
\begin{exercise}[points = 10]
Write.
\end{exercise}
\end{document}