[Tex/LaTex] Tabularx, Caption and Footnotes

captionsfloatsfootnoteshyperreftabularx

I need to have some tables with the following requirements:

  1. The need to be of width \textwidth;
  2. The caption has to be on top of the table even at automatic page breaks;
  3. The tables should not float;
  4. There will be multiple footnotes in the table;
  5. There will be multiple references to the same footnote;
  6. References should be hyperlinked to the footnote; and
  7. The footnotes should be at the bottom of the page

Additional issues:

  1. When I use \captionof{table}, the caption and table get separated at a page break. Using \newpage before \captionof works, but I have to do that manually (I don't really get where it would be desirable to have the caption on one page and the table on the next?)
  2. Placing the tabularx in a table environment solves the caption problem, but that makes the tables float, which I don't want.
  3. I want footnotes to be referenced with hyperref. The superscripts are clickable, but just make me jump to the front page.
  4. Including the tabularx in a minipage worked, but only with the \footnote included in the minipage, which makes the \footnotes appear right after the table in the middle of the page.

Here is my MWE.

\documentclass[a4paper]{scrartcl}
\usepackage[colorlinks=true]{hyperref}
\usepackage{tabularx, multirow} % tabularx: auf Textbreite vergrößern
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}


\begin{
 \section{BLA}
    \captionof{table}{table1}\label{tab:1}
    \noindent\begin{tabularx}{\textwidth}{|X|R|}
        \hline\rule{0pt}{14pt}\ignorespaces
    \textbf{\large one} & \textbf{\large two}\\
        \hline\rule{0pt}{11pt}\ignorespaces
        three & four \footnotemark[3]
        \\\hline\rule{0pt}{11pt}\ignorespaces
        five & six \footnote{eight}
    \\\hline\rule{0pt}{11pt}\ignorespaces
        nine & ten \footnotemark[3]
        \\\hline
      \end{tabularx}
      \footnotetext[3]{seven}
\end{document}

Here, footnote 3 has not been linked and footnote 1 makes a jump to the beginning of the page.

Best Answer

Here is a solution that should solve most problems: I use the ltablex package, which is a extension of longtable to tabularx. Hence the caption shouldn't be separated from the table body, and the table doesn't float. Moreover, komascript has a footref`` command that works withhyperef`. So it suffices to add a label when the footnote appears first.

However, there's a drawback: your defintion of the R column type doesn't work in this context. So I used the makecell package: it allows defining the alignment of individual types of cells, through its \makecell command. In addition, I suppressed the repeated invisible vertical rules, and adjusted the height and depth of rows with the \makegapedcells command.

\documentclass[a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{fourier, heuristica}
\usepackage[colorlinks=true]{hyperref}
\usepackage{array, ltablex, multirow} % tabularx: auf Textbreite vergrößern

\usepackage{makecell}
\setcellgapes{5pt}
\makegapedcells
\renewcommand\theadfont{\bfseries}
\renewcommand\cellalign{rc}

\begin{document}

\section{BLA}
Text text text text text text text text text text text text text text text text textt text text text text text text text text text text text text text text text text\footnote{A footnote in main text.}.

\begin{tabularx}{\textwidth}{|X|X|}
\caption{A Table}\label{tab:1}\\
\hline
\thead{\large one} & \thead{\large two}
\endfirsthead
\hline
three & \makecell{four\,\footnote{Seven.\label{fn:3}}} \\
\hline
five & \makecell{six\,\footnote{Eight.}} \\
\hline
nine & \makecell{ten\,\footref{fn:3}} \\
\hline
\end{tabularx}
%\end{center}

Text text text text text text text text text text text text text text text text textt text text text text text text text text text text text text text text text text\footnote{Another footnote in main text.}.

\end{document} 

enter image description here