2

I want to learn how to align marks (to the right) and start the question always on a new line.

My MWE:

\documentclass[a4paper,12pt]{exam}
\usepackage{amsmath}
\pointsinrightmargin

\renewcommand\choicelabel{(\Alph{choice})} \renewcommand{\choiceshook}{% \setlength{\leftmargin}{25mm}% \setlength{\labelwidth}{\labelsep }% }

\renewcommand{\questionlabel}{ \textbf{Question \thequestion}:}

\begin{document} \begin{questions}

\question[1]  Start this line on a new line and align the marks with the rest of the paper.
\begin{choices} \choice 1 \choice 2 \choice 2 \choice 3 \end{choices}

\question[2]  Drop and align this one too.
\begin{choices} \choice 6 \choice 3 \choice 2 \choice 0 \end{choices}

\question[3]
Drop and align this sentence too!

\question Drop and align this sentence one too!

\begin{parts} % Keep this part as it is.
    \part[4] Keep as it is.
    \part[5] Keep as it is.
    \part
    Consider this and that:
    \begin{subparts}
        \subpart[6] This one is aligned with the parts.
        \subpart[7] So is this one.
    \end{subparts}
\end{parts}

\end{questions} \end{document}

I tried to use

\setlength{\rightpointsmargin}{15mm}

But it simply shifts all marks, but the one I'm interested in are the ones that have gone over the page.

Ideally, this is what I would like to always happen (regardless if I modify the question/parts/choice labels/shook).

Expected result

EDIT: UPDATED CODE

\documentclass[a4paper,12pt]{exam}
\usepackage{amsmath}
\usepackage[showframe=true]{geometry}
\pointsinrightmargin
\pointname{}
\pointformat{\textbf{\thepoints}}

\qformat{{\textbf{Question \thequestion}}\hfill\textbf{\thepoints}\hspace{-1.5cm}}

\renewcommand\choicelabel{(\Alph{choice})} \renewcommand{\choiceshook}{% \setlength{\leftmargin}{25mm}% \setlength{\labelwidth}{\labelsep}% }

\begin{document} \begin{questions}

\question[1]  Start this line on a new line and align the marks with the rest of the paper.
\begin{choices} \choice 1 \choice 2 \choice 2 \choice 3 \end{choices}

\question[2]  Drop and align this one too.
\begin{choices} \choice 6 \choice 3 \choice 2 \choice 0 \end{choices}

\question[3]
Drop and align this sentence too!

\question Drop and align this sentence one too!

\begin{parts} % Keep this part as it is.
    \part[4] Keep as it is.
    \part[5] Keep as it is.
    \part
    Consider this and that:
    \begin{subparts}
        \subpart[6] This one is aligned with the parts.
        \subpart[7] So is this one.
    \end{subparts}
\end{parts}

\end{questions} \end{document}

  • https://tex.stackexchange.com/questions/122698/start-the-content-of-an-item-on-a-new-line-after-the-item-label-in-enumerate-env This is the best example I can find where the question starts directly below the label. – Alan Jones Jan 15 '21 at 08:10
  • You hacking solution seems to work quite nicely. Is there anything more that you would like to achieve? – Alan Xiang Jan 16 '21 at 21:26
  • I'm not sure what you mean? I still can't get the multiple choice and short answers points to align perfectly in the right margin. – Alan Jones Jan 17 '21 at 00:07
  • I've removed the "align" tag; it is specific to math displays. – barbara beeton Feb 06 '24 at 03:50

1 Answers1

0

An ugly patch:

\documentclass[a4paper,12pt]{exam}
\usepackage{amsmath}
\usepackage[showframe=true]{geometry}
\pointsinrightmargin
\pointname{}
\pointformat{\textbf{\thepoints}}

\qformat{{\textbf{Question \thequestion}}\hfill% \rlap{\hspace*{14.5mm}\textbf{\thepoints}} }

\renewcommand\choicelabel{(\Alph{choice})} \renewcommand{\choiceshook}{% \setlength{\leftmargin}{25mm}% \setlength{\labelwidth}{\labelsep}% }

\begin{document} \begin{questions}

\question[1]  Start this line on a new line and align the marks with the rest of the paper.
\begin{choices} \choice 1 \choice 2 \choice 2 \choice 3 \end{choices}

\question[2]  Drop and align this one too.
\begin{choices} \choice 6 \choice 3 \choice 2 \choice 0 \end{choices}

\question[3]
Drop and align this sentence too!

\question Drop and align this sentence one too!

\begin{parts} % Keep this part as it is.
    \part[4] Keep as it is.
    \part[5] Keep as it is.
    \part
    Consider this and that:
    \begin{subparts}
        \subpart[6] This one is aligned with the parts.
        \subpart[7] So is this one.
    \end{subparts}
\end{parts}

\end{questions} \end{document}

Alan Xiang
  • 5,227