# [texhax] TeX underline & \hfill question

Hubert Lam hubert at lamfamily.info
Sun Dec 4 08:35:06 CET 2011

By the way, here is the result:

[cid:image003.png at 01CCB2B3.6FFCCB70]
Also amend the \vspace[3ex] to your liking depending on how large your handwriting may be. This is to adjust the vertical height provided for the fill in lines.

From: Hubert Lam
Sent: Sunday, December 04, 2011 6:29 PM
To: 'Amber K'; texhax at tug.org
Subject: RE: [texhax] TeX underline & \hfill question

Hi Amber K,

Are you trying to create lines for people to handwrite/fill in (cloze)?

If so here's my implementation.

\documentclass{article}
\usepackage{calc}
\newcommand{\Cloze}[1]{\begin{minipage}[b]{\widthof{\Huge \textbf{#1}}} \vspace{3ex} \dotfill \end{minipage}}
% creates a minipage of the width of the required text which \dotfill can fill up

\begin{document}
A \textbf{relation} is a \Cloze{rule} that maps \Cloze{elements} from the \Cloze{domain} to the \Cloze{range}.
\end{document}

This will create dotted lines with variable length \dotfill s. The package calc does the magic in calculating the hspace required.

Hubert

From: texhax-bounces at tug.org<mailto:texhax-bounces at tug.org> [mailto:texhax-bounces at tug.org]<mailto:[mailto:texhax-bounces at tug.org]> On Behalf Of Amber K
Sent: Sunday, December 04, 2011 5:40 PM
To: support at tug.org<mailto:support at tug.org>
Subject: [texhax] TeX underline & \hfill question

When I create lesson plans, I like to make handouts with lines that fill the page as well a solutions keys where I put text on the lines.  I've been manually adjusting the widtch value in inches one line at a time until they line up, and I'm really hoping there is an easier way.

Right now, if the handout looks like:

Conclusion: \hrulefill

I am typing this for the key:

Conclusion: \underline{\makebox[4.94in][s]{\color{red}{Answers will vary but should be based on evidence collected}{\hfill}}}

Where the 4.94in part was the value I needed to manually adjust.  When I want to have everything underlined, I found a suggestion online to do something like this:

\underline{\makebox[5.7in][s]{Choice 2: \color{red}{Students should select a second choice from one of the five options below. They }{\hfill}}}

This works extremely well for those cases, but I'm hoping there is way to do something like that without having to either have everything underlined or nothing at all.  I searched for a way to remove underlining from part of the command (like \textnormal) but I haven't found anything to work for removing underlining.  Any suggestion would be very greatly appreciated.

Thanks,

Amber

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20111204/ccdb9bd6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 36398 bytes
Desc: image003.png
URL: <http://tug.org/pipermail/texhax/attachments/20111204/ccdb9bd6/attachment-0001.png>