3

I am referencing the same footnote multiple times within a table. I have been able to use this answer to reference the same footnote in multiple spots: Multiple references to the same footnote with hyperref support - is there a better solution?

Now I am stuck as to how to get rid of the references to the footnotes which reappear before my text (after the table). Here is my example:

\documentclass[12pt]{article}
\usepackage{footmisc}

\begin{document}
\begin{table}[!htb]
    \centering
    \begin{tabular}{lll}
    & col1 & col2\\\hline
    row1 & val11\footref{fn:note1} & val12\\
    row2 & val21\footref{fn:note1} & val22\footref{fn:note2}\\
\end{tabular}   \caption{Caption for table.}
\end{table}
\footnote{\label{fn:note1}First note}
\footnote{\label{fn:note2}Second note}
I do not want my text to be preceded by the superscripts 1 and 2 referencing the footnotes from the table.
\end{document}

This yields the following, which has the unwanted superscripts 1 2 right before my text: enter image description here

How can I get rid of these unwanted superscripts (the extra ones)? Thanks!

1
  • Welcomet to TeX.SE.
    – Mico
    Mar 8, 2022 at 5:59

2 Answers 2

5

The tools of the threeparttable package are great for tables that contain repeated footnotes. The footnote markers -- inserted via \tnote directives needn't be numbers; the arguments of the \tnote directives can be numerals, letters, or just about any other symbol, and they don't have to occur in any particular order; your readers, though, might appreciate if you do impose some order...

Formally, a threeparttable environments has three parts (hence the name): a tabular-like environment (could also be tabular* or tabularx), a tablenotes environment, and a \caption directive. The code automatically limits the widths of parts 2 and 3 to that of the tabular-like environment.

enter image description here

\documentclass[12pt]{article}
\usepackage{threeparttable} % for "\tnote" macro and "tablenotes" environment
\usepackage{booktabs} % for well-spaced horizontal rules (\toprule, \midrule, etc.)

\begin{document}
\begin{table}[!htb]
\centering
    \begin{threeparttable}
    \begin{tabular}{ lccc }
    \toprule
    & col1 & col2 & col3\\ 
    \midrule
    row1 & val11\tnote{1} & val12          & val13 \\
    row2 & val21\tnote{1} & val22\tnote{z} & val23\tnote{z} \\
    \bottomrule
    \end{tabular}   

    \smallskip
    \footnotesize
    \begin{tablenotes}
    \item[1] A footnote which happens to be quite long.
    \item[z] A fairly short footnote
    \end{tablenotes}
    \caption{Caption of table.}    
    \end{threeparttable}
\end{table}

The text that follows the table is no longer preceded by superscript numerals 1 and 2.
\end{document}
4
  • Thanks, this looks promising but I am wary of the fact that these footnotes are created within the table space, rather than added to the other footnotes I already have (and for which I would like the counter to simply increment). I am currently checking out if it is possible with this package...
    – sg1234
    Mar 8, 2022 at 13:52
  • I might have been wrong in assuming the proper format was to include table footnotes with the other footnotes. Therefore I have chosen the alternative method of including a single footnote in the caption, which then details all the things relating to the footnotes in the table. For my purposes, it is sufficient. However, given that my previous needs were different, I'm unsure what to do with this question now: should I accept this answer although it is not exactly what I would have liked (but what I would have liked is maybe poor form)? Happy I learned about threeparttable so +1, thanks, lmk.
    – sg1234
    Mar 8, 2022 at 15:04
  • @sg1234 - I suppose there can be important regional differences in how and where table-related footnotes get placed. I suppose that as long as readers can easily and unambiguously make the connections between the footnote markers and their associated text, it probably doesn't matter greatly whether the footnote text is placed (a) close to the table itself, as in the example above, or (b) at the bottom of the page, possibly intermingled with other footnotes. I guess one reason my answer went with option (a) as it's the sensible option if an entire page consists of a table.
    – Mico
    Mar 9, 2022 at 11:29
  • 1
    I am accepting your answer because it might help someone looking for option (a), but if you can find the time to amend it with a pointer, link or solution for option (b) I think it would make the answer even more valuable (though i am by no means making a request here :-), it would also help me in case I change my mind and go back to individual refs in the cells). I think a requirement for such an answer would be for the numbering to be incorporated within the general footnotes numbering.
    – sg1234
    Mar 9, 2022 at 19:45
0

With the talltblr table, which is tabularray equivalent to threeparttable package you can easy repeat table footnotes:

\documentclass[12pt]{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\SetTblrStyle{note}{font=\footnotesize, verb}

\begin{document}
    \begin{table}[!htb]
    \centering
\begin{talltblr}[
caption = {Caption of table.},
  label = {tab: test},
note{1} = {A footnote which happens to be more than one line long. }, % <---
note{2} = {Fairly short footnote}, % <---
                ]{lccc}
    \toprule
        & column 1  & column 2 & column 3               \\
    \midrule
row1    & value 11\TblrNote{1}
                    & value 12  & value 13              \\
row2    & value 21\TblrNote{1}
                    & value 22\TblrNote{2}
                                & value 23\TblrNote{2}  \\
    \bottomrule
    \end{talltblr}
\end{table}
\end{document}

enter image description here

You must log in to answer this question.

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