Debian Codegraph @

texmf-dist/source/latex/tablefootnote/tablefootnote.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: tablefootnote.dtx
4 % Version: 2014/01/26 v1.1c
5 %
6 % Copyright (C) 2011 - 2014 by
7 % H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
8 %
9 % This work may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either
11 % version 1.3c of this license or (at your option) any later
12 % version. This version of this license is in
13 % http://www.latex-project.org/lppl/lppl-1-3c.txt
14 % and the latest version of this license is in
15 % http://www.latex-project.org/lppl.txt
16 % and version 1.3c or later is part of all distributions of
17 % LaTeX version 2005/12/01 or later.
18 %
19 % This work has the LPPL maintenance status "maintained".
20 %
21 % The Current Maintainer of this work is H.-Martin Muench.
22 %
23 % This work consists of the main source file tablefootnote.dtx,
24 % the README, and the derived files
25 % tablefootnote.sty, tablefootnote.pdf,
26 % tablefootnote.ins, tablefootnote.drv,
27 % tablefootnote-example.tex, tablefootnote-example.pdf.
28 %
29 % Distribution:
30 % http://mirror.ctan.org/macros/latex/contrib/tablefootnote/tablefootnote.dtx
31 % http://mirror.ctan.org/macros/latex/contrib/tablefootnote/tablefootnote.pdf
32 % http://mirror.ctan.org/install/macros/latex/contrib/tablefootnote.tds.zip
33 %
34 % See http://www.ctan.org/pkg/tablefootnote (Catalogue)
35 %
36 % Unpacking:
37 % (a) If tablefootnote.ins is present:
38 % tex tablefootnote.ins
39 % (b) Without tablefootnote.ins:
40 % tex tablefootnote.dtx
41 % (c) If you insist on using LaTeX
42 % latex \let\install=y\input{tablefootnote.dtx}
43 % (quote the arguments according to the demands of your shell)
44 %
45 % Documentation:
46 % (a) If tablefootnote.drv is present:
47 % (pdf)latex tablefootnote.drv
48 % makeindex -s gind.ist tablefootnote.idx
49 % (pdf)latex tablefootnote.drv
50 % makeindex -s gind.ist tablefootnote.idx
51 % (pdf)latex tablefootnote.drv
52 % (b) Without tablefootnote.drv:
53 % (pdf)latex tablefootnote.dtx
54 % makeindex -s gind.ist tablefootnote.idx
55 % (pdf)latex tablefootnote.dtx
56 % makeindex -s gind.ist tablefootnote.idx
57 % (pdf)latex tablefootnote.dtx
58 %
59 % The class ltxdoc loads the configuration file ltxdoc.cfg
60 % if available. Here you can specify further options, e.g.
61 % use DIN A4 as paper format:
62 % \PassOptionsToClass{a4paper}{article}
63 %
64 % Installation:
65 % TDS:tex/latex/tablefootnote/tablefootnote.sty
66 % TDS:doc/latex/tablefootnote/tablefootnote.pdf
67 % TDS:doc/latex/tablefootnote/tablefootnote-example.tex
68 % TDS:doc/latex/tablefootnote/tablefootnote-example.pdf
69 % TDS:source/latex/tablefootnote/tablefootnote.dtx
70 %
71 %<*ignore>
72 \begingroup
73 \catcode123=1 %
74 \catcode125=2 %
75 \def\x{LaTeX2e}%
76 \expandafter\endgroup
77 \ifcase 0\ifx\install y1\fi\expandafter
78 \ifx\csname processbatchFile\endcsname\relax\else1\fi
79 \ifx\fmtname\x\else 1\fi\relax
80 \else\csname fi\endcsname
81 %</ignore>
82 %<*install>
83 \input docstrip.tex
84 \Msg{******************************************************************}
85 \Msg{* Installation *}
86 \Msg{* Package: tablefootnote 2014/01/26 v1.1c Table foot notes (HMM) *}
87 \Msg{******************************************************************}
88
89 \keepsilent
90 \askforoverwritefalse
91
92 \let\MetaPrefix\relax
93 \preamble
94
95 This is a generated file.
96
97 Project: tablefootnote
98 Version: 2014/01/26 v1.1c
99
100 Copyright (C) 2011 - 2014 by
101 H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
102
103 The usual disclaimer applies:
104 If it doesn't work right that's your problem.
105 (Nevertheless, send an e-mail to the maintainer
106 when you find an error in this package.)
107
108 This work may be distributed and/or modified under the
109 conditions of the LaTeX Project Public License, either
110 version 1.3c of this license or (at your option) any later
111 version. This version of this license is in
112 http://www.latex-project.org/lppl/lppl-1-3c.txt
113 and the latest version of this license is in
114 http://www.latex-project.org/lppl.txt
115 and version 1.3c or later is part of all distributions of
116 LaTeX version 2005/12/01 or later.
117
118 This work has the LPPL maintenance status "maintained".
119
120 The Current Maintainer of this work is H.-Martin Muench.
121
122 This work consists of the main source file tablefootnote.dtx,
123 the README, and the derived files
124 tablefootnote.sty, tablefootnote.pdf,
125 tablefootnote.ins, tablefootnote.drv,
126 tablefootnote-example.tex, tablefootnote-example.pdf.
127
128 In memoriam Tommy Muench + 2014/01/02.
129
130 \endpreamble
131 \let\MetaPrefix\DoubleperCent
132
133 \generate{%
134 \file{tablefootnote.ins}{\from{tablefootnote.dtx}{install}}%
135 \file{tablefootnote.drv}{\from{tablefootnote.dtx}{driver}}%
136 \usedir{tex/latex/tablefootnote}%
137 \file{tablefootnote.sty}{\from{tablefootnote.dtx}{package}}%
138 \usedir{doc/latex/tablefootnote}%
139 \file{tablefootnote-example.tex}{\from{tablefootnote.dtx}{example}}%
140 }
141
142 \catcode32=13\relax% active space
143 \let =\space%
144 \Msg{************************************************************************}
145 \Msg{*}
146 \Msg{* To finish the installation you have to move the following}
147 \Msg{* file into a directory searched by TeX:}
148 \Msg{*}
149 \Msg{* tablefootnote.sty}
150 \Msg{*}
151 \Msg{* To produce the documentation run the file `tablefootnote.drv'}
152 \Msg{* through (pdf)LaTeX, e.g.}
153 \Msg{* pdflatex tablefootnote.drv}
154 \Msg{* makeindex -s gind.ist tablefootnote.idx}
155 \Msg{* pdflatex tablefootnote.drv}
156 \Msg{* makeindex -s gind.ist tablefootnote.idx}
157 \Msg{* pdflatex tablefootnote.drv}
158 \Msg{*}
159 \Msg{* At least three runs are necessary e.g. to get the}
160 \Msg{* references right!}
161 \Msg{*}
162 \Msg{* Happy TeXing!}
163 \Msg{*}
164 \Msg{************************************************************************}
165
166 \endbatchfile
167 %</install>
168 %<*ignore>
169 \fi
170 %</ignore>
171 %
172 % \section{The documentation driver file}
173 %
174 % The next bit of code contains the documentation driver file for
175 % \TeX{}, i.\,e., the file that will produce the documentation you
176 % are currently reading. It will be extracted from this file by the
177 % \texttt{docstrip} programme. That is, run \LaTeX{} on \texttt{docstrip}
178 % and specify the \texttt{driver} option when \texttt{docstrip}
179 % asks for options.
180 %
181 % \begin{macrocode}
182 %<*driver>
183 \NeedsTeXFormat{LaTeX2e}[2011/06/27]
184 \ProvidesFile{tablefootnote.drv}%
185 [2014/01/26 v1.1c Table foot notes (HMM)]
186 \documentclass{ltxdoc}[2007/11/11]% v2.0u
187 \usepackage{holtxdoc}[2012/03/21]% v0.24
188 %% tablefootnote may work with earlier versions of LaTeX2e and those
189 %% class and package, but this was not tested.
190 %% Please consider updating your LaTeX, class, and package
191 %% to the most recent version (if they are not already the most
192 %% recent version).
193 \hypersetup{%
194 pdfsubject={Footnotes in Tables (HMM)},%
195 pdfkeywords={LaTeX, tablefootnote, footnote, table, H.-Martin Muench},%
196 pdfencoding=auto,%
197 pdflang={en},%
198 breaklinks=true,%
199 linktoc=all,%
200 pdfstartview=FitH,%
201 pdfpagelayout=OneColumn,%
202 bookmarksnumbered=true,%
203 bookmarksopen=true,%
204 bookmarksopenlevel=3,%
205 pdfmenubar=true,%
206 pdftoolbar=true,%
207 pdfwindowui=true,%
208 pdfnewwindow=true%
209 }
210 \CodelineIndex
211 \hyphenation{printing docu-ment}
212 \gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
213 \makeatletter
214 \@ifundefined{eTeX}{\gdef\eTeX{$\m@th \varepsilon $-\TeX }}{% else \relax
215 }
216 \makeatother
217 \begin{document}
218 \DocInput{tablefootnote.dtx}%
219 \end{document}
220 %</driver>
221 % \end{macrocode}
222 %
223 % \fi
224 %
225 % \CheckSum{584}
226 %
227 % \CharacterTable
228 % {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
229 % Lower-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
230 % Digits \0\1\2\3\4\5\6\7\8\9
231 % Exclamation \! Double quote \" Hash (number) \#
232 % Dollar \$ Percent \% Ampersand \&
233 % Acute accent \' Left paren \( Right paren \)
234 % Asterisk \* Plus \+ Comma \,
235 % Minus \- Point \. Solidus \/
236 % Colon \: Semicolon \; Less than \<
237 % Equals \= Greater than \> Question mark \?
238 % Commercial at \@ Left bracket \[ Backslash \\
239 % Right bracket \] Circumflex \^ Underscore \_
240 % Grave accent \` Left brace \{ Vertical bar \|
241 % Right brace \} Tilde \~}
242 %
243 % \GetFileInfo{tablefootnote.drv}
244 %
245 % \begingroup
246 % \def\x{\#,\$,\^,\_,\~,\ ,\&,\{,\},\%}%
247 % \makeatletter
248 % \@onelevel@sanitize\x
249 % \expandafter\endgroup
250 % \expandafter\DoNotIndex\expandafter{\x}
251 % \expandafter\DoNotIndex\expandafter{\string\ }
252 % \begingroup
253 % \makeatletter
254 % \lccode`9=32\relax
255 % \lowercase{%^^A
256 % \edef\x{\noexpand\DoNotIndex{\@backslashchar9}}%^^A
257 % }%^^A
258 % \expandafter\endgroup\x
259 %
260 % \DoNotIndex{\\,\,}
261 % \DoNotIndex{\documentclass,\usepackage,\ProvidesPackage,\begin,\end}
262 % \DoNotIndex{\MessageBreak,\message}
263 % \DoNotIndex{\NeedsTeXFormat,\DoNotIndex,\verb}
264 % \DoNotIndex{\def,\edef,\gdef,\global}
265 % \DoNotIndex{\ifx,\listfiles,\mathord,\mathrm}
266 % \DoNotIndex{\kvoptions,\SetupKeyvalOptions,\ProcessKeyvalOptions}
267 % \DoNotIndex{\bigskip,\space,\thinspace,\ldots}
268 % \DoNotIndex{\indent,\noindent,\newline,\linebreak,\pagebreak}
269 % \DoNotIndex{\textbf,\textit,\textsf,\texttt,\textsc,\textquotedblleft,\textquotedblright}
270 % \DoNotIndex{\plainTeX,\TeX,\LaTeX,\pdfLaTeX}
271 % \DoNotIndex{\chapter,\section,\the,\csname,\endscname}
272 % \DoNotIndex{\value,\arabic,\hline,\text,\caption,\centering,\clear,\url}
273 %
274 % \title{The \xpackage{tablefootnote} package}
275 % \date{2014/01/26 v1.1c}
276 % \author{H.-Martin M\"{u}nch\\\xemail{Martin.Muench at Uni-Bonn.de}}
277 %
278 % \maketitle
279 %
280 % \begin{abstract}
281 % This \LaTeX{} package provides the command |\tablefootnote| to be used
282 % in a \texttt{table} or \texttt{sidewaystable} environment,
283 % where |\footnote| will not work and when using |\footnotemark| and
284 % |\footnotetext| and adjusting the counters (including \texttt{Hfootnote})
285 % manually is either too much work or would not even work (\texttt{sidewaystable}).
286 % \end{abstract}
287 %
288 % \bigskip
289 %
290 % \noindent Disclaimer for web links: The author is not responsible for any contents
291 % referred to in this work unless he has full knowledge of illegal contents.
292 % If any damage occurs by the use of information presented there, only the
293 % author of the respective pages might be liable, not the one who has referred
294 % to these pages.
295 %
296 % \bigskip
297 %
298 % \noindent {\color{green} Save per page about $200\unit{ml}$ water,
299 % $2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood:\\
300 % Therefore please print only if this is really necessary.}
301 %
302 % \pagebreak
303 %
304 % \tableofcontents
305 %
306 % \pagebreak
307 %
308 % \section{Introduction\label{sec:Introduction}}
309 %
310 % \indent This \LaTeX{} package provides the command |\tablefootnote{...}| to be
311 % used in a \texttt{table} or \texttt{sidewaystable} environment. In those
312 % environments |\footnote{...}| would not work and would need to be replaced
313 % by |\footnotemark| in the \texttt{(sideways)\allowbreak table} and
314 % |\footnotetext{...}| after the \texttt{(sideways)table} environment ended.
315 % Additionally the counters for \texttt{footnote} and
316 % (when the \xpackage{hyperref} package is used) \texttt{Hfootnote}
317 % would need to be adjusted manually. Then still the hyperlinks
318 % in a \texttt{(sideways)table} would not work.
319 % When the \xpackage{footnotebackref} package is used,
320 % |\footnotemark| and |\footnotetext{...}| would need to be redefined.
321 % Just using |\tablefootnote{...}| (with optional argument for custom foot note
322 % marks) in the (sideways)table does all this automatically.
323 % (Compatibility with the \xpackage{footnotebackref} package
324 % was achieved without redefining |\footnotemark| or |\footnotetext|.)
325 % Redefining |\footnote| was \emph{not} done as to not create conflicts with
326 % other packages.
327 %
328 % \section{Usage}
329 %
330 % \indent Just load the package placing
331 % \begin{quote}
332 % |\usepackage{tablefootnote}|
333 % \end{quote}
334 % \noindent in the preamble of your \LaTeXe{} source file and use\newline
335 % |\tablefootnote{...}| instead of |\footnote{...}| and\newline
336 % |\tablefootnote[...]{...}| instead of |\footnote[...]{...}|
337 % in (sideways)\allowbreak tables.\\
338 % When the \xpackage{footnotebackref} package is used,
339 % it must be loaded before the \xpackage{tablefootnote} package
340 % and the \xpackage{hyperrefpackage} with option |hyperfootnotes=true|
341 % must be loaded, too. (Backreference{-}links without links do not make sense.)\\
342 % When the \xpackage{rotating} package (for |sidewaystable|s) is used,
343 % it must be loaded before the \xpackage{tablefootnote} package and it must be
344 % a recent version (v2.16a, 2009/03/28, or newer).\\
345 % If |\tablefootnote{...}| is used in a tabular environment, which is inside
346 % of a (sideways)table environment, everything is fine, but when the tabular
347 % environment is not inside of a (sideways)table, the \textbf{table}footnote
348 % will not work.\\
349 %
350 % Pages with tables with footnotes, which are rotated with the \xpackage{lscape}-
351 % or with the \xpackage{pdflscape}-package (|\begin{landscape}|, table, |\end{landscape}|),
352 % are possible. But when the \xpackage{footmisc}-package is used, \xpackage{(pdf)lscape}
353 % should be loaded before \xpackage{footmisc}.\\
354 %
355 % When the \xpackage{footmisc}-package is used with option \texttt{para},
356 % this is regarded with the exception of a \texttt{sidewaystable}. There the footnotes
357 % are printed one below the other. (Well, this is better than no footnote in a
358 % \texttt{sidewaystable} at all, isn't it?)\\
359 %
360 % When the (sideways)table floats, the footnotes are set and (when \xpackage{hyperref}
361 % is used) hyperlinked, but they are not automatically adapted when the table floats
362 % over/under another footnote. Thus either do not use a footnote between original and
363 % float position of the (sideways)table, or place the (sideways)table in
364 % \textquotedblleft here\textquotedblright\ position. |\clear(double)page|, |h(!)|,
365 % |H|~from the \xpackage{float} package (\url{http://www.ctan.org/pkg/float}),
366 % or |\FloatBarrier| from the \xpackage{picins} package
367 % (\url{http://www.ctan.org/pkg/picins}) might help, too.
368 % (Or after finishing the document, move the (sideways)table in the source code
369 % near the position where it floats to or use the optional footnote marks.)
370 %
371 % \pagebreak
372 %
373 % \section{Alternatives\label{sec:Alternatives}}
374 %
375 % \begin{description}
376 % \item[-] The \xpackage{longtable} package provides the \texttt{longtable} environment
377 % as replacement for the combined \texttt{table} and \texttt{tabular} environments.
378 % Footnotes are real footnotes (not just tablenotes), are continuously numbered and
379 % hyperlinked (when using the \xpackage{hyperref} package), and the hyperlinks really
380 % work. As drawback the appearance of the caption changes slightly (e.\,g.~distance
381 % to the table, width of the caption), which can probably be changed back manually.
382 % Furthermore, longtables are meaned to break over more than one page. If that is not
383 % wished, it must be prevented by |\nopagebreak|-commands and by ending the longtable
384 % lines with |\\*| instead of |\\|. longtables do not float. (Therefore using the
385 % \xpackage{tablefootnote} package and |\FloatBarrier| from the \xpackage{picins} package
386 % before and after the table environment is similar~- but \xpackage{tablefootnote} does not
387 % change the table-caption!) \texttt{sidewaystable} does not work with it.\\
388 % \url{http://www.ctan.org/pkg/longtable}
389 %
390 % \item[-] The \xpackage{supertabular} package provides the \texttt{mpsupertabular}
391 % environment as replacement for the combined \texttt{table} and \texttt{tabular}
392 % environments. Footnotes are just tablenotes (with working hyperlinks when using the
393 % \xpackage{hyperref} package), i.\,e. numbered a, b, c and placed below the table
394 % and not at the end of the page. Therefore there is no float problem (because the
395 % tablenotes numbering is not included in the continuous numbering of the footnotes).
396 % Placing the \texttt{supertabular} inside of a \texttt{sidewaystable} breaks the
397 % hyperlinks to the tablenotes.\\
398 % \url{http://www.ctan.org/pkg/supertabular}
399 %
400 % \item[-] The \xpackage{ctable} package has its very own notation for defining tables.
401 % It can create tablenotes and sideways-tables. The tablenotes are not automatically
402 % hyperlinked. The \texttt{ctable}s float. Because the tablenotes numbering is not
403 % included in the continuous numbering of the footnotes there is no float problem.\\
404 % \url{http://www.ctan.org/pkg/ctable}
405 %
406 % \item[-] The \xpackage{footnote} package provides |\makesavenoteenv{table}|. After
407 % loading the package and using that command in the preamble, in tables |\footnote{...}|
408 % can be used. Using |\makesavenoteenv{tabular}| and \\
409 % |\makesavenoteenv{sidewaystable}|
410 % is possible, but it neither solves the float problem, nor do the created hyperlinks
411 % work (i.\,e.~they aim at wrong locations). The \xpackage{mdwtab} from the same bundle
412 % is incompatible with other table-related packages (e.\,g. \xpackage{supertabular},
413 % \xpackage{array}) and not $100\,\%$ compatible with the \texttt{tabular} environment.\\
414 % \url{http://www.ctan.org/pkg/footnote}\\
415 % \url{http://www.ctan.org/pkg/mdwtab}
416 %
417 % \item[-] The \xpackage{tabularx} package does produce footnotes for sidewaystables,
418 % but uses a, b, c instead of 1, 2, 3. The hyperlinks to the footnotes do not work.
419 % Because the footnotes numbering is not included in the continuous numbering of
420 % the other footnotes there is no float problem.\\
421 % \url{http://www.ctan.org/pkg/tabularx}
422 %
423 % \item[-] Placing a tabular inside a minipage inside a table produces tablenotes.
424 % Therefore there is no float problem (because the footnotes are not continuously
425 % numbered). The hyperlinks to the table notes indeed work.
426 %
427 % \pagebreak
428 %
429 % \item[-] The \xpackage{threeparttable} package creates tablenotes again. Therefore
430 % there is no float problem (because the tablenotes are not continuously numbered with
431 % the footnotes). There are no hyperlinks to the table notes (at least not automatically).
432 % Using |sidewaystable| (with table notes) works.\\
433 % \url{http://www.ctan.org/pkg/threeparttable}
434 %
435 % \item[-] The \xpackage{threeparttablex} package creates tablenotes again. Therefore there
436 % is no float problem (because the tablenotes are not continuously numbered with the
437 % footnotes). With option \texttt{referable} the tablenotes are hyperlinked. Use of
438 % a |sidewaystable| (with table notes) did not work for me. When using the
439 % \texttt{referable} option according to the example in the \xpackage{threeparttablex}
440 % manual the \xpackage{longtable} package is used, therefore that package could be used
441 % directly without \xpackage{threeparttablex} (see above).\\
442 % \url{http://www.ctan.org/pkg/threeparttablex}
443 %
444 % \item[-] One can manually use |\footnotemark| in the table and |\footnotetext{...}|
445 % after the table environment ended and manually change the |footnote| and
446 % (when the \xpackage{hyperref} package is used) |Hfootnote| counters and needs
447 % to insert
448 % \begin{verbatim}
449 % \makeatletter
450 % \global\let\Hy@saved@currentHref\@currentHref
451 % \hyper@makecurrent{Hfootnote}%
452 % \global\let\Hy@footnote@currentHref\@currentHref
453 % \global\let\@currentHref\Hy@saved@currentHref
454 % \makeatother
455 % \end{verbatim}
456 % before each |\footnotetext{...}|, but with more than very few footnotes this can become
457 % much work (and is prone to produce errors). And this does not even work with
458 % sidewaystables. (And it does not work with the \xpackage{footnotebackref} package
459 % without redefining |\footnotemark| and |\footnotetext{...}|.)
460 % \end{description}
461 %
462 % \bigskip
463 %
464 % \noindent (You programmed or found another alternative,
465 % which is available at \CTAN{}?\\
466 % OK, send an e-mail to me with the name, location at \CTAN{},
467 % and a short notice, and I will probably include it in
468 % the list above.)
469 %
470 % \newpage
471 %
472 % \section{Example}
473 %
474 % \begin{macrocode}
475 %<*example>
476 \documentclass[british]{article}[2007/10/19]% v1.4h
477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 \usepackage{float}[2001/11/08]% v1.3d
479 \usepackage{placeins}[2005/04/18]% v2.2 ; for \FloatBarrier
480 \usepackage{rotating}[2009/03/28]% v2.16a; for sidewaystable-environment
481 \usepackage[%
482 hyperfootnotes=true,%
483 extension=pdf,%
484 plainpages=false,%
485 pdfpagelabels=true,%
486 hyperindex=false,%
487 pdflang={en},%
488 pdftitle={tablefootnote package example},%
489 pdfauthor={H.-Martin Muench},%
490 pdfsubject={Example for the tablefootnote package},%
491 pdfkeywords={LaTeX, tablefootnote, footnote, table, H.-Martin Muench},%
492 % pdfview=FitH and FitBH do not work: hyperlinks in sidewaystables
493 % do no lead to the footnotes, due to a bug in pdfTeX,
494 % computing wrong anchor coordinates (Heiko Oberdiek, 29. October 2011)
495 % pdfview=Fit, FitV, FitR, FitB, FitBV work
496 % print is OK for all those options
497 pdfstartview=FitH,%
498 pdfpagelayout=OneColumn%
499 ]{hyperref}[2012/11/06]% v6.83m
500 % Due to the urls used in the example, either the hyperref or the url
501 % package are needed (or the urls must be removed before compiling).
502
503 \usepackage{footnotebackref}[2012/07/01]% v1.0
504 \usepackage{tablefootnote}[2014/01/26]% v1.1c
505
506 \gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
507 \listfiles
508 \begin{document}
509 \pagenumbering{arabic}
510 \section*{Example for tablefootnote}
511
512 This example demonstrates the use of package\newline
513 \textsf{tablefootnote}, v1.1c as of 2014/01/26 (HMM).\newline
514 There were no options used. (The package provides no options.)\newline
515
516 \textbf{The \texttt{tablefootnote-example.tex} needs to be compiled
517 at least twice to get the references right!}\newline
518
519 If the etoolbox-package is found, it is automatically used.\newline
520
521 For more details please see the documentation!\newline
522
523 \noindent Save per page about $200\unit{ml}$ water,
524 $2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood:\newline
525 Therefore please print only if this is really necessary.\newline
526
527 Here is some text.\footnote{And this is a text footnote.}\newline
528
529 Tables \ref{tab.symbol}, \ref{tab.normal}, \ref{tab.another} and
530 \ref{tab.floatH} show normal tables, table~\ref{tab.sideways} depicts
531 a sidewaystable. Table~\ref{tab.floatH} uses the float
532 specifier~\texttt{H} from the float package.\newline
533
534 \texttt{Hyperref} option \verb|pdfview=FitH| and \verb|FitBH| do
535 not work due to a bug in pdf\TeX{}, computing wrong
536 anchor coordinates (\textsc{Heiko Oberdiek}, 29.~October 2011).
537 Depending on used pdf-viewer, hyperlinks in sidewaystables lead
538 e.\,g.~at the end of the document, not at the footnote.
539 \verb|pdfview=Fit|, \verb|FitV|, \verb|FitR|, \verb|FitB|,
540 \verb|FitBV| work, print is OK for all those options.
541
542 \bigskip
543
544 \listoftables
545
546 \pagebreak
547
548 \renewcommand{\thefootnote}{\fnsymbol{footnote}}
549 \verb|\renewcommand{\thefootnote}{\fnsymbol{footnote}}|
550 causes footnote{-}symbol{-}footnotes, which are possible
551 (see Table~\ref{tab.symbol}).
552
553 \begin{table}
554 \centering
555 \begin{tabular}{ccc}
556 Another\tablefootnote{A table footnote.} & %
557 text\tablefootnote{Another table footnote.} & %
558 in a table\tablefootnote{A third table footnote.}
559 \end{tabular}
560 \caption[A footnotesymbol table]{%
561 A table with footnote-symbol-footnotes.\label{tab.symbol}}
562 \end{table}
563
564 Some text.\footnote{A text footnote.}
565
566 \renewcommand{\thefootnote}{\arabic{footnote}}
567 \verb|\renewcommand{\thefootnote}{\arabic{footnote}}|
568 switches back to normal footnote numbers again.
569
570 \pagebreak
571
572 \begin{table}
573 \centering
574 \begin{tabular}{ccc}
575 Some\tablefootnote{A table footnote.} & %
576 text\tablefootnote[99]{A table footnote with custom footnote number.} & %
577 in a table\tablefootnote{A third table footnote.}
578 \end{tabular}
579 \caption[A table]{A normal table.\label{tab.normal}}
580 \end{table}
581
582 Some text.\footnote{Another text footnote.}
583
584 \pagebreak
585
586 % \end{macrocode}
587 %
588 % \pagebreak
589 %
590 % \begin{macrocode}
591 More text.\footnote{And yet another text footnote.}
592
593 \begin{table}[t]
594 \centering
595 \begin{tabular}{|c|c|c|}
596 \hline
597 Another\tablefootnote{A $3^{rd}$ table footnote.} & %
598 text\tablefootnote{Another $3^{rd}$ table footnote.} & %
599 in a table\tablefootnote{A $3^{rd}$ third table footnote.}\\ \hline
600 \end{tabular}
601 \caption[Another table]{Another table (third one)\label{tab.another}}
602 \end{table}
603
604 Please note that Table~\ref{tab.another} floated to the top of the page.
605 While the footnotes are set and (when hyperref is used) hyperlinked,
606 they are not automatically adapted. Thus either do not use a footnote
607 at the same page before the table, or place the table in
608 \textquotedblleft here\textquotedblright\ or
609 \textquotedblleft bottom\textquotedblright\ position.
610 \verb|\clear(double)page|, \verb|h(!)|, \verb|H|~from the
611 \texttt{float} package, or \verb|\FloatBarrier| from the
612 \texttt{picins} package might help, too. (Or move the table in the
613 source code near the position where it floats to
614 or use the optional footnote marks.)
615
616 Table~\ref{tab.floatH} (page~\pageref{tab.floatH}) uses float specifier
617 \texttt{H} from the float package and does not float.
618
619 Some text.\footnote{This is just another text footnote.}
620
621 \pagebreak
622
623 \FloatBarrier
624
625 \begin{sidewaystable}
626 \centering%
627 \begin{tabular}{ccc}
628 Text\tablefootnote{Please rotate the view for testing the %
629 hyperlinks.} & %
630 in a\tablefootnote[98]{Another sidewaystable footnote %
631 with optional footnote mark.} & %
632 sidewaystable%
633 \tablefootnote{Sidewaystable-environment provided by %
634 \url{http://www.ctan.org/pkg/rotating} package.}
635 \end{tabular}
636 \caption[A sideways table]{A table in the \texttt{sideways} %
637 environment\label{tab.sideways}}%
638 \end{sidewaystable}%
639
640 \FloatBarrier
641
642 \pagebreak
643
644 % \end{macrocode}
645 %
646 % \pagebreak
647 %
648 % \begin{macrocode}
649 A last table, here with float specifier \texttt{H} from the
650 float\footnote{\url{http://www.ctan.org/pkg/float}} package.
651
652 \begin{table}[H]
653 \centering
654 \begin{tabular}{ccc}
655 Another\tablefootnote{A $5^{th}$ table footnote.} & %
656 text\tablefootnote{Another $5^{th}$ table footnote.} & %
657 in a table\tablefootnote{A $5^{th}$ third table footnote.}
658 \end{tabular}
659 \caption[A last table]{A very last table\label{tab.floatH}}
660 \end{table}
661
662 Some text.\footnote{This is just another text footnote.}
663
664 \pagebreak
665
666 End of the example for the
667 tablefootnote\footnote{\url{http://www.ctan.org/pkg/tablefootnote}}
668 package.
669
670 \end{document}
671 %</example>
672 % \end{macrocode}
673 %
674 % \StopEventually{}
675 %
676 % \newpage
677 %
678 % \section{The implementation}
679 %
680 % We start off by checking that we are loading into \LaTeXe{} and
681 % announcing the name and version of this package.
682 %
683 % \begin{macrocode}
684 %<*package>
685 % \end{macrocode}
686 %
687 % \begin{macrocode}
688 \NeedsTeXFormat{LaTeX2e}[2011/06/27]
689 \ProvidesPackage{tablefootnote}[2014/01/26 v1.1c
690 Table foot notes (HMM)]
691 % \end{macrocode}
692 %
693 % A short description of the \xpackage{tablefootnote} package:
694 %
695 % \begin{macrocode}
696 %% Provides the \tablefootnote[...]{...} command
697 %% for footnotes in (sideways)tables.
698
699 % \end{macrocode}
700 %
701 % We need the \xpackage{ltxcmds} and \xpackage{letltxmacro} packages
702 % by \textsc{Heiko Oberdiek}:
703 %
704 % \begin{macrocode}
705 \RequirePackage{ltxcmds}[2011/11/09]% v1.22
706 \RequirePackage{letltxmacro}[2010/09/02]% v1.4
707 \RequirePackage{xifthen}[2009/04/17]% v1.3
708 % \end{macrocode}
709 %
710 % A last information for the user:
711 %
712 % \begin{macrocode}
713 %% tablefootnote may work with earlier versions of LaTeX and those
714 %% packages, but this was not tested. Please consider updating
715 %% your LaTeX and packages to the most recent version
716 %% (if they are not already the most recent version).
717
718 % \end{macrocode}
719 %
720 % \indent See subsection~\ref{ss:Downloads} about how to get them.\\
721 %
722 % When the \xpackage{rotating} package (for |sidewaystable|s) is used,
723 % it must be loaded before the \xpackage{tablefootnote} package and it must be
724 % a recent version:
725 %
726 % \begin{macrocode}
727 \@ifpackageloaded{rotating}{%
728 \gdef\tfn@rotating{1}
729 \@ifpackagelater{rotating}{2009/03/28}% v2.16a
730 {% >= 2009/03/28, OK
731 }{% else
732 \PackageWarningNoLine{tablefootnote}{%
733 It is required version\MessageBreak%
734 2009/03/28 v2.16a (or later) of package rotating,\MessageBreak%
735 but only version\MessageBreak%
736 `\csname [email protected]\endcsname'\MessageBreak%
737 is available}%
738 }%
739 }{% else
740 \gdef\tfn@rotating{0}%
741 }
742
743 % \end{macrocode}
744 %
745 % There are no options to be processed.\\
746 %
747 % We need some definitions:
748 %
749 % \begin{macrocode}
750 \def\tfn@footnotetablecount{0}
751 \def\tfn@footnotetableprint{0}
752 \def\tfn@footnotezero{0}
753 \def\tfn@fnt{0}
754 \def\tfn@swt{0}% _s_ide_w_ays_t_able
755 \def\tfn@fmpw{\relax}% f_oot_m_isc_p_ara_w_arn-switch
756 \def\tfn@fnbr{0}% f_oot_n_ote_b_ack_r_ef(erence package)
757
758 % \end{macrocode}
759 %
760 % \begin{macro}{\tfn@hyperfootnotes}
761 % We need a wrapper for the used |\ifHy@hyperfootnotes|,
762 % which is not defined when the \xpackage{hyperref} package has not been loaded:
763 %
764 % \begin{macrocode}
765 \DeclareRobustCommand{\tfn@hyperfootnotes}[2]{%
766 \ifHy@hyperfootnotes%
767 #1%
768 \else%
769 #2%
770 \fi%
771 }
772
773 % \end{macrocode}
774 % \end{macro}
775 %
776 % \begin{macro}{\tablemakefntext}
777 % |\tablemakefntext| makes the footnotetext for a footnote in a table.
778 %
779 % \begin{macrocode}
780 \ltx@ifpackageloaded{footnotebackref}{%
781 \gdef\tfn@fnbr{1}%
782 \ifx\FootnoteBackref@symbol\empty%
783 \ifFootnoteBackref@numberlinked%
784 \newcommand\tablemakefntext[1]{%
785 \noindent\makebox[1.634em][r]{%
786 \mbox{\textsuperscript{\normalfont%
787 \hyperlink{tfn:m\theHfootnote}{\@thefnmark}%
788 }}}%
789 \ #1%
790 }
791 \else
792 \newcommand\tablemakefntext[1]{%
793 \noindent\makebox[1.8em][r]{%
794 \mbox{\textsuperscript{\normalfont%
795 \@thefnmark%
796 }}}%
797 #1%
798 }
799 \fi
800 \else
801 \newcommand\tablemakefntext[1]{%
802 \noindent\makebox[1.8em][r]{%
803 \mbox{\textsuperscript{\normalfont%
804 \ifFootnoteBackref@numberlinked%
805 \hyperlink{tfn:m\theHfootnote}{\@thefnmark}\ %
806 \else%
807 \@thefnmark%
808 \fi%
809 }}}%
810 \hyperlink{tfn:m\theHfootnote}{\FootnoteBackref@symbol}%
811 #1%
812 }
813 \fi
814 }{%
815 \newcommand\tablemakefntext[1]{%
816 \noindent\makebox[1.8em][r]{%
817 \mbox{\textsuperscript{\normalfont%
818 \@thefnmark%
819 }}}%
820 #1%
821 }
822 }
823
824 % \end{macrocode}
825 %
826 % \end{macro}
827 %
828 % \pagebreak
829 %
830 % \begin{macro}{\swtablemakefntext}
831 % \begin{macrocode}
832 \newcommand\swtablemakefntext[1]{\noindent\ #1}
833
834 % \end{macrocode}
835 % \end{macro}
836 %
837 % \begin{macro}{\tfn@footnotemarks}
838 % |\tfn@footnotemarks| uses the |\footnotemark| command to place a foot note mark
839 % and decreases the |\tfn@footnotetablecount| (i.\,e.~increases the negative value)
840 % of the number of footnote(marks) in the table. If the \xpackage{footnotebackref}
841 % package is used, it is also necessary to create an according |\hypertarget| for
842 % the back reference.
843 %
844 % \begin{macrocode}
845 \newcommand{\tfn@footnotemarks}[1][]{%
846 \hbox{%
847 \ifthenelse{\isempty{#1}}%
848 {\footnotemark%
849 \ltx@ifpackageloaded{footnotebackref}%
850 {\raisebox{\ht\strutbox}{\hypertarget{tfn:m\theHfootnote}{}}}%
851 {% footnotebackref not loaded
852 }%
853 }%
854 {\ltx@ifpackageloaded{hyperref}%
855 {\tfn@hyperfootnotes{%
856 \hyperlink{tfn:#1}{\footnotemark[#1]}%
857 }{\footnotemark[#1]}}%
858 {\footnotemark[#1]}%
859 \ltx@ifpackageloaded{footnotebackref}%
860 {\raisebox{\ht\strutbox}{\hypertarget{tfn:m#1}{}}}{}%
861 }%
862 }%
863 \@tempcnta=\tfn@footnotetablecount\relax%
864 \advance\@tempcnta by -1\relax%
865 \xdef\tfn@footnotetablecount{\the\@tempcnta}%
866 }
867
868 % \end{macrocode}
869 % \end{macro}
870 %
871 % \begin{macro}{\tfn@footmiscparawarn}
872 % When the \xpackage{footmisc} package is used with option |para|,
873 % we need to issue a warning. (Any idea how to resolve this issue?)\\
874 % It must be given inside of it's own command, because |\ifFN@para| is not
875 % defined when \xpackage{footmisc} has not been loaded, and then the
876 % |\fi| would be a |\fi| without |\if| (and \TeX{} does not like single
877 % |\fi|s).
878 %
879 % \begin{macrocode}
880 \newcommand{\tfn@footmiscparawarn}{%
881 \ifFN@para%
882 \PackageWarning{tablefootnote}{%
883 Package footmisc with option para used.\MessageBreak%
884 Unfortunately package tablefootnote is not yet\MessageBreak%
885 able to regard this in sidewaystables.\MessageBreak%
886 Here the footnotes are printed one below\MessageBreak%
887 the other. Sorry!\MessageBreak%
888 }%
889 \fi%
890 }
891
892 % \end{macrocode}
893 % \end{macro}
894 %
895 % \begin{macro}{\tfn@updateHyper}
896 % |\tfn@updateHyper| updates some \xpackage{hyperref} internals.
897 %
898 % \begin{macrocode}
899 \newcommand{\tfn@updateHyper}{%
900 % The code of this command is partly from the
901 % hyperref package by Heiko Oberdiek, 2011/10/01, v6.82j.
902 % Newer versions of that package are available at CTAN.org.
903 \global\let\Hy@saved@currentHref\@currentHref%
904 \tfn@hyperfootnotes{\hyper@makecurrent{Hfootnote}}{}%
905 \global\let\Hy@footnote@currentHref\@currentHref%
906 \global\let\@currentHref\Hy@saved@currentHref%
907 }
908
909 % \end{macrocode}
910 % \end{macro}
911 %
912 % \begin{macro}{\tfn@footnotetext}
913 % |\tfn@footnotetext| contains the |\footnotetext[...]{...}| command and handles
914 % the numbering. |\tfn@footnotetext| will be executed after the table.
915 % The foot note counter has been increased automatically with each |\footnotemark|,
916 % therefore it must be reset to its value before the table began.
917 %
918 % \begin{macrocode}
919 \newcommand{\tfn@footnotetext}[2][]{%
920 \ifx\tfn@footnotetableprint\tfn@footnotezero%
921 % This is the first footnotetext after the (sideways)table.
922 \addtocounter{footnote}{\tfn@footnotetablecount}%
923 % \end{macrocode}
924 %
925 % When the \xpackage{hyperref} package is used, also its |Hfootnote| counter must
926 % be reset (when the footnotes are hyperlinked).
927 %
928 % \begin{macrocode}
929 \ltx@ifpackageloaded{hyperref}{%
930 \tfn@hyperfootnotes{%
931 \addtocounter{Hfootnote}{\tfn@footnotetablecount}}{}%
932 \tfn@updateHyper%
933 }{}%
934 \fi%
935 % \end{macrocode}
936 %
937 % For issuing the text for the next footnote the footnote-counter
938 % (and |Hfootnote| counter in case of links) are increased by one.
939 %
940 % \begin{macrocode}
941 \addtocounter{footnote}{+1}%
942 \ltx@ifpackageloaded{hyperref}{%
943 \tfn@hyperfootnotes{\addtocounter{Hfootnote}{+1}}{}%
944 % \end{macrocode}
945 %
946 % The \xpackage{hyperref} package was not expecting this kind of change of the
947 % |(H)footnote| numbers, therefore some code-lines are missing here which can be
948 % found at other places in that same package and are called by this command.
949 %
950 % \begin{macrocode}
951 \tfn@updateHyper%
952 % \end{macrocode}
953 %
954 % When \xpackage{hyperref} is not loaded, nothing is to be done here.
955 %
956 % \begin{macrocode}
957 }{}%
958 % \end{macrocode}
959 %
960 % The |\footnotetext[...]{...}| places the foot note text as usual.
961 %
962 % \begin{macrocode}
963 \ifx\tfn@swt\tfn@footnotezero%
964 \ifthenelse{\isempty{#1}}%
965 {\footnotetext{#2}}%
966 {\ltx@ifpackageloaded{hyperref}%
967 {\tfn@hyperfootnotes{%
968 \footnotetext[#1]{%
969 \raisebox{\ht\strutbox}{\hypertarget{tfn:#1}{}}#2}%
970 }{\footnotetext[#1]{#2}%
971 }%
972 }{\footnotetext[#1]{#2}}%
973 }%
974 \else%
975 % \end{macrocode}
976 %
977 % If there is more than one tablefootnote in the |sidewaystable|, \\
978 % the |\tfn@footmiscparawarn| shall be given,
979 %
980 % \begin{macrocode}
981 \ifx\tfn@footnotetableprint\tfn@footnotezero%
982 \gdef\tfn@fmpw{\tfn@footmiscparawarn}%
983 \else%
984 \ltx@ifpackageloaded{footmisc}{\tfn@fmpw}{\relax}%
985 % \end{macrocode}
986 %
987 % but we do not want to repeat the message for a third(, forth,\ldots)
988 % tablefootnote in the |sidewaystable|.
989 %
990 % \begin{macrocode}
991 \gdef\tfn@fmpw{\relax}%
992 \fi%
993 % \end{macrocode}
994 %
995 % |\@makefnmark| is \\
996 % |\hbox {\@textsuperscript {\normalfont \@thefnmark }}|, \\
997 % but according to |\show\@thefnmark| here |\@thefnmark| is
998 % |{\protect \itshape}| instead of |\thefootnote| (Why?!).\\
999 % If the \xpackage{footnotebackref} package is used,
1000 % back references must be created for the table footnotes, too.
1001 %
1002 % \begin{macrocode}
1003 \ltx@ifpackageloaded{footnotebackref}{%
1004 \LetLtxMacro{\tfncurrentmft}{\@makefntext}%
1005 \LetLtxMacro{\@makefntext}{\swtablemakefntext}%
1006 \ifthenelse{\isempty{#1}}%
1007 {\footnotetext{%
1008 \raisebox{\ht\strutbox}{\hypertarget{tfn:\theHfootnote}{}}%
1009 \hbox{\@textsuperscript{\normalfont%
1010 \hyperlink{tfn:m\theHfootnote}{\thefootnote}}}\thinspace%
1011 \ifx\FootnoteBackref@symbol\empty%
1012 \else\hyperlink{tfn:m\theHfootnote}{\FootnoteBackref@symbol}%
1013 \fi%
1014 #2}%
1015 }{\edef\tfn@tfn{\arabic{footnote}}%
1016 \edef\tfn@thn{\arabic{Hfootnote}}%
1017 \setcounter{footnote}{#1}%
1018 \setcounter{Hfootnote}{#1}%
1019 \tfn@updateHyper%
1020 \footnotetext{%
1021 \raisebox{\ht\strutbox}{\hypertarget{tfn:#1}{}}%
1022 \hbox{\@textsuperscript{\normalfont%
1023 \hyperlink{tfn:m#1}{#1}}}%
1024 \thinspace%
1025 \ifx\FootnoteBackref@symbol\empty%
1026 \else%
1027 \raisebox{\ht\strutbox}{%
1028 \hyperlink{tfn:m#1}{\FootnoteBackref@symbol}}%
1029 \fi%
1030 #2%
1031 }%
1032 \setcounter{footnote}{\tfn@tfn}%
1033 \setcounter{Hfootnote}{\tfn@thn}%
1034 \tfn@updateHyper%
1035 }%
1036 \LetLtxMacro{\@makefntext}{\tfncurrentmft}%
1037 }{% footnotebackref not loaded
1038 \ifthenelse{\isempty{#1}}%
1039 {\footnotetext{%
1040 \hbox{\@textsuperscript{\normalfont\thefootnote}}%
1041 \ltx@ifpackageloaded{hyperref}%
1042 {\tfn@hyperfootnotes{%
1043 \raisebox{\ht\strutbox}{%
1044 \hypertarget{tfn:\theHfootnote}{}}}{}%
1045 }{}%
1046 \thinspace%
1047 #2}%
1048 }{%
1049 % \end{macrocode}
1050 %
1051 % \pagebreak
1052 %
1053 % \begin{macrocode}
1054 \edef\tfn@tfn{\arabic{footnote}}%
1055 \ltx@ifpackageloaded{hyperref}{%
1056 \tfn@hyperfootnotes{\xdef\tfn@thn{\arabic{Hfootnote}}}{}%
1057 }{}%
1058 \setcounter{footnote}{#1}
1059 \ltx@ifpackageloaded{hyperref}{%
1060 \tfn@hyperfootnotes{\setcounter{Hfootnote}{#1}}{}%
1061 \tfn@updateHyper%
1062 }{}%
1063 \footnotetext{%
1064 \hbox{\@textsuperscript{\normalfont #1}}%
1065 \ltx@ifpackageloaded{hyperref}{%
1066 \tfn@hyperfootnotes{\raisebox{\ht\strutbox}{%
1067 \hypertarget{tfn:#1}{}}}{}%
1068 }{}%
1069 \thinspace%
1070 #2}%
1071 \setcounter{footnote}{\tfn@tfn}%
1072 \ltx@ifpackageloaded{hyperref}{%
1073 \tfn@hyperfootnotes{\setcounter{Hfootnote}{\tfn@thn}}{}%
1074 \tfn@updateHyper%
1075 }{}%
1076 }%
1077 }%
1078 \fi%
1079 % \end{macrocode}
1080 %
1081 % For further footnotes in the table the \\
1082 % |\ifx\tfn@footnotetableprint\tfn@footnotezero|\ldots|\fi| \\
1083 % from the beginning of this |\tfn@footnotetext| macro must not be repeated,
1084 % therefore we deactivate this by defining |\tfn@footnotetableprint| to
1085 % something other than |0| (here |1| is used).
1086 %
1087 % \begin{macrocode}
1088 \gdef\tfn@footnotetableprint{1}%
1089 % \end{macrocode}
1090 %
1091 % |\tfn@footnotetablecount| contains the negative number of footnote texts
1092 % to be printed, therefore it is increase by one (i.\,e.~the negative number
1093 % decreases, i.\,e.~$-3$ becomes~$-2$).
1094 %
1095 % \begin{macrocode}
1096 \@tempcnta=\tfn@footnotetablecount\relax%
1097 \advance\@tempcnta by +1\relax%
1098 \xdef\tfn@footnotetablecount{\the\@tempcnta}%
1099 % \end{macrocode}
1100 %
1101 % When it is zero, all footnote texts have been placed, and\\
1102 % |\tfn@footnotetableprint| can be reset to zero and\\
1103 % |\tfn@tablefootnoteprintout| can be cleared.
1104 %
1105 % \begin{macrocode}
1106 \ifx\tfn@footnotetablecount\tfn@footnotezero% all footnotes placed
1107 \gdef\tfn@footnotetableprint{0}%
1108 \global\let\tfn@tablefootnoteprintout\relax% brute force
1109 %\else there is at least one \footnotemark which needs \footnotetext
1110 \fi
1111 }
1112
1113 % \end{macrocode}
1114 % \end{macro}
1115 %
1116 % \begin{macro}{\tfn@tablefootnoteprintout}
1117 % When something shall be cleared or redefined, it is a good idea
1118 % to define it. It~will be later filled with the foot note text to be printed.
1119 %
1120 % \begin{macrocode}
1121 \newcommand{\tfn@tablefootnoteprintout}{\relax}
1122
1123 % \end{macrocode}
1124 % \end{macro}
1125 %
1126 % \pagebreak
1127 %
1128 % \begin{macro}{\tablefootnote}
1129 % |\tablefootnote[...]{...}| is the command to be used by the user instead of
1130 % |\footnote[...]{...}| in the (sideways)table. It places a foot note mark via
1131 % |\tfn@footnotemarks| and appends a |\tfn@footnotetext{#1}| to the\\
1132 % |\tfn@tablefootnoteprintout| macro, and remembers that table foot notes
1133 % have been used.
1134 %
1135 % \begin{macrocode}
1136 \newcommand{\tablefootnote}[2][]{%
1137 \tfn@footnotemarks[#1]%
1138 \ifthenelse{\isempty{#1}}{\relax}{%
1139 \ltx@GlobalPrependToMacro{\tfn@tablefootnoteprintout}{%
1140 \addtocounter{footnote}{+1}%
1141 \ltx@ifpackageloaded{hyperref}{%
1142 \tfn@hyperfootnotes{\addtocounter{Hfootnote}{+1}}{}%
1143 \tfn@updateHyper%
1144 }{}%
1145 }%
1146 }%
1147 \ltx@GlobalAppendToMacro{\tfn@tablefootnoteprintout}{%
1148 \tfn@footnotetext[#1]{#2}%
1149 \ifthenelse{\isempty{#1}}{\relax}{%
1150 \addtocounter{footnote}{-1}%
1151 \ltx@ifpackageloaded{hyperref}{%
1152 \tfn@hyperfootnotes{\addtocounter{Hfootnote}{-1}}{}%
1153 \tfn@updateHyper%
1154 }{}%
1155 }%
1156 }%
1157 \gdef\tfn@fnt{1}%
1158 }
1159
1160 % \end{macrocode}
1161 % \end{macro}
1162 %
1163 % \begin{macro}{\tfn@swtbox}
1164 % For |sidewaystable|s the |\tfn@tablefootnoteprintout| is placed in a \\
1165 % |\parbox|, which can be placed at the end of the |sidewaystable|:
1166 %
1167 % \begin{macrocode}
1168 \newcommand{\tfn@swtbox}{%
1169 \ifvoid \footins%
1170 \vskip 2\baselineskip%
1171 \else%
1172 \vskip \skip\footins%
1173 \fi%
1174 \parbox[b][][t]{\linewidth}{\raggedright\tfn@tablefootnoteprintout}%
1175 }
1176
1177 % \end{macrocode}
1178 % \end{macro}
1179 %
1180 % |\tfn@tablefootnoteprintout| shall be executed after the end of the table environment.
1181 % The \xpackage{etoolbox} package provides very easy syntax for this:
1182 %
1183 % \begin{macrocode}
1184 \IfFileExists{etoolbox.sty}{%
1185 \RequirePackage{etoolbox}[2011/01/03]% v2.1
1186 \AfterEndEnvironment{table}{%
1187 \ltx@ifpackageloaded{footnotebackref}{%
1188 \LetLtxMacro{\tfncurrentmft}{\@makefntext}%
1189 \LetLtxMacro{\@makefntext}{\tablemakefntext}%
1190 \tfn@tablefootnoteprintout%
1191 \LetLtxMacro{\@makefntext}{\tfncurrentmft}%
1192 }{% footnotebackref not loaded
1193 \tfn@tablefootnoteprintout%
1194 }%
1195 \gdef\tfn@fnt{0}%
1196 }%
1197 % \end{macrocode}
1198 %
1199 % When the \xpackage{rotating} package has been loaded, we need to detect
1200 % whether the |\tablefootnote| is placed inside of a |sidewaystable|.
1201 %
1202 % \begin{macrocode}
1203 \ltx@ifpackageloaded{rotating}{%
1204 \AtBeginEnvironment{sidewaystable}{%
1205 \gdef\tfn@swt{1}%
1206 }
1207 % \end{macrocode}
1208 %
1209 % At the end of |sidewaystable| environments |\tfn@swtbox| shall be placed
1210 % (if~there was any |\tablefootnote| in that |sidewaystable| at all).
1211 % And |\tfn@swt| as well as |\tfn@fnt| must be reset to |0|.
1212 %
1213 % \begin{macrocode}
1214 \AtEndEnvironment{sidewaystable}{%
1215 \ifx\tfn@fnt\tfn@footnotezero% \relax
1216 \else%
1217 \ltx@ifpackageloaded{footnotebackref}{%
1218 \LetLtxMacro{\tfncurrentmft}{\@makefntext}%
1219 \LetLtxMacro{\@makefntext}{\tablemakefntext}%
1220 \tfn@swtbox%
1221 \LetLtxMacro{\@makefntext}{\tfncurrentmft}%
1222 }{% footnotebackref not loaded
1223 \tfn@swtbox%
1224 }%
1225 \fi%
1226 \gdef\tfn@swt{0}%
1227 \gdef\tfn@fnt{0}%
1228 }%
1229 }{}% else \relax
1230 }{%
1231 % \end{macrocode}
1232 %
1233 % When the \xpackage{etoolbox} package is not available (e.\,g. because of missing
1234 % \eTeX{}) we~do a workaround:
1235 %
1236 % \begin{macrocode}
1237 \PackageWarning{tablefootnote}{%
1238 Package etoolbox not available, therefore\MessageBreak%
1239 substituting commands \string\AtEndEnvironment\space %
1240 and\MessageBreak%
1241 \string\AfterEndEnvironment\space for tablefootnotes%
1242 \MessageBreak%
1243 }%
1244 \@ifpackagelater{letltxmacro}{2010/09/02}%
1245 {% >= 2010/09/02, OK
1246 \GlobalLetLtxMacro{\tfnorigtable}{\table}
1247 \GlobalLetLtxMacro{\tfnendorigtable}{\endtable}
1248 % \end{macrocode}
1249 %
1250 % |\GlobalLetLtxMacro| was introduced in version 2010/09/02 v1.4 of the
1251 % \xpackage{letltxmacro} package.
1252 %
1253 % \begin{macrocode}
1254 }{% else
1255 \PackageError{tablefootnote}{%
1256 Outdated version of letltxmacro package used%
1257 }{Version 2010/09/02 v1.4 or newer needed but not found!%
1258 \MessageBreak%
1259 Update the used letltxmacro package.}
1260 \LetLtxMacro{\tfnorigtable}{\table}
1261 \LetLtxMacro{\tfnendorigtable}{\endtable}
1262 }%
1263 % \end{macrocode}
1264 %
1265 % \pagebreak
1266 %
1267 % \begin{macrocode}
1268 \ltx@ifpackageloaded{float}{%
1269 \@ifpackagelater{float}{2001/11/08}% v1.3d
1270 {% >= 2001/11/08, OK
1271 }{% else
1272 \PackageWarningNoLine{tablefootnote}{%
1273 It is required version\MessageBreak
1274 2001/11/08 v1.3d (or later) of package float,\MessageBreak
1275 but only version\MessageBreak
1276 `\csname [email protected]\endcsname'\MessageBreak
1277 is available}%
1278 }%
1279 }{\relax}
1280 \renewenvironment{table}{%
1281 \ltx@ifpackageloaded{float}{%
1282 % \end{macrocode}
1283 %
1284 % When \xpackage{etoolbox.sty} was not found, and the \xpackage{float} package
1285 % has been loaded, and the float specifier is \texttt{H}, then |\endtable| was
1286 % let to |\float@endH| by the \xpackage{float} package (line~79 of
1287 % \xpackage{float.sty}, 2001/11/08 v1.3d:\\
1288 % |\expandafter\let\csname end#1\endcsname\float@endH|), i.\,e.~appending\\
1289 % |\tfn@tablefootnoteprintout \gdef\tfn@fnt{0}| to |\endtable| is useless.
1290 % Instead of this, it must be appended to |\float@endH|.\\
1291 % (Why is this not necessary when \xpackage{etoolbox} is used?
1292 % That is a good question, answers are welcome.)
1293 %
1294 % \begin{macrocode}
1295 \ltx@LocalAppendToMacro{\float@endH}{%
1296 \ltx@ifpackageloaded{footnotebackref}{%
1297 \LetLtxMacro{\tfncurrentmft}{\@makefntext}%
1298 \LetLtxMacro{\@makefntext}{\tablemakefntext}%
1299 \tfn@tablefootnoteprintout%
1300 \LetLtxMacro{\@makefntext}{\tfncurrentmft}%
1301 }{% footnotebackref not loaded
1302 \tfn@tablefootnoteprintout%
1303 }%
1304 \gdef\tfn@fnt{0}%
1305 }%
1306 }{\relax}
1307 \tfnorigtable%
1308 }{%
1309 \tfnendorigtable%
1310 \ltx@ifpackageloaded{footnotebackref}{%
1311 \LetLtxMacro{\tfncurrentmft}{\@makefntext}%
1312 \LetLtxMacro{\@makefntext}{\tablemakefntext}%
1313 \tfn@tablefootnoteprintout%
1314 \LetLtxMacro{\@makefntext}{\tfncurrentmft}%
1315 }{% footnotebackref not loaded
1316 \tfn@tablefootnoteprintout%
1317 }%
1318 \gdef\tfn@fnt{0}%
1319 }%
1320 % \end{macrocode}
1321 %
1322 % \pagebreak
1323 %
1324 % The |sidewaystable|-environment must be treated separately:
1325 %
1326 % \begin{macrocode}
1327 \ltx@ifpackageloaded{rotating}{%
1328 \let\tfnorigsidewaystable\sidewaystable
1329 \let\tfnendorigsidewaystable\endsidewaystable
1330 \renewenvironment{sidewaystable}{%
1331 \gdef\tfn@swt{1}%
1332 \tfnorigsidewaystable%
1333 }{%
1334 \ifx\tfn@fnt\tfn@footnotezero% \relax
1335 \else%
1336 \ltx@ifpackageloaded{footnotebackref}{%
1337 \LetLtxMacro{\tfncurrentmft}{\@makefntext}%
1338 \LetLtxMacro{\@makefntext}{\tablemakefntext}%
1339 \tfn@swtbox%
1340 \LetLtxMacro{\@makefntext}{\tfncurrentmft}%
1341 }{% footnotebackref not loaded
1342 \tfn@swtbox%
1343 }%
1344 \fi%
1345 \gdef\tfn@swt{0}%
1346 \gdef\tfn@fnt{0}%
1347 \tfnendorigsidewaystable%
1348 }%
1349 }{}%
1350 }
1351
1352 % \end{macrocode}
1353 %
1354 % \DescribeMacro{\AtBeginDocument}
1355 % When the \xpackage{rotating} (for |sidewaystable|s) or the
1356 % \xpackage{footnotebackref} (for back references for the footnotes)
1357 % package is used, it must be loaded before the \xpackage{tablefootnote} package.
1358 % Using both packages is also possible, in which case both must be loaded before
1359 % the \xpackage{tablefootnote} package. If any one of those packages is loaded
1360 % |\AtBeginDocument| after this check, the according error message will not be
1361 % given, but packages really should be loaded before |\AtBeginDocument|.
1362 %
1363 % \begin{macrocode}
1364 \AtBeginDocument{%
1365 \ltx@ifpackageloaded{footnotebackref}{%
1366 \ifx\tfn@fnbr\tfn@footnotezero%
1367 \PackageError{tablefootnote}{%
1368 Package footnotebackref loaded after tablefootnote}{%
1369 When using both the footnotebackref and the tablefootnote %
1370 package,\MessageBreak%
1371 the footnotebackref package MUST be loaded before the %
1372 tablefootnote package!\MessageBreak%
1373 }%
1374 \fi%
1375 }{% else \relax
1376 }
1377 \ltx@ifpackageloaded{rotating}{%
1378 \ifx\tfn@rotating\tfn@footnotezero%
1379 \PackageError{tablefootnote}{%
1380 Package rotating loaded after tablefootnote}{%
1381 When using both the rotating and the tablefootnote package,%
1382 \MessageBreak%
1383 the rotating package MUST be loaded before the tablefootnote%
1384 \space package!\MessageBreak%
1385 }%
1386 \fi%
1387 }{% else \relax
1388 }
1389 % \end{macrocode}
1390 %
1391 % \pagebreak
1392 %
1393 % When the document is compiled with \LuaLaTeX{}, hyperlinks in rotated content
1394 % will be misplaced, regardless of the use of the \xpackage{tablefootnote} package
1395 % (or of tables or footnotes). The text to be printed will be OK.
1396 % This problem of \LuaLaTeX{} (not \xpackage{tablefootnote}) was found and reported
1397 % by \textsc{Arno Trautmann}, 2011/11/15 -- thanks!
1398 %
1399 % \begin{macrocode}
1400 \ltx@ifpackageloaded{hyperref}{%
1401 \tfn@hyperfootnotes{
1402 \ifluatex%
1403 \PackageWarningNoLine{tablefootnote}{%
1404 LuaTeX and hyperref package used:\MessageBreak%
1405 Hyperreferences in rotated content\MessageBreak%
1406 will be misplaced\MessageBreak%
1407 regardless of tablefootnote package.\MessageBreak%
1408 The text to be printed will be OK%
1409 }%
1410 \fi%
1411 }{% else \relax
1412 }%
1413 }{% else \relax
1414 }%
1415 % \end{macrocode}
1416 %
1417 % When the \xpackage{footnotebackref} package is used but the footnotes are not
1418 % hyperlinked, neither the back references nor the tablefootnotes will work.
1419 %
1420 % \begin{macrocode}
1421 \ltx@ifpackageloaded{footnotebackref}{%
1422 \ltx@ifpackageloaded{hyperref}{%
1423 \tfn@hyperfootnotes{\relax}{% else
1424 \PackageError{tablefootnote}{%
1425 footnotebackref but not hyperfootnotes}{%
1426 The footnotebackref package is used\MessageBreak%
1427 but the hyperfootnotes option of the hyperref package%
1428 \MessageBreak%
1429 was set to false.\MessageBreak%
1430 Either enable hyperfootnotes or do not use footnotebackref.%
1431 \MessageBreak%
1432 Loading of the tablefootnote package will be aborted.%
1433 }%
1434 \endinput%
1435 }%
1436 }{\PackageError{tablefootnote}{footnotebackref but not hyperref}{%
1437 The footnotebackref package is used\MessageBreak%
1438 but not the hyperref package.\MessageBreak%
1439 Either load hyperref or do not use footnotebackref.%
1440 \MessageBreak%
1441 Loading of the tablefootnote package will be aborted.%
1442 }%
1443 \endinput%
1444 }%
1445 }{}
1446 }
1447
1448 % \end{macrocode}
1449 %
1450 % \begin{macrocode}
1451 %</package>
1452 % \end{macrocode}
1453 %
1454 % \pagebreak
1455 %
1456 % \section{Installation}
1457 %
1458 % \subsection{Downloads\label{ss:Downloads}}
1459 %
1460 % Everything is available on \CTAN{}, \url{http://www.ctan.org/},
1461 % but may need additional packages themselves.\\
1462 %
1463 % \DescribeMacro{tablefootnote.dtx}
1464 % For unpacking the |tablefootnote.dtx| file and constructing the documentation
1465 % it is required:
1466 % \begin{description}
1467 % \item[-] \TeX{} Format \LaTeXe{}: \url{http://www.CTAN.org/}
1468 %
1469 % \item[-] document class \xpackage{ltxdoc}, 2007/11/11, v2.0u,
1470 % \url{http://www.ctan.org/pkg/ltxdoc}
1471 %
1472 % \item[-] package \xpackage{holtxdoc}, 2012/03/21, v0.24,
1473 % \url{http://www.ctan.org/pkg/holtxdoc}
1474 %
1475 % \item[-] package \xpackage{hypdoc}, 2011/08/19, v1.11,
1476 % \url{http://www.ctan.org/pkg/hypdoc}
1477 % \end{description}
1478 %
1479 % \DescribeMacro{tablefootnote.sty}
1480 % The |tablefootnote.sty| for \LaTeXe{} (i.\,e.~each document using
1481 % the \xpackage{tablefootnote} package) requires:
1482 % \begin{description}
1483 % \item[-] \TeX{} Format \LaTeXe{}, \url{http://www.CTAN.org/}
1484 %
1485 % \item[-] package \xpackage{letltxmacro}, 2010/09/02, v1.4,
1486 % \url{http://www.ctan.org/pkg/letltxmacro}.
1487 %
1488 % \item[-] package \xpackage{ltxcmds}, 2011/11/09, v1.22,
1489 % \url{http://www.ctan.org/pkg/ltxcmds}
1490 % \end{description}
1491 %
1492 % When the \xpackage{hyperref} package is used, also the \xpackage{ifluatex} package
1493 % is needed, but it is already loaded automatically by the \xpackage{hyperref}
1494 % package.\\
1495 % When the \xpackage{etoolbox} package is available, it is used:
1496 % \begin{description}
1497 % \item[-] package \xpackage{etoolbox}, 2011/01/03, v2.1,
1498 % \url{http://www.ctan.org/pkg/etoolbox}.
1499 % \end{description}
1500 %
1501 % \DescribeMacro{tablefootnote-example.tex}
1502 % The |tablefootnote-example.tex| requires the same files as all
1503 % documents using the \xpackage{tablefootnote} package and additionally:
1504 % \begin{description}
1505 % \item[-] class \xpackage{article}, 2007/10/19, v1.4h, from \xpackage{classes.dtx}:\\
1506 % \CTAN{macros/latex/base/classes.dtx}
1507 %
1508 % \item[-] package \xpackage{rotating}, 2009/03/28, v2.16a,
1509 % \url{http://www.ctan.org/pkg/rotating}
1510 %
1511 % \item[-] package \xpackage{float}, 2001/11/08, v1.3d,
1512 % \url{http://www.ctan.org/pkg/float}
1513 %
1514 % \item[-] package \xpackage{placeins}, 2005/04/18, v2.2,
1515 % \url{http://www.ctan.org/pkg/placeins}\\
1516 % for |\FloatBarrier|
1517 %
1518 % \item[-] package \xpackage{hyperref}, 2012/11/06, v6.83m,
1519 % \url{http://www.ctan.org/pkg/hyperref}
1520 %
1521 % \item[-] package \xpackage{tablefootnote}, 2014/01/26, v1.1c,\\
1522 % \url{http://www.ctan.org/pkg/tablefootnote}\\
1523 % (Well, it is the example file for this package, and because you
1524 % are reading the documentation for the \xpackage{tablefootnote} package,
1525 % it can be assumed that you already have some version of it~--
1526 % is it the current one?)
1527 % \end{description}
1528 %
1529 % \DescribeMacro{Oberdiek}
1530 % \DescribeMacro{holtxdoc}
1531 % \DescribeMacro{ifluatex}
1532 % \DescribeMacro{letltxmacro}
1533 % \DescribeMacro{ltxcmds}
1534 % All packages of \textsc{Heiko Oberdiek}'s bundle `oberdiek'
1535 % (especially \xpackage{holtxdoc}, \xpackage{ifluatex}, \xpackage{letltxmacro},
1536 % and \xpackage{ltxcmds}) are also available in a TDS compliant ZIP archive:\\
1537 % \CTAN{install/macros/latex/contrib/oberdiek.tds.zip}.\\
1538 % It is probably best to download and use this, because the packages in there
1539 % are quite probably both recent and compatible among themselves.\\
1540 %
1541 % \pagebreak
1542 %
1543 % \DescribeMacro{hyperref}
1544 % \noindent \xpackage{hyperref} is not included in that bundle and needs to be
1545 % downloaded separately,\\
1546 % \url{http://www.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.\\
1547 %
1548 % \DescribeMacro{M\"{u}nch}
1549 % A hyperlinked list of my (other) packages can be found at
1550 % \url{http://www.ctan.org/author/muench-hm}.\\
1551 %
1552 % \subsection{Package, unpacking TDS}
1553 % \paragraph{Package.} This package is available on \CTAN{}
1554 % \begin{description}
1555 % \item[\CTAN{macros/latex/contrib/tablefootnote/tablefootnote.dtx}]\hspace*{0.1cm} \\
1556 % The source file.
1557 % \item[\CTAN{macros/latex/contrib/tablefootnote/tablefootnote.pdf}]\hspace*{0.1cm} \\
1558 % The documentation.
1559 % \item[\CTAN{macros/latex/contrib/tablefootnote/tablefootnote-example.pdf}]\hspace*{0.1cm} \\
1560 % The compiled example file, as it should look like.
1561 % \item[\CTAN{macros/latex/contrib/tablefootnote/README}]\hspace*{0.1cm} \\
1562 % The README file.
1563 % \end{description}
1564 % There is also a tablefootnote.tds.zip available:
1565 % \begin{description}
1566 % \item[\CTAN{install/macros/latex/contrib/tablefootnote.tds.zip}]\hspace*{0.1cm} \\
1567 % Everything in \xfile{TDS} compliant, compiled format.
1568 % \end{description}
1569 % which additionally contains\\
1570 % \begin{tabular}{ll}
1571 % tablefootnote.ins & The installation file.\\
1572 % tablefootnote.drv & The driver to generate the documentation.\\
1573 % tablefootnote.sty & The \xext{sty}le file.\\
1574 % tablefootnote-example.tex & The example file.
1575 % \end{tabular}
1576 %
1577 % \bigskip
1578 %
1579 % \noindent For required other packages, please see the preceding subsection.
1580 %
1581 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
1582 % \docstrip{} archive. The files are extracted by running the
1583 % \xext{dtx} through \plainTeX{}:
1584 % \begin{quote}
1585 % \verb|tex tablefootnote.dtx|
1586 % \end{quote}
1587 %
1588 % \noindent About generating the documentation see paragraph~\ref{GenDoc} below.\\
1589 %
1590 % \paragraph{TDS.} Now the different files must be moved into
1591 % the different directories in your installation TDS tree
1592 % (also known as \xfile{texmf} tree):
1593 % \begin{quote}
1594 % \def\t{^^A
1595 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
1596 % tablefootnote.sty & tex/latex/tablefootnote/tablefootnote.sty\\
1597 % tablefootnote.pdf & doc/latex/tablefootnote/tablefootnote.pdf\\
1598 % tablefootnote-example.tex & doc/latex/tablefootnote/tablefootnote-example.tex\\
1599 % tablefootnote-example.pdf & doc/latex/tablefootnote/tablefootnote-example.pdf\\
1600 % tablefootnote.dtx & source/latex/tablefootnote/tablefootnote.dtx\\
1601 % \end{tabular}^^A
1602 % }^^A
1603 % \sbox0{\t}^^A
1604 % \ifdim\wd0>\linewidth
1605 % \begingroup
1606 % \advance\linewidth by\leftmargin
1607 % \advance\linewidth by\rightmargin
1608 % \edef\x{\endgroup
1609 % \def\noexpand\lw{\the\linewidth}^^A
1610 % }\x
1611 % \def\lwbox{^^A
1612 % \leavevmode
1613 % \hbox to \linewidth{^^A
1614 % \kern-\leftmargin\relax
1615 % \hss
1616 % \usebox0
1617 % \hss
1618 % \kern-\rightmargin\relax
1619 % }^^A
1620 % }^^A
1621 % \ifdim\wd0>\lw
1622 % \sbox0{\small\t}^^A
1623 % \ifdim\wd0>\linewidth
1624 % \ifdim\wd0>\lw
1625 % \sbox0{\footnotesize\t}^^A
1626 % \ifdim\wd0>\linewidth
1627 % \ifdim\wd0>\lw
1628 % \sbox0{\scriptsize\t}^^A
1629 % \ifdim\wd0>\linewidth
1630 % \ifdim\wd0>\lw
1631 % \sbox0{\tiny\t}^^A
1632 % \ifdim\wd0>\linewidth
1633 % \lwbox
1634 % \else
1635 % \usebox0
1636 % \fi
1637 % \else
1638 % \lwbox
1639 % \fi
1640 % \else
1641 % \usebox0
1642 % \fi
1643 % \else
1644 % \lwbox
1645 % \fi
1646 % \else
1647 % \usebox0
1648 % \fi
1649 % \else
1650 % \lwbox
1651 % \fi
1652 % \else
1653 % \usebox0
1654 % \fi
1655 % \else
1656 % \lwbox
1657 % \fi
1658 % \else
1659 % \usebox0
1660 % \fi
1661 % \end{quote}
1662 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip{}'s
1663 % \xfile{TDS} installing feature, then some files can already be in the right
1664 % place, see the documentation of \docstrip{}.
1665 %
1666 % \subsection{Refresh file name databases}
1667 %
1668 % If your \TeX{}~distribution (\TeX live, \mikTeX{}, \dots{}) relies on file name
1669 % databases, you must refresh these. For example, \teTeX{} users run
1670 % \verb|texhash| or \verb|mktexlsr|.
1671 %
1672 % \subsection{Some details for the interested}
1673 %
1674 % \paragraph{Unpacking with \LaTeX{}.}
1675 % The \xfile{.dtx} chooses its action depending on the format:
1676 % \begin{description}
1677 % \item[\plainTeX:] Run \docstrip{} and extract the files.
1678 % \item[\LaTeX:] Generate the documentation.
1679 % \end{description}
1680 % If you insist on using \LaTeX{} for \docstrip{} (really,
1681 % \docstrip{} does not need \LaTeX{}), then inform the autodetect routine
1682 % about your intention:
1683 % \begin{quote}
1684 % \verb|latex \let\install=y\input{tablefootnote.dtx}|
1685 % \end{quote}
1686 % Do not forget to quote the argument according to the demands
1687 % of your shell.
1688 %
1689 % \paragraph{Generating the documentation.\label{GenDoc}}
1690 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
1691 % the documentation. The process can be configured by a
1692 % configuration file \xfile{ltxdoc.cfg}. For instance, put the following
1693 % line into this file, if you want to have A4 as paper format:
1694 % \begin{quote}
1695 % \verb|\PassOptionsToClass{a4paper}{article}|
1696 % \end{quote}
1697 %
1698 % \noindent An example follows how to generate the
1699 % documentation with \pdfLaTeX{}:
1700 %
1701 % \begin{quote}
1702 %\begin{verbatim}
1703 %pdflatex tablefootnote.dtx
1704 %makeindex -s gind.ist tablefootnote.idx
1705 %pdflatex tablefootnote.dtx
1706 %makeindex -s gind.ist tablefootnote.idx
1707 %pdflatex tablefootnote.dtx
1708 %\end{verbatim}
1709 % \end{quote}
1710 %
1711 % \subsection{Compiling the example}
1712 %
1713 % The example file, \textsf{tablefootnote-example.tex}, can be compiled via\\
1714 % \indent |latex tablefootnote-example.tex|,\\
1715 % \indent |lualatex tablefootnote-example.tex|,\\
1716 % or (recommended)\\
1717 % \indent |pdflatex thumbs-example.tex|\\
1718 % and will need at least two compiler runs to get everything right.
1719 %
1720 % \bigskip
1721 %
1722 % \section{Acknowledgements}
1723 %
1724 % I would like to thank \textsc{Heiko Oberdiek} for providing
1725 % the \xpackage{hyperref}, \xpackage{ifluatex}, \xpackage{letltxmacro},
1726 % \xpackage{ltxcmds}, as well as a~lot~(!) of other useful packages
1727 % (from which I also got everything I know about creating a file in
1728 % \xext{dtx} format, OK, say it: copying),
1729 % and for information about the \pdfTeX{}-bug,
1730 % \textsc{Arno Trautmann} for reporting the bug of misplaced hyperreferences in
1731 % |sidewaystable|s using \LuaTeX{}, independently of the \xpackage{tablefootnote}
1732 % package or footnotes at all,
1733 % \textsc{Thomas~V.} for reporting the bug of not handling the case of
1734 % \xpackage{hyperref} option |hyperfootnotes=false|,
1735 % \textsc{Sverre Stausland Johnsen} for reporting the bug in case of \emph{not}
1736 % using \xpackage{hyperref},
1737 % and the \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex} newsgroups
1738 % as well as everybody at \url{http://tex.stackexchange.com}
1739 % for their help in all things \TeX{}.
1740 %
1741 % \pagebreak
1742 %
1743 % \phantomsection
1744 % \begin{History}\label{History}
1745 % \begin{Version}{2011/10/26 v1.0a, tabfootn}
1746 % \item Upload to \CTAN{macros/latex/contrib/tablefootnote/}.
1747 % \end{Version}
1748 % \begin{Version}{2011/10/29 v1.0b}
1749 % \item Renamed to \xpackage{tablefootnote}.
1750 % \item Added support for the |sidewaystable|-environment of the
1751 % \xpackage{rotating} package.
1752 % \item Diverse changes in documentation and README.
1753 % \end{Version}
1754 % \begin{Version}{2011/11/06 v1.0c}
1755 % \item Replaced |^{\text{\thefootnote}}| by |{}^{\text{\textup{\thefootnote}}}|.
1756 % \item Bug fix: When \xpackage{etoolbox.sty} was not found, and the \xpackage{float}
1757 % package had been loaded, and the float specifier was \texttt{H},
1758 % then the |\tablefootnote|s were not printed for that table. Fixed.
1759 % \end{Version}
1760 % \begin{Version}{2011/11/19 v1.0d}
1761 % \item Replaced |{}^{\text{\textup{\thefootnote}}}| by
1762 % |\textsuperscript{\thefootnote}|, therefore the \xpackage{amstext}
1763 % package is no longer required by the \xpackage{tablefootnote} package.
1764 % \item \xpackage{lscape} and \xpackage{pdflscape} package now work with
1765 % \xpackage{tablefootnote} (except for using a \texttt{sidewaystable} on
1766 % a \texttt{landscape} page).
1767 % \item Added information about footnotes in \texttt{sidewaystable} being printed
1768 % one below the other, even if \xpackage{footmisc} package with option
1769 % \texttt{para} is used.
1770 % \item Redefined |\tfn@swtbox| from
1771 % \begin{verbatim}
1772 % \vspace{0.8cm}%
1773 % \begin{spacing}{0.1}%
1774 % \subcaptionbox*{}[\linewidth][l]{\tfn@tablefootnoteprintout}%
1775 % \end{spacing}%
1776 % \end{verbatim}
1777 % to
1778 % \begin{verbatim}
1779 % \vspace{2\baselineskip}%
1780 % \parbox[b][][t]{\linewidth}{\raggedright\tfn@tablefootnoteprintout}%
1781 % \end{verbatim}
1782 % , therefore the \xpackage{setspace} and \xpackage{subcaption} packages
1783 % are no longer required by the \xpackage{tablefootnote} package.
1784 % \item No longer uses |\numexpr|, therefore also usable without \eTeX{}.
1785 % \item Replaced |\textsuperscript{\thefootnote}| by
1786 % |\hbox {\@textsuperscript {\normalfont \thefootnote }}|,
1787 % which is next to the original definition of |\@makefnmark|
1788 % (|\hbox {\@textsuperscript {\normalfont \@thefnmark }}|,
1789 % but according to |\show\@thefnmark| here |\@thefnmark| is
1790 % |{\protect \itshape}| instead of |\thefootnote|).
1791 % \item Added an error message, when \LuaTeX{}, \xpackage{rotating} package, and
1792 % \xpackage{hyperref} package are used together. Hyperreferences in
1793 % |sidewaystable|s are misplaced, independently of the
1794 % \xpackage{tablefootnote} package or footnotes at all. (Bug reported
1795 % by \textsc{Arno Trautmann}, 2011/11/15 -- thanks!)
1796 % \item Added footnotesymbol-footnote-numbers in the example.
1797 % \end{Version}
1798 % \begin{Version}{2011/11/26 v1.0e}
1799 % \item Check for \xpackage{hyperref} is only done once.
1800 % \item Message regarding the misplacement of hyperlinks by \LuaLaTeX{}
1801 % changed form error to warning.
1802 % \item Replaced |\vspace{2\baselineskip}| by
1803 % \begin{verbatim}
1804 % \ifvoid \footins%
1805 % \vskip 2\baselineskip%
1806 % \else%
1807 % \vskip \skip\footins%
1808 % \fi%
1809 % \end{verbatim}
1810 % between the |sidewaystable|s and their footnotes.
1811 % \item The warning about un-regarded |para|-option of \xpackage{footmoisc}
1812 % package is only given at the second |tablefootnote| in a |sidewaystable|,
1813 % not repeatedly for every |tablefootnote| in a |sidewaystable|.
1814 % \end{Version}
1815 % \begin{Version}{2012/01/01 v1.0f}
1816 % \item Bugfix: Wrong installation path given in the documentation, fixed.
1817 % \item Update of documentation, README, and \xfile{dtx} internals.
1818 % \end{Version}
1819 % \begin{Version}{2012/01/14 v1.0g}
1820 % \item Bugfix: There was a |relax| instead of a |\relax|, fixed.
1821 % \end{Version}
1822 % \begin{Version}{2012/07/29 v1.0h}
1823 % \item \xpackage{tablefootnote} is now compatible to the new
1824 % \xpackage{footnotebackref} package, 2012/07/01, v1.0,
1825 % \url{http://www.ctan.org/pkg/footnotebackref}.
1826 % \end{Version}
1827 % \begin{Version}{2014/01/08 v1.1a}
1828 % \item Tablefootnotes now regard optional footnote marks:
1829 % |\tablefootnote[| custom mark here! |]{...}|
1830 % \item Bug fix: the case of \xpackage{hyperref} option |hyperfootnotes=false|
1831 % was not handeled at all. (Bug reported by \textsc{Thomas~V.}, %
1832 % 2014/01/02 -- thanks!)
1833 % \item A lot of details.
1834 % \end{Version}
1835 % \begin{Version}{2014/01/20 v1.1b}
1836 % \item Bug fix: Package was broken when \xpackage{hyperref} was \emph{not} used.
1837 % (Bug reported by \textsc{Sverre Stausland Johnsen} -- thanks!)
1838 % \end{Version}
1839 % \begin{Version}{2014/01/26 v1.1c}
1840 % \item The emergency bug fix of version 2014/01/20 v1.1b was replaced by using
1841 % the new robust macro |\tfn@hyperfootnotes|, which only \emph{internally}
1842 % uses |\ifHy@hyperfootnotes|. If the \xpackage{hyperref} package is not used,
1843 % \LaTeX{} now does not see any confusing
1844 % |\ifHy@hyperfootnotes|\ldots|\else|\ldots|\fi| at all.
1845 % \item URLs and README updated.
1846 % \end{Version}
1847 % \end{History}
1848 %
1849 % \bigskip
1850 %
1851 % When you find a mistake or have a suggestion for an improvement of this package,
1852 % please send an e-mail to the maintainer, thanks! (Please see BUG REPORTS in the README.)
1853 %
1854 % \bigskip
1855 %
1856 % \PrintIndex
1857 %
1858 % \Finale
1859 \endinput