From c4b820a9814d2797004f542450059a7fabb1d284 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:53:47 +0000 Subject: ctable git-svn-id: svn://tug.org/texlive/trunk@802 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/ctable/ctable.sty | 162 ++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/ctable/ctable.sty (limited to 'Master/texmf-dist/tex/latex/ctable') diff --git a/Master/texmf-dist/tex/latex/ctable/ctable.sty b/Master/texmf-dist/tex/latex/ctable/ctable.sty new file mode 100644 index 00000000000..5230770a9ff --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctable/ctable.sty @@ -0,0 +1,162 @@ +%% +%% This is file `ctable.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctable.dtx (with options: `package') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from ctable.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file ctable.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%%% File: ctable.dtx +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ctable} + [2004/06/19 v1.6b LaTeX package ctable] +\RequirePackage{color,keyval,array,tabularx,booktabs,rotating} +\def\NN{\tabularnewline} +\def\FL{\toprule} +\def\ML{\NN\midrule} +\def\LL{\NN\bottomrule} +\def\@ctblfgcolor#1 #2 #3={\definecolor{@ctblframefg}{rgb}{#1,#2,#3}} +\def\@ctblbgcolor#1 #2 #3={\definecolor{@ctblframebg}{rgb}{#1,#2,#3}} +\newdimen\@ctblframesep +\newdimen\@ctblframerule +\newdimen\@ctblwidth +\newdimen\@ctblmaxwidth +\newdimen\@ctblw % the final width +\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}{botcap}[]{\def\@ctblbotcap {1}} +\define@key{ctbl}{rotate}[]{\def\@ctblrotate {sideways}} +\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=} +\def\@ctblCaption{ + \ifx\@ctblcap\empty\let\@ctblcap\@ctblcaption\fi + \ifx\@ctblcaption\empty\else + \caption[\@ctblcap]{\label{\@ctbllabel}\@ctblcaption} + \fi +} +\newdimen\@ctbloldsep +\newdimen\@ctbloldrule +\def\@ctblframe#1#2#3{% + \@ctbloldsep\fboxsep\fboxsep\@ctblframesep% + \@ctbloldrule\fboxrule\fboxrule\@ctblframerule% + \fcolorbox{#1}{#2}{\fboxsep\@ctbloldsep\fboxrule\@ctbloldrule #3}% +} +\newcommand{\tnote}[2][a]{% + \hbox{\@textsuperscript{\normalfont\textit{#1}}}\NN} +\newcommand{\tmark}[1][a]{% + \hbox{\@textsuperscript{\normalfont\textit{#1}}}} +\newcommand{\ctable}[4][]{ + \def\@ctbltaborfig{table} + \def\@ctblalign {center} + \def\@ctblrotate {} + \def\@ctblpos {} + \def\@ctblcaption {} + \def\@ctblcap {} + \def\@ctbllabel {} + \def\@ctblbeg {\begin{\@ctblrotate\@ctbltaborfig\@ctblstarred}} + \def\@ctblbegin {\@ctblbeg} + \def\@ctblend {\end{\@ctblrotate\@ctbltaborfig\@ctblstarred}} + \def\@ctblbotcap {} + \def\@ctblstarred {} + \definecolor{@ctblframefg}{rgb}{0,0,0} + \definecolor{@ctblframebg}{rgb}{1,1,1} + \@ctblframerule0pt + \@ctblframesep0pt + \@ctblwidth=0pt + \@ctblmaxwidth=0pt + \setkeys{ctbl}{#1} + \ifdim\@ctblwidth=0pt\else + \ifdim\@ctblmaxwidth=0pt\else + \PackageError{ctable}{ + You may not use the width and maxwidth options together}{% + Use either width or maxwidth} + \fi + \fi + \ifx\@ctblpos\empty\else + \ifx\@ctblrotate\empty\else + \PackageError{ctable}{ + You may not use the pos and rotate options together}{% + Rotated tables and figures are always typeset on a separate page} + \fi + \fi + \newcolumntype{Y}{X}% save the X type + \sbox\ctbl@tabel{% + \newcolumntype{X}{l}% temporarily make type X = l + \@ctblframe{@ctblframefg}{@ctblframebg}{% + \begin{tabular}{#2} + #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}% + }% + } + \ifdim\@ctblmaxwidth=0pt + \ifdim\@ctblwidth=0pt + \sbox{\ctbl@t}{\usebox\ctbl@tabel} + \else + \sbox{\ctbl@t}{\usebox\ctbl@tabelx} + \fi + \else + \ifdim\wd\ctbl@tabel>\@ctblmaxwidth + \sbox{\ctbl@t}{\usebox\ctbl@tabelx} + \else + \sbox{\ctbl@t}{\usebox\ctbl@tabel} + \fi + \fi + \@ctblw=\wd\ctbl@t + \@ctblbegin + \begin{\@ctblalign} + \begin{minipage}{\@ctblw} + \ifx\@ctblbotcap\empty\@ctblCaption\vspace{2ex}\fi + \usebox\ctbl@t % insert the tabular + \def\@ctblfootnotes{#3} + \ifx#3\empty\else % append footnotes, if any + \\ + \begin{tabularx}{\@ctblw}{r@{\,}>{\footnotesize\raggedright}X} + #3 + \end{tabularx} + \fi + \ifx\@ctblbotcap\empty\else\@ctblCaption\fi + \end{minipage} + \end{\@ctblalign} + \@ctblend +} +\endinput +%% +%% End of file `ctable.sty'. -- cgit v1.2.3