7

What I need to do: footnotes written (typset) in the same paragraph/line within tabular environment. What I am doing:

\begin{table}[!htb]
  \caption{Caption text.}
  \label{tab:text}
  \begin{ruledtabular}
    \begin{tabular}{p}
      & \multicolumn{1}{c}{Reference} \\ \cline{2-1}
      \textrm{Text} & \colrule
      Text & Text & A\footnote{one} B\footnote{Two} & C\footnote{Three} \\
    \end{tabular}
  \end{ruledtabular}
\end{table}

This yields footnotes on three lines at the bottom of the table

a One

b Two

c Three

What I am trying to achieve:

a One; b Two; c Three

After some search, I stumbled upon footmisc package with its para option.

\usepackage[para]{footmisc}

This declaration does nothing but causes result above to be centered instead (of ragged to the right).

Any suggestions will be much appreciated.

ETA: here is a concrete MWE

\documentclass[%
 reprint,
]{revtex4-1}
\usepackage{graphicx}
\usepackage{dcolumn}
\usepackage{color}
\usepackage{float}
%\usepackage[para]{footmisc}
%\usepackage{dblfnote}
\begin{document}
\renewcommand{\arraystretch}{1.05}
\begin {table}[!h]
\caption{\label{tab1}
Table.}
\begin{ruledtabular}
\begin{tabular}{ccc}
\textrm{Label}&
\textrm{Value} &\\
\colrule
1 & One\footnote{testl} \\
2 & Two\footnote{test2} \\
3 & Three\footnote{test3} \\
\end{tabular}
\end{ruledtabular}
\end{table}
\end{document}

which compiles to

enter image description here

2 Answers2

6

You can use threeparttable and the para option from the threeparttable package. However, the space between the notes and the following text is not optimal; this can be corrected with the help of the etoolbox package, to add some spacing at the end of threeparttable. I patching of \TPT@doparanotes was also needed in order to get the appropriate font size for table notes:

\documentclass[reprint]{revtex4-1}
\usepackage[para]{threeparttable}
\usepackage{etoolbox}
\usepackage{lipsum}

% space below table notes
\AtEndEnvironment{threeparttable}{\vskip10pt}{}{}% change here
\makeatletter
% font size for table notes
\patchcmd{\TPT@doparanotes}
  {\TPT@hsize}
  {\TPT@hsize\footnotesize}
  {}
  {}
\makeatother

\begin{document}

\lipsum[4-7]
\begin{threeparttable}[!ht]
  \caption{Caption text.}
  \label{tab:text}
\begin{ruledtabular}
\begin{tabular}{cc}
\textrm{Label}&
\textrm{Value} \\
\colrule
1 & One\tnote{a} \\
2 & Two\tnote{b} \\
3 & Three\tnote{c} \\
\end{tabular}
\begin{tablenotes}
\item[a] the first footnote note.
\item[b] the second note.
\item[c] the third footnote note.
\end{tablenotes}
\end{ruledtabular}
\end{threeparttable}
\lipsum[4]

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • Thanks. Got desired output. Minus, I lost formatting. The threeparttable i.e. table object is now centred (needs to be right ragged/justified). Furthermore, I lost the natural spacing between the end of the table and the following text paragraph. Are there options to control these 2 aspects? – user45903 Feb 12 '14 at 19:09
  • @user45903 Please see my updated answer for a possible solution for the spacing problem. The other issue (the one about formatting), I don't quite understand it. Could you please describe in more detail which seems to be the problem? Better yet, could you please compose a little test document (like the one in my answer) and add it to your question showing the difference bettwen a regular table formatting and the one with threeparttable? – Gonzalo Medina Feb 12 '14 at 19:29
  • Many thanks @ G. Medina. The document paragraphs are in a justified format. The table however is now centred. The desired output is to have the table justified too. Note: I am using a 2-column document/typset. Unfortunately, I cannot replicate the effect on the test MWE above. – user45903 Feb 12 '14 at 19:44
  • @user45903 How are you achieving text justification? It's hard to diagnose the problem without any code. Please try to compose an example code reproducing the problem. – Gonzalo Medina Feb 12 '14 at 20:04
  • @G.Medina. Revtex4-1 controls the formatting, no requirements from my part. Leaving a space (1 line) between text and table makes the latter adhere to text justification (??). Skipping the space renders it centred on the column. Unexpected. – user45903 Feb 12 '14 at 20:22
  • Update: the threeparttable /tnote method definitely yields footnotes which are bigger in size (same size as paragraph text) than the table /footnote one, where the footnote are smaller.It is the latter output that is desired. – user45903 Feb 12 '14 at 21:38
  • @user45903 I've added a solution for the font size of the notes. – Gonzalo Medina Feb 12 '14 at 22:43
0

Very simple:

 ... your table
\end{tabular}
$^a$ the first footnote note, $^b$ the second, $^c$ the third.
\end{threeparttable}
\end{table}
  • 3
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Dec 26 '22 at 17:06
  • 1
    Your answer does not help for large documents with complicated footnoting, since the footnote markers need to change as more text and footnotes are added. – Benjamin McKay Dec 27 '22 at 14:52