高级表格脚注

高级表格脚注

我需要在表格上添加脚注,如下例所示,取自《物理评论 B》:

在此处输入图片描述

由于 Phys. Rev. B 是用 LaTeX 编写的(修订版TeX),我相信任何课程都应该可以做到这一点。我正在使用 Classic Thesis 和 ArsClassica 包。我已经使用 minipage 实现了非常类似的效果:

\begin{table}
    \begin{minipage}{\textwidth}
    \centering
    \begin{tabular}{l c c c c c c}
    \toprule
    & $a$ (\si{\angstrom}) & $c/a$ & $u$ & $B_0$ (\si{\giga\pascal}) & $B_0'$ & $E_g$ (\si{\electronvolt})\\
    \midrule
    GGA & \num{3.126} & \num{1.602} & \num{0.382} & \num{191} & \num{3.67} & \num{4.10}\\
    GGA\footnote{\cite{Stampfl1999}.} & \num{3.113} & \num{1.619} & \num{ 0.380} & \num{192} & \num{3.69} & \num{4.25}\\
    GGA\footnote{\cite{Zoroddu2001}.} & \num{3.110} & \num{1.606} & \num{0.382} & - & - & - \\
    Exp.\footnote{\cite{Stampfl1999}.} & \num{3.111} & \num{1.601} & \num{0.385} & \num{185}-\num{212} & \num{5.7}-\num{6.3}& \num{6.28} \\
    Exp.\footnote{\cite{Schulz1977}.} & \num{3.110} & \num{1.601} & \num{0.382} & \num{202} & - & - \\

    \bottomrule
    \end{tabular}
    \end{minipage}

    \caption{Caption on top.}

\end{table}

结果如下:

在此处输入图片描述

但是,这里你会发现一个大问题:由于我使用了宽度为 的 minipage \textwidth,脚注没有与表格对齐(如示例中所示)。可以实现这种对齐吗?如何实现?


根据 Bernard 的回答,我使用了这个:

\begin{table}
    \centering
    \begin{threeparttable}
    \caption{Comparison of calculated binding energy and bond lengths for \ce{O2} and \ce{N2} with experimental and other theoretical values.}
    \begin{tabular}{l c c c c}
    \toprule
    & $E_b^\text{\ce{O2}}$ (\si{\electronvolt}) & $d_\text{\ce{O}-\ce{O}}$ (\si{\angstrom})& $E_b^\text{\ce{N2}}$ (\si{\electronvolt}) & $d_\text{\ce{N}-\ce{N}}$ (\si{\angstrom})\\
    \midrule
    GGA & \num{-5.855} & \num{1.215} & \num{-10.138} & \num{1.096} \\
    GGA\tnote{a}& - & - & \num{-9.867}& \num{1.105}\\
    GGA\tnote{b} & - & - & \num{-10.558} & \num{1.113}\\
    Exp.\tnote{c} & \num{-5.12} & \num{1.21} & - & - \\
    Exp.\tnote{a} & - & - & \num{-9.9}& \num{1.10}\\
    \bottomrule
    \end{tabular}

    \begin{tablenotes}
        \item[a] \cite{Stampfl1999}.
        \item[b] \cite{Zoroddu2001}.
        \item[c] \cite{Wang2008}.
    \end{tablenotes}
    \end{threeparttable}
\end{table}

然而,在我看来,标题有一个问题,它显然被限制在与表格相同的长度内:

在此处输入图片描述

答案1

您可以使用 来实现这一点threeparttable,它定义了一个同名环境和一个tablenotes环境。如果您将标题放在tablethreeparttable环境之间,则标题的宽度为textwidth;如果您将其放在里面 threeparttable,它的宽度将是表格的实际宽度:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry} 
\usepackage{booktabs, caption}
\captionsetup{labelfont=sf, width =\textwidth}
\usepackage{siunitx}
\usepackage[flushleft]{threeparttable}

\begin{document}

