[texhax] TeX underline & \hfill question

Hubert Lam hubert at lamfamily.info
Sun Dec 4 08:29:01 CET 2011

Hi Amber K,

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

If so here's my implementation.

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

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

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


From: texhax-bounces at tug.org [mailto:texhax-bounces at tug.org] On Behalf Of Amber K
Sent: Sunday, December 04, 2011 5:40 PM
To: 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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20111204/cdd19289/attachment-0001.html>

More information about the texhax mailing list