From ea6b77b4ca75244e8aea9fcecaff57fc2fd0677e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 17 Sep 2009 00:14:36 +0000 Subject: ctable 1.14 (16sep09) git-svn-id: svn://tug.org/texlive/trunk@15322 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/ctable/ctable.dtx | 182 ++++++++++------------- Master/texmf-dist/source/latex/ctable/ctable.ins | 2 +- 2 files changed, 76 insertions(+), 108 deletions(-) (limited to 'Master/texmf-dist/source/latex/ctable') diff --git a/Master/texmf-dist/source/latex/ctable/ctable.dtx b/Master/texmf-dist/source/latex/ctable/ctable.dtx index c95d289201d..b5f59163ca7 100644 --- a/Master/texmf-dist/source/latex/ctable/ctable.dtx +++ b/Master/texmf-dist/source/latex/ctable/ctable.dtx @@ -19,16 +19,18 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ctable} %<*package> - [2008/05/01 v1.13 ctable package] + [2009/09/15 v1.14 ctable package] % % %<*driver> \documentclass{ltxdoc} -\usepackage{carom,ctable,txfonts} +\usepackage{ctable,txfonts} +\usepackage[l2tabu,orthodox]{nag} \usepackage[ verbose, pdftex, paper=a4paper, + nomarginpar, bottom=30mm, nohead ]{geometry} @@ -77,7 +79,7 @@ % % \fi % -% \CheckSum{390} +% \CheckSum{387} % % \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 @@ -143,6 +145,13 @@ % same number as previous table, ` (continued' added % to caption. % } +% \changes{v1.14}{2008/08/12}{nosuper propagation to later tables prohibited +% added option doinside +% use of (obsolete) carom.sty for docs discontinued +% empty labels not created +% newcolumntype warnings removed +% caption package not needed anymore +% } % % \GetFileInfo{ctable.dtx} % @@ -244,6 +253,10 @@ % can then be used to give the float a minimum % width. The tabular will be centered in it.\NN[1ex] % +% |doinside=...| & command to be run inside, just before the tabular +% or tabularx environment. You can use this, for example, +% for the adjustment of the font size with |\small|.\NN[1ex] +% % |pos=...| & float position, default: |tbp|.\NN[1ex] % % |label=...| & for |\label|\NN[1ex] @@ -293,12 +306,12 @@ % |framesep=...| & set the distance between the frame and the table % to the given dimension. The default is |0pt|.\NN[1ex] % -% |framefg=|\sl r g b & set the foreground color of the frame (the +% |framefg=|\slshape r g b & set the foreground color of the frame (the % rule color) to the given triplet of % \textsl{rgb}-values. The values should be numbers % between 0 and 1. The default is |0 0 0| (black).\NN[1ex] % -% |framebg=|\sl r g b & set the background color of the frame (the +% |framebg=|\slshape r g b & set the background color of the frame (the % color inside the frame) to the given triplet of % \textsl{rgb}-values. The values should be numbers % between 0 and 1. The default is |1 1 1| (white).\NN[1ex] @@ -473,57 +486,11 @@ % } % % Figures, even single ones, are always put in tabular cells. This is not -% 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|\{% -% \href{http://tug.ctan.org/obsolete/macros/latex/contrib/xymtex/carom.sty}{\texttt{carom}}\} -% it has been typeset with: -% \color{vbgreen} -% \begin{verbatim} -% \ctable[ -% figure, -% botcap, -% pos = h, -% caption = The di- and tri-bromobenzenes, -% label = fig, -% framebg = .53 .81 .92, -% framerule = 1pt, -% framesep = 4ex, -% ]{ccc}{}{ \NN -% \bzdrv{1==Br;2==Br}& -% \bzdrv{1==Br;3==Br}& -% \bzdrv{1==Br;4==Br} \NN -% 1,2 & 1,3 & 1,4 \NN[3ex] -% \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 -% } -% \end{verbatim} -% \color{black} -% \ctable[ -% figure, -% botcap, -% pos = h, -% caption = The di- and tri-bromobenzenes, -% label = fig, -% framebg = .53 .81 .92, -% framerule = 1pt, -% framesep = 4ex, -% ]{ccc}{}{ \NN -% \bzdrv{1==Br;2==Br}& -% \bzdrv{1==Br;3==Br}& -% \bzdrv{1==Br;4==Br} \NN -% 1,2 & 1,3 & 1,4 \NN[3ex] -% \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 -% } -% (The excessive whitespace at the left of the figure is caused by -% the bounding boxes generated by the |carom| package.) +% particularly handy for single pictures, but it eases the construction of +% arrays of pictures, including sub-captions, delineation, and spacing. For a +% small example, which also shows how you can simplify the construction of +% figure arrays, see subsection~\ref{figureexample} on +% page~\pageref{figureexample}. % % \section{Option examples} % In the following, small examples will be shown illustrating the effect of @@ -562,7 +529,6 @@ % \ROW{B}{s13b}{13b} % \ROW{B}{s13c}{13c} % -% \newpage % \subsection{\ttfamily\bfseries mincapwidth} % |ctable| forces caption and footnotes to stay within the width of the table. % Sometimes, however, tables are so narrow, that this is not really what you want. @@ -632,7 +598,7 @@ % \ROW{Y}{s04a}{04a} % \ROW{B}{s04b}{04b} % -% \subsection{\ttfamily\bfseries figure, botcap} +% \subsection{\ttfamily\bfseries figure, botcap}\label{figureexample} % By default, |ctable| generates a table float, but with the |figure| option, a % figure float is generated instead. The caption stays on top, so if you are % accustomed to have bottom caption for your figures, you will probably also need @@ -658,15 +624,15 @@ % % \section{Implementation} % \begin{macrocode} -\RequirePackage{color,xkeyval,array,tabularx,booktabs,rotating,caption} +\RequirePackage{color,xkeyval,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}} -\let\@cttextsuperscript\@textsuperscript -\def\@ctcopy#1{\footnotesize #1} +\def\@ctbltextsuperscript#1{\ifx\@ctblnosuper\empty\@textsuperscript{#1}\else{\footnotesize#1}\fi} +\def\@ctbldoinside{\relax} \newdimen\@ctblframesep \newdimen\@ctblframerule \newdimen\@ctblwidth @@ -704,40 +670,39 @@ 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}{center}[]{\let\@ctblalign\centering} +\define@key{ctbl}{right}[]{\let\@ctblalign\raggedleft} +\define@key{ctbl}{left}[]{\let\@ctblalign\raggedright} \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}{nosuper}[]{\def\@ctblnosuper{1}} \define@key{ctbl}{notespar}[]{\def\@ctblnotespar{1}} +\define@key{ctbl}{doinside}{\def\@ctbldoinside{#1}} % \end{macrocode} % A caption will only be generated if the \textsl{caption} option was used. % First adapt |\@caption| so that it does not insert empty (short) captions % in the lot/lof % \begin{macrocode} -\long\def\@caption#1[#2]#3{% - \par - \ifx#2\empty\else\addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}\fi% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup} \def\@ctblCaption{ \ifx\@ctblcap\undefined\let\@ctblcap\@ctblcaption\fi \ifx\@ctblcaption\empty\else - \caption[\@ctblcap]{\label{\@ctbllabel}\@ctblcaption\ \@ctblcontinued} + \caption[\@ctblcap]{\ifx\@ctbllabel\empty\else\label{\@ctbllabel}\fi\@ctblcaption\ \@ctblcontinued\strut} \fi } +% \end{macrocode} +% Need to redefine X columntype, but the array package would generate a warning. +% So first set the type to be redefined to |\undefined| to suppress the warning. +% Save the standard X type once in the new type Y +% \begin{macrocode} +\newcolumntype{Y}{X} +\def\@ctblXcolumntype#1{ + \let\NC@find@X\undefined + \newcolumntype{X}{#1} +} \def\@ctblframe#1#2#3{% \@ctbloldsep\fboxsep\fboxsep\@ctblframesep% \@ctbloldrule\fboxrule\fboxrule\@ctblframerule% @@ -745,16 +710,16 @@ } \newcommand{\tnote}[2][a]{% \ifx\@ctblnotespar\empty% - \hbox{\@cttextsuperscript{\normalfont\textit{#1}}}\NN + \hbox{\@ctbltextsuperscript{\normalfont\textit{#1}}}\NN \else% - \@cttextsuperscript{\normalfont\textit{#1}}\,#2 + \@ctbltextsuperscript{\normalfont\textit{#1}}\,#2 \fi } \newcommand{\tmark}[1][a]{% \hbox{\textsuperscript{\normalfont\textit{#1}}}} \newcommand{\ctable}[4][]{% \def\@ctbltaborfig{table}% - \def\@ctblalign {center}% + \let\@ctblalign\centering% \def\@ctblsideways{}% \def\@ctblcontinued{}% \def\@ctblpos {}% @@ -766,11 +731,12 @@ \def\@ctblend {\end{\@ctblsideways\@ctbltaborfig\@ctblstarred}}% \def\@ctblbotcap {}% \def\@ctblstarred {}% + \def\@ctblnosuper{} \def\@ctblnotespar{}% \definecolor{@ctblframefg}{rgb}{0,0,0}% \definecolor{@ctblframebg}{rgb}{1,1,1}% \@ctblframerule0pt - \@ctblcaptionskip0ex + \@ctblcaptionskip=0ex \@ctblframesep0pt \@ctblwidth=0pt \@ctblmaxwidth=0pt @@ -805,14 +771,14 @@ Such a label can't be referenced} \fi \fi - \newcolumntype{Y}{X}% save the X type % \end{macrocode} % save the table contents in a box, so we can determine its width, % initially, save the table typeset with the tabular environment: % \begin{macrocode} \sbox\ctbl@t{% - \newcolumntype{X}{l}% temporarily make type X = l + \@ctblXcolumntype{l}% temporarily make type X = l \@ctblframe{@ctblframefg}{@ctblframebg}{% + \@ctbldoinside \begin{tabular}{#2} #4% \end{tabular}% @@ -837,8 +803,9 @@ % \if@ctblusex \sbox\ctbl@t{% - \newcolumntype{X}{Y}% restore X + \@ctblXcolumntype{Y}% restore X \@ctblframe{@ctblframefg}{@ctblframebg}{% + \@ctbldoinside \begin{tabularx}{\ifdim\@ctblwidth>0pt\@ctblwidth\else\@ctblmaxwidth\fi}{#2} #4% \end{tabularx}% @@ -865,31 +832,32 @@ % |\@ctblbegin| is now defined as something like |\begin{table}[tbp]|. % \begin{macrocode} \@ctblbegin - \ifx\@ctblcontinued\empty\else\ContinuedFloat\fi - \begin{\@ctblalign} - \begin{minipage}{\@ctblfloatwidth}\parindent0pt - \ifx\@ctblbotcap\empty\@ctblCaption\vskip\@ctblcaptionskip\fi - \centering{\usebox\ctbl@t} % insert the tabular - \def\@ctblfootnotes{#3}% - \ifx#3\empty\else % append footnotes, if any - \ifx\@ctblnotespar\empty% - \\ - \begin{tabularx}{\hsize}{r@{\,}>{\footnotesize\raggedright}X} - #3% - \end{tabularx}% - \else% - \\[.2ex] - \begin{minipage}{\hsize}\footnotesize\raggedright% - #3% - \end{minipage}% - \fi + \ifx\@ctblcontinued\empty\else\addtocounter{\@ctbltaborfig}{-1}\fi + \@ctblalign + \begin{minipage}{\@ctblfloatwidth}\parindent0pt + \ifx\@ctblbotcap\empty\@ctblCaption\vskip\@ctblcaptionskip\fi + \centering{\usebox\ctbl@t} % insert the tabular + \def\@ctblfootnotes{#3}% + \ifx#3\empty\else{% append footnotes, if any + \footnotesize + \ifx\@ctblnotespar\empty% + \\ + \begin{tabularx}{\hsize}{r@{\,}>{\raggedright}X} + #3% + \end{tabularx}% + \else% + \\[.2ex] + \begin{minipage}{\hsize}\raggedright% + #3% + \end{minipage}% \fi - \ifx\@ctblbotcap\empty\else\vskip\@ctblcaptionskip\@ctblCaption\fi - \end{minipage} - \end{\@ctblalign} + } + \fi + \ifx\@ctblbotcap\empty\else\vskip\@ctblcaptionskip\@ctblCaption\fi + \end{minipage} \@ctblend } % \end{macrocode} % \Finale \endinput -$Id: ctable.dtx,v 1.59 2008/04/30 13:18:59 wybo Exp $ +$Id: ctable.dtx,v 1.64 2009-09-15 11:15:59 wybo Exp $ diff --git a/Master/texmf-dist/source/latex/ctable/ctable.ins b/Master/texmf-dist/source/latex/ctable/ctable.ins index 7b8e79eaff8..d6868d9ab74 100644 --- a/Master/texmf-dist/source/latex/ctable/ctable.ins +++ b/Master/texmf-dist/source/latex/ctable/ctable.ins @@ -61,4 +61,4 @@ and version 1.2 or later is part of all distributions of LaTeX version \Msg{**************************************************************} \endbatchfile -$Id: ctable.ins,v 1.6 2007/08/18 12:14:49 wybo Exp $ +$Id: ctable.ins,v 1.6 2007-08-18 12:14:49 wybo Exp $ -- cgit v1.2.3