diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-08 15:58:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-08 15:58:47 +0000 |
commit | ba8058f661bc514c2d960695ddb21d5501abbf97 (patch) | |
tree | 3ed20232ad39107bf24cde0e6795db6da5ee7e38 /Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex | |
parent | 3ed1ea28cc76e0634ad44d87ef6d963bf25f376e (diff) |
float 0.2a (7sep07)
git-svn-id: svn://tug.org/texlive/trunk@4910 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex | 395 |
1 files changed, 204 insertions, 191 deletions
diff --git a/Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex b/Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex index 06cd012b883..10195f2fe28 100644 --- a/Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex +++ b/Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex @@ -8,59 +8,24 @@ % 3) s-longtable3.tex % Redefines \tablename command: ``Continuation of table 1. % and ``Finishing of table 1.'' (Is that correct English form?) -\begin{filecontents}{t-longtable.sty} -% \iffalse -% t-longtable.sty - Patch to longtable package -\ProvidesPackage{t-longtable} - [2006/06/23 v0.0a (ALPHA-temp) Patch to longtable package] -% \fi -% \begin{macrocode} -\RequirePackage{longtable}[2004/02/01] -% \end{macrocode} -% The box for last head. Defined in the same way as others. -% \begin{macrocode} -\newbox\LT@lasthead -% \end{macrocode} -% This counter register to count long table pages. -% \begin{macrocode} -\newcounter{LTpage} -% \end{macrocode} -% This command (number of longtable's page) defined by hand for -% each table. The default number is~2. -% \begin{macrocode} -\newcommand\LTlastpage{2} -% \end{macrocode} -% Storing of original definition of |\longtable|. -% In new definition was added counter of longtable's pages. -% \begin{macrocode} -\@ifdefinable\TeXr@ori@longtable{\let\TeXr@ori@longtable\longtable} -\def\longtable{% - \setcounter{LTpage}\@ne - \TeXr@ori@longtable} -% \end{macrocode} -% Storing original definition of |\LT@ouput|. -% Here, in new definition, added increasing of \texttt{LTpage}. -% In the case of defined |\lasthead| contents and last page was -% checked, the contents of last head loaded. -% \begin{macrocode} -\@ifdefinable\TeXr@ori@LT@output{\let\TeXr@ori@LT@output\LT@output} -\def\LT@output{% - \addtocounter{LTpage}\@ne - \ifvoid\LT@lasthead\else - \ifnum\value{LTpage}=\LTlastpage - \let\LT@head\LT@lasthead - \fi - \fi - \TeXr@ori@LT@output} -% \end{macrocode} -% The definition of last head box. Defined in the same way as others. -% \begin{macrocode} -\def\endlasthead{\LT@end@hd@ft\LT@lasthead} -% \end{macrocode} -% -\endinput -\end{filecontents} \begin{filecontents}{s-longtable.tex} +\begin{longtable}{@{}lll} +\caption{The ISOGRK3 entity set and more more more more more more more more more more more more more more more more more more text}\\ + \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline +\endfirsthead +\LTcontcaption{}\\ + \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline +\endhead +\LTfincaption{}\\ + \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline +\endlasthead + \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}} +\endfoot + \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}} +\endprelastfoot +\noalign{\gdef\Continued{}\gdef\ContTable{}} + \hline +\endlastfoot alpha & GREEK SMALL LETTER ALPHA & 03B1\\ beta & GREEK SMALL LETTER BETA & 03B2\\ chi & GREEK SMALL LETTER CHI & 03C7\\ @@ -246,197 +211,245 @@ upsi & SMALL LETTER UPSILON & 03C5\\ Xi & CAPITAL LETTER XI & 039E\\ xi & SMALL LETTER XI & 03BE\\ zeta & SMALL LETTER ZETA & 03B6\\ +\end{longtable} \endinput % end of s-longtable.tex \end{filecontents} -\begin{filecontents}{s-longtable1.tex} \documentclass{book} -\usepackage{array,t-longtable} +\advance\textwidth.5in +\advance\evensidemargin-.25in +\advance\oddsidemargin-.25in + \usepackage{floatrow} +\usepackage{array,fr-longtable} \usepackage[labelsep=newline]{caption} \floatsetup[longtable]{font={small,sf},LTcapwidth=table,margins=centering, captionskip=5pt} \captionsetup[longtable]{font={small,rm}} -\DeclareCaptionLabelFormat{rightlabelcont}% +\DeclareCaptionLabelFormat{LTrightlabelcont}% {\rightline{\bothIfFirst{#1}{ }#2\ContTable}} +\DeclareCaptionLabelFormat{labelcont}% + {\rightline{\bothIfFirst{\ContTable}{ }#2}} % % Then define text for continued/finished table head, \ldots \newcommand\ContTable{} % % caption for continued head, \ldots -\newcommand\LTcontcaption[1]{% +\newcommand\LTcontcaptionI[1]{% \noalign{\gdef\ContTable{\captioncontinued}} - \caption{#1}} + \caption[]{#1}} % % and caption for finished head. (At the |\lastfoot| definition the |\ContTable| % must be defined as empty). -\newcommand\LTfincaption[1]{% +\newcommand\LTfincaptionI[1]{% \noalign{\gdef\ContTable{\captionfinished}} - \caption{#1}} + \caption[]{#1}} +% +% caption for continued head, \ldots +\newcommand\LTcontcaptionII{% + \caption[]{\emph{Continued}}} +% +% and caption for finished head. +\newcommand\LTfincaptionII{% + \caption[]{\emph{Finished}}} +% +% caption for continued head, \ldots +\newcommand\LTcontcaptionIII[1]{% + \noalign{\gdef\ContTable{\emph{Continuation of \tablename}}} + \caption[]{#1}} +% +% and caption for finished head. (At the |\lastfoot| definition the +% |\ContTable| must be defined as empty). +\newcommand\LTfincaptionIII[1]{% + \noalign{\gdef\ContTable{\emph{Finishing of \tablename}}} + \caption[]{#1}} + % % The examples of continued and finished heads. \newcommand\captioncontinued{. \emph{Continued}} \newcommand\captionfinished{. \emph{Finished}} +% +% Then define text for continued/finished table head, \ldots + \begin{document} -\chapter{Defining head of last page of long table: variant~1} +\chapter[Heads and Foots in Longtable]{Last Head And Last But One Foot In Longtable} -Here is example of defining of last head in long table. The words ``Continued'' and ``Finished'' defined by \verb|\ContTable| and added at the label of table caption: label format \texttt{rightlabelcont} (it will be defined for long table in group). These definitions are loaded in \verb|\LTcontcaption| and \verb|\LTfincaption| macros. At the \verb|\lastfoot| set \verb|\ContTable| emptied. +This file shows three examples of defining of last head and foot before last of +long table. They are printed in different sizes just to check work of page counting +algorithm. -The last page (number of table pages) of table defined ``by hand'' by command \verb|\LTlastpage|. Here: -\begin{verbatim} -\def\LTlastpage{5} -\end{verbatim} +The common settings: +\begin{quote}\obeylines\parskip0pt +\verb|\floatsetup[longtable]{font={small,sf},LTcapwidth=table,| +\verb| margins=centering,captionskip=5pt}| +\verb|\captionsetup[longtable]{font={small,rm}}| +\end{quote} +Here table font family settings are different from caption. In this case +font family settings were loaded in both setups. -\begingroup -\captionsetup[table]{labelformat=rightlabelcont} -\def\LTlastpage{5} +The body of long table is written in following way: +\begin{quote}\obeylines\parskip0pt +\verb|\begin{longtable}{@{}lll}| +\verb|\caption{The ISOGRK3 entity set and more more more more more more| +\verb| more more more more more more more more more more more text}\\| +\verb| \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\| +\verb|\hline| +\verb|\endfirsthead| +\verb|\LTcontcaption{}\\| +\verb| \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\| +\verb|\hline| +\verb|\endhead| +\verb|\LTfincaption{}\\| +\verb| \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\| +\verb|\hline| +\verb|\endlasthead| +\verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}}| +\verb|\endfoot| +\verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}}| +\verb|\endprelastfoot| +\verb|\noalign{\gdef\Continued{}\gdef\ContTable{}}| +\verb| \hline| +\verb|\endlastfoot| +\end{quote} +At the \verb|\lastfoot| set definitions of macros \verb|\Continued| and +\verb|\ContTable| globally emptied. -\begin{longtable}{@{}lll} -\caption{The ISOGRK3 entity set and more more more more more more more more more more more more more more more more more more text}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endfirsthead -\LTcontcaption{}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endhead -\LTfincaption{}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endlasthead - \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}} -\endfoot -\noalign{\gdef\Continued{}} - \hline -\endlastfoot -\input s-longtable.tex -\end{longtable} - -\endgroup -\end{document} -% end of s-longtable1.tex -\end{filecontents} -\begin{filecontents}{s-longtable2.tex} -\documentclass{book} - -\usepackage{array,t-longtable} -\usepackage{floatrow} -\usepackage[labelsep=period,singlelinecheck=no]{caption} -\floatsetup[table]{LTcapwidth=table,margins=raggedright,captionskip=5pt} - -\DeclareCaptionLabelFormat{rightlabelcont}% - {\rightline{\bothIfFirst{#1}{ }#2\ContTable}} -% -% caption for continued head, \ldots -\newcommand\LTcontcaption[1]{% - \caption{\emph{Continued}. #1}} -% -% and caption for finished head. -\newcommand\LTfincaption[1]{% - \caption{\emph{Finished}. #1}} +Besides of \verb|\endlasthead| command defined by \textsf{fr-longtable} package for +last head of table and \verb|\endprelastfoot|---for foot before last, there are +defined two special commands for captions: \verb|\LTcontcaption|---for continued pages +and \verb|\LTfincaption| for finishing page in this sample file. In the three examples +below they are defined in different way. -\begin{document} +\section{Variant~I} -\chapter{Defining head of last page of long table: variant~2} +For the first variant defined the label format \texttt{LTrightlabelcont} +(it will be defined for long table in group): +\begin{quote}\obeylines\parskip0pt +\verb|\DeclareCaptionLabelFormat{LTrightlabelcont}%| +\verb| {\rightline{\bothIfFirst{#1}{ }#2\ContTable}}| +\end{quote} -Here is example of defining of last head in long table. The words ``Continued'' and ``Finished'' added in caption text. The last page (number table of pages) of table defined by hand by command \verb|\LTlastpage|. Here: -\begin{verbatim} -\def\LTlastpage{5} -\end{verbatim} -(If you use \verb|\caption| instead of \verb|\LTcontcaption| and \verb|\LTfincaption| definitions, you ought to reduce \verb|\LTlastpage| by~1, in this example equal~4.) -\def\LTlastpage{5} +These definitions are loaded in \verb|\LTcontcaption| and \verb|\LTfincaption| macros: +caption for continued head: +\begin{quote}\obeylines\parskip0pt +\verb|\newcommand\LTcontcaption[1]{%| +\verb| \noalign[]{\gdef\ContTable{\captioncontinued}}| +\verb| \caption{#1}}| +\end{quote} +and caption for finished head: +\begin{quote}\obeylines\parskip0pt +\verb|\newcommand\LTfincaption[1]{%| +\verb| \noalign[]{\gdef\ContTable{\captionfinished}}| +\verb| \caption{#1}}| +\end{quote} +The \verb|\captioncontinued| and \verb|\captionfinished| commands define words +``Continued'' and ``Finished'' consequently. \begingroup -%\captionsetup[table]{labelformat=rightlabelcont} - -\begin{longtable}{@{}lll} -\caption{The ISOGRK3 entity set and more more more more more more more more more more more more more more more more more more text}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endfirsthead -\LTcontcaption{}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endhead -\LTfincaption{}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endlasthead - \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}} -\endfoot -\noalign{\gdef\Continued{}} - \hline -\endlastfoot +\captionsetup[longtable]{labelformat=LTrightlabelcont} +\floatsetup[longtable]{font={Large,sf}} +%\def\LTlastpage{5} +\let\LTcontcaption\LTcontcaptionI +\let\LTfincaption\LTfincaptionI \input s-longtable.tex -\end{longtable} \endgroup -\end{document} -% end of s-longtable2.tex -\end{filecontents} -\begin{filecontents}{s-longtable3.tex} -\documentclass{book} -\usepackage{array,t-longtable} -\usepackage{floatrow} -\usepackage[labelsep=newline]{caption} -\floatsetup[table]{font={small,sf},LTcapwidth=table,margins=raggedright, - captionskip=5pt} -\captionsetup[longtable]{font={small,rm}} +\clearpage +\section{Variant~II} -\DeclareCaptionLabelFormat{labelcont}% - {\rightline{\bothIfFirst{\ContTable}{ }#2}} -% -% Then define text for continued/finished table head, \ldots -\newcommand\ContTable{\tablename} -% -% caption for continued head, \ldots -\newcommand\LTcontcaption[1]{% - \noalign{\gdef\ContTable{\emph{Continuation of \tablename}}} - \caption{#1}} -% -% and caption for finished head. (At the |\lastfoot| definition the -% |\ContTable| must be defined as empty). -\newcommand\LTfincaption[1]{% - \noalign{\gdef\ContTable{\emph{Finishing of \tablename}}} - \caption{#1}} +For the second there +are loaded definitions of \verb|\LTcontcaption| and \verb|\LTfincaption| macros: +caption for continued head: +\begin{quote}\obeylines\parskip0pt +\verb|\newcommand\LTcontcaption{%| +\verb| \caption[]{\emph{Continued}}}| +\end{quote} +and caption for finished head: +\begin{quote}\obeylines\parskip0pt +\verb|\newcommand\LTfincaption{%| +\verb| \caption[]{\emph{Finished}}}| +\end{quote} +The words +``Continued'' and ``Finished'' defined in \verb|\LTcontcaption| and \verb|\LTfincaption| +macros. -\begin{document} +You may see that usage of \verb|\LTcontcaption| and \verb|\LTfincaption| is rather unnecessary. And preamble of \textsf{longtable} could be +\begin{quote}\obeylines\parskip0pt +\verb|\begin{longtable}{@{}lll}| +\verb|\caption{The ISOGRK3 entity set and more more more more more more| +\verb| more more more more more more more more more more more text}\\| +\verb| \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\| +\verb|\hline| +\verb|\endfirsthead| +\verb|\caption[]{\emph{Continued}}\\| +\verb| \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\| +\verb|\hline| +\verb|\endhead| +\verb|\caption[]{\emph{Finished}}\\| +\verb| \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\| +\verb|\hline| +\verb|\endlasthead| +\verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}}| +\verb|\endfoot| +\verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}}| +\verb|\endprelastfoot| +\verb|\noalign{\gdef\Continued{}\gdef\ContTable{}}| +\verb| \hline| +\verb|\endlastfoot| +\end{quote} -\chapter{Defining head of last page of long table: variant~3} +\begingroup +\captionsetup[table]{labelsep=period,singlelinecheck=no} +%\def\LTlastpage{5} +\let\LTcontcaption\LTcontcaptionII +\let\LTfincaption\LTfincaptionII +\input s-longtable.tex + +\endgroup -Here is example of defining of last head in long table. The words ``Continuation of'' and ``Finishing of'' added in the \verb|\ContTable| definition. This command used instead of \verb|\tablename| in tale label. The last page (number of table pages) of table defined by hand by command \verb|\LTlastpage|. Here: -\begin{verbatim} -\def\LTlastpage{5} -\end{verbatim} +\clearpage +\section{Variant~III} -\def\LTlastpage{5} +For the first variant defined the label format \texttt{LTrightlabelcont} +(it will be defined for long table in group): +\begin{quote}\obeylines\parskip0pt +\verb|\DeclareCaptionLabelFormat{labelcont}%| +\verb| {\rightline{\bothIfFirst{\ContTable}{ }#2}}| +\end{quote} -\begingroup\sffamily +There are definitions of \verb|\LTcontcaption| and \verb|\LTfincaption| macros: +caption for continued head: +\begin{quote}\obeylines\parskip0pt +\verb|\newcommand\LTcontcaptionIII[1]{%| +\verb| \noalign{\gdef\ContTable{\emph{Continuation of \tablename}}}| +\verb| \caption[]{#1}}| +\end{quote} +and caption for finished head: +\begin{quote}\obeylines\parskip0pt +\verb|\newcommand\LTfincaptionIII[1]{%| +\verb| \noalign{\gdef\ContTable{\emph{Finishing of \tablename}}}| +\verb| \caption[]{#1}}| +\end{quote} + +\begingroup \captionsetup[table]{labelformat=labelcont} +\floatsetup[longtable]{font={scriptsize,sf}} +%\def\LTlastpage{5} +\let\scriptsize\tiny +\let\LTcontcaption\LTcontcaptionIII +\let\LTfincaption\LTfincaptionIII +\renewcommand\ContTable{\tablename} -\begin{longtable}{@{}lll} -\caption{The ISOGRK3 entity set and more more more more more more more more more more more more more more more more more more text}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endfirsthead -\LTcontcaption{}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endhead -\LTfincaption{}\\ - \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline -\endlasthead - \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}} -\endfoot -\noalign{\gdef\Continued{}} - \hline -\endlastfoot \input s-longtable.tex -\end{longtable} \endgroup + +\listoftables + \end{document} -% end of s-longtable3.tex -\end{filecontents} -%Run LaTeX trough one of the following files -\input s-longtable1.tex -%\input s-longtable2.tex -%\input s-longtable3.tex \endinput
\ No newline at end of file |