home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fonts 1
/
freshfonts1.bin
/
programs
/
amiga
/
pastex
/
macros
/
distribs
/
array
/
hhline.doc
(
.txt
)
< prev
next >
Wrap
LaTeX Document
|
1992-09-06
|
13KB
|
336 lines
% \iffalse
% This file is part of the array package.
% ---------------------------------------
% This file was contributed. In case of error please inform the
% original author.
% \fi
%\iffalse
%%% ====================================================================
%%% @LaTeX-style-file{
%%% author = "David Carlisle",
%%% version = "2.01",
%%% date = "26 June 1992",
%%% time = "14:59:06 BST",
%%% filename = "hhline.sty",
%%% address = "Computer Science Department
%%% Manchester University
%%% Oxford Road
%%% Manchester
%%% England
%%% M13 9PL",
%%% telephone = "+44 61 275 6139",
%%% FAX = "+44 61 275 6236",
%%% checksum = "35688 370 1639 13144",
%%% email = "carlisle@cs.man.ac.uk (Internet)",
%%% codetable = "ISO/ASCII",
%%% keywords = "LaTeX, array, tabular, hline",
%%% supported = "yes",
%%% docstring = "
%%% hhline.sty
%%% LaTeX style option defining an alternative to \hline for
%%% producing horizontal lines in tables. This allows user level
%%% control over the interaction with vertical lines.
%%% The checksum field above was produced by
%%% Robert Solovay's checksum utility.",
%%% }
%%% ====================================================================
\def\fileversion{v2.01}
\def\filedate{92/06/26}
\def\docdate {92/06/26}
% \CheckSum{285}
% \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 \~}
% \arrayrulewidth=1pt
% \doublerulesep=3pt
% \title{hhline.sty\thanks
% {Version \fileversion, revised \filedate, documentation dated
% \docdate}}
% \author{D. P. Carlisle}
% \date{26 June 1992}
% \maketitle
% \begin{abstract}
% "\hhline" produces a line like "\hline", or a double line like
% "\hline\hline", except for its interaction with vertical lines.
% Version 1: 4 June 91
% Version 2: 6 November 1991
% Adds the "~" token which allows "\cline"-like constructions in which
% the hlines do not cross all the columns.
% Version 2.01: Re-issue for the new {\tt doc} and {\tt docstrip}.
% \end{abstract}
% \section{Introduction}
% The argument to "\hhline" is similar to the preamble of an {\tt
% array} or {\tt tabular}. It consists of a list of tokens with the
% following meanings:
% \begin{tabular}{cl}
% "=" & A double hline the width of a column.\\
% "-" & A single hline the width of a column.\\[10pt]
% "~" & A column with no hline.\\[10pt]
% "|" & A vline which `cuts' through a double (or single) hline.\\
% ":" & A vline which is broken by a double hline.\\[10pt]
% "#" & A double hline segment between two vlines.\\
% "t" & The top half of a double hline segment.\\
% "b" & The bottom half of a double hline segment.\\
% "*" & "*{3}{==#}" expands to "==#==#==#",
% as in the {\tt*}-form for the preamble.
% \end{tabular}
% If a double vline is specified ("||" or "::") then the hlines
% produced by "\hhline" are broken. To obtain the effect of an hline
% `cutting through'the double vline, use a "#" or omit the vline
% specifiers, depending on whether or not you wish the double vline to
% break.
% The tokens {\tt t} and {\tt b} must be used between two vertical
% rules. "|tb|" produces the same lines as "#", but is much less
% efficient. The main use for these are to make constructions like
% "|t:" (top left corner) and ":b|" (bottom right corner).
% If "\hhline" is used to make a single hline, then the argument
% should only contain the tokens "-", "~" and "|" (and
% {\tt*}-expressions).
% An example using most of these features is:
% \vcenter{\hsize=2in\begin{verbatim}
% \begin{tabular}{||cc||c|c||}
% \hhline{|t:==:t:==:t|}
% a&b&c&d\\
% \hhline{|:==:|~|~||}
% 1&2&3&4\\
% \hhline{#==#~|=#}
% i&j&k&l\\
% \hhline{||--||--||}
% w&x&y&z\\
% \hhline{|b:==:b:==:b|}
% \end{tabular}
% \end{verbatim}
% \qquad
% \begin{tabular}{||cc||c|c||}
% \hhline{|t:==:t:==:t|}
% a&b&c&d\\
% \hhline{|:==:|~|~||}
% 1&2&3&4\\
% \hhline{#==#~|=#}
% i&j&k&l\\
% \hhline{||--||--||}
% w&x&y&z\\
% \hhline{|b:==:b:==:b|}
% \end{tabular}
% The lines produced by \LaTeX's "\hline" consist of a single (\TeX\
% primitive) "\hrule". The lines produced by "\hhline" are made
% up of lots of small line segments. \TeX\ will place these very
% accurately in the {\tt .dvi} file, but the program that you use to
% print the {\tt .dvi} file may not line up these segments exactly. (A
% similar problem can occur with diagonal lines in the {\tt picture}
% environment.)
% If this effect causes a problem, you could try a different driver
% program, or if this is not possible, increasing "\arrayrulewidth"
% may help to reduce the effect.
% \StopEventually{}
% \section{The Macros}
% \begin{macrocode}
%<*style>
\@ifundefined{hhline}{}{\endinput}
\wlog{Style-Option: `hhline' \fileversion
\space\space <\filedate> (D.P.C.)}
\wlog{English documentation dated \space <\docdate> (D.P.C.)}
% \end{macrocode}
% \begin{macro}{\HH@box}
% Makes a box containing a double hline segment. The most common case,
% both rules of length "\doublerulesep" will be stored in "\box1", this
% is not initialised until "\hhline" is called as the user may change
% the parameters "\doublerulesep" and "\arrayrulewidth". The two
% arguments to "\HH@box" are the widths (ie lengths) of the top and
% bottom rules.
% \begin{macrocode}
\def\HH@box#1#2{\vbox{%
\hrule \@height \arrayrulewidth \@width #1
\vskip \doublerulesep
\hrule \@height \arrayrulewidth \@width #2}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\HH@add}
% Build up the preamble in the register "\toks@".
% \begin{macrocode}
\def\HH@add#1{\toks@\expandafter{\the\toks@#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\HH@xexpast}
% \begin{macro}{\HH@xexnoop}
% We `borrow' the version of "\@xexpast" from Mittelbach's array.sty,
% as this allows "#" to appear in the argument list.
% \begin{macrocode}
\def\HH@xexpast#1*#2#3#4\@@{%
\@tempcnta #2
\toks@={#1}\@temptokena={#3}%
\let\the@toksz\relax \let\the@toks\relax
\def\@tempa{\the@toksz}%
\ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do
{\edef\@tempa{\@tempa\the@toks}\advance \@tempcnta \m@ne}%
\let \@tempb \HH@xexpast \else
\let \@tempb \HH@xexnoop \fi
\def\the@toksz{\the\toks@}\def\the@toks{\the\@temptokena}%
\edef\@tempa{\@tempa}%
\expandafter \@tempb \@tempa #4\@@}
\def\HH@xexnoop#1\@@{}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\hhline}
% Use a simplified version of "\@mkpream" to break apart the argument
% to "\hhline". Actually it is oversimplified, It assumes that the
% vertical rules are at the end of the column. If you were to specify
% "c|@{xx}|" in the array argument, then "\hhline" would not be
% able to access the first vertical rule. (It ought to have an "@"
% option, and add "\leaders" up to the width of a box containing the
% "@"-expression. We use a loop made with "\futurelet" rather
% than "\@tfor" so that we can use "#" to denote the crossing of
% a double hline with a double vline.\\
% "\if@firstamp" is true in the first column and false otherwise.\\
% "\if@tempswa" is true if the previous entry was a vline
% (":",