2

I am making a simple exam using the code below:

\begin {document}
\begin{enumerate}
\item Text here
\item Text here
\item Text here
\end{enumerate}
\end {document}

I want to put a long underscore before each number where students can put their answer like this:

______________ 1. Text here

______________ 2. Text here

______________ 3. Text here

______________ 4. Text here

______________ 5. Text here

______________ 6. Text here

______________ 7. Text here

______________ 8. Text here

______________ 9. Text here

_____________ 10. Text here

_____________ 11. Text here

3

One possibility is to load the enumerate package and set the labels as you want. That long underline may be achieved using a \rule{2cm}{.4pt}, for example.

\documentclass[12pt]{article}
\usepackage{enumerate}
\begin{document}

\begin{enumerate}[{\rule{2cm}{.4pt} 1.}]
\item Text here
\item Text here
\item Text here
\end{enumerate}

\end{document}

enter image description here

Another option which takes into account the width of the numbers greater than 9:

\documentclass[12pt]{article}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}[label={\makebox[1.5in]{\hrulefill~~\arabic*.}},leftmargin=*]
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\item Text here
\end{enumerate}

\end{document}

enter image description here

  • I am using miktex and texmaker sir. – Ken Mirasol Jun 2 '17 at 22:15
  • I am using the code \ begin{enumerate}[label=rule {1.5in}{0.15mm}~\arabic*, align=left, leftmargin=*] – Ken Mirasol Jun 2 '17 at 22:15
  • Yes, that should work with any LaTeX engine or editor of your choice. – AboAmmar Jun 2 '17 at 22:18
  • Thanks a lot sir. I just change the \begin {enumitem} in the preamble to \begin {enumerate}. – Ken Mirasol Jun 2 '17 at 22:24
  • Another problem sir. The text are aligned properly but the line before the number is not aligned after number 9 – Ken Mirasol Jun 2 '17 at 22:26
2

It is very easy using enumitem tools. The [wide=0pt] option sets the document margin as the list margin:

\documentclass[12pt]{article}
\usepackage{enumitem}

\begin{document}

\lipsum[11]
\begin{enumerate}[label={\makebox[1in][r]{\hrulefill~\arabic*.}}, wide=0pt, ref=\arabic*, start=7]
\item Text here
\item Text here
\item  A longer text here. A longer text. A longer text. A longer text. A longer text. A longer text. A longer text. 
\item Text here
\item Text here
\end{enumerate}

\end{document} 

enter image description here

  • 1
    @cfr: As long as the answer are one-lined, none. For longer answers, the left margin of the list is the left margin of the body, thanks to the wide=0pt option. I've modified the text to show this. – Bernard Jun 18 '17 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.