\begin{table}[!htbp]
\centering
    \caption{Caption on top. A long long long and very very silly caption . A long long long and very very silly caption.}
  \begin{threeparttable}
    \begin{tabular}{l c c c c c c}
      \toprule
                    & $a$ (\si{\angstrom}) & $c/a$ & $u$ & $B_0$ (\si{\giga\pascal}) & $B_0'$ & $E_g$ (\si{\electronvolt}) \\
      \midrule
      GGA & \num{3.126} & \num{1.602} & \num{0.382} & \num{191} & \num{3.67} & \num{4.10} \\
      GGA\tnote{a} & \num{3.113} & \num{1.619} & \num{ 0.380} & \num{192} & \num{3.69} & \num{4.25} \\
      GGA\tnote{b} & \num{3.110} & \num{1.606} & \num{0.382} & -- & -- & -- \\
      Exp.\tnote{c} & \num{3.111} & \num{1.601} & \num{0.385} & \num{185}-\num{212} & \num{5.7}-\num{6.3} & \num{6.28} \\
      Exp.\tnote{d} & \num{3.110} & \num{1.601} & \num{0.382} & \num{202} & -- & -- \\
      \bottomrule
    \end{tabular}
    \begin{tablenotes}
      \item[a]\cite{Stampfl1999}
      \item[b]\cite{Zoroddu2001}
      \item[c]\cite{Stampfl1999}
      \item[d]\cite{Schulz1977}
    \end{tablenotes}
  \end{threeparttable}
  \label{table2}
\end{table}



\begin{table}[!htbp]
\centering
  \begin{threeparttable}
    \caption{Caption on top. A long long long and very very silly caption . A long long long and very very silly caption.}

    \begin{tabular}{l c c c c c c}
      \toprule
                    & $a$ (\si{\angstrom}) & $c/a$ & $u$ & $B_0$ (\si{\giga\pascal}) & $B_0'$ & $E_g$ (\si{\electronvolt}) \\
      \midrule
      GGA & \num{3.126} & \num{1.602} & \num{0.382} & \num{191} & \num{3.67} & \num{4.10} \\
      GGA\tnote{a} & \num{3.113} & \num{1.619} & \num{ 0.380} & \num{192} & \num{3.69} & \num{4.25} \\
      GGA\tnote{b} & \num{3.110} & \num{1.606} & \num{0.382} & -- & -- & -- \\
      Exp.\tnote{c} & \num{3.111} & \num{1.601} & \num{0.385} & \num{185}-\num{212} & \num{5.7}-\num{6.3} & \num{6.28} \\
      Exp.\tnote{d} & \num{3.110} & \num{1.601} & \num{0.382} & \num{202} & -- & -- \\
      \bottomrule
    \end{tabular}
    \begin{tablenotes}
      \item[a]\cite{Stampfl1999}
      \item[b]\cite{Zoroddu2001}
      \item[c]\cite{Stampfl1999}
      \item[d]\cite{Schulz1977}
    \end{tablenotes}
  \end{threeparttable}
  \label{table2}
\end{table}

\end{document} 

在此处输入图片描述

答案2

楼主评论说他喜欢我的回答在图的 \caption 中使用 \footnote,尽管他/她对自动计算宽度感兴趣minipage。这里我展示了如何做到这一点。我将tabular内容放入一个\def以便于调用,然后将其放在一个临时的中\hbox。然后我可以使用\wd0作为minipage宽度,只需tabular使用其中定义的宏调用内容即可。

\documentclass[12pt]{article}
\usepackage{boxhandler}
\begin{document}
This is an alternate way to do a footnote in a table, with the minipage
environment.
\begin{table}[ht]
  \def\tblcontent{\footnotesize\begin{tabular}{|l|c|c|}
    \hline
    Title & Column 1 & Column 2\\
    \hline
    First Test & 1.234 & 5.389\footnote{\scriptsize This is the
     footnote text blah blah blah blahty blah}\\
    \hline
    Second Test & 3.894 & 1.586~~\\
    \hline
  \end{tabular}}
  \setbox0=\hbox{\tblcontent}
  \centering
  \caption{Caption goes here}
  \begin{minipage}{\wd0}   % GUESS (OR CALCULATE) MINIPAGE WIDTH
    \renewcommand\footnoterule{}     % ELIMINATE LITTLE LINE SEPARATER
    \tblcontent
    \vspace{-2ex}                    % SHIFT FOOTNOTE UP
  \end{minipage}
\end{table}
\end{document}

在此处输入图片描述

相关内容