Debian Codegraph @

texmf-dist/doc/latex/floatrow/sample-longtable.tex

raw
1 % This file installs three samples-variants of setting
2 % of Continued and Finished pages of long table
3 % 1) s-longtable1.tex
4 % Adds words in the table label: ``Table 1. Continued''
5 % and ``Table 1. Finished''
6 % 2) s-longtable2.tex
7 % Adds words in the caption text: ``Continued'' and ``Finished''
8 % 3) s-longtable3.tex
9 % Redefines \tablename command: ``Continuation of table 1.
10 % and ``Finishing of table 1.'' (Is that correct English form?)
11 \begin{filecontents}{s-longtable.tex}
12 \begin{longtable}{@{}lll}
13 \caption{The ISOGRK3 entity set and more more more more more more more more more
14 more more more more more more more more more text}\\
15 \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline
16 \endfirsthead
17 \LTcontcaption{}\\
18 \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline
19 \endhead
20 \LTfincaption{}\\
21 \bfseries Entity&\bfseries Unicode Name&\bfseries Unicode\\ \hline
22 \endlasthead
23 \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}}
24 \endfoot
25 \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}}
26 \endprelastfoot
27 \noalign{\gdef\Continued{}\gdef\ContTable{}}
28 \hline
29 \endlastfoot
30 alpha & GREEK SMALL LETTER ALPHA & 03B1\\
31 beta & GREEK SMALL LETTER BETA & 03B2\\
32 chi & GREEK SMALL LETTER CHI & 03C7\\
33 \empty
34 Delta & GREEK CAPITAL LETTER DELTA & 0394\\
35 delta & GREEK SMALL LETTER DELTA & 03B4\\
36 epsi & GREEK SMALL LETTER EPSILON & 03B5\\
37 epsis & GREEK LUNATE EPSILON SYMBOL & 03F5\\
38 epsiv & GREEK SMALL LETTER EPSILON & 03B5\\
39 eta & GREEK SMALL LETTER ETA & 03B7\\
40 Gamma & GREEK CAPITAL LETTER GAMMA & 0393\\
41 gamma & GREEK SMALL LETTER GAMMA & 03B3\\
42 gammad & GREEK SMALL LETTER DIGAMMA & 03DD\\
43 iota & GREEK SMALL LETTER IOTA & 03B9\\
44 kappa & GREEK SMALL LETTER KAPPA & 03BA\\
45 kappav & GREEK KAPPA SYMBOL & 03F0\\
46 Lambda & GREEK CAPITAL LETTER LAMDA & 039B\\
47 lambda & GREEK SMALL LETTER LAMDA & 03BB\\
48 mu & GREEK SMALL LETTER MU & 03BC\\
49 nu & GREEK SMALL LETTER NU & 03BD\\
50 Omega & GREEK CAPITAL LETTER OMEGA & 03A9\\
51 omega & GREEK SMALL LETTER OMEGA & 03C9\\
52 Phi & GREEK CAPITAL LETTER PHI & 03A6\\
53 phis & GREEK PHI SYMBOL & 03D5\\
54 phiv & GREEK SMALL LETTER PHI & 03C6\\
55 Pi & GREEK CAPITAL LETTER PI & 03A0\\
56 pi & GREEK SMALL LETTER PI & 03C0\\
57 piv & GREEK PI SYMBOL & 03D6\\
58 Psi & GREEK CAPITAL LETTER PSI & 03A8\\
59 psi & GREEK SMALL LETTER PSI & 03C8\\
60 rho & GREEK SMALL LETTER RHO & 03C1\\
61 rhov & GREEK RHO SYMBOL & 03F1\\
62 Sigma & GREEK CAPITAL LETTER SIGMA & 03A3\\
63 sigma & GREEK SMALL LETTER SIGMA & 03C3\\
64 sigmav & GREEK SMALL LETTER FINAL SIGMA & 03C2\\
65 tau & GREEK SMALL LETTER TAU & 03C4\\
66 Theta & GREEK CAPITAL LETTER THETA & 0398\\
67 thetas & GREEK SMALL LETTER THETA & 03B8\\
68 thetav & GREEK THETA SYMBOL & 03D1\\
69 Upsi & GREEK UPSILON WITH HOOK SYMBOL & 03D2\\
70 upsi & GREEK SMALL LETTER UPSILON & 03C5\\
71 Xi & GREEK CAPITAL LETTER XI & 039E\\
72 xi & GREEK SMALL LETTER XI & 03BE\\
73 zeta & GREEK SMALL LETTER ZETA & 03B6\\
74 %
75 %
76 %
77 alpha & SMALL LETTER ALPHA & 03B1\\
78 beta & SMALL LETTER BETA & 03B2\\
79 chi & SMALL LETTER CHI & 03C7\\
80 \empty
81 Delta & CAPITAL LETTER DELTA & 0394\\
82 delta & SMALL LETTER DELTA & 03B4\\
83 epsi & SMALL LETTER EPSILON & 03B5\\
84 epsis & LUNATE EPSILON SYMBOL & 03F5\\
85 epsiv & SMALL LETTER EPSILON & 03B5\\
86 eta & SMALL LETTER ETA & 03B7\\
87 Gamma & CAPITAL LETTER GAMMA & 0393\\
88 gamma & SMALL LETTER GAMMA & 03B3\\
89 gammad & SMALL LETTER DIGAMMA & 03DD\\
90 iota & SMALL LETTER IOTA & 03B9\\
91 kappa & SMALL LETTER KAPPA & 03BA\\
92 kappav & KAPPA SYMBOL & 03F0\\
93 Lambda & CAPITAL LETTER LAMDA & 039B\\
94 lambda & SMALL LETTER LAMDA & 03BB\\
95 mu & SMALL LETTER MU & 03BC\\
96 nu & SMALL LETTER NU & 03BD\\
97 Omega & CAPITAL LETTER OMEGA & 03A9\\
98 omega & SMALL LETTER OMEGA & 03C9\\
99 Phi & CAPITAL LETTER PHI & 03A6\\
100 phis & PHI SYMBOL & 03D5\\
101 phiv & SMALL LETTER PHI & 03C6\\
102 Pi & CAPITAL LETTER PI & 03A0\\
103 pi & SMALL LETTER PI & 03C0\\
104 piv & PI SYMBOL & 03D6\\
105 Psi & CAPITAL LETTER PSI & 03A8\\
106 psi & SMALL LETTER PSI & 03C8\\
107 rho & SMALL LETTER RHO & 03C1\\
108 rhov & RHO SYMBOL & 03F1\\
109 Sigma & CAPITAL LETTER SIGMA & 03A3\\
110 sigma & SMALL LETTER SIGMA & 03C3\\
111 sigmav & SMALL LETTER FINAL SIGMA & 03C2\\
112 tau & SMALL LETTER TAU & 03C4\\
113 Theta & CAPITAL LETTER THETA & 0398\\
114 thetas & SMALL LETTER THETA & 03B8\\
115 thetav & THETA SYMBOL & 03D1\\
116 Upsi & UPSILON WITH HOOK SYMBOL & 03D2\\
117 upsi & SMALL LETTER UPSILON & 03C5\\
118 Xi & CAPITAL LETTER XI & 039E\\
119 xi & SMALL LETTER XI & 03BE\\
120 zeta & SMALL LETTER ZETA & 03B6\\
121 %
122 %
123 %
124 alpha & SMALL LETTER ALPHA & 03B1\\
125 beta & SMALL LETTER BETA & 03B2\\
126 chi & SMALL LETTER CHI & 03C7\\
127 \empty
128 Delta & CAPITAL LETTER DELTA & 0394\\
129 delta & SMALL LETTER DELTA & 03B4\\
130 epsi & SMALL LETTER EPSILON & 03B5\\
131 epsis & LUNATE EPSILON SYMBOL & 03F5\\
132 epsiv & SMALL LETTER EPSILON & 03B5\\
133 eta & SMALL LETTER ETA & 03B7\\
134 Gamma & CAPITAL LETTER GAMMA & 0393\\
135 gamma & SMALL LETTER GAMMA & 03B3\\
136 gammad & SMALL LETTER DIGAMMA & 03DD\\
137 iota & SMALL LETTER IOTA & 03B9\\
138 kappa & SMALL LETTER KAPPA & 03BA\\
139 kappav & KAPPA SYMBOL & 03F0\\
140 Lambda & CAPITAL LETTER LAMDA & 039B\\
141 lambda & SMALL LETTER LAMDA & 03BB\\
142 mu & SMALL LETTER MU & 03BC\\
143 nu & SMALL LETTER NU & 03BD\\
144 Omega & CAPITAL LETTER OMEGA & 03A9\\
145 omega & SMALL LETTER OMEGA & 03C9\\
146 Phi & CAPITAL LETTER PHI & 03A6\\
147 phis & PHI SYMBOL & 03D5\\
148 phiv & SMALL LETTER PHI & 03C6\\
149 Pi & CAPITAL LETTER PI & 03A0\\
150 pi & SMALL LETTER PI & 03C0\\
151 piv & PI SYMBOL & 03D6\\
152 Psi & CAPITAL LETTER PSI & 03A8\\
153 psi & SMALL LETTER PSI & 03C8\\
154 rho & SMALL LETTER RHO & 03C1\\
155 rhov & RHO SYMBOL & 03F1\\
156 Sigma & CAPITAL LETTER SIGMA & 03A3\\
157 sigma & SMALL LETTER SIGMA & 03C3\\
158 sigmav & SMALL LETTER FINAL SIGMA & 03C2\\
159 tau & SMALL LETTER TAU & 03C4\\
160 Theta & CAPITAL LETTER THETA & 0398\\
161 thetas & SMALL LETTER THETA & 03B8\\
162 thetav & THETA SYMBOL & 03D1\\
163 Upsi & UPSILON WITH HOOK SYMBOL & 03D2\\
164 upsi & SMALL LETTER UPSILON & 03C5\\
165 Xi & CAPITAL LETTER XI & 039E\\
166 xi & SMALL LETTER XI & 03BE\\
167 zeta & SMALL LETTER ZETA & 03B6\\
168 %
169 %
170 %
171 alpha & SMALL LETTER ALPHA & 03B1\\
172 beta & SMALL LETTER BETA & 03B2\\
173 chi & SMALL LETTER CHI & 03C7\\
174 \empty
175 Delta & CAPITAL LETTER DELTA & 0394\\
176 delta & SMALL LETTER DELTA & 03B4\\
177 epsi & SMALL LETTER EPSILON & 03B5\\
178 epsis & LUNATE EPSILON SYMBOL & 03F5\\
179 epsiv & SMALL LETTER EPSILON & 03B5\\
180 eta & SMALL LETTER ETA & 03B7\\
181 Gamma & CAPITAL LETTER GAMMA & 0393\\
182 gamma & SMALL LETTER GAMMA & 03B3\\
183 gammad & SMALL LETTER DIGAMMA & 03DD\\
184 iota & SMALL LETTER IOTA & 03B9\\
185 kappa & SMALL LETTER KAPPA & 03BA\\
186 kappav & KAPPA SYMBOL & 03F0\\
187 Lambda & CAPITAL LETTER LAMDA & 039B\\
188 lambda & SMALL LETTER LAMDA & 03BB\\
189 mu & SMALL LETTER MU & 03BC\\
190 nu & SMALL LETTER NU & 03BD\\
191 Omega & CAPITAL LETTER OMEGA & 03A9\\
192 omega & SMALL LETTER OMEGA & 03C9\\
193 Phi & CAPITAL LETTER PHI & 03A6\\
194 phis & PHI SYMBOL & 03D5\\
195 phiv & SMALL LETTER PHI & 03C6\\
196 Pi & CAPITAL LETTER PI & 03A0\\
197 pi & SMALL LETTER PI & 03C0\\
198 piv & PI SYMBOL & 03D6\\
199 Psi & CAPITAL LETTER PSI & 03A8\\
200 psi & SMALL LETTER PSI & 03C8\\
201 rho & SMALL LETTER RHO & 03C1\\
202 rhov & RHO SYMBOL & 03F1\\
203 Sigma & CAPITAL LETTER SIGMA & 03A3\\
204 sigma & SMALL LETTER SIGMA & 03C3\\
205 sigmav & SMALL LETTER FINAL SIGMA & 03C2\\
206 tau & SMALL LETTER TAU & 03C4\\
207 Theta & CAPITAL LETTER THETA & 0398\\
208 thetas & SMALL LETTER THETA & 03B8\\
209 thetav & THETA SYMBOL & 03D1\\
210 Upsi & UPSILON WITH HOOK SYMBOL & 03D2\\
211 upsi & SMALL LETTER UPSILON & 03C5\\
212 Xi & CAPITAL LETTER XI & 039E\\
213 xi & SMALL LETTER XI & 03BE\\
214 zeta & SMALL LETTER ZETA & 03B6\\
215 \end{longtable}
216 \endinput
217 % end of s-longtable.tex
218 \end{filecontents}
219 \documentclass{book}
220
221 \advance\textwidth.5in
222 \advance\evensidemargin-.25in
223 \advance\oddsidemargin-.25in
224
225 \usepackage[labelsep=newline]{caption}
226 \usepackage{floatrow}
227 \providecommand\floatsetup[2][]{}
228 \usepackage{array,fr-longtable}
229 \floatsetup[longtable]{font={small,sf},LTcapwidth=table,margins=centering,
230 captionskip=5pt}
231 \captionsetup[longtable]{font=small}
232
233 \DeclareCaptionLabelFormat{labelcontI}%
234 {\rightline{\bothIfFirst{#1}{ }#2 (\emph{continued})}}
235 \DeclareCaptionLabelFormat{labelfinI}%
236 {\rightline{\bothIfFirst{#1}{ }#2 (\emph{finished})}}
237
238 \DeclareCaptionLabelFormat{labelcontIII}%
239 {\rightline{\emph{Continuation of \tablename} #2}}
240 \DeclareCaptionLabelFormat{labelfinIII}%
241 {\rightline{\emph{Finishing of \tablename} #2}}
242 %
243 % Caption for continued head, \ldots
244 \newcommand\LTcontcaptionI[1]{%
245 \captionsetup{labelformat=labelcontI}\caption[]{#1}}
246 %
247 % and caption for finished head.
248 \newcommand\LTfincaptionI[1]{%
249 \captionsetup{labelformat=labelfinI}\caption[]{#1}}
250 %
251 % Caption for continued head, \ldots
252 \newcommand\LTcontcaptionII{%
253 \caption[]{\emph{Continued}}}
254 %
255 % and caption for finished head.
256 \newcommand\LTfincaptionII{%
257 \caption[]{\emph{Finished}}}
258 %
259 % Caption for continued head, \ldots
260 \newcommand\LTcontcaptionIII[1]{%
261 \captionsetup{labelformat=labelcontIII}\caption[]{#1}}
262 %
263 % and caption for finished head.
264 \newcommand\LTfincaptionIII[1]{%
265 \captionsetup{labelformat=labelfinIII}\caption[]{#1}}
266
267 \begin{document}
268
269 \chapter[Heads and Foots in Longtable]{Last Head And Last But One Foot In Longtable}
270
271 This file shows three examples of defining of last head and foot before last of
272 long table. They are printed in different sizes just to check work of page counting
273 algorithm.
274
275 The common settings:
276 \begin{quote}\obeylines\parskip0pt
277 \verb|\floatsetup[longtable]{font={small,sf},LTcapwidth=table,|
278 \verb| margins=centering,captionskip=5pt}|
279 \verb|\captionsetup[longtable]{font=small}|
280 \end{quote}
281 Here table font family settings are different from caption. The version 3.1 of
282 \textsf{caption} package solves this problem.
283 But for the version 3.0q you ought restore Roman family settings |rm|.
284
285
286 \section{Variant~I}
287
288 For the first variant the following label format was defined:
289 \begin{quote}\obeylines\parskip0pt
290 \verb|\DeclareCaptionLabelFormat{labelcontI}%|
291 \verb| {\rightline{\bothIfFirst{#1}{ }#2 (\emph{continued})}}|
292 \verb|\DeclareCaptionLabelFormat{labelfinI}%|
293 \verb| {\rightline{\bothIfFirst{#1}{ }#2 (\emph{finished})}}|
294 \end{quote}
295
296 The body of long table is written in following way:
297 \begin{quote}\obeylines\parskip0pt
298 \verb|\begin{longtable}{@{}lll}|
299 \verb|\caption{The ISOGRK3 entity set and more more more more more more|
300 \verb| more more more more more more more more more more more text}\\|
301 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
302 \verb|\hline|
303 \verb|\endfirsthead|
304 \verb|\captionsetup{labelformat=labelcontI}\caption[]{}\\|
305 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
306 \verb|\hline|
307 \verb|\endhead|
308 \verb|\captionsetup{labelformat=labelfinI}\caption[]{}\\|
309 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
310 \verb|\hline|
311 \verb|\endlasthead|
312 \verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}}|
313 \verb|\endfoot|
314 \verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}}|
315 \verb|\endprelastfoot|
316 \verb| \hline|
317 \verb|\endlastfoot|
318 \end{quote}
319
320 \begingroup
321 \floatsetup[longtable]{font={Large,sf}}
322 %\def\LTlastpage{5}
323 \let\LTcontcaption\LTcontcaptionI
324 \let\LTfincaption\LTfincaptionI
325 \input s-longtable.tex
326
327 \endgroup
328
329 \clearpage
330 \section{Variant~II}
331
332 You may see that usage of \verb|labelformat| key here is unnecessary.
333 And preamble of the \textsf{longtable} looks like:
334 \begin{quote}\obeylines\parskip0pt
335 \verb|\begin{longtable}{@{}lll}|
336 \verb|\caption{The ISOGRK3 entity set and more more more more more more|
337 \verb| more more more more more more more more more more more text}\\|
338 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
339 \verb|\hline|
340 \verb|\endfirsthead|
341 \verb|\caption[]{\emph{Continued}}\\|
342 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
343 \verb|\hline|
344 \verb|\endhead|
345 \verb|\caption[]{\emph{Finished}}\\|
346 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
347 \verb|\hline|
348 \verb|\endlasthead|
349 \verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}}|
350 \verb|\endfoot|
351 \verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}}|
352 \verb|\endprelastfoot|
353 \verb| \hline|
354 \verb|\endlastfoot|
355 \end{quote}
356
357
358 \begingroup
359 \captionsetup[table]{labelsep=period,singlelinecheck=no}
360 %\def\LTlastpage{5}
361 \let\LTcontcaption\LTcontcaptionII
362 \let\LTfincaption\LTfincaptionII
363 \input s-longtable.tex
364
365 \endgroup
366
367 \clearpage
368 \section{Variant~III}
369
370 For the last variant the following label format was defined in preamble:
371 \begin{quote}\obeylines\parskip0pt
372 \verb|\DeclareCaptionLabelFormat{labelcontIII}%|
373 \verb| {\rightline{\emph{Continuation of \tablename} #2}}|
374 \verb|\DeclareCaptionLabelFormat{labelfinIII}%|
375 \verb| {\rightline{\emph{Finishing of \tablename} #2}}|
376 \end{quote}
377
378 The body of long table is written in following way:
379 \begin{quote}\obeylines\parskip0pt
380 \verb|\begin{longtable}{@{}lll}|
381 \verb|\caption{The ISOGRK3 entity set and more more more more more more|
382 \verb| more more more more more more more more more more more text}\\|
383 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
384 \verb|\hline|
385 \verb|\endfirsthead|
386 \verb|\captionsetup{labelformat=labelcontIII}\caption[]{}\\|
387 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
388 \verb|\hline|
389 \verb|\endhead|
390 \verb|\captionsetup{labelformat=labelfinIII}\caption[]{}\\|
391 \verb| \bfseries Entity &\bfseries Unicode Name&\bfseries Unicode\\|
392 \verb|\hline|
393 \verb|\endlasthead|
394 \verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Continued on next page}}|
395 \verb|\endfoot|
396 \verb| \hline \multicolumn{3}{@{}r@{}}{\emph{Finished on next page}}|
397 \verb|\endprelastfoot|
398 \verb| \hline|
399 \verb|\endlastfoot|
400 \end{quote}
401
402 \begingroup
403 \floatsetup[longtable]{font={scriptsize,sf}}
404 %\def\LTlastpage{5}
405 \let\scriptsize\tiny
406 \let\LTcontcaption\LTcontcaptionIII
407 \let\LTfincaption\LTfincaptionIII
408 \renewcommand\ContTable{\tablename}
409
410 \input s-longtable.tex
411
412 \endgroup
413
414 \listoftables
415
416 \end{document}
417 \endinput