summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/floatrow/sample-longtable.tex
blob: 8430d32f269154a3dd2075381419f6844266f3d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
% This file installs three samples-variants of setting
% of Continued and Finished pages of long table
% 1) s-longtable1.tex
%    Adds words in the table label: ``Table 1. Continued''
%    and ``Table 1. Finished''
% 2) s-longtable2.tex
%    Adds words in the caption text: ``Continued'' and ``Finished''
% 3) s-longtable3.tex
%    Redefines \tablename command: ``Continuation of table 1.
%    and ``Finishing of table 1.'' (Is that correct English form?)
\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\\
\empty
Delta              & GREEK CAPITAL LETTER DELTA          & 0394\\
delta              & GREEK SMALL LETTER DELTA            & 03B4\\
epsi               & GREEK SMALL LETTER EPSILON          & 03B5\\
epsis              & GREEK LUNATE EPSILON SYMBOL         & 03F5\\
epsiv              & GREEK SMALL LETTER EPSILON          & 03B5\\
eta                & GREEK SMALL LETTER ETA              & 03B7\\
Gamma              & GREEK CAPITAL LETTER GAMMA          & 0393\\
gamma              & GREEK SMALL LETTER GAMMA            & 03B3\\
gammad             & GREEK SMALL LETTER DIGAMMA          & 03DD\\
iota               & GREEK SMALL LETTER IOTA             & 03B9\\
kappa              & GREEK SMALL LETTER KAPPA            & 03BA\\
kappav             & GREEK KAPPA SYMBOL                  & 03F0\\
Lambda             & GREEK CAPITAL LETTER LAMDA          & 039B\\
lambda             & GREEK SMALL LETTER LAMDA            & 03BB\\
mu                 & GREEK SMALL LETTER MU               & 03BC\\
nu                 & GREEK SMALL LETTER NU               & 03BD\\
Omega              & GREEK CAPITAL LETTER OMEGA          & 03A9\\
omega              & GREEK SMALL LETTER OMEGA            & 03C9\\
Phi                & GREEK CAPITAL LETTER PHI            & 03A6\\
phis               & GREEK PHI SYMBOL                    & 03D5\\
phiv               & GREEK SMALL LETTER PHI              & 03C6\\
Pi                 & GREEK CAPITAL LETTER PI             & 03A0\\
pi                 & GREEK SMALL LETTER PI               & 03C0\\
piv                & GREEK PI SYMBOL                     & 03D6\\
Psi                & GREEK CAPITAL LETTER PSI            & 03A8\\
psi                & GREEK SMALL LETTER PSI              & 03C8\\
rho                & GREEK SMALL LETTER RHO              & 03C1\\
rhov               & GREEK RHO SYMBOL                    & 03F1\\
Sigma              & GREEK CAPITAL LETTER SIGMA          & 03A3\\
sigma              & GREEK SMALL LETTER SIGMA            & 03C3\\
sigmav             & GREEK SMALL LETTER FINAL SIGMA      & 03C2\\
tau                & GREEK SMALL LETTER TAU              & 03C4\\
Theta              & GREEK CAPITAL LETTER THETA          & 0398\\
thetas             & GREEK SMALL LETTER THETA            & 03B8\\
thetav             & GREEK THETA SYMBOL                  & 03D1\\
Upsi               & GREEK UPSILON WITH HOOK SYMBOL      & 03D2\\
upsi               & GREEK SMALL LETTER UPSILON          & 03C5\\
Xi                 & GREEK CAPITAL LETTER XI             & 039E\\
xi                 & GREEK SMALL LETTER XI               & 03BE\\
zeta               & GREEK SMALL LETTER ZETA             & 03B6\\
%
%
%
alpha              &  SMALL LETTER ALPHA            & 03B1\\
beta               &  SMALL LETTER BETA             & 03B2\\
chi                &  SMALL LETTER CHI              & 03C7\\
\empty
Delta              &  CAPITAL LETTER DELTA          & 0394\\
delta              &  SMALL LETTER DELTA            & 03B4\\
epsi               &  SMALL LETTER EPSILON          & 03B5\\
epsis              &  LUNATE EPSILON SYMBOL         & 03F5\\
epsiv              &  SMALL LETTER EPSILON          & 03B5\\
eta                &  SMALL LETTER ETA              & 03B7\\
Gamma              &  CAPITAL LETTER GAMMA          & 0393\\
gamma              &  SMALL LETTER GAMMA            & 03B3\\
gammad             &  SMALL LETTER DIGAMMA          & 03DD\\
iota               &  SMALL LETTER IOTA             & 03B9\\
kappa              &  SMALL LETTER KAPPA            & 03BA\\
kappav             &  KAPPA SYMBOL                  & 03F0\\
Lambda             &  CAPITAL LETTER LAMDA          & 039B\\
lambda             &  SMALL LETTER LAMDA            & 03BB\\
mu                 &  SMALL LETTER MU               & 03BC\\
nu                 &  SMALL LETTER NU               & 03BD\\
Omega              &  CAPITAL LETTER OMEGA          & 03A9\\
omega              &  SMALL LETTER OMEGA            & 03C9\\
Phi                &  CAPITAL LETTER PHI            & 03A6\\
phis               &  PHI SYMBOL                    & 03D5\\
phiv               &  SMALL LETTER PHI              & 03C6\\
Pi                 &  CAPITAL LETTER PI             & 03A0\\
pi                 &  SMALL LETTER PI               & 03C0\\
piv                &  PI SYMBOL                     & 03D6\\
Psi                &  CAPITAL LETTER PSI            & 03A8\\
psi                &  SMALL LETTER PSI              & 03C8\\
rho                &  SMALL LETTER RHO              & 03C1\\
rhov               &  RHO SYMBOL                    & 03F1\\
Sigma              &  CAPITAL LETTER SIGMA          & 03A3\\
sigma              &  SMALL LETTER SIGMA            & 03C3\\
sigmav             &  SMALL LETTER FINAL SIGMA      & 03C2\\
tau                &  SMALL LETTER TAU              & 03C4\\
Theta              &  CAPITAL LETTER THETA          & 0398\\
thetas             &  SMALL LETTER THETA            & 03B8\\
thetav             &  THETA SYMBOL                  & 03D1\\
Upsi               &  UPSILON WITH HOOK SYMBOL      & 03D2\\
upsi               &  SMALL LETTER UPSILON          & 03C5\\
Xi                 &  CAPITAL LETTER XI             & 039E\\
xi                 &  SMALL LETTER XI               & 03BE\\
zeta               &  SMALL LETTER ZETA             & 03B6\\
%
%
%
alpha              &  SMALL LETTER ALPHA            & 03B1\\
beta               &  SMALL LETTER BETA             & 03B2\\
chi                &  SMALL LETTER CHI              & 03C7\\
\empty
Delta              &  CAPITAL LETTER DELTA          & 0394\\
delta              &  SMALL LETTER DELTA            & 03B4\\
epsi               &  SMALL LETTER EPSILON          & 03B5\\
epsis              &  LUNATE EPSILON SYMBOL         & 03F5\\
epsiv              &  SMALL LETTER EPSILON          & 03B5\\
eta                &  SMALL LETTER ETA              & 03B7\\
Gamma              &  CAPITAL LETTER GAMMA          & 0393\\
gamma              &  SMALL LETTER GAMMA            & 03B3\\
gammad             &  SMALL LETTER DIGAMMA          & 03DD\\
iota               &  SMALL LETTER IOTA             & 03B9\\
kappa              &  SMALL LETTER KAPPA            & 03BA\\
kappav             &  KAPPA SYMBOL                  & 03F0\\
Lambda             &  CAPITAL LETTER LAMDA          & 039B\\
lambda             &  SMALL LETTER LAMDA            & 03BB\\
mu                 &  SMALL LETTER MU               & 03BC\\
nu                 &  SMALL LETTER NU               & 03BD\\
Omega              &  CAPITAL LETTER OMEGA          & 03A9\\
omega              &  SMALL LETTER OMEGA            & 03C9\\
Phi                &  CAPITAL LETTER PHI            & 03A6\\
phis               &  PHI SYMBOL                    & 03D5\\
phiv               &  SMALL LETTER PHI              & 03C6\\
Pi                 &  CAPITAL LETTER PI             & 03A0\\
pi                 &  SMALL LETTER PI               & 03C0\\
piv                &  PI SYMBOL                     & 03D6\\
Psi                &  CAPITAL LETTER PSI            & 03A8\\
psi                &  SMALL LETTER PSI              & 03C8\\
rho                &  SMALL LETTER RHO              & 03C1\\
rhov               &  RHO SYMBOL                    & 03F1\\
Sigma              &  CAPITAL LETTER SIGMA          & 03A3\\
sigma              &  SMALL LETTER SIGMA            & 03C3\\
sigmav             &  SMALL LETTER FINAL SIGMA      & 03C2\\
tau                &  SMALL LETTER TAU              & 03C4\\
Theta              &  CAPITAL LETTER THETA          & 0398\\
thetas             &  SMALL LETTER THETA            & 03B8\\
thetav             &  THETA SYMBOL                  & 03D1\\
Upsi               &  UPSILON WITH HOOK SYMBOL      & 03D2\\
upsi               &  SMALL LETTER UPSILON          & 03C5\\
Xi                 &  CAPITAL LETTER XI             & 039E\\
xi                 &  SMALL LETTER XI               & 03BE\\
zeta               &  SMALL LETTER ZETA             & 03B6\\
%
%
%
alpha              &  SMALL LETTER ALPHA            & 03B1\\
beta               &  SMALL LETTER BETA             & 03B2\\
chi                &  SMALL LETTER CHI              & 03C7\\
\empty
Delta              &  CAPITAL LETTER DELTA          & 0394\\
delta              &  SMALL LETTER DELTA            & 03B4\\
epsi               &  SMALL LETTER EPSILON          & 03B5\\
epsis              &  LUNATE EPSILON SYMBOL         & 03F5\\
epsiv              &  SMALL LETTER EPSILON          & 03B5\\
eta                &  SMALL LETTER ETA              & 03B7\\
Gamma              &  CAPITAL LETTER GAMMA          & 0393\\
gamma              &  SMALL LETTER GAMMA            & 03B3\\
gammad             &  SMALL LETTER DIGAMMA          & 03DD\\
iota               &  SMALL LETTER IOTA             & 03B9\\
kappa              &  SMALL LETTER KAPPA            & 03BA\\
kappav             &  KAPPA SYMBOL                  & 03F0\\
Lambda             &  CAPITAL LETTER LAMDA          & 039B\\
lambda             &  SMALL LETTER LAMDA            & 03BB\\
mu                 &  SMALL LETTER MU               & 03BC\\
nu                 &  SMALL LETTER NU               & 03BD\\
Omega              &  CAPITAL LETTER OMEGA          & 03A9\\
omega              &  SMALL LETTER OMEGA            & 03C9\\
Phi                &  CAPITAL LETTER PHI            & 03A6\\
phis               &  PHI SYMBOL                    & 03D5\\
phiv               &  SMALL LETTER PHI              & 03C6\\
Pi                 &  CAPITAL LETTER PI             & 03A0\\
pi                 &  SMALL LETTER PI               & 03C0\\
piv                &  PI SYMBOL                     & 03D6\\
Psi                &  CAPITAL LETTER PSI            & 03A8\\
psi                &  SMALL LETTER PSI              & 03C8\\
rho                &  SMALL LETTER RHO              & 03C1\\
rhov               &  RHO SYMBOL                    & 03F1\\
Sigma              &  CAPITAL LETTER SIGMA          & 03A3\\
sigma              &  SMALL LETTER SIGMA            & 03C3\\
sigmav             &  SMALL LETTER FINAL SIGMA      & 03C2\\
tau                &  SMALL LETTER TAU              & 03C4\\
Theta              &  CAPITAL LETTER THETA          & 0398\\
thetas             &  SMALL LETTER THETA            & 03B8\\
thetav             &  THETA SYMBOL                  & 03D1\\
Upsi               &  UPSILON WITH HOOK SYMBOL      & 03D2\\
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}
\documentclass{book}

