diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-11 23:58:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-11 23:58:45 +0000 |
commit | 7bfbc9c1bf5365013609f5c3e3c776d3ccb4a150 (patch) | |
tree | 6bf64b9af4119436bbc48de7b6ecd9b3a9d4ec0f | |
parent | 894bcc2978b18ffb9d75dcca763eaa423dd93cc1 (diff) |
trunk/Master/texmf-dist/source/latex/umoline
git-svn-id: svn://tug.org/texlive/trunk@572 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/source/latex/umoline/umoline.dtx | 1278 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/umoline/umoline.ins | 6 |
2 files changed, 1284 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/umoline/umoline.dtx b/Master/texmf-dist/source/latex/umoline/umoline.dtx new file mode 100644 index 00000000000..9efadccf4c3 --- /dev/null +++ b/Master/texmf-dist/source/latex/umoline/umoline.dtx @@ -0,0 +1,1278 @@ +% \iffalse +%% Style file `umoline'. +%% Copyright (C) 1999,2000 Hiroshi Nakashima <nakasima@tutics.tut.ac.jp> +%% (Toyohashi Univ. of Tech.) +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% +% \fi +% +% \CheckSum{485} +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% \iffalse +%% +%<*dtx> +\ProvidesFile{umoline.dtx} +%</dtx> +%<package>\def\next{LaTeX2e} +%<package>\ifx\fmtname\next +%<package>\def\next{ +%<package>\NeedsTeXFormat{LaTeX2e}[1994/12/01] +%<package>\ProvidesPackage{umoline}} +%<package>\else\def\next[#1]{}\fi +%<package>\next +%<driver>\ProvidesFile{umoline.drv} +% \fi +% \ProvidesFile{umoline.dtx} +[2000/07/11 v1.1 ] +% \iffalse +%<*driver> +\documentclass{ltxdoc} +\usepackage{umoline} +\DisableCrossrefs +\PageIndex +\CodelineNumbered +\RecordChanges +%</driver> +%<driver>\OnlyDescription +%<driver>\def\ONLYDESCRIPTION{} +%<*driver> +\advance\textwidth4em +\begin{document} +\DocInput{umoline.dtx} +\end{document} +%</driver> +% \fi +% \changes{v1.0}{1999/04/14} +% {The style is born from jumoline.} +% +% \errorcontextlines10000 +% \def\|{\verb|} +% \DeleteShortVerb\| +% \GetFileInfo{umoline.dtx} +% \setcounter{IndexColumns}{2} +% +% \def\bottomfraction{.9} +% \def\cs#1{\hbox{\tt\char\escapechar#1}} +% \def\Item{\vskip-\itemsep\vskip-\parsep\vskip0pt\item} +% +% \makeatletter +% \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation +% \global\@eqnswtrue +% \global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr +% $$\halign to \displaywidth\bgroup\hskip\@centering +% $\displaystyle\tabskip\z@{##}$\@eqnsel&\global\@eqcnt\@ne +% \hfil$\;{##}\;$\hfil +% &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil +% \tabskip\@centering&\llap{##}\tabskip\z@\cr} +% +% \def\Meta#1{\penalty\@highpenalty +% \hbox{{\tt\char`\{}{\it\meta{#1}}{\tt\char`\}}}} +% \def\opt#1{{\tt[}{\it\meta{#1}}{\tt]}} +% \def\optn#1{{\tt[#1]}} +% \def\arg#1{{\tt\char`\{#1\char`\}}} +% +% \let\latex@addmarginpar\@addmarginpar +% \let\latex@latex@warning@no@line\@latex@warning@no@line +% \def\@addmarginpar{\let\@latex@warning@no@line\@gobble +% \latex@addmarginpar +% \let\@latex@warning@no@line\latex@latex@warning@no@line} +% \let\@font@warning\@gobble +% +% \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist +% \edef\saved@macroname{\string#2} +% \def\makelabel##1{\llap{##1\hskip\@totalleftmargin}} +% \if@inlabel +% \let\@tempa\@empty \count@\macro@cnt +% \loop \ifnum\count@>\z@ +% \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat +% \edef\makelabel##1{\llap{\vtop to\baselineskip +% {\@tempa\hbox{##1}\vss} +% \hskip\@totalleftmargin}} +% \advance \macro@cnt \@ne +% \else \macro@cnt\@ne \fi +% \edef\@tempa{\noexpand\item[ +% #1 +% \noexpand\PrintMacroName +% \else +% \noexpand\PrintEnvName +% \fi +% {\string#2}]} +% \@tempa +% \global\advance\c@CodelineNo\@ne +% #1 +% \SpecialMainIndex{#2}\nobreak +% \DoNotIndex{#2} +% \else +% \SpecialMainEnvIndex{#2}\nobreak +% \fi +% \global\advance\c@CodelineNo\m@ne +% \ignorespaces} +% +% \def\DescribeOpt{\leavevmode\@bsphack\begingroup\MakePrivateLetters +% \Describe@Opt} +% \def\Describe@Opt#1{\endgroup \Describe@pt{#1}} +% \def\Describe@pt#1#2{ +% \marginpar{\raggedleft\PrintDescribeMacro{#1}} +% \SpecialOptUsageIndex{#1}{#2}} +% \def\SpecialOptUsageIndex#1#2{ +% \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar usage} +% \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar usage} +% \@esphack\ignorespaces} +% \def\SpecialOptMainIndex#1#2{ +% \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar main} +% \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar main} +% \@esphack\ignorespaces} +% \def\SpecialOptIndex#1#2{ +% \index{#1\actualchar{\protect\ttfamily#1} (#2)} +% \index{#2s:\levelchar{\protect\ttfamily#1}} +% \@esphack\ignorespaces} +% \def\SpecialOptIndexS#1#2{ +% \index{#1\actualchar{\protect\ttfamily#1} (#2)} +% \index{#2es:\levelchar{\protect\ttfamily#1}} +% \@esphack\ignorespaces} +% +% \def\SpecialMainIndex#1{\@bsphack +% \RemoveAtFromCS{#1} +% \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa +% \actualchar \string\verb +% \quotechar*\verbatimchar\string#1\verbatimchar +% \encapchar main}}\@tempa +% \@esphack} +% \def\SpecialIndex#1{\@bsphack +% \RemoveAtFromCS{#1} +% \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa +% \actualchar \string\verb +% \quotechar*\verbatimchar\string#1\verbatimchar}}\@tempa +% \@esphack} +% +% \let\RAFCempty\@empty +% \let\RAFCgobble\@gobble +% \makeatother +% \def\RemoveAtFromCS#1{\edef\RAFCtempa{\expandafter\RAFCgobble\string#1} +% \edef\RAFCtempa{\expandafter\string\csname\RAFCtempa\endcsname} +% \expandafter\iRemoveAtFromCS\RAFCtempa@\NIL} +% \def\iRemoveAtFromCS#1#2@#3\NIL{\def\RAFCtempb{#3} +% \ifx\RAFCtempb\RAFCempty \def\RAFCtempa{#2}\let\next\relax +% \else \def\RAFCtempa{#2@}\def\next{\iiRemoveAtFromCS#3\NIL} +% \def\RAFCtempb{#2} +% \ifx\RAFCtempb\RAFCempty +% \else\ifx\RAFCtempb\CommonCSPrefix +% \else\ifx\RAFCtempb\CommonIfPrefix +% \else \def\RAFCtempa{}\def\next{\xRemoveAtFromCS#2@#3\NIL}\fi\fi\fi\fi +% \next} +% \def\iiRemoveAtFromCS#1{\ifx#1@\edef\RAFCtempa{\RAFCtempa@} +% \let\next\iiRemoveAtFromCS +% \else \def\next{\xRemoveAtFromCS#1}\fi +% \next} +% \def\xRemoveAtFromCS#1@\NIL{\edef\RAFCtempa{#1\RAFCtempa}} +% \makeatletter +% +% \begingroup +% \gdef\@sverbcat{\catcode`\@\active\catcode`\#\active} +% \catcode`\@\active \gdef@{\char`\@\penalty\exhyphenpenalty} +% \catcode`\#\active \gdef#{\penalty\exhyphenpenalty} +% \endgroup +% \let\latex@sverb\@sverb +% \def\@sverb{\@sverbcat\latex@sverb} +% +% \def\theglossary{\onecolumn \glossary@prologue +% \GlossaryParms \let\item\@idxitem \ignorespaces} +% \def\endtheglossary{\relax} +% +% +% +% \def\bracepair{`{\tt\char`\{\char`\}'}} +% +% \ifx\ONLYDESCRIPTION\undefined\else +% \let\SpecialUsageIndex\SpecialMainIndex +% \let\SpecialOptUsageIndex\SpecialOptMainIndex +% \fi +% +% +% +% \edef\CommonCSPrefix{\expandafter\RAFCgobble\string\UMO} +% \edef\CommonIfPrefix{\expandafter\RAFCgobble\string\ifUMO} +% +% \title{\textsf{umoline}\\ +% The Package for Under/Mid/Overline for Long Texts\thanks{ +% This file has version number \fileversion, last revised \filedate.}} +% \author{Hiroshi Nakashima\\(Toyohashi Univ. of Tech.)} +% \date{\filedate} +% \maketitle +% +% \begin{abstract} +% This file provides macros to draw \|\Underline|, \|\Midline| and +% \|\Overline| with a long text allowing line breaking in the text. +% \end{abstract} +% +% \tableofcontents +% \newpage +% +% +% \section{Introduction} +% \label{sec:intro} +% +% Users of \TeX{} and \LaTeX{} often complain that a text with \|\underline| +% and \|\overline| cannot have line-break points in it. This makes it hard +% to draw lines under a sentence in order to, for example, show that the +% sentence is modified by a revision. +% +% Although it is almost impossible to find the perfect solution for the +% problem, we could have a acceptable approximation by introducing certain +% reasonable restrictions. For example, macros provided by \textsf{umoline} +% only accept {\em ordinary} texts as their objective texts to draw +% underline, etc. In fact, many \TeX{}ackers have written macros having this +% restriction, including author's \textsf{julem}\footnote{ +% +% This style was named by someone who distributed author's macro set posted +% to a news group, and thus the author himself does not know the reason why +% it is called so.} +% +% which copes with texts in both Japanese and English (and other European +% languages). The style, however, has a few drawbacks including that it +% consumes a huge amount of computational time and dvi-file space. +% +% The style \textsf{umoline} is designed to solve the problem minimizing +% the time/space consumption to some acceptable level although still they are +% not very small. Note that \textsf{umoline} is only for English (and +% possibly some other European language) and another style \textsf{jumoline} +% by the author is available for Japanese users. +% +% +% \section{Usage} +% \label{sec:usage} +% +% \subsection{Basic Usage} +% \label{sec:usage-basic} +% +% The package is usable to both \LaTeXe{} and \LaTeX-2.09 users with their +% standard package loading declaration. If you use \LaTeXe, simply do the +% following. +% \begin{quote} +% \|\usepackage{umoline}|\SpecialIndex{\usepackage} +% \end{quote} +% If you still love \LaTeX-2.09, the following is what you have to do. +% \begin{quote} +% \|\documentstyle[..,umoline,...]|\Meta{style}\SpecialIndex{\documentstyle} +% \end{quote} +% +% You have the following three basic commands to draw underlines and +% relatives. +% +% \begin{itemize} +% \item \|\Underline|\Meta{text} +% \DescribeMacro{\Underline}\par +% Draw lines under the \meta{text}. \Underline{For example, this sentence +% is generated by +% {\tt\string\Underline\char`\{}\UMOspace{0pt}[0]{\tt For Example, }{\ldots} +% {\tt\char`\}}.} +% +% \item \|\Midline|\Meta{text} +% \DescribeMacro{\Midline}\par +% Draw lines as if hyphens are overlaid on the \meta{text}. \Midline{For +% example, this sentence is generated by +% {\tt\string\Midline\char`\{}\UMOspace{0pt}[0]{\tt For Example, }{\ldots} +% {\tt\char`\}}.} +% +% \item \|\Overline|\Meta{text} +% \DescribeMacro{\Overline}\par +% Draw lines over the \meta{text}. \Overline{For example, this sentence is +% generated by +% {\tt\string\Overline\char`\{}\UMOspace{0pt}[0]{\tt For Example, }{\ldots} +% {\tt\char`\}}.} +% \end{itemize} +% +% For each command shown above, its argument \meta{text} is the sequence of +% one of the following elements. +% +% \begin{itemize} +% \item +% Ordinary characters excluding those for command invocation and math +% staffs. For example; +% +% \begin{quote} +%\begin{verbatim} +%\Underline{Since this sentence does not have macro invocation nor math +%staffs, you may path it directly to the commands.} +%\end{verbatim} +% \end{quote} +% +% will produce the following result. +% +% \begin{quote} +% \Underline{Since this sentence does not have macro invocation nor math +% staffs, you may path it directly to the commands.} +% \end{quote} +% +% \item +% Character string surrounded by `\|{|' and `\|}|'. Any string that can be +% passed to \LaTeX's \|\mbox| is also able to be passed to \|\Underline| and +% its relatives. Since the string is processed as if it is packed into +% \|\mbox|, line break will never occur in the string. For example; +% +% \begin{quote} +%\begin{verbatim} +%\Underline{The {\textbf{boldface}} part and the math part {$y=x^2$} are +%surrounded by brace pairs because they have special characters.} +%\end{verbatim} +% \end{quote} +% +% will produce the following result. +% \begin{quote} +% \Underline{The {\textbf{boldface}} part and the math part {$y=x^2$} are +% surrounded by brace pairs because they have special characters.} +% \end{quote} +% +% \item +% Commands \|\UMOspace|, \|\UMOnewline| and \|\\| for spacing and line +% breaking. The usage of them will be shown later. +% \end{itemize} +% +% +% +% \subsection{Control Lines} +% \label{sec:usage-line} +% +% The default distance of the lines drawn by \|\Underline| and its relatives +% from baselines are defined as follows, where $b$ is the value of +% \|\baselineskip| and $a$ is the height of `-'\footnote{ +% +% The height of `-' is not the distance between a baseline and the visible +% short line of the image of `-'. Rather, its invisible part is +% approximately twice as tall as the distance.}. +% +% Note that positive value +% means the lines are drawn above baselines, while below baselines if +% negative. +% \SpecialIndex{\baselineskip} +% \SpecialIndex{\strutbox} +% +% \begin{eqnarray*} +% \|\Underline|&:& -0.3b\ \hbox{(depth of \|\strutbox|)}\\ +% \|\Midline|&:& +0.5a\\ +% \|\Overline|&:& +0.7b\ \hbox{(height of \|\strutbox|)} +% \end{eqnarray*} +% +% If you wish to draw lines at the position other than the defaults, you may +% set the following {\em length commands} (or {\em dimen register} in TeX's +% jargon) to some appropriate positive values representing the distance from +% baselines using \|\setlength|. +% +% \begin{itemize} +% \item +% \makebox[12em]{\cs{UnderlineDepth} \dotfill} +% The depth of \|\Underline| +% \DescribeMacro{\UnderlineDepth} +% +% \item +% \makebox[12em]{\cs{MidlineHeight} \dotfill} +% The height of \|\Midline| +% \DescribeMacro{\MidlineHeight} +% +% \item +% \makebox[12em]{\cs{OverlineHeight} \dotfill} +% The height of \|\Overline| +% \DescribeMacro{\OverlineHeight} +% \end{itemize} +% +% Setting these commands to any negative values makes corresponding lines +% drawn at the defaults. +% +% \leavevmode\DescribeMacro{\MidlineChar} +% Another position control for \|\Midline| is to change the {\em reference} +% character by \|\Midline|\allowbreak\|Char|\Meta{$c$}. That is, +% \|\Midline| will be +% drawn $0.5a$ above baselines where $a$ is the height of $c$. +% +% \leavevmode\DescribeMacro{\UMOline} +% Yet another position control can be done by a generalized line drawing +% command; +% +% \begin{quote} +% \|\UMOline|\Meta{height}\Meta{text} +% \end{quote} +% +% This command draw lines \meta{height} above (or below if negative) +% baselines for the \meta{text}. +% +% \leavevmode\DescribeMacro{\UMOlineThickness} +% The thickness of lines is the value set to the length-command +% \|\UMOlineThickness|, whose default value is 0.4\,pt. +% +% +% +% \subsection{Explicit Spacing and Line Breaking} +% \label{sec:usage-space} +% +% If the argument \meta{text} has a command invocation, it should be +% surrounded by `\|{|' and `\|}|' and its result will be packed in a +% \|\mbox|. Therefore a space inserted by \|{\hspace|\Meta{len}\|}| will +% not disappear when a line is broken just before the space. Commands for +% line breaking, such as \|\(no)linebreak|, \|\newline| and \|\\| will not +% have any effect in \|\mbox| (or cause error). +% \SpecialIndex{\hspace} +% \SpecialIndex{\linebreak} +% \SpecialIndex{\nolinebreak} +% \SpecialIndex{\newline} +% \SpecialIndex{\\} +% +% To solve these problems, the following commands for spacing and line +% breaking are available. +% +% \begin{itemize} +% \item +% \|\UMOspace|\Meta{len}\opt{num} +% \DescribeMacro{\UMOspace}\par +% A space of \meta{len} wide is inserted and will disappear if a line is +% broken just before the space. The optional argument \meta{num} discourage +% or encourage the line break at the space. If \meta{num} is non-negative, +% it discourages line breaking in the same way as the argument of +% \|\nolinebreak|. If negative, it encourages breaking and its absolute +% value corresponds to the argument of \|\linebreak|. +% +% Note that if \opt{num} follows `\|*|', \meta{num} is interpreted as the +% value to pass \TeX's \|\penalty|. +% \SpecialIndex{\penalty} +% +% \item +% \|\UMOspace*|\Meta{len} +% \DescribeMacro{\UMOspace*}\par +% A space of \meta{len} wide is inserted and will not disappear even if a +% line is broken at the space. +% +% \item +% \|\UMOnewline|, \|\\| +% \DescribeMacro{\UMOnewline} +% \DescribeMacro{\\}\par +% Terminate a line simply leaving space. +% +% \item +% \|\UMOnewline*|, \|\\*| +% \DescribeMacro{\UMOnewline*} +% \DescribeMacro{\\*}\par +% Terminate a line leaving underlined (or mid/overlined) space. +% \end{itemize} +% +% +% +% \subsection{Remarks} +% \label{sec:usage-note} +% +% \begin{enumerate} +% \item +% No hyphenation will be performed in \meta{text}. +% +% \item +% As other \LaTeX's commands, \|\verb| in \meta{text} may cause an error even +% if it surrounded by `\|{|' and `\|}|'. +% +% \item +% Also as other \LaTeX's commands, paragraph separator cannot be included in +% \meta{text} or you will have an error message. +% +% \item +% Processing time for underlined (or mid/overlined) text is approximately 10 +% times as long as that for ordinary text. The size of dvi file also +% enlarged by factor three or so. +% \end{enumerate} +% +% +% +% \IndexPrologue{\newpage\section*{Index} +% Underlined number refers to the page where the specification of +% corresponding entry is described.} +% \StopEventually{\PrintIndex} +% +% +% +% \newpage +% \section{Implementation} +% \label{sec:imp} +% +% \subsection{Problems and Solution} +% \label{sec:imp-solution} +% +% The fundamental difficulty to draw underlines and its relatives is removed +% by restricting as \meta{text} may have {\em ordinary} characters and other +% staffs surrounded by \bracepair{} (called {\em blocked text}), because we +% can pick each element in \meta{text} and draw a line for the element. +% Thus remaining problems is {\em glues} that may be stretched or shrunk +% when a paragraph is build. +% +% This problem has the following two subproblems. +% +% \begin{enumerate} +% \item +% How can we obtain the natural width, stretch and shrink of a glue +% automatically inserted by \TeX's spacing mechanism? +% +% \item +% How can we draw the line having the same natural width, stretch and shrink +% as the glue? +% \end{enumerate} +% +% The second problem is relatively easy because we have \|\leaders| whose +% specification is as follows. +% \SpecialIndex{\leaders} +% +% \begin{quote} +% \|\leaders\hrule height|\meta{$h$}\|depth|\meta{$d$}\|\hskip|\meta{$s$} +% \end{quote} +% +% The important (and not well-known) feature of \|\leaders| is that $h$ and +% $d$ are not necessary to be non-negative, but $h$ simply specifies the +% distance between the upper edge of the line and the baseline, while $d$ is +% that for the lower edge\footnote{ +% +% The lack of the knowledge of this fact caused one major drawback of +% \textsf{julem} in which a line for a space is terribly inefficiently drawn +% by \cs{leaders} with \cs{hbox} containing a very short line segment.}. +% +% Note that positive (negative) value of $h$ ($d$) means the edge is above +% the baseline, and negative (positive) means below it. Thus for an +% underline whose upper edge is $u$ below the baseline and thickness is $w$, +% we can simply do the following to have a space-like object that will be +% stretched or shrunk and will be potentially discarded on line breaking in +% the exactly same way as the space produced by \|\hskip|\meta{$s$}. +% +% \begin{quote} +% \|\leaders\hrule height|\meta{$-u$}\|depth|\meta{$u{+}w$}\|\hskip|\meta{$s$} +% \end{quote} +% +% Mid-lines and overlines are also drawn in similar ways. +% +% As for the first problem, we can calculate the natural width, stretch and +% shrink by simulating \TeX's spacing machanism. For each space in +% \meta{text} (but not in blocked text), let $f$ be the \|\spacefactor| +% defined by the word (or other object) preceeding the space, $d_i$ be the +% \|\fontdimen|\meta{$i$} of the selected font, $s$ and $x$ be \|\spaceskip| +% and \|\xspaceskip|, $n(g)$, $p(g)$ and $m(g)$ be the natural width and +% stetch/shrink factor of the glue $g$. The glue $\sigma$ inserted for +% the space is calculated as shown in Table~\ref{tab:space}. +% \SpecialIndex{\spacefactor}\SpecialIndex{\spaceskip} +% \SpecialIndex{\xspaceskip} +% +% \begin{table}[b] +% \caption{Glue for Interword Space} +% \label{tab:space} +% $$\arraycolsep0pt +% \begin{array}{r@{\;\land\;}l@{\quad}c@{\quad}c@{\quad}c} +% \multicolumn2c{\hbox{condition}}&n(\sigma)&p(\sigma)&m(\sigma)\\\hline +% f<2000&n(s)=0& d_2& d_3\cdot(f/1000)& d_4\cdot(1000/f)\\ +% f<2000&n(s)\neq0& n(s)& p(s)\cdot(f/1000)& m(s)\cdot(1000/f)\\ +% f\geq2000&n(x)=0& d_2+d_7&d_3\cdot(f/1000)& d_4\cdot(1000/f)\\ +% f\geq2000&n(x)\neq0& n(x)& p(x)& m(x) +% \end{array} +% $$ +% \end{table} +% +% +% +% \subsection{Tricks for Compatibility} +% \label{sec:imp-compat} +% +% At the very beginning of \textsf{umoline.sty}, we checks whether it is +% loaded by \LaTeXe{} or \LaTeX-2.09, and then declares \|\NeedsTeXFormat| +% and \|\ProvidesPackage| if \LaTeXe{}. This part is embedded at the +% beginning of \textsf{umoline.dtx} in a tricky manner to let +% \textsf{docstrip} produce the following code. +% \SpecialIndex{\NeedsTeXFormat} +% \SpecialIndex{\ProvidesPackage} +% +%\begin{quote} +%\begin{verbatim} +%\def\next{LaTeX2e} +%\ifx\fmtname\next +%\def\next{ +%\NeedsTeXFormat{LaTeX2e}[1994/12/01] +%\ProvidesPackage{umoline}} +%\else\def\next[#1]{}\fi +%\next +%[2000/07/11 v1.1 ] +%\end{verbatim} +%\end{quote} +% +% \begin{macro}{\PackageError} +% We have to define \|\PackageError|, which is only \LaTeX2e-specific +% macro in \textsf{umoline}, using \|\@latexerr| if the macro has not yet +% defined (i.e. \LaTeX-2.09). +% \SpecialIndex{\@latexerr} +% \end{macro} +% +% \iffalse +%<*package> +% \fi +% \begin{macrocode} + +\ifx\PackageError\undefined +\def\PackageError#1#2#3{\@latexerr{#1:#2}{#3^^J\@ehc}} +\fi + +%%^L + +% \end{macrocode} +% +% +% +% \subsection{Register Declaration} +% \label{sec:imp-decl} +% +% In \textsf{umoline}, we use the following registers and relatives. +% +% \begin{itemize} +% \item +% \begin{macro}{\UnderlineDepth} +% \|\UnderlineDepth| (dimen)\\ +% The distance from baseline to the upper edge of an underline. It is +% initialized to a negative value (\|-\maxdimen|) to refer the default +% value, the depth of \|\strutbox|. +% \end{macro} +% +% \item +% \begin{macro}{\MidlineHeight} +% \|\MidlineHeight| (dimen)\\ +% The distance from baseline to the lower edge of a mid-line. It is +% initialized to a negative value (\|-\maxdimen|) to refer the default +% value, the half height of \|\UMO@midlinechar| (see +% \S\ref{sec:imp-uifinit}). +% \end{macro} +% +% \item +% \begin{macro}{\OverlineHeight} +% \|\OverlineHeight| (dimen)\\ +% The distance from baseline to the lower edge of a overline. It is +% initialized to a negative value (\|-\maxdimen|) to refer the default +% value, the height of \|\strutbox|. +% \end{macro} +% +% \item +% \begin{macro}{\UMOlineThickness} +% \|\UMOlineThickness| (dimen)\\ +% The thickness of underlines and its relatives, and is initialized to the +% default 0.4\,pt. +% \end{macro} +% +% \item +% \begin{macro}{\UMO@height} +% \|\UMO@height| (dimen)\\ +% The distance from baseline to the upper edge of lines, which is refered in +% line drawing procedure. +% \end{macro} +% +% \item +% \begin{macro}{\UMO@depth} +% \|\UMO@depth| (dimen)\\ +% The distance from baseline to the lower edge of lines, which is refered in +% line drawing procedure. +% \end{macro} +% +% \item +% \begin{macro}{\UMO@spacefactor} +% \|\UMO@spacefactor| (count)\\ +% The value of \|\spacefactor| at the time a word or blocked text is produced. +% \SpecialIndex{\spacefactor} +% \end{macro} +% +% \item +% \begin{macro}{\ifUMO@nospace} +% \|\ifUMO@nospace| (if)\\ +% True if the word or blocked text currently processed is the first member of +% \meta{text} or is +% preceded by a blocked text (or its sequence) following a space. For such +% an element, we don't insert interword space before it. +% \end{macro} +% \end{itemize} +% +% \begin{macrocode} +%% Register Declaration + +\newdimen\UnderlineDepth \UnderlineDepth-\maxdimen +\newdimen\MidlineHeight \MidlineHeight-\maxdimen +\newdimen\OverlineHeight \OverlineHeight-\maxdimen +\newdimen\UMOlineThickness \UMOlineThickness.4pt + +\newdimen\UMO@height \newdimen\UMO@depth + +\newcount\UMO@spacefactor + +\newif\ifUMO@nospace + +%%^L + +% \end{macrocode} +% +% We also use the following registers defined by \LaTeX. +% +% \begin{itemize}\item[] +% \|\@tempboxa|\quad\|\@tempdima|\quad\|\@tempdimb|\quad +% \|\@tempskipa|\quad\|\@tempcnta|\\\|\if@tempswa| +% \SpecialIndex{\@tempboxa} +% \SpecialIndex{\@tempdima} +% \SpecialIndex{\@tempdimb} +% \SpecialIndex{\@tempskipa} +% \SpecialIndex{\@tempcnta} +% \SpecialIndex{\if@tempswa} +% \end{itemize} +% +% +% +% +% \subsection{User Interface and Initialization} +% \label{sec:imp-uifinit} +% +% \begin{macro}{\MidlineChar} +% \begin{macro}{\UMO@midlinechar} +% The macro \|\MidlineChar|\Meta{$c$} defines \meta{$c$} as the body of +% \|\UMO@midlinechar| that is refered by \|\Midline| to calculate its +% default height. The default of \meta{$c$}, `-', is also defined by +% \|\MidlineChar|. +% \end{macro}\end{macro} +% +% \begin{macrocode} +%% User Interface and Initialization + +\def\MidlineChar{\def\UMO@midlinechar} +\MidlineChar{-} + +% \end{macrocode} +% +% \begin{macro}{\Underline} +% \begin{macro}{\Midline} +% \begin{macro}{\Overline} +% \begin{macro}{\UMOline} +% The user interface macros, \|\Underline|\Meta{text}, +% \|\Midline|\Meta{text}, \|\Overline|\Meta{text}, +% \|\UMOline|\Meta{height}\Meta{text}, call the following common macro to +% draw lines at the position specific to them. +% +% \begin{quote} +% \|\UMO@line|\Meta{reg-or-def}\Meta{reg-height}\Meta{def-height}\Meta{text} +% \end{quote} +% +% The distance $\delta$ between baseline and the baseline-side edge of the +% line is defined by the following equation. +% +% \begin{equation} +% \delta=\cases{\meta{reg-height}&if $\meta{reg-or-def}\geq 0$\cr +% \meta{def-height}&if $\meta{reg-or-def}< 0$} +% \label{eq:delta} +% \end{equation} +% +% Therefore, the following argument passing properly controls the drawing +% position described in \S\ref{sec:usage-line}, where $c$ is the body of +% \|\UMO@midlinechar|. +% +% \begin{center}\begin{tabular}{l|lll} +% &\meta{reg-or-def}&\meta{reg-height}&\meta{def-height}\\\hline +% \|\Underline|&\|\UnderlineDepth|&\|-\UnderlineDepth|&\|\dp\strutbox|\\ +% \|\Midline|&\|\MidlineHeight|&\|\MidlineHeight|&{\it height-of\/}(c)/2\\ +% \|\Overline|&\|\OverlineHeight|&\|\OverlineHeight|&\|\ht\strutbox|\\ +% \|\UMOline|&\|-\maxdimen|&---&\meta{height}\\ +% \end{tabular}\end{center} +% \end{macro}\end{macro}\end{macro}\end{macro} +% +% \begin{macrocode} +\def\Underline{\UMO@line\UnderlineDepth{-\UnderlineDepth}{-\dp\strutbox}} +\def\Midline{\setbox\@tempboxa\hbox{\UMO@midlinechar}% + \UMO@line\MidlineHeight\MidlineHeight{.5\ht\@tempboxa}} +\def\Overline{\UMO@line\OverlineHeight\OverlineHeight{\ht\strutbox}} +\def\UMOline{\UMO@line{-\maxdimen}\z@} + +% \end{macrocode} +% +% \begin{macro}{\UMO@line} +% \begin{macro}{\\} +% Since the behavior of the control character \|\\| in \meta{text} has to be +% different from that of its original version, \|\UMO@line| firstly opens a +% group to \|\let| the \|\\| be our own newline command \|\UMOnewline|. +% +% Next, we calculate $\delta$ of the equation (\ref{eq:delta}). Since +% $\delta$ is the distance from baseline to the baseline-side edge of the +% drawn line, we then calculate \|\UMO@height| ($h$) and \|\UMO@depth| +% ($d$) using the following equations, where $w$ is the value of +% \|\UMOlineThickness|. +% +% \begin{eqnarray} +% h&=&\cases{\delta+w&if $\delta\geq0$\cr +% \delta&if $\delta<0$}\\[.3ex] +% e&=&\cases{-\delta&if $\delta\geq0$\cr +% -\delta+w&if $\delta<0$} +% \end{eqnarray} +% +% Then \|\ifUMO@nospace| is set to true for the first element of \meta{text}, +% \TeX's mode is turned to horizontal by \|\leavevmode| if necessary, and +% \|\UMO@spacefactor| is set to the current value of \|\spacefactor| to cope +% with the case that \meta{text} has a leading space. +% +% After those initializations, \|\UMO@wordloop| (see \S\ref{sec:imp-word}) +% is invoked to process each space-separated word element in \meta{text}. +% The argument passed to \|\UMO@wordloop| has the form of; +% +% \begin{quote} +% $w_1$\verb*| |$w_2$\verb*| |\ldots\verb*| |$w_n$\verb*| \@nil | +% \end{quote} +% +% where $w_i$ is a word element. The last element \|\@nil| and the space +% following it is added to \meta{text} by a trick expanding +% \|\noexpand\@nil\space| using \|\edef| and expanding the result once more +% by \|\expandafter|. +% +% After \|\UMO@worldloop| completes its procedure for \meta{text}, +% \|\UMO@line| close the group and invokes \|\UMO@aftergroup| to make +% \|\spacefactor| have an appropriate value when the space following +% \meta{text} processed by \TeX. +% \end{macro}\end{macro} +% \begin{macrocode} +\def\UMO@line#1#2#3#4{\begingroup \let\\\UMOnewline + \ifdim#1<\z@ \UMO@height#3\relax + \else \UMO@height#2\relax \fi + \UMO@depth-\UMO@height + \ifdim\UMO@height<\z@ \advance\UMO@depth\UMOlineThickness + \else \advance\UMO@height\UMOlineThickness \fi + \UMO@nospacetrue + \ifvmode\leavevmode\fi \UMO@spacefactor\spacefactor + \def\@tempa{#4 }\edef\@tempb{\noexpand\@nil\space}% + \expandafter\expandafter\expandafter\UMO@wordloop + \expandafter\@tempa\@tempb + \endgroup \UMO@aftergroup} + +%%^L + +% \end{macrocode} +% +% +% +% \subsection{Processing Word Elements} +% \label{sec:imp-word} +% +% Since we have \|\UMOspace| and \|\UMOnewline| (and \|\\| as its alias) as +% {\em top-level} elements of \meta{text}, we have to scan each character in +% \meta{text} to find them after picking space-separated word elements. +% +% \begin{macro}{\UMO@wordloop} +% The macro \|\UMO@wordloop| checks if the first character of given word +% element is `\|{|' by \|\UMO@ifbgroup|. If so, it invokes +% \|\UMO@wordblock| to process the blocked text following the character, +% while \|\UMO@iwordloop| is invoked to process characters in the word +% element otherwise. +% \end{macro} +% +% \begin{macro}{\UMO@ifbgroup} +% \begin{macro}{\UMO@ifnc} +% \SpecialIndex{\if@nextchar} +% The macro \|\UMO@ifbgroup|\meta{then}\meta{else} is similar to \LaTeX's +% \|\if@nextchar\bgroup|\meta{then}\allowbreak\meta{else}, but not +% equivalent because it does not skip spaces preceding `\|{|'. This +% feature is introduced to cope with a \meta{text} having leading spaces as +% the following. +% +% \begin{quote} +% \verb*|\Underline{ |\Meta{blocked-text}\ldots\|}| +% \end{quote} +% +% Removing the space skip feature makes the implementation of +% \|\UMO@ifbgroup| simpler because it just uses \|\futurelet| to get the +% following character. +% \end{macro}\end{macro} +% +% \begin{macrocode} +%% Processing Word Elements + +\def\UMO@wordloop{\UMO@ifbgroup\UMO@wordblock\UMO@iwordloop} +\def\UMO@ifbgroup#1#2{\let\@tempa#1\let\@tempb#2\futurelet\@tempc\UMO@ifnc} +\def\UMO@ifnc{\ifx\@tempc\bgroup \let\next\@tempa \else\let\next\@tempb \fi + \next} +% \end{macrocode} +% +% \begin{macro}{\UMO@wordblock} +% \begin{macro}{\UMO@theword} +% The macro \|\UMO@wordblock|\Meta{blocked-text} at first produces an +% underline (or others) for the space followed by \Meta{blocked-text}, if +% exists, by \|\UMO@spaceskip| (see \S\ref{sec:imp-wordspace}). Next, it +% invokes \|\UMO@putword| (see \S\ref{sec:imp-drawline}) that produces +% underlined (or other type) word contained in the macro \|\UMO@theword| +% that is defined as \meta{blocked-text}. Finally, it repeats the procedure +% for word elements invoking \|\UMO@wordloop| turning \|\ifUMO@nospace| to +% true to indicate that the element directly following \Meta{blocked-text} +% does not follows a space. +% +% If \Meta{blocked-text} is followed by a space, it is detected by +% \|\UMO@iwordloop| to produce underlined (or other type) space before next +% word element is processed as shown later, and the \|\spacefactor| is set +% to the value determined by the last character (or a few trailing +% characters) of \meta{blocked-text}. Thus, it is not correct to say +% \meta{blocked-text} is packed into \|\mbox| and put because the +% \|\spacefacor| for \|\mbox| is always 1000. However, this feature will +% make the spacing of \meta{text} natural when it has blocked word. +% \end{macro}\end{macro} +% +% \begin{macrocode} +\def\UMO@wordblock#1{\UMO@spaceskip + \def\UMO@theword{#1}\UMO@putword \UMO@nospacetrue + \UMO@wordloop} +% \end{macrocode} +% +% \begin{macro}{\UMO@iwordloop} +% \begin{macro}{\UMO@theword} +% The macro \|\UMO@iwordloop|\meta{word}\verb*| | invokes \|\UMO@end| (see +% \S\ref{sec:imp-end}) for finalization if \meta{word} is \|\@nil|. If the +% \meta{word} is empty mainly because the preceding word element is a +% blocked text that \|\UMO@wordblock| has processed and removed, +% \|\ifUMO@nospace| is turned to false in order to insert a interword space +% preceding the next word element. +% +% Otherwise, \|\UMO@iwordloop| produces an +% underline (or others) for the space followed by \meta{word}, if +% exists, by \|\UMO@spaceskip| (see \S\ref{sec:imp-wordspace}). Then it +% invokes \|\UMO@charloop|\meta{word}\allowbreak\hbox{\|\@nil|} to process +% the character string of \meta{word} after initializing \|\UMO@theword| +% empty. Finally, \|\UMO@wordloop| is recursively invoked after turning +% \|\ifUMO@nospace| to false to indicate the \meta{word} is followed by a +% space. +% \end{macro}\end{macro} +% +% \begin{macrocode} +\def\UMO@iwordloop#1 {\def\@tempa{#1}\ifx\@tempa\@nnil \let\next\UMO@end + \else\ifx\@tempa\empty \else + \UMO@spaceskip + \def\UMO@theword{}\UMO@charloop#1\@nil\fi + \UMO@nospacefalse \let\next\UMO@wordloop \fi + \next} + +% \end{macrocode} +% +% \begin{macro}{\UMO@charloop} +% The macro \|\UMO@charloop| checks if the given character +% is `\|{|' by \|\UMO@ifbgroup| (see above), because a word element may have +% a blocked text directly following a character string. If so, it invokes +% \|\UMO@charblock| to process the blocked text following the character, +% while \|\UMO@icharloop| is invoked to process the given characters as the +% member of word element otherwise. +% \end{macro} +% +% \begin{macro}{\UMO@charblock} +% \begin{macro}{\UMO@theword} +% The macro \|\UMO@charblock|\Meta{blocked-text} at first produces an +% underlined (or other type) word that precedes \Meta{blocked-text} by +% \|\UMO@putword| (see \S\ref{sec:imp-drawline}). Next, it +% invokes \|\UMO@putword| again but this time for \meta{blocked-text} that +% is \|\def|ined as the body of \|\UMO@theword|. +% Finally, it repeats the procedure +% for the remaining character string by invoking \|\UMO@charloop|. +% \end{macro}\end{macro} +% +% \begin{macrocode} +\def\UMO@charloop{\UMO@ifbgroup\UMO@charblock\UMO@icharloop} +\def\UMO@charblock#1{\UMO@putword + \def\UMO@theword{#1}\UMO@putword + \UMO@charloop} +% \end{macrocode} +% +% \begin{macro}{\UMO@icharloop} +% \begin{macro}{\UMO@theword} +% \|\UMO@icharloop|\meta{char} at first checks if the \meta{char} is +% \|\@nil|, \|\UMOspace| or \|\UMOnewline| (or its alias \|\\|). If the +% \meta{char} is one of them, the character string preceding the \meta{char} +% is underlined (or other-lined) by \|\UMO@putword| (see +% \S\ref{sec:imp-drawline}). Then \|\UMO@icharloop| finishes the procedure +% for the character string if \meta{char} is \|\@nil|, inserts underlined +% (or other type) space by \|\UMO@space| (see \S\ref{sec:imp-spnl}) if +% \|\UMOspace|, or breaks line by \|\UMO@newline| (see \S\ref{sec:imp-spnl}) +% if \|\UMOnewline|. +% +% Otherwise, the \meta{char} is appended to the tail of \|\UMO@theword| and +% \|\UMO@charloop| is recursively invoked for the following characters. +% \end{macro}\end{macro} +% +% \begin{macro}{\UMOspace} +% \begin{macro}{\UMOnewline} +% Note that the control sequences \|\UMOspace| and \|\UMOnewline| cannot be +% processed properly if they occur in a context other than the argument of +% \|\UMO@icharloop|, for example outside of \|\Underline|. Thus they are +% defined to complain about their illegal occurrence by \|\PackageError|. +% \end{macro}\end{macro} +% +% \begin{macrocode} +\def\UMO@icharloop#1{\def\@tempa{#1}% + \ifx\@tempa\@nnil \UMO@putword \let\next\relax + \else\ifx\UMOspace#1\relax \UMO@putword \let\next\UMO@space + \else\ifx\UMOnewline#1\relax \UMO@putword \let\next\UMO@newline + \else\edef\UMO@theword{\UMO@theword#1}% + \let\next\UMO@charloop \fi\fi\fi \next} +\def\UMOspace{\PackageError{jumoline}% + {\string\UMOspace\space cannot be used here.}% + {\string\UMOspace\space can be used only in the argument of + \string\Underline\space and its relatives.}} +\def\UMOnewline{\PackageError{jumoline}% + {\string\UMOnewline\space cannot be used here.}% + {\string\UMOnewline\space can be used only in the argument of + \string\Underline\space and its relatives.}} + +%%^L + +% \end{macrocode} +% +% +% +% \subsection{Interword Spacing} +% \label{sec:imp-wordspace} +% +% \begin{macro}{\UMO@spaceskip} +% The macro \|\UMO@spaceskip| produces an underline (or others) for an +% interword space if \|\ifUMO@nospace| is false. Since the glue for the +% space is calculated as shown in Table~\ref{tab:space}, it invokes +% \|\UMO@skip|\meta{$\sigma$} (see \S\ref{sec:imp-drawline}) after setting +% \|\@tempskipa| to $\sigma$ calculated referring \|\UMO@spacefactor| that is +% the value of \|\spacefactor| at the time the word preceding the space is +% processed. +% \end{macro} +% +% \begin{macro}{\UMO@setspaceskip} +% A non-trivial part of the calculation of $\sigma$ is to obtain the natural +% width and stretch/shrink factor of \|\spaceskip| ($s$) individually. +% Since no convenient primitives to obtain $n(s)$, $p(s)$ and $m(s)$ are +% available, we have to define a macro \|\UMO@setspaceskip| that processes +% the character string representation of $s$, \meta{the-s}, which is +% obtained by \|\the\spaceskip|. This \meta{the-s} is represented in one of +% the following four forms. +% $$ +% \def\PLUS{\hbox{\tt\char`\ plus\char`\ }} +% \def\MINUS{\hbox{\tt\char`\ minus\char`\ }} +% \def\LAND{{\;\land\;}} +% \meta{the-s}=\cases{n(s)& if $p(s)=0\LAND m(s)=0$\cr +% n(s)\PLUS p(s)& if $p(s)\neq0\LAND m(s)=0$\cr +% n(s)\MINUS m(s)& if $p(s)=0\LAND m(s)\neq0$\cr +% n(s)\PLUS p(s)\MINUS m(s)&if $p(s)\neq0\LAND m(s)\neq0$} +% $$ +% Thus \|\UMO@spaceskip| invokes \|\UMO@setspaceskip| by the following +% tricky sequence; +% +% \begin{quote} +% \|\UMO@setspaceskip|\meta{the-s}\verb*| @ @ @ @ \@nil| +% \end{quote} +% +% in order to pass at least six elements (sixth is a garbage) separated by +% five spaces. The part from \meta{the-s} to the preceding space of +% \|\@nil| of the calling sequence shown above is generated by a trick +% expanding ``\|\the\spaceskip\space @ @ @ @ |'' using \|\edef| and +% expanding the result once more by \|\expandafter|. +% +% On the other hand, the argument syntax of \|\UMO@setspaceskip| is as +% follows. +% +% \begin{itemize}\item[] +% \|\UMO@setspaceskip|\meta{$n$}\verb*| |\meta{plus-or-minus}\verb*| | +% \meta{p-or-m}\verb*| |\meta{minus}\verb*| |\meta{$m$}\verb*| | +% \meta{trailer}\|\@nil| +% \end{itemize} +% +% Thus we will know how \meta{the-s} is represented by checking whether +% \meta{plus-or-minus} is ``\|plus|'', ``\|minus|'' or ``\|@|'', and whether +% \meta{minus} is ``\|\minus|'' or ``\|@|'', in order to set \|\@tempskipa| +% to an appropriate glue. +% \end{macro} +% +% \begin{macro}{\UMO@plus} +% \begin{macro}{\UMO@minus} +% \changes{v1.1-1}{2000/07/11} +% {Fixed the misspell of the macro names for \texttt{plus} and +% \texttt{minus}.} +% Note that ``\|plus|'' and ``\|minus|'' shown above have to consist of +% characters whose \|\catcode| are not 11 but 12. To obtain these unusual +% character strings easily, we \|\def|ine \|\UMO@plus| and \|\UMO@minus| as +% these strings beforehand by extracting them from \|\the\@tempskipa| that +% contains ``\|\1pt plus 2pt minus 3pt|''. +% \end{macro}\end{macro} +% +% \begin{macrocode} +%% Interword Spacing + +\def\UMO@spaceskip{\ifUMO@nospace\else + \ifdim\spaceskip=\z@ + \@tempdima\fontdimen3\font\relax + \multiply\@tempdima\UMO@spacefactor \divide\@tempdima\@m + \@tempdimb\fontdimen4\font\relax \multiply\@tempdimb\@m + \divide\@tempdimb\UMO@spacefactor + \@tempskipa\fontdimen2\font plus\@tempdima minus\@tempdimb\relax + \else + \edef\@tempa{\the\spaceskip\space @ @ @ @ }% + \expandafter\UMO@setspaceskip\@tempa\@nil + \fi + \ifnum\UMO@spacefactor<2000\else + \ifdim\xspaceskip=\z@ \advance\@tempskipa\fontdimen7\font + \else \@tempskipa\xspaceskip + \fi\fi + \UMO@skip\@tempskipa \fi} +\def\UMO@setspaceskip#1 #2 #3 #4 #5 #6\@nil{\@tempdima\z@ \@tempdimb\z@ + \def\@tempa{#2}\def\@tempb{#3}% + \ifx\@tempa\UMO@plus \@tempdima#3\def\@tempa{#4}\def\@tempb{#5}\fi + \ifx\@tempa\UMO@minus \@tempdimb\@tempb\relax\fi + \multiply\@tempdima\UMO@specefactor \divide\@tempdima\@m + \multiply\@tempdimb\@m \divide\UMO@spacefactor + \@tempskipa#1 plus\@tempdima minus\@tempdimb\relax} +\def\@tempa#1 #2 #3 #4 #5\@nil{\def\UMO@plus{#2}\def\UMO@minus{#4}} +\@tempskipa1pt plus 2pt minus 3pt +\expandafter\@tempa\the\@tempskipa\@nil + +%%^L + +% \end{macrocode} +% +% +% +% \subsection{Drawing Lines} +% \label{sec:imp-drawline} +% +% \begin{macro}{\UMO@putword} +% \|\UMO@putword| produces a \|\hbox| containing a \meta{word} +% defined as the body of \|\UMO@theword| and an underline (or others) for +% the \meta{word}. The width of line is that of the \|\hbox|, and the height +% and depth is \|\UMO@height| and \|\UMO@depth| respectively. The line is +% put by \|\rlap| so that it is laid over the \|\hbox|. After the box and +% line is produced \|\UMO@theword| is reinitialized to empty. +% \end{macro} +% +% \begin{macro}{\UMO@skip} +% \|\UMO@skip|\Meta{glue} draws an underline (or others) for a +% stretchable\slash shrinkable space of \meta{glue} by \|\leaders| as shown +% in \S\ref{sec:imp-solution}. +% \end{macro} +% +% \begin{macrocode} +%% Draw Under/Mid/Overline + +\def\UMO@putword{\setbox\@tempboxa\hbox{\UMO@theword + \global\UMO@spacefactor\spacefactor}% + \@tempdima\wd\@tempboxa + \rlap{\vrule\@height\UMO@height\@depth\UMO@depth\@width\@tempdima}% + \box\@tempboxa\def\UMO@theword{}} +\def\UMO@skip#1{% + \leaders\hrule\@height\UMO@height\@depth\UMO@depth\hskip#1\relax} + +%%^L + +% \end{macrocode} +% +% +% +% \subsection{Explicit Spacing and Line Breaking} +% \label{sec:imp-spnl} +% +% \begin{macro}{\UMO@space} +% \begin{macro}{\UMO@sspace} +% \begin{macro}{\UMO@ispace} +% \begin{macro}{\UMO@iispace} +% \begin{macro}{\UMO@penalty} +% The procedure for the user interface control sequence +% \|\UMOspace|\Meta{glue}\opt{pen} is performed by \|\UMO@space| to check +% the existence of `\|*|' directly following \|\UMOspace|, \|\UMO@ispace| to +% check that of `\|*|' directly preceding \opt{pen}, and \|\UMO@iispace| to +% check that of \opt{pen} and to invoke \|\UMO@skip| (see +% \S\ref{sec:imp-drawline}) to draw a line for the space. The penalty is +% inserted by \|\UMO@penalty| following \LaTeX's convention if \|\@tempswa| +% is true or \TeX's otherwise. +% +% The sequence \|\UMOspace*|\Meta{glue} is processed by \|\UMO@sspace| that +% inserts \|\vrule| of zero wide and \|\nobreak| as \|\hspace*| does, and +% then draw a line by \|\UMO@skip| for a space of \meta{glue}. +% +% In both cases, \|\UMO@charloop| is invoked after underlined (or other +% type) space is produced to process characters following \|\UMOspace|. +% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} +% +% \begin{macrocode} +%% Explicit Spacing and Line Breaking + +\def\UMO@space{\@ifstar\UMO@sspace\UMO@ispace} +\def\UMO@sspace#1{\vrule width\z@\nobreak\UMO@skip{#1}\UMO@charloop} +\def\UMO@ispace#1{\@tempskipa#1\relax + \@ifstar{\@tempswafalse\UMO@iispace}{\@tempswatrue\UMO@iispace}} +\def\UMO@iispace{\@ifnextchar[%] + {\UMO@penalty}% + {\UMO@skip\@tempskipa \UMO@charloop}} +\def\UMO@penalty[#1]{\@tempcnta#1\relax + \if@tempswa + \ifnum\@tempcnta<\z@ \@tempcnta-\@tempcnta \fi + \ifcase\@tempcnta \or + \@tempcnta\@lowpenalty \or + \@tempcnta\@medpenalty \or + \@tempcnta\@highpenalty \else + \@tempcnta\@M \fi + \ifnum#1<\z@ \@tempcnta-\@tempcnta \fi \fi + \penalty\@tempcnta \UMO@skip\@tempskipa \UMO@charloop} + +% \end{macrocode} +% +% \begin{macro}{\UMO@newline} +% The user interface control sequence \|\UMOnewline|(\|*|) is processed by +% \|\UMO@newline|. It produces a underlined (or other type) space having +% \|1fil| stretch factor by \|\UMO@skip| if `\|*|' is supplied, while a +% space of \|1fil| is simply inserted otherwise. In both cases, \|\break| +% is inserted after the space to break a line and \|\UMO@charloop| is +% invoked for the characters following \|\UMOnewline|. +% \end{macro} +% +% \begin{macrocode} +\def\UMO@newline{\@ifstar{\UMO@skip{0pt plus1fil}\break \UMO@charloop}% + {\hfil \break \UMO@charloop}} + +%%^L + +% \end{macrocode} +% +% +% +% \subsection{Finalization} +% \label{sec:imp-end} +% +% \begin{macro}{\UMO@end} +% \begin{macro}{\UMO@aftergroup} +% When the \meta{text} is completely processed, \|\UMO@end| is invoked from +% \|\UMO@iwordloop| to set \|\spacefactor| to the value at the last word +% element is produced. Since this assignment has to be performed outside the +% group that \|\UMO@line| has opened (see \S\ref{sec:imp-uifinit}), setting +% \|\spacefactor| to \|\UMO@spacefactor| is \|\xdef|ined as the body of +% \|\UMO@aftergroup| that is called by \|\UMO@line| after the group is closed. +% \end{macro}\end{macro} +% +% \begin{macrocode} +%% Finalization + +\def\UMO@end{\xdef\UMO@aftergroup{\spacefactor\number\UMO@spacefactor}} +% \end{macrocode} +% \iffalse +%</package> +% \fi +% +% +% +% \IndexPrologue{\newpage\section*{Index} +% Italicized number refers to the page where the specification and usage of +% corresponding entry is described, while underlined is for the +% implementation of the entry.\endgraf +% +% To find a control sequence, remove prefixes \cs{@}, \cs{adl@} or +% \cs{ifadl@} from its name if it has one of them.} +% \Finale +% \GlossaryPrologue{\newpage\section*{Revision History}} +% \PrintChanges +\endinput diff --git a/Master/texmf-dist/source/latex/umoline/umoline.ins b/Master/texmf-dist/source/latex/umoline/umoline.ins new file mode 100644 index 00000000000..0e574d6f73d --- /dev/null +++ b/Master/texmf-dist/source/latex/umoline/umoline.ins @@ -0,0 +1,6 @@ +\input docstrip.tex +\keepsilent +\askonceonly +\generate{\file{umoline.sty}{\from{umoline.dtx}{package}} + \file{umoline-man.tex}{\from{umoline.dtx}{driver}}} +\endbatchfile |