答案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}