1

I'd like to put some lines on a page where a student can answer a question, and I'd like that line to go from the prompt to the right edge of the text. The most simpleminded and (therefore?) unsuccessful of doing so is with the following MWE:

\documentclass{article}

\begin{document}
\begin{enumerate}
\item Prompt: \underline{\hspace{\linewidth}}

\underline{\hspace{\linewidth}}
\end{enumerate}
\end{document}

The problem is that the first line extends into the right margin. What I need is to find an expression that tells the first line how much space is left from the insertion point (right after "Prompt:") to the left margin.

The second line is exactly the right length.

Bernhard
  • 1,248
  • 3
    \item Prompt: \hrulefill – egreg Mar 20 '16 at 13:12
  • I wouldn't call it simpleminded – in fact, I'd say 'underlining a bunch of horizontal whitespace' is overthinking the idea of 'drawing a horizontal line'. Sometimes it helps to take a step back :) – Sean Allred Mar 20 '16 at 14:44

0 Answers0