\advance\textwidth.5in
\advance\evensidemargin-.25in
\advance\oddsidemargin-.25in

\usepackage[labelsep=newline]{caption}
\usepackage{floatrow}
\providecommand\floatsetup[2][]{}
\usepackage{array,fr-longtable}
\floatsetup[longtable]{font={small,sf},LTcapwidth=table,margins=centering,
    captionskip=5pt}
\captionsetup[longtable]{font=small}

\DeclareCaptionLabelFormat{labelcontI}%
  {\rightline{\bothIfFirst{#1}{ }#2 (\emph{continued})}}
\DeclareCaptionLabelFormat{labelfinI}%
  {\rightline{\bothIfFirst{#1}{ }#2 (\emph{finished})}}

\DeclareCaptionLabelFormat{labelcontIII}%
  {\rightline{\emph{Continuation of \tablename} #2}}
\DeclareCaptionLabelFormat{labelfinIII}%
  {\rightline{\emph{Finishing of \tablename} #2}}
%
% Caption for continued head, \ldots
\newcommand\LTcontcaptionI[1]{%
 \captionsetup{labelformat=labelcontI}\caption[]{#1}}
%
% and caption for finished head.
\newcommand\LTfincaptionI[1]{%
 \captionsetup{labelformat=labelfinI}\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]{%
 \captionsetup{labelformat=labelcontIII}\caption[]{#1}}
%
% and caption for finished head.
\newcommand\LTfincaptionIII[1]{%
 \captionsetup{labelformat=labelfinIII}\caption[]{#1}}

\begin{document}

\chapter[Heads and Foots in Longtable]{Last Head And Last But One Foot In Longtable}

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 common settings:
\begin{quote}\obeylines\parskip0pt
\verb|\floatsetup[longtable]{font={small,sf},LTcapwidth=table,|
\verb|    margins=centering,captionskip=5pt}|
\verb|\captionsetup[longtable]{font=small}|
\end{quote}
Here table font family settings are different from caption. The version 3.1 of 
\textsf{caption} package solves this problem.
But for the version 3.0q you ought restore Roman family settings |rm|.


\section{Variant~I}

For the first variant the following label format was defined:
\begin{quote}\obeylines\parskip0pt
\verb|\DeclareCaptionLabelFormat{labelcontI}%|
\verb|  {\rightline{\bothIfFirst{#1}{ }#2 (\emph{continued})}}|
\verb|\DeclareCaptionLabelFormat{labelfinI}%|
\verb|  {\rightline{\bothIfFirst{#1}{ }#2 (\emph{finished})}}|
\end{quote}

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|\captionsetup{labelformat=labelcontI}\caption[]{}\\|
\verb|  \bfseries Entity  &\bfseries  Unicode Name&\bfseries  Unicode\\|
\verb|\hline|
\verb|\endhead|
\verb|\captionsetup{labelformat=labelfinI}\caption[]{}\\|
\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|   \hline|
\verb|\endlastfoot|
\end{quote}

\begingroup
\floatsetup[longtable]{font={Large,sf}}
%\def\LTlastpage{5}
\let\LTcontcaption\LTcontcaptionI
\let\LTfincaption\LTfincaptionI
\input s-longtable.tex

\endgroup

\clearpage
\section{Variant~II}

You may see that usage of \verb|labelformat| key here is unnecessary. 
And preamble of the \textsf{longtable} looks like:
\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|   \hline|
\verb|\endlastfoot|
\end{quote}


\begingroup
\captionsetup[table]{labelsep=period,singlelinecheck=no}
%\def\LTlastpage{5}
\let\LTcontcaption\LTcontcaptionII
\let\LTfincaption\LTfincaptionII
\input s-longtable.tex

\endgroup

\clearpage
\section{Variant~III}

For the last variant the following label format was defined in preamble:
\begin{quote}\obeylines\parskip0pt
\verb|\DeclareCaptionLabelFormat{labelcontIII}%|
\verb|  {\rightline{\emph{Continuation of \tablename} #2}}|
\verb|\DeclareCaptionLabelFormat{labelfinIII}%|
\verb|  {\rightline{\emph{Finishing of \tablename} #2}}|
\end{quote}

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|\captionsetup{labelformat=labelcontIII}\caption[]{}\\|
\verb|  \bfseries Entity  &\bfseries  Unicode Name&\bfseries  Unicode\\|
\verb|\hline|
\verb|\endhead|
\verb|\captionsetup{labelformat=labelfinIII}\caption[]{}\\|
\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|   \hline|
\verb|\endlastfoot|
\end{quote}

\begingroup
\floatsetup[longtable]{font={scriptsize,sf}}
%\def\LTlastpage{5}
\let\scriptsize\tiny
\let\LTcontcaption\LTcontcaptionIII
\let\LTfincaption\LTfincaptionIII
\renewcommand\ContTable{\tablename}

\input s-longtable.tex

\endgroup

\listoftables

\end{document}
\endinput