summaryrefslogtreecommitdiff
path: root/macros/generic/misc/underlin.tex
blob: eec6aaa129ccea09ba0213bbb1dfddf45809a91f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
% underlin.tex - real multi-word underlining
% By Stephen Gildea <gildea@x.org> January 1995.

% Usage: \textul{text to underline}

\def\textul#1{\leavevmode\let\textulnext=\textuli\textuli#1 & }
\def\textuli#1 {\ifx&#1\unskip\let\textulnext=\relax\else
  \textulword{#1}\textulspace\fi \textulnext}
\newskip\textulspskip		%saved size of a space
\def\textulword#1{%
  \setbox0\hbox{#1\space\global\textulspskip=\the\lastskip\unskip}%
  \dimen0=\dp0\dp0=1.2pt
  \setbox0\vtop{\box0\hrule}\ifdim\dp0<\dimen0\dp0=\dimen0\fi \box0}
\def\textulspace{\leaders\hrule height -1.2pt depth 1.6pt
                         \hskip\textulspskip}

% For a much fancier version with many options (e.g., strikeout),
% see ulem.sty in the CTAN archive.