I need to prepare a "fill the blanks" test. I'm able to get the "blanks" with '\hrulefill' but I need to put a number under the line. The blanks need numbers because the answer has to be written on another page.
How do I do it?
Thanks in advance
Text Formatting ⇒ text under \hrulefill
-
- Posts: 120
- Joined: Fri Nov 14, 2008 9:40 pm
text under \hrulefill
Hello. The best solution I've found is using
If you find how to put the number under the bar, it would be very nice. It does not work for me, even with an underbrace (is there another solution, actually)?
I just programmed this now.
Code: Select all
\documentclass[10pt]{article}
\usepackage{ifthen}
\newboolean{Teachernotes} % false at start
% \setboolean{Teachernotes}{true} % true if the output is the teacher's document, false if the output is the pupil's document; TO UNCOMMENT IF STUDENTS VERSION
\newcounter{nb-holes}
\setcounter{nb-holes}{1}
\newcommand{\Hole}[1]{
\ifthenelse{\boolean{Teachernotes}} % if the output is the teacher's document,
{\textbf{#1}} % pupil-hidden words are in bold
{\underline{\phantom{#1}} (\arabic{nb-holes})} % (else) at the place of the word (the pupil has to write down on his sheet), is a bar, to let him write. This bar has the word's size.
% {$\underbrace{\underline{\phantom{#1}}}_{(\arabic{nb-holes})}$} % Does not work, actually.
\addtocounter{nb-holes}{1} % nb-holes is incremented
}
\begin{document} %% TEST DOC
Here is a \Hole{test}. The number of the test is \Hole{$\pi$}.
\end{document}
I just programmed this now.