在考试类中使用 \extrawidth 会导致不必要的页边距变化(每页)

在考试类中使用 \extrawidth 会导致不必要的页边距变化(每页)

在按照指南在本网站上看到有关考试课程的优点后,我尝试了该课程:使用考试文档类 作者:Philip Hirschhorn 。但是,我在页边距标记数量方面遇到了一些问题。我尝试使用该\extrawidth{}功能,但无济于事。

当我所有的问题都放在一页上时,它可以工作,但是当问题超过一页时,边距会不断自行变化......

梅威瑟:

% Exam style
    \documentclass[addpoints,12pt]{exam}
% Adding in my packages for maths
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath, amsfonts, amssymb, color, mathtools}
% Borders
    \usepackage[a4paper,bindingoffset=0 cm, left=2cm, right=2cm, top=2cm, bottom=2cm, footskip=0.5cm]{geometry}
%--------------------------------------------------------------------
%   Customisations to the exam layout design
%--------------------------------------------------------------------
% Settings for marks
    \pointsdroppedatright  % Marks at bottom right
    \marginpointname{ \points}  % Gives my margin points a name
    \marksnotpoints  % Using 'Marks' not 'Points'
    \pointformat{\themarginpoints}  % Setting for the display
% Settings for total marks (per question)
    \totalformat{Total Marks for Question \thequestion: \totalpoints  \points}  % Setting for the display  
% Settings for questions
    \qformat{\textbf{Question \thequestion} (\totalpoints\ \points) \hfill}
    \renewcommand{\questionshook}{%
          \setlength{\leftmargin}{0cm}%
          \setlength{\labelwidth}{-\labelsep}%
    }  % No indent for the question content

\begin{document}
\begin{questions}
% So the dropmarks fit in the right margin
    \extrawidth{3cm}
    \question  %[2] means worth 2 marks, not question 2
    Imagine if there is no air
    \begin{parts}    
        \part[2] What would be the effect on the balloon industry? 
        \fillwithlines{5cm}
        \droppoints
        \part[6] What would be the effect on the aircraft industry? 
        \fillwithlines{15cm}
        \droppoints
    \end{parts}
    \question[5]
    Why is there air?
    \fillwithlines{15cm}
    \droppoints
\end{questions}
\end{document}

当我运行它时,第一页和第二页的边距不同,而我使用的指南没有答案......(也试过谷歌,但没有成功)

任何帮助都值得感谢!

答案1

将命令放在\extrawidth之前\begin{document}。否则,\extrawidth仅适用于当前页面(我相信)。

\documentclass{exam}
\usepackage[a4paper,bindingoffset=0 cm, left=2cm, right=2cm, top=2cm, bottom=2cm, footskip=0.5cm]{geometry}
\totalformat{Total Marks for Question \thequestion: \totalpoints  \points}  % Setting for the display  
% Settings for questions
\qformat{\textbf{Question \thequestion} (\totalpoints\ \points) \hfill}
\renewcommand{\questionshook}{%
      \setlength{\leftmargin}{0cm}%
      \setlength{\labelwidth}{-\labelsep}%
}  % No indent for the question content

\extrawidth{3cm}

\begin{document}
\begin{questions}
% So the dropmarks fit in the right margin
\question  %[2] means worth 2 marks, not question 2
Imagine if there is no air
\begin{parts}    
    \part[2] What would be the effect on the balloon industry? 
    \fillwithlines{5cm}
    \droppoints
    \part[6] What would be the effect on the aircraft industry? 
    \fillwithlines{15cm}
    \droppoints
\end{parts}
\question
Why is there air?
\begin{parts}
  \part[2]Why is there not no air?
  \fillwithlines{5cm}
  \droppoints
  \part[3]Why not something other than air?
  \fillwithlines{5cm}
  \droppoints
\end{parts}
\end{questions}
\end{document}

相关内容