如何更改试卷模板中的标记位置

如何更改试卷模板中的标记位置

我正在使用 {exam} 文档类进行试卷设置。在生成的 PDF 中,当我打印输出时,标记几乎位于右边界上。我可以将其稍微向左移动或至少与文本右对齐吗?MWE 给出如下:

\documentclass[12pt]{exam}
\usepackage[margin = 2.2cm]{geometry}
\linespread{1}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\begin{document}
\begin{center}
\textbf{Name of Institution}\newline
\textbf{Name of Department}\newline
\textbf{Name of Examination}\newline
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hspace{1cm} \textbf{Semester: 4th} \newline
\textbf{Time: 2 Hrs \hspace{3cm}  \hspace{7cm} \ \  Max. Marks: 50}\newline

\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here 
\begin{enumerate}[i.]
        \item Type question here  XXXXXXX.
    \item YYYYYY.
    \item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here 
\end{enumerate}
\textbf{\droppoints}
\end{parts}
\question 
\begin{parts}
    \part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
    \part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here 
    \textbf{\droppoints}
    \end{parts}
\end {questions}
\end{document}

答案1

不错的变体Jesse op den Brouw's回答(+1):

  • 不同立场\droppoints
  • 一些与主题无关的代码更改

    \documentclass[12pt]{exam}
    \usepackage[showframe,   % in real document remove this option
                margin=22mm]{geometry}
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{enumitem}
    \setlist[enumerate]{label=\roman*.,after=\vspace{-0.5\baselineskip}}
    \makeatletter
    \def\droppoints{%
      \leavevmode\unskip\nobreak\hfill
            \rlap{\hskip\marginparsep\padded@point@block}%
                    }
    \makeatother
    
    \begin{document}
    \begin{center}\bfseries
    Name of Institution\\
    Name of Department\\
    Name of Examination
    \end{center}
    \textbf{Course Code:XXX (YYYYYY) }  \hfill\textbf{Semester: 4th}    \\
    \textbf{Time: 2 Hrs                 \hfill  Max. Marks: 50}         \\
    
    \begin{questions}
    \pointsdroppedatright
    \question
    \begin{parts}
    \part[3] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here
    \textbf{\droppoints}
    \part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
    \begin{enumerate}
        \item Type question here  XXXXXXX.
        \item YYYYYY.
        \item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here
    \end{enumerate}
    \textbf{\droppoints}
    \end{parts}
    \question
    \begin{parts}
        \part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here
        \textbf{\droppoints}
        \part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
        \textbf{\droppoints}
        \end{parts}
    \end {questions}
    

在此处输入图片描述

答案2

只是略有改进@JesseopdenBrouw 的回答(认真的说如果有人赞成这个答案,也请考虑赞成他的答案,所有的工作都是他完成的,我只包含了一个可行的断点)。

如果问题的最后一行没有足够的空间(2em 加上点所占的空间),则以下内容会跳转到下一行并在那里打印点。我还将 包含\textbf在 的定义中\droppoints。在下面的 MWE 中,可以看到问题 1.a 中这种变化的影响。

\documentclass[12pt]{exam}
\usepackage[margin = 2.2cm]{geometry}
\linespread{1}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}

\makeatletter
\def\droppoints{%
  \leavevmode\unskip\nobreak\hfill\penalty50\hskip2em
  \null\nobreak\hfill
  \textbf{\padded@point@block}%
  \par
}
\makeatother


\begin{document}
\begin{center}
\textbf{Name of Institution}\newline
\textbf{Name of Department}\newline
\textbf{Name of Examination}\newline
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hspace{1cm} \textbf{Semester: 4th} \newline
\textbf{Time: 2 Hrs \hspace{3cm}  \hspace{7cm} \ \  Max. Marks: 50}\newline


\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question
here Type question here Type question here Type question here Type question here
Type quest\droppoints
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here 
\begin{enumerate}[i.]
        \item Type question here  XXXXXXX.
    \item YYYYYY.
    \item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here 
\end{enumerate}
\droppoints
\end{parts}
\question 
\begin{parts}
    \part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \droppoints
    \part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here 
    \droppoints
    \end{parts}
\end {questions}
\end{document}

在此处输入图片描述

答案3

只需重新定义\droppoints

\documentclass[12pt]{exam}
\usepackage[margin = 2.2cm]{geometry}
\linespread{1}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}

\makeatletter
\def\droppoints{%
  \leavevmode\unskip\nobreak\hfill
  \rlap{\hskip\rightmargin  % Defined by the list environment
        \llap{\padded@point@block}%
  }% rlap
  \par
}
\makeatother


\begin{document}
\begin{center}
\textbf{Name of Institution}\newline
\textbf{Name of Department}\newline
\textbf{Name of Examination}\newline
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hspace{1cm} \textbf{Semester: 4th} \newline
\textbf{Time: 2 Hrs \hspace{3cm}  \hspace{7cm} \ \  Max. Marks: 50}\newline


\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here 
\begin{enumerate}[i.]
        \item Type question here  XXXXXXX.
    \item YYYYYY.
    \item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here 
\end{enumerate}
\textbf{\droppoints}
\end{parts}
\question 
\begin{parts}
    \part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
    \part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here 
    \textbf{\droppoints}
    \end{parts}
\end {questions}
\end{document}

相关内容