From 5949618821cfe384176ae1a4a7a032a3f6e7ee30 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 25 Nov 2011 00:10:43 +0000
Subject: tablefootnote (21nov11)

git-svn-id: svn://tug.org/texlive/trunk@24651 c570f23f-e606-0410-a88d-b1316a301751
---
 .../source/latex/tablefootnote/tablefootnote.dtx   | 363 +++++++++++++++------
 1 file changed, 258 insertions(+), 105 deletions(-)

(limited to 'Master/texmf-dist/source/latex/tablefootnote/tablefootnote.dtx')

diff --git a/Master/texmf-dist/source/latex/tablefootnote/tablefootnote.dtx b/Master/texmf-dist/source/latex/tablefootnote/tablefootnote.dtx
index f83c17556d5..0a828f7ba25 100644
--- a/Master/texmf-dist/source/latex/tablefootnote/tablefootnote.dtx
+++ b/Master/texmf-dist/source/latex/tablefootnote/tablefootnote.dtx
@@ -1,7 +1,7 @@
 % \iffalse meta-comment
 %
 % File: tablefootnote.dtx
-% Version: 2011/11/06 v1.0c
+% Version: 2011/11/19 v1.0d
 %
 % Copyright (C) 2011 by
 %    H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
@@ -84,7 +84,7 @@
 \input docstrip.tex
 \Msg{******************************************************************}
 \Msg{* Installation                                                   *}
-\Msg{* Package: tablefootnote 2011/11/06 v1.0c Table foot notes (HMM) *}
+\Msg{* Package: tablefootnote 2011/11/19 v1.0d Table foot notes (HMM) *}
 \Msg{******************************************************************}
 
 \keepsilent
@@ -96,7 +96,7 @@
 This is a generated file.
 
 Project: tablefootnote
-Version: 2011/11/06 v1.0c
+Version: 2011/11/19 v1.0d
 
 Copyright (C) 2011 by
     H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
@@ -181,7 +181,7 @@ the README, and the derived files
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}[2011/06/24]%
 \ProvidesFile{tablefootnote.drv}%
-  [2011/11/06 v1.0c Table foot notes (HMM)]%
+  [2011/11/19 v1.0d Table foot notes (HMM)]%
 \documentclass{ltxdoc}[2007/11/11]% v2.0u
 \usepackage{holtxdoc}[2011/02/04]% v0.21
 %% tablefootnote may work with earlier versions of LaTeX2e and those
@@ -209,6 +209,10 @@ the README, and the derived files
 \CodelineIndex
 \hyphenation{printing docu-ment}
 \gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
+\makeatletter
+\@ifundefined{eTeX}{\gdef\eTeX{$\m@th \varepsilon $-\TeX }}{% else \relax
+}
+\makeatother
 \begin{document}
   \DocInput{tablefootnote.dtx}%
 \end{document}
@@ -217,7 +221,7 @@ the README, and the derived files
 %
 % \fi
 %
-% \CheckSum{229}
+% \CheckSum{263}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -261,13 +265,13 @@ the README, and the derived files
 % \DoNotIndex{\kvoptions,\SetupKeyvalOptions,\ProcessKeyvalOptions}
 % \DoNotIndex{\bigskip,\space,\thinspace,\ldots}
 % \DoNotIndex{\indent,\noindent,\newline,\linebreak,\pagebreak}
-% \DoNotIndex{\textbf,\textit,\textsf,\texttt,textsc,\textquotedblleft,\textquotedblright}
+% \DoNotIndex{\textbf,\textit,\textsf,\texttt,\textsc,\textquotedblleft,\textquotedblright}
 % \DoNotIndex{\plainTeX,\TeX,\LaTeX,\pdfLaTeX}
 % \DoNotIndex{\chapter,\section,\the,\csname,\endscname}
 % \DoNotIndex{\value,\arabic,\hline,\text,\caption,\centering,\clear,\url}
 %
 % \title{The \xpackage{tablefootnote} package}
