| 1 |
\documentclass[a4paper]{article} |
| 2 |
\usepackage[a4paper]{geometry} |
| 3 |
\usepackage{miscdoc} |
| 4 |
\usepackage[scaled=0.85]{luximono} |
| 5 |
\begin{document} |
| 6 |
\title{The \textsf{tabls} package} |
| 7 |
\author{Donald Arseneau\thanks{Documentation derived from the package |
| 8 |
file by Robin Fairbairns}} |
| 9 |
\maketitle |
| 10 |
\begin{quote} |
| 11 |
The package modifies \LaTeX{}'s \texttt{array} and \texttt{tabular} |
| 12 |
environments to keep text from touching other text or hlines above |
| 13 |
or below. |
| 14 |
\end{quote} |
| 15 |
\section{New parameters, etc.} |
| 16 |
|
| 17 |
The behaviour of the package is controlled by a small set of |
| 18 |
parameters, which are all \TeX{} \cs{dimen} registers (and so may be |
| 19 |
adjusted using \LaTeX{} \cs{setlength} commands. |
| 20 |
|
| 21 |
\paragraph{\cs{tablinesep} (or \cs{tablelineskip}):} the minimum space |
| 22 |
between text on successive lines in a tabular environment. Negative |
| 23 |
distances are treated as zero. The default value is \texttt{1pt}. A |
| 24 |
value of \texttt{0pt} turns off checking for touching text. Text |
| 25 |
given in an \verb|@{ }| specification (cf. the \textsf{array} package) |
| 26 |
is never checked for overlap. |
| 27 |
|
| 28 |
\paragraph{\cs{arraylinesep} (or \cs{arraylineskip})}: like |
| 29 |
\cs{tablinesep}, but for arrays. |
| 30 |
|
| 31 |
\paragraph{\cs{extrarulesep}:} extra space to add above and below each |
| 32 |
\cs{hline} and \cs{cline}. There will be at least |
| 33 |
\texttt{\cs{extrarulesep} + 0.5\cs{tablinesep}} between an \cs{hline} |
| 34 |
and a line of text. Negative values can be used, but only until some |
| 35 |
text touches the line. The default value is \texttt{3pt}. |
| 36 |
|
| 37 |
\noindent To ensure interline separations in tables but not arrays, |
| 38 |
declare |
| 39 |
\begin{quote} |
| 40 |
\cs{setlength}\cmdinvoke{arraylinesep}{0pt} |
| 41 |
\end{quote} |
| 42 |
\noindent The appearance of normal \LaTeX{} tables can be had with |
| 43 |
\begin{quote} |
| 44 |
\cs{setlength}\cmdinvoke{tablinesep}{0pt}\\ |
| 45 |
\cs{setlength}\cmdinvoke{arraylinesep}{0pt}\\ |
| 46 |
\cs{setlength}\cmdinvoke{extrarulesep}{0pt} |
| 47 |
\end{quote} |
| 48 |
\noindent but it would be better to not use \textsf{tabls} in this |
| 49 |
situation. |
| 50 |
|
| 51 |
The command \cmdinvoke{hline}[extra] has gained an optional length |
| 52 |
argument (just like \bsbs), which gives the space to insert below the |
| 53 |
line. This space is in addition to the \cs{extrarulesep} and |
| 54 |
linesep. A negative value will reduce the space until the line |
| 55 |
touches some text below, and will then have no further effect. For |
| 56 |
example, \cmdinvoke{hline}[-9cm] draws a horizontal line while |
| 57 |
suppressing all the extra spacing. |
| 58 |
|
| 59 |
(This \cs{hline} also fixes the notches that used to appear at the |
| 60 |
junction between horizontal and vertical lines.) |
| 61 |
|
| 62 |
\section{How it works} |
| 63 |
|
| 64 |
There are no struts in the preamble entries\footnote{The comments in |
| 65 |
the package say this is a lie\dots}, rather, there are tests to |
| 66 |
measure the maximum height and depth of all entries on a line. The |
| 67 |
maximum values start at the size of LaTeX's \cs{@arstrut} minus the |
| 68 |
appropriate linesep. At the \bsbs, a strut is inserted (in its own |
| 69 |
column) which is that maximum size plus the linesep plus any |
| 70 |
additional space for separation from \cs{hline}s. |
| 71 |
|
| 72 |
\section{The Downside} |
| 73 |
|
| 74 |
Building a table will be slower than before because the entries have |
| 75 |
to be boxed twice (by the package's \cs{@seesize} and by \cs{halign} |
| 76 |
itself) instead of just once. |
| 77 |
\cs{setlength}\cmdinvoke{tablinesep}{0pt} will recover most of this |
| 78 |
speed, with \cs{extrarulesep} still partially in effect\,---\,extra |
| 79 |
space will still be added around \cs{hline}s, but it may be taken up |
| 80 |
by very tall or very deep table entries; thus text may still touch the |
| 81 |
lines. Because of the speed penalty, if your computer is slow, it is |
| 82 |
probably best to omit \textsf{tabls} until producing a final copy. |
| 83 |
\end{document} |