0

For the following MWE,

\documentclass[addpoints]{exam}

\begin{document}
    \setlength{\parindent}{0pt}
    \qformat{\textbf{\underline{Question (\thequestion) [\totalpoints\ Marks]}}\hfill}

    \begin{questions}
        \question[15]
        \vspace{\baselineskip}% doesn't increase the spacing between the head and body
        question body
    \end{questions}
\end{document}

how can I:

1- increase the spacing between the question head and its body (in addition to understanding why vspace doesn't work as expected)

2- and left-align the question body with its head?

enter image description here

Diaa
  • 9,599

1 Answers1

1

Here it is:

\documentclass[addpoints]{exam}

% Remove margins
\renewcommand{\questionshook}{%
  \setlength{\leftmargin}{0pt}%
  \setlength{\labelwidth}{-\labelsep}%
}

\begin{document}
    %\setlength{\parindent}{0pt}
    \qformat{\textbf{\underline{Question (\thequestion) [\totalpoints\ Marks]}}\hfill}

    \begin{questions}
        \question[15] \hspace*{0pt}\vspace*{\baselineskip}

        question body

        \question[10] \hspace*{0pt}\vspace*{\baselineskip}

        question body

    \end{questions}
\end{document}

output

  • Thanks for your answer. Could you please explain to me the meaning of the preamble? I don't quite understand \leftmargin, \labelwidth and \labelsep. Or you can refer me that part of the manual where I can find some explanation about them. – Diaa Sep 02 '18 at 21:43
  • 1
    The questions environment is nothing more than a list, like itemize. Covered deep in the exam class, \question is merely an \item, so the normal list paramaters apply. You can find the list parameters at https://tex.stackexchange.com/questions/17957/is-there-a-picture-showing-all-the-lengths-used-in-lists – Jesse op den Brouw Sep 03 '18 at 06:42
  • May I know what macro is used for recalling the value of \labelwidth, \labelsep for either questions or labels? – Diaa Sep 02 '19 at 12:07
  • Sorry, I don't understand. \labelwidth et al. gives you the values. – Jesse op den Brouw Sep 28 '19 at 07:36