-% \date{2011/11/06 v1.0c}
+% \date{2011/11/19 v1.0d}
 % \author{H.-Martin M\"{u}nch\\\xemail{Martin.Muench at Uni-Bonn.de}}
 %
 % \maketitle
@@ -328,6 +332,16 @@ the README, and the derived files
 % environment is not inside of a (sideways)table, the \textbf{table}footnote
 % will not work.\\
 %
+% Pages with tables with footnotes, which are rotated with the \xpackage{lscape}-
+% or with the \xpackage{pdflscape}-package (|\begin{landscape}|, table, |\end{landscape}|),
+% are possible. But when the \xpackage{footmisc}-package is used, \xpackage{(pdf)lscape}
+% should be loaded before \xpackage{footmisc}.\\
+%
+% When the \xpackage{footmisc}-package is used with option \texttt{para},
+% this is regarded with the exception of a \texttt{sidewaystable}. There the footnotes
+% are printed one below the other. (Well, this is better than no footnote in a
+% \texttt{sidewaystable} at all, isn't it?)\\
+%
 % When the (sideways)table floates, the footnotes are set and (when \xpackage{hyperref}
 % is used) hyperlinked, but they are not automatically adapted when the table floates
 % over/under another footnote. Thus either do not use a footnote between original and
@@ -374,6 +388,8 @@ the README, and the derived files
 %   included in the continouse numbering of the footnotes there is no float problem.\\
 %   \url{http://www.ctan.org/pkg/ctable}
 %
+% \pagebreak
+%
 % \item[-] The \xpackage{footnote} package provides |\makesavenoteenv{table}|. After
 %   loading the package and using that command in the preamble, in tables |\footnote{...}|
 %   can be used. Using |\makesavenoteenv{tabular}| and \\
@@ -385,8 +401,6 @@ the README, and the derived files
 %   \url{http://www.ctan.org/pkg/footnote}\\
 %   \url{http://www.ctan.org/pkg/mdwtab}
 %
-% \pagebreak
-%
 % \item[-] The \xpackage{tabularx} package does produce footnotes for sidewaystables,
 %   but uses a, b, c instead of 1, 2, 3. The hyperlinks to the footnotes do not work.
 %   Because the footnotes numbering is not included in the continouse numbering of
@@ -447,7 +461,6 @@ the README, and the derived files
 \usepackage{float}[2001/11/08]%    v1.3d
 \usepackage{placeins}[2005/04/18]% v2.2  ; for \FloatBarrier
 \usepackage{rotating}[2009/03/28]% v2.16a; for sidewaystable-environment
-\usepackage{tablefootnote}[2011/11/06]% v1.0c
 \usepackage[%
  extension=pdf,%
  plainpages=false,%
@@ -467,6 +480,8 @@ the README, and the derived files
  pdfpagelayout=OneColumn%
 ]{hyperref}[2011/10/01]% v6.82j
 
+\usepackage{tablefootnote}[2011/11/19]% v1.0d
+
 \gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
 \listfiles
 \begin{document}
@@ -474,7 +489,7 @@ the README, and the derived files
 \section*{Example for tablefootnote}
 
 This example demonstrates the use of package\newline
-\textsf{tablefootnote}, v1.0c as of 2011/11/06 (HMM).\newline
+\textsf{tablefootnote}, v1.0d as of 2011/11/19 (HMM).\newline
 There were no options used. (The package provides no options.)\newline
 
 \textbf{The \texttt{tablefootnote-example.tex} needs to be compiled
@@ -490,10 +505,10 @@ Therefore please print only if this is really necessary.\newline
 
 Here is some text.\footnote{And this is a text footnote.}\newline
 
-Tables \ref{tab.first}, \ref{tab.another} and \ref{tab.floatH} show
-normal tables, table~\ref{tab.sideways} depicts a sidewaystable.
-Table~\ref{tab.floatH} uses the float specifier~\texttt{H} from the
-float package.\newline
+Tables \ref{tab.symbol}, \ref{tab.normal}, \ref{tab.another} and
+\ref{tab.floatH} show normal tables, table~\ref{tab.sideways} depicts
+a sidewaystable. Table~\ref{tab.floatH} uses the float
+specifier~\texttt{H} from the float package.\newline
 
 %    \end{macrocode}
 %
@@ -514,6 +529,30 @@ e.\,g.~at the end of the document, not at the footnote.
 
 \pagebreak
 
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+\verb|\renewcommand{\thefootnote}{\fnsymbol{footnote}}|
+causes footnote-symbol-footnotes, which are possible
+(see Table~\ref{tab.symbol}).
+
+\begin{table}
+\centering
+\begin{tabular}{ccc}
+Another\tablefootnote{A table footnote.} & %
+text\tablefootnote{Another table footnote.} & %
+in a table\tablefootnote{A third table footnote.}
+\end{tabular}
+\caption[A footnotesymbol table]{A table with footnote-symbol-footnotes.%
+ \label{tab.symbol}}
+\end{table}
+
+Some text.\footnote{A text footnote.}
+
+\renewcommand{\thefootnote}{\arabic{footnote}}
+\verb|\renewcommand{\thefootnote}{\arabic{footnote}}|
+switches back to normal footnote numbers again.
+
+\pagebreak
+
 \begin{table}
 \centering
 \begin{tabular}{ccc}
@@ -521,30 +560,35 @@ Some\tablefootnote{A table footnote.} & %
 text\tablefootnote{Another table footnote.} & %
 in a table\tablefootnote{A third table footnote.}
 \end{tabular}
-\caption[A table]{A first table\label{tab.first}}
+\caption[A table]{A normal table.\label{tab.normal}}
 \end{table}
 
 Some text.\footnote{Another text footnote.}
 
 \pagebreak
 
+%    \end{macrocode}
+%
+% \pagebreak
+%
+%    \begin{macrocode}
 More text.\footnote{And yet another text footnote.}
 
 \begin{table}[t]
 \centering
 \begin{tabular}{|c|c|c|}
 \hline
-Another\tablefootnote{A $2^{nd}$ table footnote.} & %
-text\tablefootnote{Another $2^{nd}$ table footnote.} & %
-in a table\tablefootnote{A $2^{nd}$ third table footnote.}\\ \hline
+Another\tablefootnote{A $3^{rd}$ table footnote.} & %
+text\tablefootnote{Another $3^{rd}$ table footnote.} & %
+in a table\tablefootnote{A $3^{rd}$ third table footnote.}\\ \hline
 \end{tabular}
-\caption[Another table]{Another table (second one)\label{tab.another}}
+\caption[Another table]{Another table (third one)\label{tab.another}}
 \end{table}
 
-Please note that the table floated to the top of the page. While the
-footnotes are set and (when hyperref is used) hyperlinked, they are
-not automatically adapted. Thus either do not use a footnote at the
-same page before the table, or place the table in
+Please note that Table~\ref{tab.another} floated to the top of the page.
+While the footnotes are set and (when hyperref is used) hyperlinked,
+they are not automatically adapted. Thus either do not use a footnote
+at the same page before the table, or place the table in
 \textquotedblleft here\textquotedblright\ or
 \textquotedblleft bottom\textquotedblright\ position.
 \verb|\clear(double)page|, \verb|h(!)|, \verb|H|~from the
@@ -564,7 +608,7 @@ Some text.\footnote{This is just another text footnote.}
 \begin{sidewaystable}
 \centering%
 \begin{tabular}{ccc}
-Text\tablefootnote{Rotate view for testing the hyperlinks.} & %
+Text\tablefootnote{Please rotate the view for testing the hyperlinks.} & %
 in a\tablefootnote{Another sidewaystable footnote.} & %
 sidewaystable%
 \tablefootnote{Sidewaystable-environment provided by %
@@ -578,15 +622,20 @@ environment\label{tab.sideways}}%
 
 \pagebreak
 
+%    \end{macrocode}
+%
+% \pagebreak
+%
+%    \begin{macrocode}
 A last table, here with float specifier \texttt{H} from the
 float\footnote{\url{http://CTAN.org/pkg/float}} package.
 
 \begin{table}[H]
 \centering
 \begin{tabular}{ccc}
-Another\tablefootnote{A $4^{th}$ table footnote.} & %
-text\tablefootnote{Another $4^{th}$ table footnote.} & %
-in a table\tablefootnote{A $4^{th}$ third table footnote.}
+Another\tablefootnote{A $5^{th}$ table footnote.} & %
+text\tablefootnote{Another $5^{th}$ table footnote.} & %
+in a table\tablefootnote{A $5^{th}$ third table footnote.}
 \end{tabular}
 \caption[A last table]{A very last table\label{tab.floatH}}
 \end{table}
@@ -617,7 +666,7 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 %
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[2011/06/27]
-\ProvidesPackage{tablefootnote}[2011/11/06 v1.0c
+\ProvidesPackage{tablefootnote}[2011/11/19 v1.0d
               Table foot notes (HMM)]
 
 %    \end{macrocode}
@@ -625,7 +674,7 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % A short description of the \xpackage{tablefootnote} package:
 %
 %    \begin{macrocode}
-%% Provides the \tablefootnoteote{...} command
+%% Provides the \tablefootnote{...} command
 %% for footnotes in (sideways)tables.
 
 %    \end{macrocode}
@@ -633,47 +682,68 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % We need the \xpackage{ltxcmds} package by \textsc{Heiko Oberdiek}:
 %
 %    \begin{macrocode}
-\RequirePackage{ltxcmds}[2011/04/18]%      v1.20
+\RequirePackage{ltxcmds}[2011/04/18]%     v1.20
 
 %    \end{macrocode}
 %
+% A last information for the user:
+%
+%    \begin{macrocode}
+%% tablefootnote may work with earlier versions of LaTeX and that
+%% package, but this was not tested. Please consider updating
+%% your LaTeX and packages to the most recent version
+%% (if they are not already the most recent version).
+
+%    \end{macrocode}
+%
+% \indent See subsection~\ref{ss:Downloads} about how to get them.\\
+%
 % When the \xpackage{rotating} package (for |sidewaystable|s) is used,
-% some more packages are needed:
+% it must be recent:
 %
 %    \begin{macrocode}
 \@ifpackageloaded{rotating}{%
   \gdef\tfn@rotating{1}
-  \@ifpackagelater{rotating}{2009/03/28}%  v2.16a
+  \@ifpackagelater{rotating}{2009/03/28}% v2.16a
    {% >= 2009/03/28, OK
    }{% else
      \PackageWarningNoLine{tablefootnote}{%
-       It is required version\MessageBreak
-       2009/03/28 v2.16a (or later) of package rotating,\MessageBreak
-       but only version\MessageBreak
-      `\csname ver@rotating.sty\endcsname'\MessageBreak
+       It is required version\MessageBreak%
+       2009/03/28 v2.16a (or later) of package rotating,\MessageBreak%
+       but only version\MessageBreak%
+      `\csname ver@rotating.sty\endcsname'\MessageBreak%
       is available}%
    }%
-  \RequirePackage{amstext}[2000/06/29]%    v2.01
-  \RequirePackage{setspace}[2000/12/01]%   v6.7
-  \RequirePackage{subcaption}[2011/09/12]% v1.1b
- }{% else
-  \gdef\tfn@rotating{0}%
- }
-
+  \@ifpackageloaded{hyperref}{%
+    \gdef\tfn@rotating{2}
+    \RequirePackage{ifluatex}[2010/03/01]% v1.3
+    \ifluatex%
+      \PackageError{tablefootnote}{%
+        LuaTeX & rotating & hyperref used%
+       }{LuaTeX and the rotating package are used.\MessageBreak%
+         Hyperreferences in sidewaystables will be misplaced%
+         \MessageBreak%
+         regardless of tablefootnote package\MessageBreak%
+         (even without footnotes at all).\MessageBreak%
 %    \end{macrocode}
 %
-% A last information for the user:
+% Bug reported by \textsc{Arno Trautmann}, 2011/11/15 - thanks!
 %
 %    \begin{macrocode}
-%% tablefootnote may work with earlier versions of LaTeX and those
-%% packages, but this was not tested. Please consider updating
-%% your LaTeX and packages to the most recent version
-%% (if they are not already the most recent version).
+         Do not use sidewaystables with hyperreferences\MessageBreak%
+         or use pdflatex instead of LuaTeX.\MessageBreak%
+         (Or fix the LuaTeX/rotating/hyperref error...)\MessageBreak%
+       }%
+    \fi%
+   }{}% else \relax
+ }{% else
+  \gdef\tfn@rotating{0}%
+ }
 
 %    \end{macrocode}
 %
-% \indent See subsection~\ref{ss:Downloads} about how to get them.\\
 % There are no options to be processed.\\
+%
 % We need some definitions:
 %
 %    \begin{macrocode}
@@ -693,11 +763,33 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 %    \begin{macrocode}
 \newcommand{\tfn@footnotemarks}{%
   \footnotemark%
-  \count255=\tfn@footnotetablecount \relax%
-  \count255=\numexpr \count255 - 1 \relax%
-  \xdef\tfn@footnotetablecount{\the\count255}%
+  \@tempcnta=\tfn@footnotetablecount%
+  \advance\@tempcnta by -1%
+  \xdef\tfn@footnotetablecount{\the\@tempcnta}%
 }
 
+%    \end{macrocode}
+%
+% \DescribeMacro{\tfn@footmiscparawarn}
+% When the \xpackage{footmisc} package is used with option |para|,
+% we need to issue a warning. (Any idea how to resolve this issue?)\\
+% It must be given inside of it's own command, because |\ifFN@para| is not
+% defined when \xpackage{footmisc} has not been loaded, and then the 
+% |\fi| would be a |\fi| without |\if| (and \TeX{} does not like single
+% |\fi|s).
+%
+%    \begin{macrocode}
+\newcommand{\tfn@footmiscparawarn}{%
+  \ifFN@para%
+    \PackageWarning{tablefootnote}{%
+      Package footmisc with option para used.\MessageBreak%
+      Unfortunately package tablefootnote is not yet able\MessageBreak%
+      to regard this in sidewaystables. Here the footnotes\MessageBreak%
+      are printed one below the other. Sorry.\MessageBreak%
+     }%
+  \fi%
+  }
+
 %    \end{macrocode}
 %
 % \DescribeMacro{\tfn@footnotetext}
@@ -757,7 +849,7 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % When \xpackage{hyperref} is not loaded, nothing is to be done here.
 %
 %    \begin{macrocode}
-   }{}%
+   }{}% else \relax
 %    \end{macrocode}
 %
 % The |\footnotetext{...}| places the foot note text as usual.
@@ -766,7 +858,16 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
   \ifx\tfn@swt\tfn@footnotezero%
     \footnotetext{#1}%
   \else%
-    \footnotetext{${}^{\text{\textup{\thefootnote}}}$\thinspace #1}%
+    \ltx@ifpackageloaded{footmisc}{\tfn@footmiscparawarn}{\relax}%
+%    \end{macrocode}
+%
+% |\@makefnmark| is |\hbox {\@textsuperscript {\normalfont \@thefnmark }}|,
+% but according to |\show\@thefnmark| here |\@thefnmark| is
+% |{\protect \itshape}| instead of |\thefootnote| (Why?!).
+%
+%    \begin{macrocode}
+    \footnotetext{\hbox {\@textsuperscript {\normalfont \thefootnote %
+      }}\thinspace #1}%
   \fi%
 %    \end{macrocode}
 %
@@ -775,9 +876,9 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % decreases, i.\,e.~$-3$ becomes~$-2$).
 %
 %    \begin{macrocode}
-  \count255=\tfn@footnotetablecount \relax%
-  \count255=\numexpr \count255 + 1 \relax%
-  \xdef\tfn@footnotetablecount{\the\count255}%
+  \@tempcnta=\tfn@footnotetablecount%
+  \advance\@tempcnta by +1%
+  \xdef\tfn@footnotetablecount{\the\@tempcnta}%
 %    \end{macrocode}
 %
 % When it is zero, all footnote texts have been placed, and\\
@@ -819,16 +920,14 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 
 %    \end{macrocode}
 %
-% \DescribeMacro{\tablefootnote}
-% For |sidewaystable|s the |\tfn@tablefootnoteprintout| is placed in a\linebreak
-% |\subcaptionbox|, which can be placed at the same place as the |sidewaystable|:
+% \DescribeMacro{\tfn@swtbox}
+% For |sidewaystable|s the |\tfn@tablefootnoteprintout| is placed in a
+% |\parbox|, which can be placed at the same place as the |sidewaystable|:
 %
 %    \begin{macrocode}
 \newcommand{\tfn@swtbox}{%
-\vspace{0.8cm}%
-\begin{spacing}{0.1}%
-\subcaptionbox*{}[\linewidth][l]{\tfn@tablefootnoteprintout}%
-\end{spacing}%
+\vspace{2\baselineskip}%
+\parbox[b][][t]{\linewidth}{\raggedright \tfn@tablefootnoteprintout}%
 }
 
 %    \end{macrocode}
@@ -845,8 +944,6 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
    }
 %    \end{macrocode}
 %
-% \pagebreak
-%
 % When the \xpackage{rotating} package has been loaded, we need to detect whether the
 % |\tablefootnote| is placed inside of a |sidewaystable|.
 %
@@ -870,10 +967,12 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
       \gdef\tfn@swt{0}%
       \gdef\tfn@fnt{0}%
      }%
-   }{}%
+   }{}% else \relax
 }{%
 %    \end{macrocode}
 %
+% \pagebreak
+%
 % When the \xpackage{etoolbox} package is not available (e.\,g. because of missing
 % \eTeX{}) we~do a workaround:
 %
@@ -922,7 +1021,7 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 %    \end{macrocode}
 %
 % When \xpackage{etoolbox.sty} was not found, and the \xpackage{float} package
-% has been loded, and the float specifier is \texttt{H}, then |\endtable| was
+% has been loaded, and the float specifier is \texttt{H}, then |\endtable| was
 % let to |\float@endH| by the \xpackage{float} package (line~79 of
 % \xpackage{float.sty}, 2001/11/08 v1.3d:\\
 % |\expandafter\let\csname end#1\endcsname\float@endH|), i.\,e.~appending\\
@@ -939,6 +1038,11 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
      }{\relax}
     \tfnorigtable%
    }{%
+%    \end{macrocode}
+%
+% \pagebreak
+%
+%    \begin{macrocode}
      \tfnendorigtable%
      \tfn@tablefootnoteprintout%
      \gdef\tfn@fnt{0}%
@@ -968,28 +1072,39 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 
 %    \end{macrocode}
 %
-% \pagebreak
-%
 % \DescribeMacro{\AtBeginDocument}
-% When the \xpackage{rotating} package has been loaded after the \xpackage{tablefootnote}
-% package, the \xpackage{amstext}, \xpackage{setspace}, and \xpackage{subcaption}
-% packages have not been loaded automatically by the \xpackage{tablefootnote} package
-% (and there was no check of their required version). An error message is given.
-% In this case the |\tablefootnote|s in |sidewaystable|s would not work!
+% When the \xpackage{rotating} package has been loaded after the
+% \xpackage{tablefootnote} package, there was no check of its required version.
+% If additionally the \xpackage{hyperref} package was loaded, there was no check
+% for \LuaTeX{}, and the according error message was never given. Therefore here
+% an error message is given.
 %
 %    \begin{macrocode}
 \AtBeginDocument{%
   \ltx@ifpackageloaded{rotating}{%
     \ifx\tfn@rotating\tfn@footnotezero%
       \PackageError{tablefootnote}{%
-        Package rotating loaded after package tablefootnote}{%
+        Package rotating loaded after tablefootnote}{%
         When using both the rotating and the tablefootnote package,%
         \MessageBreak%
-        the rotating package must be loaded before the tablefootnote%
-        package!%
+        the rotating package MUST be loaded before the tablefootnote%
+        \space package!\MessageBreak%
        }%
     \fi%
-   }{}
+    \ltx@ifpackageloaded{hyperref}{%
+      \def\tfn@footnoteone{1}%
+      \ifx\tfn@rotating\tfn@footnoteone%
+        \PackageError{tablefootnote}{%
+          Package hyperref loaded after tablefootnote}{%
+          When using the rotating, hyperref, and the tablefootnote%
+          \MessageBreak%
+          packages, the hyperref package MUST be loaded before%
+          \MessageBreak%
+          the tablefootnote package!\MessageBreak%
+         }%
+      \fi%
+     }{}%
+   }{}%
   }
 
 %    \end{macrocode}
@@ -1035,28 +1150,22 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % \end{description}
 %
 % When the \xpackage{rotating} package is used (for its |sidewaystable| environment;
-% 2009/03/28, v2.16a, \url{http://ctan.org/pkg/rotating}) also the \xpackage{amstext},
-% \xpackage{setspace}, and \xpackage{subcaption} packages are needed (they will be
-% loaded automatically by the \xpackage{tablefootnote} package, if \xpackage{rotating}
-% is loaded \emph{before} \xpackage{tablefootnote}).
+% 2009/03/28, v2.16a, \url{http://ctan.org/pkg/rotating}), and additionally the
+% \xpackage{hyperref} package, also the \xpackage{ifluatex} package is needed
+% (it will be loaded automatically by the \xpackage{tablefootnote}
+% package, if \xpackage{rotating} and \xpackage{hyperref} are loaded
+% \emph{before} \xpackage{tablefootnote}).
 % \begin{description}
-% \item[-] package \xpackage{amstext}, 2000/06/29, v2.01,
-%           \url{http://ctan.org/pkg/amstext}
-%
-% \item[-] package \xpackage{setspace}, 2000/12/01, v6.7,
-%           \url{http://ctan.org/pkg/setspace}
-%
-% \item[-] package \xpackage{subcaption}, 2011/09/12, v1.1b,
-%           \url{http://ctan.org/pkg/subcaption}
+% \item[-] package \xpackage{ifluatex}, 2010/03/01, v1.3,
+%           \url{http://ctan.org/pkg/ifluatex}
 % \end{description}
-% (loading themselfes further packages).\\
-% When the \xpackage{etoolbox} package is not available, the
+% When the \xpackage{etoolbox} package is not available, additionally the
 % \xpackage{letltxmacro} package is used:
 % \begin{description}
 % \item[-] package \xpackage{letltxmacro}, 2010/09/02, v1.4,
 %           \url{http://ctan.org/pkg/letltxmacro}
 % \end{description}
-% (possibly loading further packages).\\
+% (both packages probably loading further packages).\\
 %
 % \DescribeMacro{tablefootnote-example.tex}
 % The \texttt{tablefootnote-example.tex} requires the same files as all
@@ -1079,7 +1188,7 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % \item[-] package \xpackage{hyperref}, 2011/10/01, v6.82j,
 %           \url{http://ctan.org/pkg/hyperref}
 %
-% \item[-] package \xpackage{tablefootnote}, 2011/11/06, v1.0c,\\
+% \item[-] package \xpackage{tablefootnote}, 2011/11/19, v1.0d,\\
 %           \url{http://ctan.org/pkg/tablefootnote}\\
 %   (Well, it is the example file for this package, and because you
 %    are reading the documentation for the \xpackage{tablefootnote} package,
@@ -1089,11 +1198,12 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 %
 % \DescribeMacro{Oberdiek}
 % \DescribeMacro{holtxdoc}
+% \DescribeMacro{ifluatex}
 % \DescribeMacro{letltxmacro}
 % \DescribeMacro{ltxcmds}
 % All packages of \textsc{Heiko Oberdiek's} bundle `oberdiek'
-% (especially \xpackage{holtxdoc}, \xpackage{letltxmacro}, and \xpackage{ltxcmds})
-% are also available in a TDS compliant ZIP archive:\\
+% (especially \xpackage{holtxdoc}, \xpackage{ifluatex}, \xpackage{letltxmacro},
+% and \xpackage{ltxcmds}) are also available in a TDS compliant ZIP archive:\\
 % \CTAN{install/macros/latex/contrib/oberdiek.tds.zip}.\\
 % It is probably best to download and use this, because the packages in there
 % are quite probably both recent and compatible among themselves.\\
@@ -1275,12 +1385,16 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 % \section{Acknowledgements}
 %
 % I would like to thank \textsc{Heiko Oberdiek} for providing
-% the \xpackage{hyperref}, \xpackage{letltxmacro}, \xpackage{ltxcmds}, as well as
-% a~lot~(!) of other useful packages (from which I also got everything
-% I know about creating a file in \xext{dtx} format, ok, say it: copying),
-% and for information about the \pdfTeX{}-bug,
-% and the \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex}
-% newsgroups for their help in all things \TeX{}.
+% the \xpackage{hyperref}, \xpackage{ifluatex}, \xpackage{letltxmacro},
+% \xpackage{ltxcmds}, as well as a~lot~(!) of other useful packages
+% (from which I also got everything I know about creating a file in \xext{dtx}
+% format, ok, say it: copying), and for information about the \pdfTeX{}-bug,
+% \textsc{Arno Trautmann} for reporting the bug (misplaced hyperreferences in
+% |sidewaystable|s using \LuaTeX{}, independently of the \xpackage{tablefootnote}
+% package or footnotes at all)\footnote{ The \xpackage{tablefootnote} package %
+% seems to be helpful to detect issues in other things (which does not mean %
+% that it does not create its own bugs!).} and the \Newsgroup{comp.text.tex}
+% and \Newsgroup{de.comp.text.tex} newsgroups for their help in all things \TeX{}.
 %
 % \pagebreak
 %
@@ -1298,10 +1412,49 @@ tablefootnote\footnote{\url{http://CTAN.org/pkg/tablefootnote}} package.
 %   \begin{Version}{2011/11/06 v1.0c}
 %     \item Replaced |^{\text{\thefootnote}}| by |{}^{\text{\textup{\thefootnote}}}|.
 %     \item Bug fix: When \xpackage{etoolbox.sty} was not found, and the \xpackage{float}
-%             package had been loded, and the float specifier was \texttt{H},
+%             package had been loaded, and the float specifier was \texttt{H},
 %             then the |\tablefootnote|s were not printed for that table. Fixed.
 %     \item Minor details.
 %   \end{Version}
+%   \begin{Version}{2011/11/19 v1.0d}
+%     \item Replaced |{}^{\text{\textup{\thefootnote}}}| by
+%             |\textsuperscript{\thefootnote}|, therefore the \xpackage{amstext}
+%             package is no longer required by the \xpackage{tablefootnote} package.
+%     \item \xpackage{lscape} and \xpackage{pdflscape} package now work with
+%             \xpackage{tablefootnote} (except for using a \texttt{sidewaystable} on
+%             a \texttt{landscape} page).
+%     \item Added information about footnotes in \texttt{sidewaystable} being printed
+%             one below the other, even if \xpackage{footmisc} package with option
+%             \texttt{para} is used.
+%     \item Redefined |\tfn@swtbox| from
+%  \begin{verbatim}
+%  \vspace{0.8cm}%
+%  \begin{spacing}{0.1}%
+%  \subcaptionbox*{}[\linewidth][l]{\tfn@tablefootnoteprintout}%
+%  \end{spacing}%
+%  \end{verbatim}
+%             to
+%  \begin{verbatim}
+%  \vspace{2\baselineskip}%
+%  \parbox[b][][t]{\linewidth}{\raggedright \tfn@tablefootnoteprintout}%
+%  \end{verbatim}
+%             , therefore the \xpackage{setspace} and \xpackage{subcaption} packages
+%             are no longer required by the \xpackage{tablefootnote} package.
+%     \item No longer uses |\numexpr|, therefore also usable without \eTeX{}.
+%     \item Replaced |\textsuperscript{\thefootnote}| by
+%             |\hbox {\@textsuperscript {\normalfont \thefootnote }}|,
+%             which is next to the original definition of |\@makefnmark|
+%             (|\hbox {\@textsuperscript {\normalfont \@thefnmark }}|,
+%             but according to |\show\@thefnmark| here |\@thefnmark| is
+%             |{\protect \itshape}| instead of |\thefootnote|).
+%     \item Added an error message, when \LuaTeX{}, \xpackage{rotating} package, and
+%            \xpackage{hyperref} package are used together. (Hyperreferences in
+%            |sidewaystable|s are misplaced, independently of the
+%            \xpackage{tablefootnote} package or footnotes at all. (Bug reported
+%            by \textsc{Arno Trautmann}, 2011/11/15 - thanks!)
+%     \item Added footnotesymbol-footnote-numbers in the example.
+%     \item Several details.
+%   \end{Version}
 % \end{History}
 %
 % \bigskip
-- 
cgit v1.2.3

