1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
% \iffalse meta-comment
%
% Copyright (C) 2010-2017 by Oleg Parashchenko <olpa@uucode.com>
% -------------------------------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{cals.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{cals}
%<*package>
[2016/11/23 CALS tables v.2.4.2]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{hyperref}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{cals.dtx}
\PrintChanges
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \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 \~}
%
%
% \changes{v2.4.2}{2017/01/20}{Bug fixes to allow table inside straddled cell.}
% \changes{v2.4.1}{2016/11/23}{Bug fixes for row separation lines.}
% \changes{v2.4}{2014/11/12}{Built-in RTL (right-to-left) support.}
% \changes{v2.2}{2013/05/27}{Hooks for bidi support.}
% \changes{v2.1}{2013/05/24}{Alignment of tables works.}
% \changes{v2.0}{2010/10/08}{Complete rewrite with different approach}
% \changes{v1.0}{2010/06/17}{Initial version from skeleton.dtx}
%
% \GetFileInfo{cals.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \title{The \textsf{cals} package\thanks{This document
% corresponds to \textsf{cals}~\fileversion, dated \filedate.}}
% \author{Oleg Parashchenko \\ \texttt{olpa@uucode.com}}
%
% \maketitle
%
% \section{Introduction}
%
% The |cals| package is a set of macros to typeset multipage tables
% with repeatable headers and footers, with cells spanned over
% rows and columns. Decorations are supported: padding, background
% color, width of separation rules. The code is compatible with
% multicol and bidi.
%
% The work is released to public (\LaTeX{} license)
% by \url{bitplant.de}~GmbH, a company which provides technical
% documentation services to industry.
%
% \section{Usage}
%
% The users' guide is a separate document, published in TUGboat 2011:2:
% \url{http://tug.org/TUGboat/tb32-2/tb101parashchenko.pdf}. There are
% examples on CTAN: \url{https://www.ctan.org/pkg/cals}.
%
% The most important feature: the table (its rows) must start in a
% vertical mode, the cells content should switch to a horizontal mode.
% For using the commands with the |@| symbol you might need to say
% |\makeatletter| first.
%
% Please post questions and suggestions to the |texhax| mailing list
% (\url{http://tug.org/mailman/listinfo/texhax}) or on \TeX-\LaTeX{}
% Stack Exchange site (\url{http://tex.stackexchange.com/}) with the
% tag |cals|.
%
% Summary of the user interface:
% \begin{verbatim}
% \begin{calstable} % [n|l|c|r]
% \colwidths{{100pt}{200pt}}
% \brow \cell{a} \cell{b} \erow
% \end{calstable}
% \end{verbatim}
%
% Table elements: |\thead|, |\tfoot|, |\tbreak{\penalty-10000}|, |\lastrule|.
%
% Table alignment: |l|, |c|, |r| for left, center and right;
% |n| for none, using the default |\leftskip| and |\rightskip|.
%
% In-cell alignment: |\alignL|, |\alignC|, |\alignR|, |\vfill|.
%
% Padding: lengths |\cals@paddingL| (|...T,R,B|), set by |\cals@setpadding{Ag}|,
% baseline alignment |\cals@paddingD|, set by |\cals@setcellprevdepth{Al}|.
%
% Color: |\cals@bgcolor|.
%
% Rules: |\cals@cs@width|, |\cals@framecs@width|, |\cals@rs@width|,
% |\cals@framers@width|, |\cals@bodyrs@width|. Overrides:
% |\cals@borderL| (|...T,R,B|).
%
% Hooks: |\cals@AtBeginTable|, |\cals@AtEndTable|,
% |\cals@AtBeginCell|, |\cals@AtEndCell|.
%
% Spanning: |\nullcell|, |\spancontent|.
%
% \StopEventually{}
%
% \section{Implementation}
%
% What happens. |\cell| creates a table cell, puts it to the
% current row and updates decorations. At the end of the row
% (|\erow|) we have the box |\cals@current@row|, the box
% |\cals@current@cs|---column separation and cells background---and
% the macros |\cals@current@rs@above| and |\cals@current@rs@below|---all
% the required data to typeset row separation.
% Before dispatching the row, all the cells are repacked
% to the common height. The row dispatcher (|\cals@row@dispatch|)
% usually just uses |\cals@issue@row|, which
% outputs |current@cs|, then joins the previous row |cs@below| with the
% current row |rs@above| and typesets the resulting row separation, and
% finally prints the row itself. If a table break is required, the
% dispatcher backups the current row and first typesets the table footer,
% a page break and the table header. In case of a row span, the set
% of the rows is converted to one big row.
%
% I tried to code as good and robust as I can. In particular,
% the package contains unit tests. However, being an unexperienced
% \TeX{} programmer, I could write bad code, especially in the section
% ``List list of tokens''. Do not hesitate to send me suggestions
% and corrections, also in the use of English.
%
% The description is split on two parts: main functionality and
% decorations. The first part is bottom-up: creating cells,
% collecting cells to a row, dispatching a row, top-level table
% elements. The second part starts with the common code,
% then explains in-row decorations (column separation and cells
% background) and between-row decorations (row separation).
%
% \input{cell.dtx}
% \input{span.dtx}
% \input{table.dtx}
% \input{lltokens.dtx}
% \input{decor.dtx}
% \input{colsep.dtx}
% \input{rowsep.dtx}
% \input{rtl.dtx}
%
% \Finale
\endinput
|