diff options
author | Karl Berry <karl@freefriends.org> | 2006-07-26 21:36:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-07-26 21:36:12 +0000 |
commit | 0a57e6b100604ff3a5631232cdad6713dea9f5be (patch) | |
tree | d40d58bb3131eeccc43b4d7dc4b6b7b73f7da5ea /Master/texmf-dist/source/latex | |
parent | 3664135885c044d7017ba1c7cdaea3deb037f695 (diff) |
ctable 1.7 (22feb06)
git-svn-id: svn://tug.org/texlive/trunk@1923 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/ctable/ctable.dtx | 143 |
1 files changed, 76 insertions, 67 deletions
diff --git a/Master/texmf-dist/source/latex/ctable/ctable.dtx b/Master/texmf-dist/source/latex/ctable/ctable.dtx index f43d91762b2..9e3bccc919a 100644 --- a/Master/texmf-dist/source/latex/ctable/ctable.dtx +++ b/Master/texmf-dist/source/latex/ctable/ctable.dtx @@ -1,5 +1,5 @@ % \iffalse -% $Id: ctable.dtx,v 1.26 2004/06/19 13:06:01 wybo Exp $ +% $Id: ctable.dtx,v 1.32 2005/08/09 13:21:31 wybo Exp $ %%% File: ctable.dtx \NeedsTeXFormat{LaTeX2e} %<*dtx> @@ -10,7 +10,7 @@ %<+abstract> easy centered table and figure floats with footnotes for LaTeX % \fi %\ProvidesFile{ctable} - [2004/06/19 v1.6b LaTeX package ctable] + [2005/08/09 v1.7 LaTeX package ctable] %\iffalse %<*driver> \documentclass[a4paper]{ltxdoc} @@ -43,11 +43,13 @@ % \changes{v1.6}{2004/03/20}{left, right and center options added % frame{sep,rule,fg,bg} options added % error in width-setting corrected} -% \changes{v1.6a}{2004/04/01}{two errors corrected: +% \changes{v1.6a}{2004/04/01}{two errors corrected: % made setting fboxsep and fboxrule only temporary -% removed superfluous space after tabulars} -% \changes{v1.6b}{2004/06/19}{Added several % at eol to remove superfluous +% removed superfluous space after tabulars} +% \changes{v1.6b}{2004/06/19}{Added several % at eol to remove superfluous % whitespace occurring sometimes} +% \changes{v1.7}{2005/08/09}{Added option sideways, option rotate now obsolete; +% added option captionskip} % \GetFileInfo{ctable} % \MakeShortVerb{\|} % \title{The |ctable| package\thanks @@ -95,15 +97,18 @@ % Options are given as key=value pairs, separated by comma's. % Extra comma's, including one behind the last pair, don't hurt. % Arguments to option should be put between braces if they contain -% comma's. +% comma's or equals signs. % Currently the following option keys have been defined: % \\[2ex] % \begin{tabularx}{\hsize}{@{}lX@{}} % |caption={...}|& table caption; the braces are needed only if your -% caption contains a comma.\NN +% caption contains a comma or an equals sign.\NN % % |cap={...}| & for a short caption to go to the |\tableofcontents|.\NN % +% |captionskip=...| & set the whitespace between the caption and the table; +% default is |2ex|.\NN +% % |pos=...| & float position, default: |tbp|.\NN % % |label=...| & for |\label|\NN @@ -130,8 +135,10 @@ % |botcap| & put the caption at the bottom of the float instead % of on top of it.\NN % -% |rotate| & rotate table or figure by 90 degrees anticlockwise -% and put it on a separate page. If you use this option, +% |sideways| & rotate table or figure by 90 degrees anticlockwise +% and put it on a separate page. With the twoside option +% for the standard \LaTeX\ document classes, rotation +% will be -90 on even pages. If you use this option, % the |pos| option is not allowed.\NN % % |star| & use the starred versions of the |table| and |figure| @@ -192,7 +199,7 @@ % \DescribeMacro{\LL} Last Line: generates a new line and a thick % rule with some extra space over it. % An optional dimen parameter sets the line width; the default is 0.08em \\ -% These macros can be used outside |\ctable| constructs. +% These macros can be used outside |\ctable| constructs. % \par % Finally, for completeness, here are some of |booktabs|' commands % that may be useful:\\ @@ -237,9 +244,9 @@ % column contains small texts only. This problem can be solved by using % the maxwidth option instead of the width option. The |X| specifiers will % then be replaced with |l| as long as the width of the resulting table -% stays with the specified maximum width. -% -% +% stays with the specified maximum width. +% +% % \section{Examples} % \subsection{Tables} % Table~\ref{tab:nowidth} is an example taken from the related package @@ -314,7 +321,7 @@ % % \subsection{Figures} % Figures, even single ones, are always put in tabular cells. This is not -% particularly handy for single pictures, but it eases the construction +% particularly handy for single pictures, but it eases the construction % of arrays of pictures, including sub-captions, delineation, and spacing. % Figure~\ref{fig} shows a figure that has been produced with the |\ctable| % command, in combination with |\usepackage{carom}|; @@ -336,7 +343,7 @@ % \bzdrv{1==Br;2==Br;3==Br}& % \bzdrv{1==Br;2==Br;4==Br}& % \bzdrv{1==Br;3==Br;5==Br} \NN -% 1,2,3 & 1,2,4 & 1,3,5 +% 1,2,3 & 1,2,4 & 1,3,5 % } % \end{verbatim} % \ctable[ @@ -355,7 +362,7 @@ % \bzdrv{1==Br;2==Br;3==Br}& % \bzdrv{1==Br;2==Br;4==Br}& % \bzdrv{1==Br;3==Br;5==Br} \NN -% 1,2,3 & 1,2,4 & 1,3,5 +% 1,2,3 & 1,2,4 & 1,3,5 % } % (The excessive whitespace at the left of the figure is caused by % the bounding boxes generated by the \textsl{carom} package.) @@ -364,7 +371,7 @@ % \parskip2ex % \begin{macrocode} %<*package> -\RequirePackage{color,keyval,array,tabularx,booktabs,rotating} +\RequirePackage{color,xkeyval,array,tabularx,booktabs,rotating} \def\NN{\tabularnewline} \def\FL{\toprule} \def\ML{\NN\midrule} @@ -374,6 +381,7 @@ \newdimen\@ctblframesep \newdimen\@ctblframerule \newdimen\@ctblwidth +\newdimen\@ctblcaptionskip \newdimen\@ctblmaxwidth \newdimen\@ctblw % the final width % \end{macrocode} @@ -388,26 +396,27 @@ % bottom, page) gets a special treatment, since \LaTeX\ does not expand % commands there. So instead of putting things like \texttt{tbp} in a % command like |\@ctblbegin| we put -% |\begin{table}[tbp]| in it. +% |\begin{table}[tbp]| in it. % \begin{macrocode} -\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=} +\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}{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}% % \end{macrocode} % a caption will only be generated if the \textsl{caption} option was used: % \begin{macrocode} @@ -428,45 +437,46 @@ \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} +\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}% \@ctblframerule0pt + \@ctblcaptionskip2ex \@ctblframesep0pt \@ctblwidth=0pt \@ctblmaxwidth=0pt - \setkeys{ctbl}{#1} + \setkeys{ctbl}{#1}% % \end{macrocode} % It makes no sense to use \textsl{width} together with \textsl{maxwidth} or -% \textsl{pos} together with \textsl{rotate} +% \textsl{pos} together with \textsl{sideways} % \begin{macrocode} \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} + Use either width or maxwidth} \fi \fi \ifx\@ctblpos\empty\else - \ifx\@ctblrotate\empty\else + \ifx\@ctblsideways\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} + You may not use the pos and sideways options together}{% + Rotated tables and figures are always typeset on a separate page} \fi \fi - \newcolumntype{Y}{X}% save the X type + \newcolumntype{Y}{X}% save the X type % \end{macrocode} % save the table contents in a box, so we can determine its width, one box % will contain the table typeset with the tabular environment: @@ -478,11 +488,10 @@ #4 \end{tabular}% }% - } + }% % \end{macrocode} % the other will get the table typeset with the tabularx environment: % \begin{macrocode} - \sbox\ctbl@tabelx{% \newcolumntype{X}{Y}% restore X \@ctblframe{@ctblframefg}{@ctblframebg}{% @@ -490,7 +499,7 @@ #4 \end{tabularx}% }% - } + }% % \end{macrocode} % if no \textsl{maxwidth} was given: % \begin{macrocode} @@ -502,12 +511,12 @@ % \end{macrocode} % then use the tabular environment: % \begin{macrocode} - \sbox{\ctbl@t}{\usebox\ctbl@tabel} + \sbox{\ctbl@t}{\usebox\ctbl@tabel}% \else % \end{macrocode} % if width was given: use the tabularx environment % \begin{macrocode} - \sbox{\ctbl@t}{\usebox\ctbl@tabelx} + \sbox{\ctbl@t}{\usebox\ctbl@tabelx}% \fi \else % \end{macrocode} @@ -518,12 +527,12 @@ % \end{macrocode} % if so, we use the tabularx environment: % \begin{macrocode} - \sbox{\ctbl@t}{\usebox\ctbl@tabelx} + \sbox{\ctbl@t}{\usebox\ctbl@tabelx}% \else % \end{macrocode} % but if within limits, we use the tabular environment: % \begin{macrocode} - \sbox{\ctbl@t}{\usebox\ctbl@tabel} + \sbox{\ctbl@t}{\usebox\ctbl@tabel}% \fi \fi % \end{macrocode} @@ -532,12 +541,12 @@ % \begin{macrocode} \@ctblw=\wd\ctbl@t % \end{macrocode} -% |\@ctblbegin| is now defined as something like |\begin{table}[tbp]|. +% |\@ctblbegin| is now defined as something like |\begin{table}[tbp]|. % \begin{macrocode} \@ctblbegin \begin{\@ctblalign} \begin{minipage}{\@ctblw} - \ifx\@ctblbotcap\empty\@ctblCaption\vspace{2ex}\fi + \ifx\@ctblbotcap\empty\@ctblCaption\vspace{\@ctblcaptionskip}\fi \usebox\ctbl@t % insert the tabular \def\@ctblfootnotes{#3} \ifx#3\empty\else % append footnotes, if any |