Debian Codegraph @

texmf-dist/source/latex/umoline/umoline.dtx

raw
1 % \iffalse
2 %% Style file `umoline'.
3 %% Copyright (C) 1999,2000 Hiroshi Nakashima <[email protected]>
4 %% (Toyohashi Univ. of Tech.)
5 %%
6 %% This program can be redistributed and/or modified under the terms
7 %% of the LaTeX Project Public License distributed from CTAN
8 %% archives in directory macros/latex/base/lppl.txt; either
9 %% version 1 of the License, or any later version.
10 %%
11 % \fi
12 %
13 % \CheckSum{485}
14 %% \CharacterTable
15 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
16 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
17 %% Digits \0\1\2\3\4\5\6\7\8\9
18 %% Exclamation \! Double quote \" Hash (number) \#
19 %% Dollar \$ Percent \% Ampersand \&
20 %% Acute accent \' Left paren \( Right paren \)
21 %% Asterisk \* Plus \+ Comma \,
22 %% Minus \- Point \. Solidus \/
23 %% Colon \: Semicolon \; Less than \<
24 %% Equals \= Greater than \> Question mark \?
25 %% Commercial at \@ Left bracket \[ Backslash \\
26 %% Right bracket \] Circumflex \^ Underscore \_
27 %% Grave accent \` Left brace \{ Vertical bar \|
28 %% Right brace \} Tilde \~}
29 %%
30 % \iffalse
31 %%
32 %<*dtx>
33 \ProvidesFile{umoline.dtx}
34 %</dtx>
35 %<package>\def\next{LaTeX2e}
36 %<package>\ifx\fmtname\next
37 %<package>\def\next{
38 %<package>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
39 %<package>\ProvidesPackage{umoline}}
40 %<package>\else\def\next[#1]{}\fi
41 %<package>\next
42 %<driver>\ProvidesFile{umoline.drv}
43 % \fi
44 % \ProvidesFile{umoline.dtx}
45 [2000/07/11 v1.1 ]
46 % \iffalse
47 %<*driver>
48 \documentclass{ltxdoc}
49 \usepackage{umoline}
50 \DisableCrossrefs
51 \PageIndex
52 \CodelineNumbered
53 \RecordChanges
54 %</driver>
55 %<driver>\OnlyDescription
56 %<driver>\def\ONLYDESCRIPTION{}
57 %<*driver>
58 \advance\textwidth4em
59 \begin{document}
60 \DocInput{umoline.dtx}
61 \end{document}
62 %</driver>
63 % \fi
64 % \changes{v1.0}{1999/04/14}
65 % {The style is born from jumoline.}
66 %
67 % \errorcontextlines10000
68 % \def\|{\verb|}
69 % \DeleteShortVerb\|
70 % \GetFileInfo{umoline.dtx}
71 % \setcounter{IndexColumns}{2}
72 %
73 % \def\bottomfraction{.9}
74 % \def\cs#1{\hbox{\tt\char\escapechar#1}}
75 % \def\Item{\vskip-\itemsep\vskip-\parsep\vskip0pt\item}
76 %
77 % \makeatletter
78 % \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation
79 % \global\@eqnswtrue
80 % \global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr
81 % $$\halign to \displaywidth\bgroup\hskip\@centering
82 % $\displaystyle\tabskip\z@{##}$\@eqnsel&\global\@eqcnt\@ne
83 % \hfil$\;{##}\;$\hfil
84 % &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil
85 % \tabskip\@centering&\llap{##}\tabskip\z@\cr}
86 %
87 % \def\Meta#1{\penalty\@highpenalty
88 % \hbox{{\tt\char`\{}{\it\meta{#1}}{\tt\char`\}}}}
89 % \def\opt#1{{\tt[}{\it\meta{#1}}{\tt]}}
90 % \def\optn#1{{\tt[#1]}}
91 % \def\arg#1{{\tt\char`\{#1\char`\}}}
92 %
93 % \let\latex@addmarginpar\@addmarginpar
94 % \let\latex@latex@warning@no@line\@latex@warning@no@line
95 % \def\@addmarginpar{\let\@latex@warning@no@line\@gobble
96 % \latex@addmarginpar
97 % \let\@latex@warning@no@line\latex@latex@warning@no@line}
98 % \let\@font@warning\@gobble
99 %
100 % \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist
101 % \edef\saved@macroname{\string#2}
102 % \def\makelabel##1{\llap{##1\hskip\@totalleftmargin}}
103 % \if@inlabel
104 % \let\@tempa\@empty \count@\macro@cnt
105 % \loop \ifnum\count@>\z@
106 % \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat
107 % \edef\makelabel##1{\llap{\vtop to\baselineskip
108 % {\@tempa\hbox{##1}\vss}
109 % \hskip\@totalleftmargin}}
110 % \advance \macro@cnt \@ne
111 % \else \macro@cnt\@ne \fi
112 % \edef\@tempa{\noexpand\item[
113 % #1
114 % \noexpand\PrintMacroName
115 % \else
116 % \noexpand\PrintEnvName
117 % \fi
118 % {\string#2}]}
119 % \@tempa
120 % \global\advance\c@CodelineNo\@ne
121 % #1
122 % \SpecialMainIndex{#2}\nobreak
123 % \DoNotIndex{#2}
124 % \else
125 % \SpecialMainEnvIndex{#2}\nobreak
126 % \fi
127 % \global\advance\c@CodelineNo\m@ne
128 % \ignorespaces}
129 %
130 % \def\DescribeOpt{\leavevmode\@bsphack\begingroup\MakePrivateLetters
131 % \Describe@Opt}
132 % \def\Describe@Opt#1{\endgroup \Describe@pt{#1}}
133 % \def\Describe@pt#1#2{
134 % \marginpar{\raggedleft\PrintDescribeMacro{#1}}
135 % \SpecialOptUsageIndex{#1}{#2}}
136 % \def\SpecialOptUsageIndex#1#2{
137 % \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar usage}
138 % \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar usage}
139 % \@esphack\ignorespaces}
140 % \def\SpecialOptMainIndex#1#2{
141 % \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar main}
142 % \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar main}
143 % \@esphack\ignorespaces}
144 % \def\SpecialOptIndex#1#2{
145 % \index{#1\actualchar{\protect\ttfamily#1} (#2)}
146 % \index{#2s:\levelchar{\protect\ttfamily#1}}
147 % \@esphack\ignorespaces}
148 % \def\SpecialOptIndexS#1#2{
149 % \index{#1\actualchar{\protect\ttfamily#1} (#2)}
150 % \index{#2es:\levelchar{\protect\ttfamily#1}}
151 % \@esphack\ignorespaces}
152 %
153 % \def\SpecialMainIndex#1{\@bsphack
154 % \RemoveAtFromCS{#1}
155 % \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa
156 % \actualchar \string\verb
157 % \quotechar*\verbatimchar\string#1\verbatimchar
158 % \encapchar main}}\@tempa
159 % \@esphack}
160 % \def\SpecialIndex#1{\@bsphack
161 % \RemoveAtFromCS{#1}
162 % \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa
163 % \actualchar \string\verb
164 % \quotechar*\verbatimchar\string#1\verbatimchar}}\@tempa
165 % \@esphack}
166 %
167 % \let\RAFCempty\@empty
168 % \let\RAFCgobble\@gobble
169 % \makeatother
170 % \def\RemoveAtFromCS#1{\edef\RAFCtempa{\expandafter\RAFCgobble\string#1}
171 % \edef\RAFCtempa{\expandafter\string\csname\RAFCtempa\endcsname}
172 % \expandafter\iRemoveAtFromCS\RAFCtempa@\NIL}
173 % \def\iRemoveAtFromCS#1#2@#3\NIL{\def\RAFCtempb{#3}
174 % \ifx\RAFCtempb\RAFCempty \def\RAFCtempa{#2}\let\next\relax
175 % \else \def\RAFCtempa{#2@}\def\next{\iiRemoveAtFromCS#3\NIL}
176 % \def\RAFCtempb{#2}
177 % \ifx\RAFCtempb\RAFCempty
178 % \else\ifx\RAFCtempb\CommonCSPrefix
179 % \else\ifx\RAFCtempb\CommonIfPrefix
180 % \else \def\RAFCtempa{}\def\next{\xRemoveAtFromCS#2@#3\NIL}\fi\fi\fi\fi
181 % \next}
182 % \def\iiRemoveAtFromCS#1{\ifx#1@\edef\RAFCtempa{\RAFCtempa@}
183 % \let\next\iiRemoveAtFromCS
184 % \else \def\next{\xRemoveAtFromCS#1}\fi
185 % \next}
186 % \def\xRemoveAtFromCS#1@\NIL{\edef\RAFCtempa{#1\RAFCtempa}}
187 % \makeatletter
188 %
189 % \begingroup
190 % \gdef\@sverbcat{\catcode`\@\active\catcode`\#\active}
191 % \catcode`\@\active \gdef@{\char`\@\penalty\exhyphenpenalty}
192 % \catcode`\#\active \gdef#{\penalty\exhyphenpenalty}
193 % \endgroup
194 % \let\latex@sverb\@sverb
195 % \def\@sverb{\@sverbcat\latex@sverb}
196 %
197 % \def\theglossary{\onecolumn \glossary@prologue
198 % \GlossaryParms \let\item\@idxitem \ignorespaces}
199 % \def\endtheglossary{\relax}
200 %
201 %
202 %
203 % \def\bracepair{`{\tt\char`\{\char`\}'}}
204 %
205 % \ifx\ONLYDESCRIPTION\undefined\else
206 % \let\SpecialUsageIndex\SpecialMainIndex
207 % \let\SpecialOptUsageIndex\SpecialOptMainIndex
208 % \fi
209 %
210 %
211 %
212 % \edef\CommonCSPrefix{\expandafter\RAFCgobble\string\UMO}
213 % \edef\CommonIfPrefix{\expandafter\RAFCgobble\string\ifUMO}
214 %
215 % \title{\textsf{umoline}\\
216 % The Package for Under/Mid/Overline for Long Texts\thanks{
217 % This file has version number \fileversion, last revised \filedate.}}
218 % \author{Hiroshi Nakashima\\(Toyohashi Univ. of Tech.)}
219 % \date{\filedate}
220 % \maketitle
221 %
222 % \begin{abstract}
223 % This file provides macros to draw \|\Underline|, \|\Midline| and
224 % \|\Overline| with a long text allowing line breaking in the text.
225 % \end{abstract}
226 %
227 % \tableofcontents
228 % \newpage
229 %
230 %
231 % \section{Introduction}
232 % \label{sec:intro}
233 %
234 % Users of \TeX{} and \LaTeX{} often complain that a text with \|\underline|
235 % and \|\overline| cannot have line-break points in it. This makes it hard
236 % to draw lines under a sentence in order to, for example, show that the
237 % sentence is modified by a revision.
238 %
239 % Although it is almost impossible to find the perfect solution for the
240 % problem, we could have a acceptable approximation by introducing certain
241 % reasonable restrictions. For example, macros provided by \textsf{umoline}
242 % only accept {\em ordinary} texts as their objective texts to draw
243 % underline, etc. In fact, many \TeX{}ackers have written macros having this
244 % restriction, including author's \textsf{julem}\footnote{
245 %
246 % This style was named by someone who distributed author's macro set posted
247 % to a news group, and thus the author himself does not know the reason why
248 % it is called so.}
249 %
250 % which copes with texts in both Japanese and English (and other European
251 % languages). The style, however, has a few drawbacks including that it
252 % consumes a huge amount of computational time and dvi-file space.
253 %
254 % The style \textsf{umoline} is designed to solve the problem minimizing
255 % the time/space consumption to some acceptable level although still they are
256 % not very small. Note that \textsf{umoline} is only for English (and
257 % possibly some other European language) and another style \textsf{jumoline}
258 % by the author is available for Japanese users.
259 %
260 %
261 % \section{Usage}
262 % \label{sec:usage}
263 %
264 % \subsection{Basic Usage}
265 % \label{sec:usage-basic}
266 %
267 % The package is usable to both \LaTeXe{} and \LaTeX-2.09 users with their
268 % standard package loading declaration. If you use \LaTeXe, simply do the
269 % following.
270 % \begin{quote}
271 % \|\usepackage{umoline}|\SpecialIndex{\usepackage}
272 % \end{quote}
273 % If you still love \LaTeX-2.09, the following is what you have to do.
274 % \begin{quote}
275 % \|\documentstyle[..,umoline,...]|\Meta{style}\SpecialIndex{\documentstyle}
276 % \end{quote}
277 %
278 % You have the following three basic commands to draw underlines and
279 % relatives.
280 %
281 % \begin{itemize}
282 % \item \|\Underline|\Meta{text}
283 % \DescribeMacro{\Underline}\par
284 % Draw lines under the \meta{text}. \Underline{For example, this sentence
285 % is generated by
286 % {\tt\string\Underline\char`\{}\UMOspace{0pt}[0]{\tt For Example, }{\ldots}
287 % {\tt\char`\}}.}
288 %
289 % \item \|\Midline|\Meta{text}
290 % \DescribeMacro{\Midline}\par
291 % Draw lines as if hyphens are overlaid on the \meta{text}. \Midline{For
292 % example, this sentence is generated by
293 % {\tt\string\Midline\char`\{}\UMOspace{0pt}[0]{\tt For Example, }{\ldots}
294 % {\tt\char`\}}.}
295 %
296 % \item \|\Overline|\Meta{text}
297 % \DescribeMacro{\Overline}\par
298 % Draw lines over the \meta{text}. \Overline{For example, this sentence is
299 % generated by
300 % {\tt\string\Overline\char`\{}\UMOspace{0pt}[0]{\tt For Example, }{\ldots}
301 % {\tt\char`\}}.}
302 % \end{itemize}
303 %
304 % For each command shown above, its argument \meta{text} is the sequence of
305 % one of the following elements.
306 %
307 % \begin{itemize}
308 % \item
309 % Ordinary characters excluding those for command invocation and math
310 % staffs. For example;
311 %
312 % \begin{quote}
313 %\begin{verbatim}
314 %\Underline{Since this sentence does not have macro invocation nor math
315 %staffs, you may path it directly to the commands.}
316 %\end{verbatim}
317 % \end{quote}
318 %
319 % will produce the following result.
320 %
321 % \begin{quote}
322 % \Underline{Since this sentence does not have macro invocation nor math
323 % staffs, you may path it directly to the commands.}
324 % \end{quote}
325 %
326 % \item
327 % Character string surrounded by `\|{|' and `\|}|'. Any string that can be
328 % passed to \LaTeX's \|\mbox| is also able to be passed to \|\Underline| and
329 % its relatives. Since the string is processed as if it is packed into
330 % \|\mbox|, line break will never occur in the string. For example;
331 %
332 % \begin{quote}
333 %\begin{verbatim}
334 %\Underline{The {\textbf{boldface}} part and the math part {$y=x^2$} are
335 %surrounded by brace pairs because they have special characters.}
336 %\end{verbatim}
337 % \end{quote}
338 %
339 % will produce the following result.
340 % \begin{quote}
341 % \Underline{The {\textbf{boldface}} part and the math part {$y=x^2$} are
342 % surrounded by brace pairs because they have special characters.}
343 % \end{quote}
344 %
345 % \item
346 % Commands \|\UMOspace|, \|\UMOnewline| and \|\\| for spacing and line
347 % breaking. The usage of them will be shown later.
348 % \end{itemize}
349 %
350 %
351 %
352 % \subsection{Control Lines}
353 % \label{sec:usage-line}
354 %
355 % The default distance of the lines drawn by \|\Underline| and its relatives
356 % from baselines are defined as follows, where $b$ is the value of
357 % \|\baselineskip| and $a$ is the height of `-'\footnote{
358 %
359 % The height of `-' is not the distance between a baseline and the visible
360 % short line of the image of `-'. Rather, its invisible part is
361 % approximately twice as tall as the distance.}.
362 %
363 % Note that positive value
364 % means the lines are drawn above baselines, while below baselines if
365 % negative.
366 % \SpecialIndex{\baselineskip}
367 % \SpecialIndex{\strutbox}
368 %
369 % \begin{eqnarray*}
370 % \|\Underline|&:& -0.3b\ \hbox{(depth of \|\strutbox|)}\\
371 % \|\Midline|&:& +0.5a\\
372 % \|\Overline|&:& +0.7b\ \hbox{(height of \|\strutbox|)}
373 % \end{eqnarray*}
374 %
375 % If you wish to draw lines at the position other than the defaults, you may
376 % set the following {\em length commands} (or {\em dimen register} in TeX's
377 % jargon) to some appropriate positive values representing the distance from
378 % baselines using \|\setlength|.
379 %
380 % \begin{itemize}
381 % \item
382 % \makebox[12em]{\cs{UnderlineDepth} \dotfill}
383 % The depth of \|\Underline|
384 % \DescribeMacro{\UnderlineDepth}
385 %
386 % \item
387 % \makebox[12em]{\cs{MidlineHeight} \dotfill}
388 % The height of \|\Midline|
389 % \DescribeMacro{\MidlineHeight}
390 %
391 % \item
392 % \makebox[12em]{\cs{OverlineHeight} \dotfill}
393 % The height of \|\Overline|
394 % \DescribeMacro{\OverlineHeight}
395 % \end{itemize}
396 %
397 % Setting these commands to any negative values makes corresponding lines
398 % drawn at the defaults.
399 %
400 % \leavevmode\DescribeMacro{\MidlineChar}
401 % Another position control for \|\Midline| is to change the {\em reference}
402 % character by \|\Midline|\allowbreak\|Char|\Meta{$c$}. That is,
403 % \|\Midline| will be
404 % drawn $0.5a$ above baselines where $a$ is the height of $c$.
405 %
406 % \leavevmode\DescribeMacro{\UMOline}
407 % Yet another position control can be done by a generalized line drawing
408 % command;
409 %
410 % \begin{quote}
411 % \|\UMOline|\Meta{height}\Meta{text}
412 % \end{quote}
413 %
414 % This command draw lines \meta{height} above (or below if negative)
415 % baselines for the \meta{text}.
416 %
417 % \leavevmode\DescribeMacro{\UMOlineThickness}
418 % The thickness of lines is the value set to the length-command
419 % \|\UMOlineThickness|, whose default value is 0.4\,pt.
420 %
421 %
422 %
423 % \subsection{Explicit Spacing and Line Breaking}
424 % \label{sec:usage-space}
425 %
426 % If the argument \meta{text} has a command invocation, it should be
427 % surrounded by `\|{|' and `\|}|' and its result will be packed in a
428 % \|\mbox|. Therefore a space inserted by \|{\hspace|\Meta{len}\|}| will
429 % not disappear when a line is broken just before the space. Commands for
430 % line breaking, such as \|\(no)linebreak|, \|\newline| and \|\\| will not
431 % have any effect in \|\mbox| (or cause error).
432 % \SpecialIndex{\hspace}
433 % \SpecialIndex{\linebreak}
434 % \SpecialIndex{\nolinebreak}
435 % \SpecialIndex{\newline}
436 % \SpecialIndex{\\}
437 %
438 % To solve these problems, the following commands for spacing and line
439 % breaking are available.
440 %
441 % \begin{itemize}
442 % \item
443 % \|\UMOspace|\Meta{len}\opt{num}
444 % \DescribeMacro{\UMOspace}\par
445 % A space of \meta{len} wide is inserted and will disappear if a line is
446 % broken just before the space. The optional argument \meta{num} discourage
447 % or encourage the line break at the space. If \meta{num} is non-negative,
448 % it discourages line breaking in the same way as the argument of
449 % \|\nolinebreak|. If negative, it encourages breaking and its absolute
450 % value corresponds to the argument of \|\linebreak|.
451 %
452 % Note that if \opt{num} follows `\|*|', \meta{num} is interpreted as the
453 % value to pass \TeX's \|\penalty|.
454 % \SpecialIndex{\penalty}
455 %
456 % \item
457 % \|\UMOspace*|\Meta{len}
458 % \DescribeMacro{\UMOspace*}\par
459 % A space of \meta{len} wide is inserted and will not disappear even if a
460 % line is broken at the space.
461 %
462 % \item
463 % \|\UMOnewline|, \|\\|
464 % \DescribeMacro{\UMOnewline}
465 % \DescribeMacro{\\}\par
466 % Terminate a line simply leaving space.
467 %
468 % \item
469 % \|\UMOnewline*|, \|\\*|
470 % \DescribeMacro{\UMOnewline*}
471 % \DescribeMacro{\\*}\par
472 % Terminate a line leaving underlined (or mid/overlined) space.
473 % \end{itemize}
474 %
475 %
476 %
477 % \subsection{Remarks}
478 % \label{sec:usage-note}
479 %
480 % \begin{enumerate}
481 % \item
482 % No hyphenation will be performed in \meta{text}.
483 %
484 % \item
485 % As other \LaTeX's commands, \|\verb| in \meta{text} may cause an error even
486 % if it surrounded by `\|{|' and `\|}|'.
487 %
488 % \item
489 % Also as other \LaTeX's commands, paragraph separator cannot be included in
490 % \meta{text} or you will have an error message.
491 %
492 % \item
493 % Processing time for underlined (or mid/overlined) text is approximately 10
494 % times as long as that for ordinary text. The size of dvi file also
495 % enlarged by factor three or so.
496 % \end{enumerate}
497 %
498 %
499 %
500 % \IndexPrologue{\newpage\section*{Index}
501 % Underlined number refers to the page where the specification of
502 % corresponding entry is described.}
503 % \StopEventually{\PrintIndex}
504 %
505 %
506 %
507 % \newpage
508 % \section{Implementation}
509 % \label{sec:imp}
510 %
511 % \subsection{Problems and Solution}
512 % \label{sec:imp-solution}
513 %
514 % The fundamental difficulty to draw underlines and its relatives is removed
515 % by restricting as \meta{text} may have {\em ordinary} characters and other
516 % staffs surrounded by \bracepair{} (called {\em blocked text}), because we
517 % can pick each element in \meta{text} and draw a line for the element.
518 % Thus remaining problems is {\em glues} that may be stretched or shrunk
519 % when a paragraph is build.
520 %
521 % This problem has the following two subproblems.
522 %
523 % \begin{enumerate}
524 % \item
525 % How can we obtain the natural width, stretch and shrink of a glue
526 % automatically inserted by \TeX's spacing mechanism?
527 %
528 % \item
529 % How can we draw the line having the same natural width, stretch and shrink
530 % as the glue?
531 % \end{enumerate}
532 %
533 % The second problem is relatively easy because we have \|\leaders| whose
534 % specification is as follows.
535 % \SpecialIndex{\leaders}
536 %
537 % \begin{quote}
538 % \|\leaders\hrule height|\meta{$h$}\|depth|\meta{$d$}\|\hskip|\meta{$s$}
539 % \end{quote}
540 %
541 % The important (and not well-known) feature of \|\leaders| is that $h$ and
542 % $d$ are not necessary to be non-negative, but $h$ simply specifies the
543 % distance between the upper edge of the line and the baseline, while $d$ is
544 % that for the lower edge\footnote{
545 %
546 % The lack of the knowledge of this fact caused one major drawback of
547 % \textsf{julem} in which a line for a space is terribly inefficiently drawn
548 % by \cs{leaders} with \cs{hbox} containing a very short line segment.}.
549 %
550 % Note that positive (negative) value of $h$ ($d$) means the edge is above
551 % the baseline, and negative (positive) means below it. Thus for an
552 % underline whose upper edge is $u$ below the baseline and thickness is $w$,
553 % we can simply do the following to have a space-like object that will be
554 % stretched or shrunk and will be potentially discarded on line breaking in
555 % the exactly same way as the space produced by \|\hskip|\meta{$s$}.
556 %
557 % \begin{quote}
558 % \|\leaders\hrule height|\meta{$-u$}\|depth|\meta{$u{+}w$}\|\hskip|\meta{$s$}
559 % \end{quote}
560 %
561 % Mid-lines and overlines are also drawn in similar ways.
562 %
563 % As for the first problem, we can calculate the natural width, stretch and
564 % shrink by simulating \TeX's spacing machanism. For each space in
565 % \meta{text} (but not in blocked text), let $f$ be the \|\spacefactor|
566 % defined by the word (or other object) preceeding the space, $d_i$ be the
567 % \|\fontdimen|\meta{$i$} of the selected font, $s$ and $x$ be \|\spaceskip|
568 % and \|\xspaceskip|, $n(g)$, $p(g)$ and $m(g)$ be the natural width and
569 % stetch/shrink factor of the glue $g$. The glue $\sigma$ inserted for
570 % the space is calculated as shown in Table~\ref{tab:space}.
571 % \SpecialIndex{\spacefactor}\SpecialIndex{\spaceskip}
572 % \SpecialIndex{\xspaceskip}
573 %
574 % \begin{table}[b]
575 % \caption{Glue for Interword Space}
576 % \label{tab:space}
577 % $$\arraycolsep0pt
578 % \begin{array}{r@{\;\land\;}l@{\quad}c@{\quad}c@{\quad}c}
579 % \multicolumn2c{\hbox{condition}}&n(\sigma)&p(\sigma)&m(\sigma)\\\hline
580 % f<2000&n(s)=0& d_2& d_3\cdot(f/1000)& d_4\cdot(1000/f)\\
581 % f<2000&n(s)\neq0& n(s)& p(s)\cdot(f/1000)& m(s)\cdot(1000/f)\\
582 % f\geq2000&n(x)=0& d_2+d_7&d_3\cdot(f/1000)& d_4\cdot(1000/f)\\
583 % f\geq2000&n(x)\neq0& n(x)& p(x)& m(x)
584 % \end{array}
585 % $$
586 % \end{table}
587 %
588 %
589 %
590 % \subsection{Tricks for Compatibility}
591 % \label{sec:imp-compat}
592 %
593 % At the very beginning of \textsf{umoline.sty}, we checks whether it is
594 % loaded by \LaTeXe{} or \LaTeX-2.09, and then declares \|\NeedsTeXFormat|
595 % and \|\ProvidesPackage| if \LaTeXe{}. This part is embedded at the
596 % beginning of \textsf{umoline.dtx} in a tricky manner to let
597 % \textsf{docstrip} produce the following code.
598 % \SpecialIndex{\NeedsTeXFormat}
599 % \SpecialIndex{\ProvidesPackage}
600 %
601 %\begin{quote}
602 %\begin{verbatim}
603 %\def\next{LaTeX2e}
604 %\ifx\fmtname\next
605 %\def\next{
606 %\NeedsTeXFormat{LaTeX2e}[1994/12/01]
607 %\ProvidesPackage{umoline}}
608 %\else\def\next[#1]{}\fi
609 %\next
610 %[2000/07/11 v1.1 ]
611 %\end{verbatim}
612 %\end{quote}
613 %
614 % \begin{macro}{\PackageError}
615 % We have to define \|\PackageError|, which is only \LaTeX2e-specific
616 % macro in \textsf{umoline}, using \|\@latexerr| if the macro has not yet
617 % defined (i.e. \LaTeX-2.09).
618 % \SpecialIndex{\@latexerr}
619 % \end{macro}
620 %
621 % \iffalse
622 %<*package>
623 % \fi
624 % \begin{macrocode}
625
626 \ifx\PackageError\undefined
627 \def\PackageError#1#2#3{\@latexerr{#1:#2}{#3^^J\@ehc}}
628 \fi
629
630 %%^L
631
632 % \end{macrocode}
633 %
634 %
635 %
636 % \subsection{Register Declaration}
637 % \label{sec:imp-decl}
638 %
639 % In \textsf{umoline}, we use the following registers and relatives.
640 %
641 % \begin{itemize}
642 % \item
643 % \begin{macro}{\UnderlineDepth}
644 % \|\UnderlineDepth| (dimen)\\
645 % The distance from baseline to the upper edge of an underline. It is
646 % initialized to a negative value (\|-\maxdimen|) to refer the default
647 % value, the depth of \|\strutbox|.
648 % \end{macro}
649 %
650 % \item
651 % \begin{macro}{\MidlineHeight}
652 % \|\MidlineHeight| (dimen)\\
653 % The distance from baseline to the lower edge of a mid-line. It is
654 % initialized to a negative value (\|-\maxdimen|) to refer the default
655 % value, the half height of \|\UMO@midlinechar| (see
656 % \S\ref{sec:imp-uifinit}).
657 % \end{macro}
658 %
659 % \item
660 % \begin{macro}{\OverlineHeight}
661 % \|\OverlineHeight| (dimen)\\
662 % The distance from baseline to the lower edge of a overline. It is
663 % initialized to a negative value (\|-\maxdimen|) to refer the default
664 % value, the height of \|\strutbox|.
665 % \end{macro}
666 %
667 % \item
668 % \begin{macro}{\UMOlineThickness}
669 % \|\UMOlineThickness| (dimen)\\
670 % The thickness of underlines and its relatives, and is initialized to the
671 % default 0.4\,pt.
672 % \end{macro}
673 %
674 % \item
675 % \begin{macro}{\UMO@height}
676 % \|\UMO@height| (dimen)\\
677 % The distance from baseline to the upper edge of lines, which is refered in
678 % line drawing procedure.
679 % \end{macro}
680 %
681 % \item
682 % \begin{macro}{\UMO@depth}
683 % \|\UMO@depth| (dimen)\\
684 % The distance from baseline to the lower edge of lines, which is refered in
685 % line drawing procedure.
686 % \end{macro}
687 %
688 % \item
689 % \begin{macro}{\UMO@spacefactor}
690 % \|\UMO@spacefactor| (count)\\
691 % The value of \|\spacefactor| at the time a word or blocked text is produced.
692 % \SpecialIndex{\spacefactor}
693 % \end{macro}
694 %
695 % \item
696 % \begin{macro}{\ifUMO@nospace}
697 % \|\ifUMO@nospace| (if)\\
698 % True if the word or blocked text currently processed is the first member of
699 % \meta{text} or is
700 % preceded by a blocked text (or its sequence) following a space. For such
701 % an element, we don't insert interword space before it.
702 % \end{macro}
703 % \end{itemize}
704 %
705 % \begin{macrocode}
706 %% Register Declaration
707
708 \newdimen\UnderlineDepth \UnderlineDepth-\maxdimen
709 \newdimen\MidlineHeight \MidlineHeight-\maxdimen
710 \newdimen\OverlineHeight \OverlineHeight-\maxdimen
711 \newdimen\UMOlineThickness \UMOlineThickness.4pt
712
713 \newdimen\UMO@height \newdimen\UMO@depth
714
715 \newcount\UMO@spacefactor
716
717 \newif\ifUMO@nospace
718
719 %%^L
720
721 % \end{macrocode}
722 %
723 % We also use the following registers defined by \LaTeX.
724 %
725 % \begin{itemize}\item[]
726 % \|\@tempboxa|\quad\|\@tempdima|\quad\|\@tempdimb|\quad
727 % \|\@tempskipa|\quad\|\@tempcnta|\\\|\if@tempswa|
728 % \SpecialIndex{\@tempboxa}
729 % \SpecialIndex{\@tempdima}
730 % \SpecialIndex{\@tempdimb}
731 % \SpecialIndex{\@tempskipa}
732 % \SpecialIndex{\@tempcnta}
733 % \SpecialIndex{\if@tempswa}
734 % \end{itemize}
735 %
736 %
737 %
738 %
739 % \subsection{User Interface and Initialization}
740 % \label{sec:imp-uifinit}
741 %
742 % \begin{macro}{\MidlineChar}
743 % \begin{macro}{\UMO@midlinechar}
744 % The macro \|\MidlineChar|\Meta{$c$} defines \meta{$c$} as the body of
745 % \|\UMO@midlinechar| that is refered by \|\Midline| to calculate its
746 % default height. The default of \meta{$c$}, `-', is also defined by
747 % \|\MidlineChar|.
748 % \end{macro}\end{macro}
749 %
750 % \begin{macrocode}
751 %% User Interface and Initialization
752
753 \def\MidlineChar{\def\UMO@midlinechar}
754 \MidlineChar{-}
755
756 % \end{macrocode}
757 %
758 % \begin{macro}{\Underline}
759 % \begin{macro}{\Midline}
760 % \begin{macro}{\Overline}
761 % \begin{macro}{\UMOline}
762 % The user interface macros, \|\Underline|\Meta{text},
763 % \|\Midline|\Meta{text}, \|\Overline|\Meta{text},
764 % \|\UMOline|\Meta{height}\Meta{text}, call the following common macro to
765 % draw lines at the position specific to them.
766 %
767 % \begin{quote}
768 % \|\UMO@line|\Meta{reg-or-def}\Meta{reg-height}\Meta{def-height}\Meta{text}
769 % \end{quote}
770 %
771 % The distance $\delta$ between baseline and the baseline-side edge of the
772 % line is defined by the following equation.
773 %
774 % \begin{equation}
775 % \delta=\cases{\meta{reg-height}&if $\meta{reg-or-def}\geq 0$\cr
776 % \meta{def-height}&if $\meta{reg-or-def}< 0$}
777 % \label{eq:delta}
778 % \end{equation}
779 %
780 % Therefore, the following argument passing properly controls the drawing
781 % position described in \S\ref{sec:usage-line}, where $c$ is the body of
782 % \|\UMO@midlinechar|.
783 %
784 % \begin{center}\begin{tabular}{l|lll}
785 % &\meta{reg-or-def}&\meta{reg-height}&\meta{def-height}\\\hline
786 % \|\Underline|&\|\UnderlineDepth|&\|-\UnderlineDepth|&\|\dp\strutbox|\\
787 % \|\Midline|&\|\MidlineHeight|&\|\MidlineHeight|&{\it height-of\/}(c)/2\\
788 % \|\Overline|&\|\OverlineHeight|&\|\OverlineHeight|&\|\ht\strutbox|\\
789 % \|\UMOline|&\|-\maxdimen|&---&\meta{height}\\
790 % \end{tabular}\end{center}
791 % \end{macro}\end{macro}\end{macro}\end{macro}
792 %
793 % \begin{macrocode}
794 \def\Underline{\UMO@line\UnderlineDepth{-\UnderlineDepth}{-\dp\strutbox}}
795 \def\Midline{\setbox\@tempboxa\hbox{\UMO@midlinechar}%
796 \UMO@line\MidlineHeight\MidlineHeight{.5\ht\@tempboxa}}
797 \def\Overline{\UMO@line\OverlineHeight\OverlineHeight{\ht\strutbox}}
798 \def\UMOline{\UMO@line{-\maxdimen}\z@}
799
800 % \end{macrocode}
801 %
802 % \begin{macro}{\UMO@line}
803 % \begin{macro}{\\}
804 % Since the behavior of the control character \|\\| in \meta{text} has to be
805 % different from that of its original version, \|\UMO@line| firstly opens a
806 % group to \|\let| the \|\\| be our own newline command \|\UMOnewline|.
807 %
808 % Next, we calculate $\delta$ of the equation (\ref{eq:delta}). Since
809 % $\delta$ is the distance from baseline to the baseline-side edge of the
810 % drawn line, we then calculate \|\UMO@height| ($h$) and \|\UMO@depth|
811 % ($d$) using the following equations, where $w$ is the value of
812 % \|\UMOlineThickness|.
813 %
814 % \begin{eqnarray}
815 % h&=&\cases{\delta+w&if $\delta\geq0$\cr
816 % \delta&if $\delta<0$}\\[.3ex]
817 % e&=&\cases{-\delta&if $\delta\geq0$\cr
818 % -\delta+w&if $\delta<0$}
819 % \end{eqnarray}
820 %
821 % Then \|\ifUMO@nospace| is set to true for the first element of \meta{text},
822 % \TeX's mode is turned to horizontal by \|\leavevmode| if necessary, and
823 % \|\UMO@spacefactor| is set to the current value of \|\spacefactor| to cope
824 % with the case that \meta{text} has a leading space.
825 %
826 % After those initializations, \|\UMO@wordloop| (see \S\ref{sec:imp-word})
827 % is invoked to process each space-separated word element in \meta{text}.
828 % The argument passed to \|\UMO@wordloop| has the form of;
829 %
830 % \begin{quote}
831 % $w_1$\verb*| |$w_2$\verb*| |\ldots\verb*| |$w_n$\verb*| \@nil |
832 % \end{quote}
833 %
834 % where $w_i$ is a word element. The last element \|\@nil| and the space
835 % following it is added to \meta{text} by a trick expanding
836 % \|\noexpand\@nil\space| using \|\edef| and expanding the result once more
837 % by \|\expandafter|.
838 %
839 % After \|\UMO@worldloop| completes its procedure for \meta{text},
840 % \|\UMO@line| close the group and invokes \|\UMO@aftergroup| to make
841 % \|\spacefactor| have an appropriate value when the space following
842 % \meta{text} processed by \TeX.
843 % \end{macro}\end{macro}
844 % \begin{macrocode}
845 \def\UMO@line#1#2#3#4{\begingroup \let\\\UMOnewline
846 \ifdim#1<\z@ \UMO@height#3\relax
847 \else \UMO@height#2\relax \fi
848 \UMO@depth-\UMO@height
849 \ifdim\UMO@height<\z@ \advance\UMO@depth\UMOlineThickness
850 \else \advance\UMO@height\UMOlineThickness \fi
851 \UMO@nospacetrue
852 \ifvmode\leavevmode\fi \UMO@spacefactor\spacefactor
853 \def\@tempa{#4 }\edef\@tempb{\noexpand\@nil\space}%
854 \expandafter\expandafter\expandafter\UMO@wordloop
855 \expandafter\@tempa\@tempb
856 \endgroup \UMO@aftergroup}
857
858 %%^L
859
860 % \end{macrocode}
861 %
862 %
863 %
864 % \subsection{Processing Word Elements}
865 % \label{sec:imp-word}
866 %
867 % Since we have \|\UMOspace| and \|\UMOnewline| (and \|\\| as its alias) as
868 % {\em top-level} elements of \meta{text}, we have to scan each character in
869 % \meta{text} to find them after picking space-separated word elements.
870 %
871 % \begin{macro}{\UMO@wordloop}
872 % The macro \|\UMO@wordloop| checks if the first character of given word
873 % element is `\|{|' by \|\UMO@ifbgroup|. If so, it invokes
874 % \|\UMO@wordblock| to process the blocked text following the character,
875 % while \|\UMO@iwordloop| is invoked to process characters in the word
876 % element otherwise.
877 % \end{macro}
878 %
879 % \begin{macro}{\UMO@ifbgroup}
880 % \begin{macro}{\UMO@ifnc}
881 % \SpecialIndex{\if@nextchar}
882 % The macro \|\UMO@ifbgroup|\meta{then}\meta{else} is similar to \LaTeX's
883 % \|\if@nextchar\bgroup|\meta{then}\allowbreak\meta{else}, but not
884 % equivalent because it does not skip spaces preceding `\|{|'. This
885 % feature is introduced to cope with a \meta{text} having leading spaces as
886 % the following.
887 %
888 % \begin{quote}
889 % \verb*|\Underline{ |\Meta{blocked-text}\ldots\|}|
890 % \end{quote}
891 %
892 % Removing the space skip feature makes the implementation of
893 % \|\UMO@ifbgroup| simpler because it just uses \|\futurelet| to get the
894 % following character.
895 % \end{macro}\end{macro}
896 %
897 % \begin{macrocode}
898 %% Processing Word Elements
899
900 \def\UMO@wordloop{\UMO@ifbgroup\UMO@wordblock\UMO@iwordloop}
901 \def\UMO@ifbgroup#1#2{\let\@tempa#1\let\@tempb#2\futurelet\@tempc\UMO@ifnc}
902 \def\UMO@ifnc{\ifx\@tempc\bgroup \let\next\@tempa \else\let\next\@tempb \fi
903 \next}
904 % \end{macrocode}
905 %
906 % \begin{macro}{\UMO@wordblock}
907 % \begin{macro}{\UMO@theword}
908 % The macro \|\UMO@wordblock|\Meta{blocked-text} at first produces an
909 % underline (or others) for the space followed by \Meta{blocked-text}, if
910 % exists, by \|\UMO@spaceskip| (see \S\ref{sec:imp-wordspace}). Next, it
911 % invokes \|\UMO@putword| (see \S\ref{sec:imp-drawline}) that produces
912 % underlined (or other type) word contained in the macro \|\UMO@theword|
913 % that is defined as \meta{blocked-text}. Finally, it repeats the procedure
914 % for word elements invoking \|\UMO@wordloop| turning \|\ifUMO@nospace| to
915 % true to indicate that the element directly following \Meta{blocked-text}
916 % does not follows a space.
917 %
918 % If \Meta{blocked-text} is followed by a space, it is detected by
919 % \|\UMO@iwordloop| to produce underlined (or other type) space before next
920 % word element is processed as shown later, and the \|\spacefactor| is set
921 % to the value determined by the last character (or a few trailing
922 % characters) of \meta{blocked-text}. Thus, it is not correct to say
923 % \meta{blocked-text} is packed into \|\mbox| and put because the
924 % \|\spacefacor| for \|\mbox| is always 1000. However, this feature will
925 % make the spacing of \meta{text} natural when it has blocked word.
926 % \end{macro}\end{macro}
927 %
928 % \begin{macrocode}
929 \def\UMO@wordblock#1{\UMO@spaceskip
930 \def\UMO@theword{#1}\UMO@putword \UMO@nospacetrue
931 \UMO@wordloop}
932 % \end{macrocode}
933 %
934 % \begin{macro}{\UMO@iwordloop}
935 % \begin{macro}{\UMO@theword}
936 % The macro \|\UMO@iwordloop|\meta{word}\verb*| | invokes \|\UMO@end| (see
937 % \S\ref{sec:imp-end}) for finalization if \meta{word} is \|\@nil|. If the
938 % \meta{word} is empty mainly because the preceding word element is a
939 % blocked text that \|\UMO@wordblock| has processed and removed,
940 % \|\ifUMO@nospace| is turned to false in order to insert a interword space
941 % preceding the next word element.
942 %
943 % Otherwise, \|\UMO@iwordloop| produces an
944 % underline (or others) for the space followed by \meta{word}, if
945 % exists, by \|\UMO@spaceskip| (see \S\ref{sec:imp-wordspace}). Then it
946 % invokes \|\UMO@charloop|\meta{word}\allowbreak\hbox{\|\@nil|} to process
947 % the character string of \meta{word} after initializing \|\UMO@theword|
948 % empty. Finally, \|\UMO@wordloop| is recursively invoked after turning
949 % \|\ifUMO@nospace| to false to indicate the \meta{word} is followed by a
950 % space.
951 % \end{macro}\end{macro}
952 %
953 % \begin{macrocode}
954 \def\UMO@iwordloop#1 {\def\@tempa{#1}\ifx\@tempa\@nnil \let\next\UMO@end
955 \else\ifx\@tempa\empty \else
956 \UMO@spaceskip
957 \def\UMO@theword{}\UMO@charloop#1\@nil\fi
958 \UMO@nospacefalse \let\next\UMO@wordloop \fi
959 \next}
960
961 % \end{macrocode}
962 %
963 % \begin{macro}{\UMO@charloop}
964 % The macro \|\UMO@charloop| checks if the given character
965 % is `\|{|' by \|\UMO@ifbgroup| (see above), because a word element may have
966 % a blocked text directly following a character string. If so, it invokes
967 % \|\UMO@charblock| to process the blocked text following the character,
968 % while \|\UMO@icharloop| is invoked to process the given characters as the
969 % member of word element otherwise.
970 % \end{macro}
971 %
972 % \begin{macro}{\UMO@charblock}
973 % \begin{macro}{\UMO@theword}
974 % The macro \|\UMO@charblock|\Meta{blocked-text} at first produces an
975 % underlined (or other type) word that precedes \Meta{blocked-text} by
976 % \|\UMO@putword| (see \S\ref{sec:imp-drawline}). Next, it
977 % invokes \|\UMO@putword| again but this time for \meta{blocked-text} that
978 % is \|\def|ined as the body of \|\UMO@theword|.
979 % Finally, it repeats the procedure
980 % for the remaining character string by invoking \|\UMO@charloop|.
981 % \end{macro}\end{macro}
982 %
983 % \begin{macrocode}
984 \def\UMO@charloop{\UMO@ifbgroup\UMO@charblock\UMO@icharloop}
985 \def\UMO@charblock#1{\UMO@putword
986 \def\UMO@theword{#1}\UMO@putword
987 \UMO@charloop}
988 % \end{macrocode}
989 %
990 % \begin{macro}{\UMO@icharloop}
991 % \begin{macro}{\UMO@theword}
992 % \|\UMO@icharloop|\meta{char} at first checks if the \meta{char} is
993 % \|\@nil|, \|\UMOspace| or \|\UMOnewline| (or its alias \|\\|). If the
994 % \meta{char} is one of them, the character string preceding the \meta{char}
995 % is underlined (or other-lined) by \|\UMO@putword| (see
996 % \S\ref{sec:imp-drawline}). Then \|\UMO@icharloop| finishes the procedure
997 % for the character string if \meta{char} is \|\@nil|, inserts underlined
998 % (or other type) space by \|\UMO@space| (see \S\ref{sec:imp-spnl}) if
999 % \|\UMOspace|, or breaks line by \|\UMO@newline| (see \S\ref{sec:imp-spnl})
1000 % if \|\UMOnewline|.
1001 %
1002 % Otherwise, the \meta{char} is appended to the tail of \|\UMO@theword| and
1003 % \|\UMO@charloop| is recursively invoked for the following characters.
1004 % \end{macro}\end{macro}
1005 %
1006 % \begin{macro}{\UMOspace}
1007 % \begin{macro}{\UMOnewline}
1008 % Note that the control sequences \|\UMOspace| and \|\UMOnewline| cannot be
1009 % processed properly if they occur in a context other than the argument of
1010 % \|\UMO@icharloop|, for example outside of \|\Underline|. Thus they are
1011 % defined to complain about their illegal occurrence by \|\PackageError|.
1012 % \end{macro}\end{macro}
1013 %
1014 % \begin{macrocode}
1015 \def\UMO@icharloop#1{\def\@tempa{#1}%
1016 \ifx\@tempa\@nnil \UMO@putword \let\next\relax
1017 \else\ifx\UMOspace#1\relax \UMO@putword \let\next\UMO@space
1018 \else\ifx\UMOnewline#1\relax \UMO@putword \let\next\UMO@newline
1019 \else\edef\UMO@theword{\UMO@theword#1}%
1020 \let\next\UMO@charloop \fi\fi\fi \next}
1021 \def\UMOspace{\PackageError{jumoline}%
1022 {\string\UMOspace\space cannot be used here.}%
1023 {\string\UMOspace\space can be used only in the argument of
1024 \string\Underline\space and its relatives.}}
1025 \def\UMOnewline{\PackageError{jumoline}%
1026 {\string\UMOnewline\space cannot be used here.}%
1027 {\string\UMOnewline\space can be used only in the argument of
1028 \string\Underline\space and its relatives.}}
1029
1030 %%^L
1031
1032 % \end{macrocode}
1033 %
1034 %
1035 %
1036 % \subsection{Interword Spacing}
1037 % \label{sec:imp-wordspace}
1038 %
1039 % \begin{macro}{\UMO@spaceskip}
1040 % The macro \|\UMO@spaceskip| produces an underline (or others) for an
1041 % interword space if \|\ifUMO@nospace| is false. Since the glue for the
1042 % space is calculated as shown in Table~\ref{tab:space}, it invokes
1043 % \|\UMO@skip|\meta{$\sigma$} (see \S\ref{sec:imp-drawline}) after setting
1044 % \|\@tempskipa| to $\sigma$ calculated referring \|\UMO@spacefactor| that is
1045 % the value of \|\spacefactor| at the time the word preceding the space is
1046 % processed.
1047 % \end{macro}
1048 %
1049 % \begin{macro}{\UMO@setspaceskip}
1050 % A non-trivial part of the calculation of $\sigma$ is to obtain the natural
1051 % width and stretch/shrink factor of \|\spaceskip| ($s$) individually.
1052 % Since no convenient primitives to obtain $n(s)$, $p(s)$ and $m(s)$ are
1053 % available, we have to define a macro \|\UMO@setspaceskip| that processes
1054 % the character string representation of $s$, \meta{the-s}, which is
1055 % obtained by \|\the\spaceskip|. This \meta{the-s} is represented in one of
1056 % the following four forms.
1057 % $$
1058 % \def\PLUS{\hbox{\tt\char`\ plus\char`\ }}
1059 % \def\MINUS{\hbox{\tt\char`\ minus\char`\ }}
1060 % \def\LAND{{\;\land\;}}
1061 % \meta{the-s}=\cases{n(s)& if $p(s)=0\LAND m(s)=0$\cr
1062 % n(s)\PLUS p(s)& if $p(s)\neq0\LAND m(s)=0$\cr
1063 % n(s)\MINUS m(s)& if $p(s)=0\LAND m(s)\neq0$\cr
1064 % n(s)\PLUS p(s)\MINUS m(s)&if $p(s)\neq0\LAND m(s)\neq0$}
1065 % $$
1066 % Thus \|\UMO@spaceskip| invokes \|\UMO@setspaceskip| by the following
1067 % tricky sequence;
1068 %
1069 % \begin{quote}
1070 % \|\UMO@setspaceskip|\meta{the-s}\verb*| @ @ @ @ \@nil|
1071 % \end{quote}
1072 %
1073 % in order to pass at least six elements (sixth is a garbage) separated by
1074 % five spaces. The part from \meta{the-s} to the preceding space of
1075 % \|\@nil| of the calling sequence shown above is generated by a trick
1076 % expanding ``\|\the\spaceskip\space @ @ @ @ |'' using \|\edef| and
1077 % expanding the result once more by \|\expandafter|.
1078 %
1079 % On the other hand, the argument syntax of \|\UMO@setspaceskip| is as
1080 % follows.
1081 %
1082 % \begin{itemize}\item[]
1083 % \|\UMO@setspaceskip|\meta{$n$}\verb*| |\meta{plus-or-minus}\verb*| |
1084 % \meta{p-or-m}\verb*| |\meta{minus}\verb*| |\meta{$m$}\verb*| |
1085 % \meta{trailer}\|\@nil|
1086 % \end{itemize}
1087 %
1088 % Thus we will know how \meta{the-s} is represented by checking whether
1089 % \meta{plus-or-minus} is ``\|plus|'', ``\|minus|'' or ``\|@|'', and whether
1090 % \meta{minus} is ``\|\minus|'' or ``\|@|'', in order to set \|\@tempskipa|
1091 % to an appropriate glue.
1092 % \end{macro}
1093 %
1094 % \begin{macro}{\UMO@plus}
1095 % \begin{macro}{\UMO@minus}
1096 % \changes{v1.1-1}{2000/07/11}
1097 % {Fixed the misspell of the macro names for \texttt{plus} and
1098 % \texttt{minus}.}
1099 % Note that ``\|plus|'' and ``\|minus|'' shown above have to consist of
1100 % characters whose \|\catcode| are not 11 but 12. To obtain these unusual
1101 % character strings easily, we \|\def|ine \|\UMO@plus| and \|\UMO@minus| as
1102 % these strings beforehand by extracting them from \|\the\@tempskipa| that
1103 % contains ``\|\1pt plus 2pt minus 3pt|''.
1104 % \end{macro}\end{macro}
1105 %
1106 % \begin{macrocode}
1107 %% Interword Spacing
1108
1109 \def\UMO@spaceskip{\ifUMO@nospace\else
1110 \ifdim\spaceskip=\z@
1111 \@tempdima\fontdimen3\font\relax
1112 \multiply\@tempdima\UMO@spacefactor \divide\@tempdima\@m
1113 \@tempdimb\fontdimen4\font\relax \multiply\@tempdimb\@m
1114 \divide\@tempdimb\UMO@spacefactor
1115 \@tempskipa\fontdimen2\font plus\@tempdima minus\@tempdimb\relax
1116 \else
1117 \edef\@tempa{\the\spaceskip\space @ @ @ @ }%
1118 \expandafter\UMO@setspaceskip\@tempa\@nil
1119 \fi
1120 \ifnum\UMO@spacefactor<2000\else
1121 \ifdim\xspaceskip=\z@ \advance\@tempskipa\fontdimen7\font
1122 \else \@tempskipa\xspaceskip
1123 \fi\fi
1124 \UMO@skip\@tempskipa \fi}
1125 \def\UMO@setspaceskip#1 #2 #3 #4 #5 #6\@nil{\@tempdima\z@ \@tempdimb\z@
1126 \def\@tempa{#2}\def\@tempb{#3}%
1127 \ifx\@tempa\UMO@plus \@tempdima#3\def\@tempa{#4}\def\@tempb{#5}\fi
1128 \ifx\@tempa\UMO@minus \@tempdimb\@tempb\relax\fi
1129 \multiply\@tempdima\UMO@specefactor \divide\@tempdima\@m
1130 \multiply\@tempdimb\@m \divide\UMO@spacefactor
1131 \@tempskipa#1 plus\@tempdima minus\@tempdimb\relax}
1132 \def\@tempa#1 #2 #3 #4 #5\@nil{\def\UMO@plus{#2}\def\UMO@minus{#4}}
1133 \@tempskipa1pt plus 2pt minus 3pt
1134 \expandafter\@tempa\the\@tempskipa\@nil
1135
1136 %%^L
1137
1138 % \end{macrocode}
1139 %
1140 %
1141 %
1142 % \subsection{Drawing Lines}
1143 % \label{sec:imp-drawline}
1144 %
1145 % \begin{macro}{\UMO@putword}
1146 % \|\UMO@putword| produces a \|\hbox| containing a \meta{word}
1147 % defined as the body of \|\UMO@theword| and an underline (or others) for
1148 % the \meta{word}. The width of line is that of the \|\hbox|, and the height
1149 % and depth is \|\UMO@height| and \|\UMO@depth| respectively. The line is
1150 % put by \|\rlap| so that it is laid over the \|\hbox|. After the box and
1151 % line is produced \|\UMO@theword| is reinitialized to empty.
1152 % \end{macro}
1153 %
1154 % \begin{macro}{\UMO@skip}
1155 % \|\UMO@skip|\Meta{glue} draws an underline (or others) for a
1156 % stretchable\slash shrinkable space of \meta{glue} by \|\leaders| as shown
1157 % in \S\ref{sec:imp-solution}.
1158 % \end{macro}
1159 %
1160 % \begin{macrocode}
1161 %% Draw Under/Mid/Overline
1162
1163 \def\UMO@putword{\setbox\@tempboxa\hbox{\UMO@theword
1164 \global\UMO@spacefactor\spacefactor}%
1165 \@tempdima\wd\@tempboxa
1166 \rlap{\vrule\@height\UMO@height\@depth\UMO@depth\@width\@tempdima}%
1167 \box\@tempboxa\def\UMO@theword{}}
1168 \def\UMO@skip#1{%
1169 \leaders\hrule\@height\UMO@height\@depth\UMO@depth\hskip#1\relax}
1170
1171 %%^L
1172
1173 % \end{macrocode}
1174 %
1175 %
1176 %
1177 % \subsection{Explicit Spacing and Line Breaking}
1178 % \label{sec:imp-spnl}
1179 %
1180 % \begin{macro}{\UMO@space}
1181 % \begin{macro}{\UMO@sspace}
1182 % \begin{macro}{\UMO@ispace}
1183 % \begin{macro}{\UMO@iispace}
1184 % \begin{macro}{\UMO@penalty}
1185 % The procedure for the user interface control sequence
1186 % \|\UMOspace|\Meta{glue}\opt{pen} is performed by \|\UMO@space| to check
1187 % the existence of `\|*|' directly following \|\UMOspace|, \|\UMO@ispace| to
1188 % check that of `\|*|' directly preceding \opt{pen}, and \|\UMO@iispace| to
1189 % check that of \opt{pen} and to invoke \|\UMO@skip| (see
1190 % \S\ref{sec:imp-drawline}) to draw a line for the space. The penalty is
1191 % inserted by \|\UMO@penalty| following \LaTeX's convention if \|\@tempswa|
1192 % is true or \TeX's otherwise.
1193 %
1194 % The sequence \|\UMOspace*|\Meta{glue} is processed by \|\UMO@sspace| that
1195 % inserts \|\vrule| of zero wide and \|\nobreak| as \|\hspace*| does, and
1196 % then draw a line by \|\UMO@skip| for a space of \meta{glue}.
1197 %
1198 % In both cases, \|\UMO@charloop| is invoked after underlined (or other
1199 % type) space is produced to process characters following \|\UMOspace|.
1200 % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
1201 %
1202 % \begin{macrocode}
1203 %% Explicit Spacing and Line Breaking
1204
1205 \def\UMO@space{\@ifstar\UMO@sspace\UMO@ispace}
1206 \def\UMO@sspace#1{\vrule width\z@\nobreak\UMO@skip{#1}\UMO@charloop}
1207 \def\UMO@ispace#1{\@tempskipa#1\relax
1208 \@ifstar{\@tempswafalse\UMO@iispace}{\@tempswatrue\UMO@iispace}}
1209 \def\UMO@iispace{\@ifnextchar[%]
1210 {\UMO@penalty}%
1211 {\UMO@skip\@tempskipa \UMO@charloop}}
1212 \def\UMO@penalty[#1]{\@tempcnta#1\relax
1213 \if@tempswa
1214 \ifnum\@tempcnta<\z@ \@tempcnta-\@tempcnta \fi
1215 \ifcase\@tempcnta \or
1216 \@tempcnta\@lowpenalty \or
1217 \@tempcnta\@medpenalty \or
1218 \@tempcnta\@highpenalty \else
1219 \@tempcnta\@M \fi
1220 \ifnum#1<\z@ \@tempcnta-\@tempcnta \fi \fi
1221 \penalty\@tempcnta \UMO@skip\@tempskipa \UMO@charloop}
1222
1223 % \end{macrocode}
1224 %
1225 % \begin{macro}{\UMO@newline}
1226 % The user interface control sequence \|\UMOnewline|(\|*|) is processed by
1227 % \|\UMO@newline|. It produces a underlined (or other type) space having
1228 % \|1fil| stretch factor by \|\UMO@skip| if `\|*|' is supplied, while a
1229 % space of \|1fil| is simply inserted otherwise. In both cases, \|\break|
1230 % is inserted after the space to break a line and \|\UMO@charloop| is
1231 % invoked for the characters following \|\UMOnewline|.
1232 % \end{macro}
1233 %
1234 % \begin{macrocode}
1235 \def\UMO@newline{\@ifstar{\UMO@skip{0pt plus1fil}\break \UMO@charloop}%
1236 {\hfil \break \UMO@charloop}}
1237
1238 %%^L
1239
1240 % \end{macrocode}
1241 %
1242 %
1243 %
1244 % \subsection{Finalization}
1245 % \label{sec:imp-end}
1246 %
1247 % \begin{macro}{\UMO@end}
1248 % \begin{macro}{\UMO@aftergroup}
1249 % When the \meta{text} is completely processed, \|\UMO@end| is invoked from
1250 % \|\UMO@iwordloop| to set \|\spacefactor| to the value at the last word
1251 % element is produced. Since this assignment has to be performed outside the
1252 % group that \|\UMO@line| has opened (see \S\ref{sec:imp-uifinit}), setting
1253 % \|\spacefactor| to \|\UMO@spacefactor| is \|\xdef|ined as the body of
1254 % \|\UMO@aftergroup| that is called by \|\UMO@line| after the group is closed.
1255 % \end{macro}\end{macro}
1256 %
1257 % \begin{macrocode}
1258 %% Finalization
1259
1260 \def\UMO@end{\xdef\UMO@aftergroup{\spacefactor\number\UMO@spacefactor}}
1261 % \end{macrocode}
1262 % \iffalse
1263 %</package>
1264 % \fi
1265 %
1266 %
1267 %
1268 % \IndexPrologue{\newpage\section*{Index}
1269 % Italicized number refers to the page where the specification and usage of
1270 % corresponding entry is described, while underlined is for the
1271 % implementation of the entry.\endgraf
1272 % 
1273 % To find a control sequence, remove prefixes \cs{@}, \cs{adl@} or
1274 % \cs{ifadl@} from its name if it has one of them.}
1275 % \Finale
1276 % \GlossaryPrologue{\newpage\section*{Revision History}}
1277 % \PrintChanges
1278 \endinput