1

I am making examination questions, and would like to align the question numbers across the question paper.

This is my effort so far:

\documentclass{article}
\usepackage[a4paper, portrait, margin=0.5in]{geometry}
\usepackage{fontspec}
\usepackage{anyfontsize}
\renewcommand{\familydefault}{\sfdefault}
\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}
\setsansfont{Times New Roman} \fontsize{11.5pt}{13.8pt}\selectfont

\begin{document}
\thispagestyle{empty}
\noindent \textbf{Formatting for Questions} \\
\\
\textbf{1} \hspace{0.5495cm} \textbf{(a)} \hspace{0.2cm} Question here \\
\hspace*{0.8525cm} \textbf{(a)} \hspace{0.1525cm} Question here \\
\hspace*{1.6775cm} Question here \\
\hspace*{0.8525cm} \textbf{(a)} \hspace{0.14cm} \textbf{(i)} \hspace{0.1485cm} Question here \\
\hspace*{0.8525cm} \textbf{(b)} \hspace{0.1175cm} \textbf{(i)} \hspace{0.1485cm} Question here \\
\hspace*{0.8525cm} \textbf{(d)} \hspace{0.1175cm} \textbf{(i)} \hspace{0.1485cm} Question here \\
\hspace*{1.6645cm} \textbf{(i)} \hspace{0.15cm} Question here \\
\hspace*{1.55175cm} \textbf{(ii)} \hspace{0.15cm} Question here \\
\hspace*{1.43925cm} \textbf{(iii)} \hspace{0.1515cm} Question here \\
\hspace*{2.4cm} Question here \\
\hspace*{0.8525cm} \textbf{(b)} \hspace{0.1285cm} Question here \\
\hspace*{0.8525cm} \textbf{(c)} \hspace{0.17375cm} Question here \\
\hspace*{0.8525cm} \textbf{(d)} \hspace{0.12825cm} Question here \\
\hspace*{0.8525cm} \textbf{(e)} \hspace{0.1735cm} Question here \\
\hspace*{0.865cm} Question here
\end{document}

As seen above, I have been using \hspace to align the question numbers, but it is rather inefficient and slightly inaccurate given the endless combinations of sub-questions.

My goal is for the following: enter image description here

  1. (a), (b), (d), etc. to start at the red line (not end together)
  2. Second column Question here, (i) to start at the blue line (ignoring (ii) and (iii))
  3. (i), (ii), (iii), etc. to end at the green line (not start together)
  4. Fourth column Question here to start at the yellow line

Any help would be appreciated. Thanks in advance!

5
  • Hi and welcome. I don't know if I understood your problem correctly. But the enumitem package allows enumerations to be aligned natively. enumitem package
    – AndréC
    Apr 29 at 20:41
  • @AndréC Hi, could you tell me which part of my question that you found hard to understand? Apologies about my bad fluency. Apr 30 at 1:11
  • I didn't understand if you want to draw the blue, red and green vertical lines or not.
    – AndréC
    Apr 30 at 6:20
  • Valid question. I do not require the lines to be drawn. I did it to make it easier to show how I wanted the numbers/letters to line up. Apr 30 at 6:48
  • @AndréC Could you give me an example of how the enumitem package can be used? As far as I know, it is used for numbered/bulleted lists. Apr 30 at 6:49

1 Answer 1

2

The enumitem package allows questions to be aligned natively. With the shortlabels

option, you can simply modify the labels by adding the desired type of label.

enter image description here

\documentclass{article}
\usepackage[a4paper, portrait, margin=0.5in]{geometry}
%\usepackage{fontspec}
\usepackage[shortlabels]{enumitem}
\usepackage{anyfontsize}
\renewcommand{\familydefault}{\sfdefault}
\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}
%\setsansfont{Times New Roman} \fontsize{11.5pt}{13.8pt}\selectfont

\begin{document}
\thispagestyle{empty}
\noindent \textbf{Formatting for Questions} \\
\\

\begin{enumerate}[1,leftmargin=10mm]
\item  Question here 
\item Question here 
\item \begin{enumerate}[(a),leftmargin=18pt]
        \item  Question here 
        \item Question here 
        \item  Question here 
            \begin{enumerate}[(i),leftmargin=16pt]
            \item  Question here 
            \item Question here 
            \item  Question here 
            \item Question here 
            \end{enumerate}
        \item Question here 
        \end{enumerate}
\item  Question here 
\item Question here 
\end{enumerate}

\end{document}
18
  • Now I understand, but is there a way to set a distance from the margin for each indent? How do make the second column start the same distance from the margin? Apr 30 at 10:31
  • Yes it is possible, I updated the code and the screenshot to put the same margin everywhere so you can see the effect, but you can change each of the margins separately.
    – AndréC
    Apr 30 at 12:13
  • The (i) category is correct. However, I would like the (a), (b), (c), etc. to start at the same margin instead of ending there. Apr 30 at 15:44
  • Do you want the (a) to start at the same margin as 3 or as (i)?
    – AndréC
    Apr 30 at 19:16
  • I would like the (a), (b), etc. to start at the same margin as the Question here after the 2. May 1 at 2:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .