[texhax] Entering horizontal lines between items

William Adams will.adams at frycomm.com
Wed Jan 9 21:11:05 CET 2013


On Jan 9, 2013, at 2:43 PM, Jerry wrote:

> A formula like: {lmargin + distance to indent - length of text} would
> work I assume. I have no idea how to code anything like that. Is there a
> package that offers that ability?

you put things into a box to measure them:

\documentclass{minimal}
\usepackage{calc}
\begin{document}
\newsavebox\namebox
\newsavebox\phonebox
\sbox\namebox{NAME:\ \ }
\sbox\phonebox{PHONE:\ }
\newlength{\underscorelength}
\newlength{\nameboxwidth}
\newlength{\phoneboxwidth}
\settowidth{\nameboxwidth}{\usebox{\namebox}}
\settowidth{\phoneboxwidth}{\usebox{\phonebox}}
\newlength{\fiveinches}
\setlength{\fiveinches}{5in}
\setlength{\underscorelength}{\textwidth-\nameboxwidth-\phoneboxwidth-5in}
NAME:\ \rule{\fiveinches}{1pt}\ PHONE:\ \rule{\underscorelength}{1pt}
\end{document}

William

-- 
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.



More information about the texhax mailing list