summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctable
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-08-15 18:55:30 +0000
committerKarl Berry <karl@freefriends.org>2007-08-15 18:55:30 +0000
commit4217b6526dc5969a75590384ceaaa4ea814fc6a0 (patch)
treee3cdcda7e6c1f7644a769f5b04c511763c7ba8c6 /Master/texmf-dist/tex/latex/ctable
parente48b37809878cd01b7b78357f6baa132ba1e1533 (diff)
ctable update (14aug07)
git-svn-id: svn://tug.org/texlive/trunk@4737 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctable')
-rw-r--r--Master/texmf-dist/tex/latex/ctable/ctable.sty153
1 files changed, 79 insertions, 74 deletions
diff --git a/Master/texmf-dist/tex/latex/ctable/ctable.sty b/Master/texmf-dist/tex/latex/ctable/ctable.sty
index 8fa817c192c..ea8ef580d31 100644
--- a/Master/texmf-dist/tex/latex/ctable/ctable.sty
+++ b/Master/texmf-dist/tex/latex/ctable/ctable.sty
@@ -20,11 +20,10 @@
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%%
-
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{ctable}
- [2007/03/04 v1.9 ctable package]
-\RequirePackage{xspace,color,xkeyval,array,tabularx,booktabs,rotating}
+ [2007/08/17 v1.10 ctable package]
+\RequirePackage{xspace,color,xkeyval,array,tabularx,booktabs,rotating,caption}
\def\NN{\tabularnewline}
\def\FL{\toprule}
\def\ML{\NN\midrule}
@@ -40,36 +39,34 @@
\newdimen\@ctblmaxwidth
\newdimen\@ctblmincapwidth
\newdimen\@ctblw % the final width
-\newdimen\@ctblww
+\newdimen\@ctblfloatwidth
\newdimen\@ctbloldsep
\newdimen\@ctbloldrule
-\newbox\ctbl@tabelx % the width with X columns
-\newbox\ctbl@tabel % the width where X is replaced with l
-\newbox\ctbl@t % the final box will become one of the two above
-\define@key{ctbl}{caption}{\def\@ctblcaption{#1}}%
-\define@key{ctbl}{cap}{\def\@ctblcap{#1}}%
-\define@key{ctbl}{label}{\def\@ctbllabel{#1}}%
-\define@key{ctbl}{pos}{\def\@ctblpos{#1}\def\@ctblbegin{\@ctblbeg[#1]}}%
-\define@key{ctbl}{width}{\@ctblwidth=#1}%
-\define@key{ctbl}{maxwidth}{\@ctblmaxwidth=#1}%
-\define@key{ctbl}{mincapwidth}{\@ctblmincapwidth=#1}%
-\define@key{ctbl}{botcap}[]{\def\@ctblbotcap{1}}%
-\define@key{ctbl}{sideways}[]{\def\@ctblsideways{sideways}}%
-\define@key{ctbl}{rotate}[]{\def\@ctblsideways{sideways}%
- \PackageWarning{ctable}{%
+\newbox\ctbl@t % tabular saved and measured here
+\define@key{ctbl}{caption}{\def\@ctblcaption{#1}}
+\define@key{ctbl}{cap}{\def\@ctblcap{#1}}
+\define@key{ctbl}{label}{\def\@ctbllabel{#1}}
+\define@key{ctbl}{pos}{\def\@ctblpos{#1}\def\@ctblbegin{\@ctblbeg[#1]}}
+\define@key{ctbl}{width}{\@ctblwidth=#1}
+\define@key{ctbl}{maxwidth}{\@ctblmaxwidth=#1}
+\define@key{ctbl}{mincapwidth}{\@ctblmincapwidth=#1}
+\define@key{ctbl}{botcap}[]{\def\@ctblbotcap{1}}
+\define@key{ctbl}{sideways}[]{\def\@ctblsideways{sideways}}
+\define@key{ctbl}{rotate}[]{\def\@ctblsideways{sideways}
+ \PackageWarning{ctable}{
using obsolete option 'rotate', use 'sideways' instead}
- }%
-\define@key{ctbl}{figure}[]{\def\@ctbltaborfig{figure}}%
-\define@key{ctbl}{center}[]{\def\@ctblalign{center}}%
-\define@key{ctbl}{right}[]{\def\@ctblalign{flushright}}%
-\define@key{ctbl}{left}[]{\def\@ctblalign{flushleft}}%
-\define@key{ctbl}{star}[]{\def\@ctblstarred {*}}%
-\define@key{ctbl}{framerule}{\@ctblframerule=#1}%
-\define@key{ctbl}{framesep}{\@ctblframesep=#1}%
-\define@key{ctbl}{framefg}{\@ctblfgcolor#1=}%
-\define@key{ctbl}{framebg}{\@ctblbgcolor#1=}%
-\define@key{ctbl}{captionskip}{\@ctblcaptionskip=#1}%
-\define@key{ctbl}{nosuper}[]{\let\@cttextsuperscript\@ctcopy}%
+ }
+\define@key{ctbl}{figure}[]{\def\@ctbltaborfig{figure}}
+\define@key{ctbl}{center}[]{\def\@ctblalign{center}}
+\define@key{ctbl}{right}[]{\def\@ctblalign{flushright}}
+\define@key{ctbl}{left}[]{\def\@ctblalign{flushleft}}
+\define@key{ctbl}{star}[]{\def\@ctblstarred {*}}
+\define@key{ctbl}{framerule}{\@ctblframerule=#1}
+\define@key{ctbl}{framesep}{\@ctblframesep=#1}
+\define@key{ctbl}{framefg}{\@ctblfgcolor#1=}
+\define@key{ctbl}{framebg}{\@ctblbgcolor#1=}
+\define@key{ctbl}{captionskip}{\@ctblcaptionskip=#1}
+\define@key{ctbl}{nosuper}[]{\let\@cttextsuperscript\@ctcopy}
\def\@ctblCaption{
\ifx\@ctblcap\empty\let\@ctblcap\@ctblcaption\fi
\ifx\@ctblcaption\empty\else
@@ -84,91 +81,99 @@
\newcommand{\tnote}[2][a]{%
\hbox{\@cttextsuperscript{\normalfont\textit{#1}}}&#2\NN}
\newcommand{\tmark}[1][a]{%
- \hbox{\@cttextsuperscript{\normalfont\textit{#1\xspace}}}}
+ \hbox{\textsuperscript{\normalfont\textit{#1\xspace}}}}
\newcommand{\ctable}[4][]{%
- \def\@ctbltaborfig{table}%
- \def\@ctblalign {center}%
- \def\@ctblsideways {}%
- \def\@ctblpos {}%
- \def\@ctblcaption {}%
- \def\@ctblcap {}%
- \def\@ctbllabel {}%
- \def\@ctblbeg {\begin{\@ctblsideways\@ctbltaborfig\@ctblstarred}}%
- \def\@ctblbegin {\@ctblbeg}%
- \def\@ctblend {\end{\@ctblsideways\@ctbltaborfig\@ctblstarred}}%
- \def\@ctblbotcap {}%
- \def\@ctblstarred {}%
- \definecolor{@ctblframefg}{rgb}{0,0,0}%
- \definecolor{@ctblframebg}{rgb}{1,1,1}%
+ \def\@ctbltaborfig{table}
+ \def\@ctblalign {center}
+ \def\@ctblsideways {}
+ \def\@ctblpos {}
+ \def\@ctblcaption {}
+ \def\@ctblcap {}
+ \def\@ctbllabel {}
+ \def\@ctblbeg {\begin{\@ctblsideways\@ctbltaborfig\@ctblstarred}}
+ \def\@ctblbegin {\@ctblbeg}
+ \def\@ctblend {\end{\@ctblsideways\@ctbltaborfig\@ctblstarred}}
+ \def\@ctblbotcap {}
+ \def\@ctblstarred {}
+ \definecolor{@ctblframefg}{rgb}{0,0,0}
+ \definecolor{@ctblframebg}{rgb}{1,1,1}
\@ctblframerule0pt
- \@ctblcaptionskip2ex
+ \@ctblcaptionskip0ex
\@ctblframesep0pt
\@ctblwidth=0pt
\@ctblmaxwidth=0pt
\@ctblmincapwidth=0pt
- \setkeys{ctbl}{#1}%
+ \setkeys{ctbl}{#1}
\ifdim\@ctblwidth=0pt\else
\ifdim\@ctblmaxwidth=0pt\else
\PackageError{ctable}{
- You may not use the width and maxwidth options together}{%
+ You may not use the width and maxwidth options together}{
Use either width or maxwidth}
\fi
\fi
\ifx\@ctblpos\empty\else
\ifx\@ctblsideways\empty\else
\PackageError{ctable}{
- You may not use the pos and sideways options together}{%
+ You may not use the pos and sideways options together}{
Rotated tables and figures are always typeset on a separate page}
\fi
\fi
+ \ifx\@ctblcaption\empty
+ \ifx\@ctbllabel\empty\else
+ \PackageError{ctable}{
+ You may not label a captionless table}{
+ Such a label can't be referenced}
+ \fi
+ \fi
\newcolumntype{Y}{X}% save the X type
- \sbox\ctbl@tabel{%
+ \sbox\ctbl@t{%
\newcolumntype{X}{l}% temporarily make type X = l
\@ctblframe{@ctblframefg}{@ctblframebg}{%
\begin{tabular}{#2}
- #4
+ #4%
\end{tabular}%
}%
}%
- \sbox\ctbl@tabelx{%
- \newcolumntype{X}{Y}% restore X
- \@ctblframe{@ctblframefg}{@ctblframebg}{%
- \begin{tabularx}{\ifdim\@ctblwidth>0pt\@ctblwidth\else\@ctblmaxwidth\fi}{#2}
- #4
- \end{tabularx}%
- }%
- }%
+ \newif\if@ctblusex\@ctblusexfalse
\ifdim\@ctblmaxwidth=0pt
\ifdim\@ctblwidth=0pt
- \sbox{\ctbl@t}{\usebox\ctbl@tabel}%
\else
- \sbox{\ctbl@t}{\usebox\ctbl@tabelx}%
+ \@ctblusextrue
\fi
\else
- \ifdim\wd\ctbl@tabel>\@ctblmaxwidth
- \sbox{\ctbl@t}{\usebox\ctbl@tabelx}%
- \else
- \sbox{\ctbl@t}{\usebox\ctbl@tabel}%
+ \ifdim\wd\ctbl@t>\@ctblmaxwidth
+ \@ctblusextrue
\fi
\fi
+ \if@ctblusex
+ \sbox\ctbl@t{%
+ \newcolumntype{X}{Y}% restore X
+ \@ctblframe{@ctblframefg}{@ctblframebg}{%
+ \begin{tabularx}{\ifdim\@ctblwidth>0pt\@ctblwidth\else\@ctblmaxwidth\fi}{#2}
+ #4%
+ \end{tabularx}%
+ }%
+ }%
+ \fi
\@ctblw=\wd\ctbl@t
- \ifdim\@ctblmincapwidth<\@ctblw\@ctblww=\@ctblw\else%
- \settowidth{\@ctblww}{\tablename\ \thetable: \@ctblcaption}
- \ifdim\@ctblww>\@ctblmincapwidth\@ctblww=\@ctblmincapwidth\fi%
+ \@ctblfloatwidth=\ifdim\@ctblmincapwidth>\@ctblw
+ \@ctblmincapwidth
+ \else
+ \@ctblw
\fi
\@ctblbegin
\begin{\@ctblalign}
- \begin{minipage}{\@ctblww}
- \ifx\@ctblbotcap\empty\@ctblCaption\vspace{\@ctblcaptionskip}\fi
+ \begin{minipage}{\@ctblfloatwidth}\parindent0pt
+ \ifx\@ctblbotcap\empty\@ctblCaption\vskip\@ctblcaptionskip\fi
\centering{\usebox\ctbl@t} % insert the tabular
- \def\@ctblfootnotes{#3}
+ \def\@ctblfootnotes{#3}%
\ifx#3\empty\else % append footnotes, if any
\\
\begin{tabularx}{\hsize}{r@{\,}>{\footnotesize\raggedright}X}
- #3
- \end{tabularx}
+ #3%
+ \end{tabularx}%
\fi
- \ifx\@ctblbotcap\empty\else\@ctblCaption\fi
+ \ifx\@ctblbotcap\empty\else\vskip\@ctblcaptionskip\@ctblCaption\fi
\end{minipage}
\end{\@ctblalign}
\@ctblend