4

I have some issues in the using of \footnote in a table. My code is as follows, in which I use the packages \usepackage{footnote} and \usepackage{tabularx}. But the text of footnote is not shown below the table, where only the superscript "1" and "2" appear aside the relevant items. I need the superscript shown as "a", "b", "c",...

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[latin1]{inputenc}
\usepackage{multirow}
\usepackage{geometry}\geometry{top=3cm,bottom=3cm,left=3.7cm,right=2.5cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\setlength{\headheight}{15pt}

\setcounter{secnumdepth}{4}

\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\Huge\bfseries}{\chaptertitlename 
\ \thechapter}{15pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-3\baselineskip}{20pt}[3.7cm]

\renewcommand{\figurename}{Figure}
\renewcommand{\bibname}{References}
\hyphenpenalty=10000
\tolerance=2500
\usepackage{longtable}
\raggedbottom

\usepackage{cite}
\usepackage{hyperref}

\usepackage{nomentbl}
\usepackage[toc,page]{appendix}
\usepackage{enumitem,calc}

\usepackage{booktabs}
\usepackage{bigstrut}
\usepackage{rotating}
\usepackage{multirow}

\usepackage{footnote}
\usepackage{tabularx}

\usepackage{lscape}
\usepackage{setspace}\linespread{1.6}
\setlength\parskip{3pt plus 1.5pt minus 1.5pt}%paragraph

\begin{document}
Some text here, as listed in Table~\ref{tab}.

\begin{table*}
  \centering
  \caption{Caption of the table}\label{tab}
  \begin{tabularx}{\textwidth}{lccc}
  \toprule
       x11            &x12 \footnotemark[1]   &x13 \footnotemark[2]    &x14 \footnotemark[2] \\
       \midrule
       x21            &x22                    &x23                     &x24                  \\
       x31            &x32 \footnotemark[1]   &x33 \footnotemark[1]    &x34                  \\
       \bottomrule
  \end{tabularx}
  \footnotetext[1]{This is the 1st footnote}%
  \footnotetext[2]{This is the 2nd footnote}%
\end{table*}

\end{document}

update: I have corrected the code according to the comment of @ Skillmon.

9
  • 1
    If you include booktabs maybe you should use it for the horizontal lines in your table. You should use \toprule and \bottomrule instead of the two \hlines and \midrule for the one beneath the table's headrow. And your MWE is missing the package tabularx.
    – Skillmon
    Jul 29, 2017 at 13:01
  • 1
    And don't use \label inside of \caption but after it.
    – Skillmon
    Jul 29, 2017 at 13:03
  • @ Skillmon thanks for your very useful suggestion. After correction, the footnotes still do not appear...
    – jsxs
    Jul 29, 2017 at 13:39
  • enclose table in in minipage
    – Zarko
    Jul 29, 2017 at 13:41
  • @Zarko, Sorry, may be it is a very easy and obvious problem for others. I don't very understand how to use the minipage. Could you please show it in my code? Thanks!
    – jsxs
    Jul 29, 2017 at 13:46

2 Answers 2

3

enter image description here

beside threeparttable you can use "classic" approach as I mentioned in comment above:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[latin1]{inputenc}
\usepackage{multirow}
\usepackage{geometry}\geometry{top=3cm,bottom=3cm,left=3.7cm,right=2.5cm}
\usepackage{booktabs}
\usepackage{footnote}
\usepackage{tabularx}

\begin{document}
Some text here, as listed in Table~\ref{tab}.

\begin{table*}[ht]
    \begin{minipage}{\linewidth}
        \renewcommand\footnoterule{}
        \renewcommand{\thefootnote}{\alph{footnote}}
  \caption{Caption of the table}\label{tab}
  \begin{tabularx}{\textwidth}{Xccc}
  \toprule
       x11            &x12 \footnotemark[1]   &x13 \footnotemark[2]    &x14 \footnotemark[2] \\
       \midrule
       x21            &x22                    &x23                     &x24                  \\
       x31            &x32 \footnotemark[1]   &x33 \footnotemark[1]    &x34                  \\
       \bottomrule
  \end{tabularx}
      \vspace{-1.5ex}% <-- added
  \footnotetext[1]{This is the 1st footnote}%
  \footnotetext[2]{This is the 2nd footnote}%
    \end{minipage}
\end{table*}

\end{document}

note: if you use tabularx environment for table, than at least one column had to be X type.

3
  • @Skillmon, no. if i do such, footnotemarks in table are numbers bit at footnotext are letters.
    – Zarko
    Jul 29, 2017 at 14:02
  • Thanks for your solution. The table now occupies one new page. However, I hope it can fit in a page together with the text.
    – jsxs
    Jul 29, 2017 at 15:11
  • @jsxs, of course now your table are taller and require more space on page, however both answers solve your footnote problem :), so remove acceptance of one of them because of new problem which is not concern of this question, is not very nice.
    – Zarko
    Jul 29, 2017 at 18:13
3

Floating environments (table, figure) do not support footnotes. There are several workarounds, e.g. wrapping the tabular in a minipage. Another option is offered by package threeparttable:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage{booktabs}
\usepackage{threeparttable}

\begin{document}
\begin{table*}
  \centering
  \begin{threeparttable}[b]
    \caption{Caption of the table}\label{tab}
    \begin{tabular}{lccc}
      \toprule
      header11 &x12\tnote{a} &x13\tnote{b} &x14\tnote{b} \\
      \midrule
      dummy21 &x22          &x23          &x24 \\
      hello31 &x32\tnote{a} &x33\tnote{a} &x34 \\
      \bottomrule
    \end{tabular}
    \begin{tablenotes}
      \footnotesize
      \item[a] This is the 1st footnote.
      \item[b] This is the 2nd footnote.
    \end{tablenotes}
  \end{threeparttable}
\end{table*}
\end{document}

Result

3
  • Thanks for your nice solution. I can only accept one answer, which allows the footnote below the table numbered by letter rather than number.
    – jsxs
    Jul 29, 2017 at 14:33
  • @jsxs There is nothing special about the marker, just switch to letters as in the updated answer. Jul 29, 2017 at 14:38
  • @ Heiko Oberdiek, With either your or Zarko's solutions, the table occupies one new page. I hope it can fit in a page together with the text.
    – jsxs
    Jul 29, 2017 at 15:13

You must log in to answer this question.

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