7

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.

1 Answer 1

5

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

4
  • Ok, Tank you for your answer. I couldn't find the package heuristica, though.
    – user54216
    Commented Jun 8, 2014 at 21:05
  • Ok, thank you for your answer. I couldn't find the package heuristica, though. Without it, the output looks like yours, but the links in the table don't make me jump to the footnotes, but to the top of the page. (How do I include my pdf output in a post btw? And how to get a newline in comments and stop posting immediately when I hit Enter because I'm used to it to do that? I think that's my 3rd edit or so because of that^^) (now I couldn't even edit my 1st (unintendedly oosted) comment...)
    – user54216
    Commented Jun 8, 2014 at 21:13
  • If you have TeX Live (2013) heuristica is not in the distribution (too recent). It's not very important: it brings a complement of expert fonts to fourier/utopia (true smallcaps, oldstyle numbers, superior and inferior figures, I believe). For the .pdf output, as far as I know, you have to make a screenshot – preferably in .png format. For a new line in comments, I'd like to know myself…
    – Bernard
    Commented Jun 8, 2014 at 21:22
  • Ok. So the heuristica package should have nothing to do with the links, right? hm, unfortunately this doesn't do anything against my problem with the links in the table footnotes...
    – user54216
    Commented Jun 9, 2014 at 21:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .