% \iffalse meta-comment % % Copyright (C) 2010-2017 by Oleg Parashchenko % ------------------------------------------------------- % % 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} % %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{cals} %<*package> [2016/11/23 CALS tables v.2.4.2] % % %<*driver> \documentclass{ltxdoc} \usepackage{hyperref} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{cals.dtx} \PrintChanges \PrintIndex \end{document} % % \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