summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cals/cals.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-11-25 22:39:44 +0000
committerKarl Berry <karl@freefriends.org>2016-11-25 22:39:44 +0000
commit4a55147e264bbcb051fbb9a51b05b190e52bd6b7 (patch)
tree93f4c55dd1e9badbcc219df8ac9663e5690329ba /Master/texmf-dist/tex/latex/cals/cals.sty
parentdc4d59f0c0a68d9586f1d3f32d9f7a3bb32e29d9 (diff)
cals (25nov16)
git-svn-id: svn://tug.org/texlive/trunk@42577 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cals/cals.sty')
-rw-r--r--Master/texmf-dist/tex/latex/cals/cals.sty118
1 files changed, 84 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/cals/cals.sty b/Master/texmf-dist/tex/latex/cals/cals.sty
index b3244e2498b..2931cc48d13 100644
--- a/Master/texmf-dist/tex/latex/cals/cals.sty
+++ b/Master/texmf-dist/tex/latex/cals/cals.sty
@@ -12,6 +12,7 @@
%% decor.dtx (with options: `package')
%% colsep.dtx (with options: `package')
%% rowsep.dtx (with options: `package')
+%% rtl.dtx (with options: `package')
%%
%% This is a generated file.
%%
@@ -29,7 +30,8 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{cals}
- [2013/05/24 CALS tables v.2.2]
+ [2016/11/23 CALS tables v.2.4.1]
+
\newcommand\cals@cell[3]{}
@@ -106,16 +108,21 @@
\cals@paddingD=\dimen0 }
\newcommand\alignL{%
-\dimen0=\cals@paddingL \cals@paddingL=\dimen0 \relax
-\dimen0=\cals@paddingR \cals@paddingR=\dimen0 \relax}
+\cals@vfillDrop\cals@paddingL
+\cals@vfillDrop\cals@paddingR}
\newcommand\alignC{%
-\dimen0=\cals@paddingL \cals@paddingL=\dimen0 plus 1fill\relax
-\dimen0=\cals@paddingR \cals@paddingR=\dimen0 plus 1fill\relax}
+\cals@vfillAdd\cals@paddingL
+\cals@vfillAdd\cals@paddingR}
\newcommand\alignR{%
-\dimen0=\cals@paddingL \cals@paddingL=\dimen0 plus 1fill\relax
-\dimen0=\cals@paddingR \cals@paddingR=\dimen0 \relax}
+\cals@vfillAdd\cals@paddingL
+\cals@vfillDrop\cals@paddingR}
+
+\newcommand\cals@vfillAdd[1]{\ifnum\gluestretchorder#1>1\relax\else
+\dimen0=#1\relax #1=\dimen0 plus 1fill\relax \fi}
+\newcommand\cals@vfillDrop[1]{\ifnum\gluestretchorder#1>0\relax
+\dimen0=#1\relax #1=\dimen0\relax \fi}
\newbox\cals@current@row
@@ -260,10 +267,20 @@
\let\cals@current@rs@below=\cals@backup@rs@below
\let\cals@current@context=\cals@backup@context
\fi\fi\fi
+\ifdim\wd\cals@current@row>\hsize\relax
+\def\cals@tohsize{}%
+\fi
\cals@issue@row
\ifx b\cals@last@context
- \ifx h\cals@last@context@bak \vskip0pt \penalty10000 \fi
- \ifx n\cals@last@context@bak \vskip0pt \penalty10000 \fi
+ {\dimen0=\pagetotal\relax
+ \advance\dimen0 by \cals@tfoot@height\relax
+ \advance\dimen0 by -\pagegoal
+ \ifdim\dimen0>0pt\relax
+ \vskip\dimen0
+ \penalty9999 % with 10000, the output page builder is not called
+ \vskip-\dimen0\relax
+ \fi
+ }%
\fi
}
@@ -272,6 +289,7 @@
\setbox\cals@backup@row=\vbox{\box\cals@current@row}%
\setbox\cals@backup@cs=\box\cals@current@cs
\let\cals@backup@rs@above=\cals@current@rs@above
+ \let\cals@backup@last@rs@below=\cals@last@rs@below
\let\cals@backup@context=\cals@last@context
\cals@backup@leftskip=\leftskip\relax
\cals@backup@rightskip=\rightskip\relax
@@ -287,6 +305,7 @@
\setbox\cals@current@row=\box\cals@backup@row
\setbox\cals@current@cs=\box\cals@backup@cs
\let\cals@current@rs@above=\cals@backup@rs@above
+ \let\cals@last@rs@below=\cals@backup@last@rs@below
\let\cals@last@context=\cals@backup@context
\leftskip=\cals@backup@leftskip
\rightskip=\cals@backup@rightskip
@@ -308,22 +327,23 @@
\let\cals@tmp=\cals@iffalse
\let\cals@tmpII=\cals@iftrue
\ifx\relax\cals@tbreak@tokens
- \ifx h\cals@current@context \else
- \ifx f\cals@current@context \else
- \ifx h\cals@last@context \else
- \ifx n\cals@last@context \else
- \dimen0=\pagetotal\relax
- \advance\dimen0 by \ht\cals@current@row\relax
- %\showthe\ht\cals@current@row\relax
- \ifx \cals@tfoot@tokens\relax \else
- %\show\cals@tfoot@height\relax
- \advance\dimen0 by \cals@tfoot@height\relax
- \fi
- %\showthe\dimen0\relax
- \ifdim \dimen0>\pagegoal\relax
- \let\cals@tmp=\cals@tmpII
- \fi
- \fi\fi\fi\fi
+ \ifinner\else
+ \ifx h\cals@current@context \else
+ \ifx f\cals@current@context \else
+ \ifx h\cals@last@context \else
+ \ifx n\cals@last@context \else
+ \dimen0=\pagetotal\relax
+ \advance\dimen0 by \ht\cals@current@row\relax
+ %\showthe\ht\cals@current@row\relax
+ \ifx \cals@tfoot@tokens\relax \else
+ %\show\cals@tfoot@height\relax
+ \advance\dimen0 by \cals@tfoot@height\relax
+ \fi
+ %\showthe\dimen0\relax
+ \ifdim \dimen0>\pagegoal\relax
+ \let\cals@tmp=\cals@tmpII
+ \fi
+ \fi\fi\fi\fi\fi
\else \let\cals@tmp=\cals@tmpII % tbreak@tokens
\fi
\cals@tmp}
@@ -346,11 +366,11 @@
\newcommand\cals@issue@rowsep@alone{%
\setbox0=\cals@hbox\cals@tohsize{%
- \hskip\leftskip
+ \cals@hskip@lr\leftskip\rightskip
\cals@rs@sofar@reset
\cals@rs@joinOne\cals@framers@width\cals@current@rs@above
\cals@rs@sofar@end
- \hskip\rightskip}%
+ \cals@hskip@lr\rightskip\leftskip}%
\ht0=0pt \dp0=0pt \box0 }
\newcommand\cals@issue@rowsep{%
@@ -359,11 +379,11 @@
\let\cals@tmpIII=\cals@rs@width \else
\let\cals@tmpIII=\cals@bodyrs@width \fi
\setbox0=\cals@hbox\cals@tohsize{%
- \hskip\leftskip
+ \cals@hskip@lr\leftskip\rightskip
\cals@rs@sofar@reset
\cals@rs@joinTwo\cals@tmpIII\cals@last@rs@below\cals@current@rs@above
\cals@rs@sofar@end
- \hskip\rightskip}%
+ \cals@hskip@lr\rightskip\leftskip}%
\ht0=0pt \dp0=0pt \box0 %
\fi}
@@ -371,24 +391,29 @@
\newcommand\cals@issue@row{%
\nointerlineskip
-\setbox0=\vtop{\cals@hbox\cals@tohsize{\hskip\leftskip \box\cals@current@cs \hskip\rightskip}}%
+\setbox0=\vtop{\cals@hbox\cals@tohsize{\cals@hskip@lr\leftskip\rightskip
+\box\cals@current@cs \cals@hskip@lr\rightskip\leftskip}}%
\ht0=0pt\relax\box0
\nointerlineskip
\cals@issue@rowsep
\nointerlineskip
-\cals@hbox\cals@tohsize{\hskip\leftskip \box\cals@current@row \hskip\rightskip}%
+\cals@hbox\cals@tohsize{\cals@hskip@lr\leftskip\rightskip
+\box\cals@current@row \cals@hskip@lr\rightskip\leftskip}%
\let\cals@last@rs@below=\cals@current@rs@below
-\let\cals@last@context=\cals@current@context}
+\let\cals@last@context=\cals@current@context
+\nobreak}
-\newenvironment{calstable}{%
+\newenvironment{calstable}[1][\cals@table@alignment]{%
+\if@RTL\@RTLtabtrue\cals@activate@rtl\fi
\let\cals@thead@tokens=\relax
\let\cals@tfoot@tokens=\relax
\let\cals@tbreak@tokens=\relax
\cals@tfoot@height=0pt \relax
\let\cals@last@context=n%
\let\cals@current@context=b%
-\parindent=0pt %
+\parindent=0pt \relax%
+\cals@setup@alignment{#1}%
\cals@setpadding{Ag}\cals@setcellprevdepth{Al}\cals@set@tohsize%
%% Alignment inside is independent on center/flushright outside
\parfillskip=0pt plus1fil\relax
@@ -396,6 +421,7 @@
\let\cals@borderR=\relax
\let\cals@borderT=\relax
\let\cals@borderB=\relax
+\setbox\cals@backup@row=\box\voidb@x\relax
\cals@AtBeginTable
}{% End of the table
\cals@tfoot@tokens\lastrule\cals@AtEndTable}
@@ -424,6 +450,8 @@
\newcommand\tbreak[1]{\def\cals@tbreak@tokens{#1}}
+\newcommand\cals@table@alignment{l}
+
\def\llt@cons#1#2{%
\toks0=\expandafter{#1}%
\toks2=\expandafter{#2}%
@@ -717,6 +745,28 @@
\cals@rs@sofar@next\cals@tmpL\cals@tmpBl\cals@tmpBr\cals@width
\fi\next}%
\expandafter\next#2\eol}
+
+\def\next{%
+ \let\if@RTL=\iffalse
+ \let\if@RTLtab=\iffalse
+ \let\@RTLtabtrue=\relax
+}
+\ifdefined\if@RTL \relax \else \next \fi
+
+\newcommand\cals@setup@alignment[1]{%
+\if c#1\relax \cals@vfillAdd \leftskip \cals@vfillAdd \rightskip \fi
+\if@RTL
+ \if l#1\relax \cals@vfillAdd \leftskip \cals@vfillDrop\rightskip \fi
+ \if r#1\relax \cals@vfillDrop\leftskip \cals@vfillDrop\rightskip \fi
+\else
+ \if l#1\relax \cals@vfillDrop\leftskip \cals@vfillDrop\rightskip \fi
+ \if r#1\relax \cals@vfillAdd \leftskip \cals@vfillDrop\rightskip \fi
+\fi
+}
+
+\newcommand\cals@hskip@lr[2]{%
+\if@RTL \hskip#2\relax \else \hskip#1\relax \fi}
+
\endinput
%%
%% End of file `cals.sty'.