3

If I enumerate like this

\textbf{Problem 1}
\begin{enumerate}[label=(\textit{\alph*})]
\item Random Text
\item Random Text
\item Random Text
\end{enumerate}

then how can I accomplish to write something at the left of the labels on the margin, like 8 pts and 9 pts in the following picture:

exam

3
  • Did you copy this code snippet from the actual exam? If so, can you make use of the remaining code to generate the desired layout?
    – Mico
    Jul 20 at 13:49
  • @Mico I wrote down what is written in the exam (I added a picture) Jul 20 at 14:37
  • 1
    @Mico Yes, sorry, I refer to the bold caraters 8 pts, etc. I would like to do this. Jul 20 at 15:50

1 Answer 1

4

Since the points may change on an \item-by-\item basis, insert the points manually via \insertpts{<num>} below:

enter image description here

\documentclass{article}

\usepackage{enumitem}

\NewDocumentCommand{\insertpts}{ m }{%
  \makebox[0pt][r]{\small\bfseries #1 pts\hspace{3em}}%
  \ignorespaces}
  
\begin{document}

\noindent \textbf{Problem 1}
\begin{enumerate}[label=(\alph*)]
  \item \insertpts{9}
  Random Text
  \item \insertpts{8}
  Random Text
  \item \insertpts{7}
  Random Text
\end{enumerate}

\end{document}

You can adjust the font specifications (currently set to \small\bfseries) and the gap by adjusting the elements inside \hspace (currently set to 3em).

1
  • That's brilliant!
    – Clément
    Aug 31 at 15:11

You must log in to answer this question.

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