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
|
% \iffalse meta-comment
%
% Copyright (C) 2010 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>
[2010/10/07 CALS tables v.2.0]
%</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.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
% multicols and pdfsync.
%
% The work is released to public (\LaTeX{} license)
% by \url{bitplant.de}~GmbH, a company which provides technical
% documentation services to industry.
%
% \section{Usage}
%
% An users' guide is a separate document, yet to be written.
% I'll do it for TUGboat 2011:1. At the moment, as a substitute,
% use the demo document provided with the package. The most
% important feature: the table (its rows) must start in a vertical
% mode, the cells content should switch to a horizontal mode.
%
% Please post questions and suggestions to the newsgroup
% |comp.text.tex| and the |texhax| mailing list (see
% \url{http://tug.org/mailman/listinfo/texhax}),
% not directly to me.
%
% Summary of the user interface:
% \begin{verbatim}
% \begin{calstable}
% \colwidths{{100pt}{200pt}}
% \brow \cell{a} \cell{b} \erow
% \end{calstable}
% \end{verbatim}
%
% Table elements: |\thead|, |\tfoot|, |\tbreak{\penalty-10000}|, |\lastrule|.
%
% 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@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}
%
% \Finale
\endinput
|