LaTeX 中表格的脚注

发布于 2024-09-02 08:18:56 字数 87 浏览 2 评论 0原文

当我对表中的值执行 \footnote{} 时,脚注不会显示。我怎样才能让它显示出来?另外,是否可以让它显示在表格底部而不是页面底部?

When I do \footnote{} for a value in a table, the footnote doesn't show up. How do I get it to show up? Also, is it possible to get it to show up at the bottom of the table rather than the bottom of the page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

伤痕我心 2024-09-09 08:18:56

没有任何头痛的最好方法是使用
来自 tablefootnote 包的 \tablefootnote 命令。将以下内容添加到您的序言中:

\usepackage{tablefootnote}

它不需要额外的技巧就可以工作。

The best way to do it without any headache is to use the
\tablefootnote command from the tablefootnote package. Add the following to your preamble:

\usepackage{tablefootnote}

It just works without the need of additional tricks.

倾城泪 2024-09-09 08:18:56

这是 LaTeX 中的一个经典难点。

问题是如何使用浮动(图形和表格,类似的对象)和脚注进行布局。特别是,很难确定为相关脚注腾出空间不会造成麻烦来为浮动选择一个位置。因此,标准的 tabularfigure 环境甚至不会尝试。

你能做什么:

  1. 假装它。只需在标题底部放置一个硬编码的垂直跳跃,然后自己编写脚注(使用 \footnotesize 作为大小)。您还必须使用 \footnotemark 自行管理符号或编号。简单,但不是很吸引人,而且脚注不会出现在页面底部。
  2. 使用 tabularx、longtable、rel= “noreferrer”>thirdparttable[x](感谢约瑟夫)或ctable< /code>支持这种行为。
  3. 手动管理。使用[h!]< /code> (或带有 float 包的 [H])来控制浮动出现的位置,并在同一页面上使用 \footnotetext 将脚注放在您想要的位置。再次使用 \footnotemark 安装该符号。脆弱且每次都需要手动工具。
  4. footnote 包提供了 savenote 环境,可以用来做到这一点。
  5. 对其进行小型化(代码完全窃取,并在这种情况下阅读有关长标题文本的免责声明):
    \begin{figure}
      \begin{minipage}{\textwidth}
        ...
        \caption[Caption for LOF]%
          {Real caption\footnote{blah}}
      \end{minipage}
    \end{figure}

其他参考: TeX FAQ 项目表格中的脚注

This is a classic difficulty in LaTeX.

The problem is how to do layout with floats (figures and tables, an similar objects) and footnotes. In particular, it is hard to pick a place for a float with certainty that making room for the associated footnotes won't cause trouble. So the standard tabular and figure environments don't even try.

What can you do:

  1. Fake it. Just put a hardcoded vertical skip at the bottom of the caption and then write the footnote yourself (use \footnotesize for the size). You also have to manage the symbols or number yourself with \footnotemark. Simple, but not very attractive, and the footnote does not appear at the bottom of the page.
  2. Use the tabularx, longtable, threeparttable[x] (kudos to Joseph) or ctable which support this behavior.
  3. Manage it by hand. Use [h!] (or [H] with the float package) to control where the float will appear, and \footnotetext on the same page to put the footnote where you want it. Again, use \footnotemark to install the symbol. Fragile and requires hand-tooling every instance.
  4. The footnote package provides the savenote environment, which can be used to do this.
  5. Minipage it (code stolen outright, and read the disclaimer about long caption texts in that case):
    \begin{figure}
      \begin{minipage}{\textwidth}
        ...
        \caption[Caption for LOF]%
          {Real caption\footnote{blah}}
      \end{minipage}
    \end{figure}

Additional reference: TeX FAQ item Footnotes in tables.

離殇 2024-09-09 08:18:56

一种可能不太优雅的方法是对其进行硬编码,我认为这只是其他人所说的一种变体。许多期刊都有一个模板,在某种程度上允许表脚注,所以我尽量保持基本的内容。尽管如此,确实已经有一些令人难以置信的软件包了,我认为这个线程很好地指出了这一点。

\documentclass{article}
\begin{document}
\begin{table}[!th]
\renewcommand{\arraystretch}{1.3} % adds row cushion
\caption{Data, level$^a$, and sources$^b$}
\vspace{4mm}
\centering
\begin{tabular}{|l|l|c|c|}
  \hline      
  \textbf{Data}  & \textbf{Description}   & \textbf{Level} & \textbf{Source} \\
  \hline      
  \hline
  Data1  &  Description. . . . . . . . . . . . . . . . . .   &  cnty & USGS \\
  \hline
  Data2  &  Description. . . . . . . . . . . . . . . . . .   &  MSA & USGS \\
  \hline
  Data3  &  Description. . . . . . . . . . . . . . . . . .   &  cnty & Census  \\
  \hline  
\end{tabular}
\end{table}
\footnotesize{$^a$ The smallest spatial unit is county, $^b$ more details in appendix A}\\
\end{document}

上面的输出代码

A maybe not-so-elegant method, which I think is just a variation of what some other people have said, is to just hardcode it. Many journals have a template that in some way allows for table footnotes, so I try to keep things pretty basic. Although, there really are some incredible packages already out there, and I think this thread does a good job of pointing that out.

\documentclass{article}
\begin{document}
\begin{table}[!th]
\renewcommand{\arraystretch}{1.3} % adds row cushion
\caption{Data, level$^a$, and sources$^b$}
\vspace{4mm}
\centering
\begin{tabular}{|l|l|c|c|}
  \hline      
  \textbf{Data}  & \textbf{Description}   & \textbf{Level} & \textbf{Source} \\
  \hline      
  \hline
  Data1  &  Description. . . . . . . . . . . . . . . . . .   &  cnty & USGS \\
  \hline
  Data2  &  Description. . . . . . . . . . . . . . . . . .   &  MSA & USGS \\
  \hline
  Data3  &  Description. . . . . . . . . . . . . . . . . .   &  cnty & Census  \\
  \hline  
\end{tabular}
\end{table}
\footnotesize{$^a$ The smallest spatial unit is county, $^b$ more details in appendix A}\\
\end{document}

Output from above code

灯角 2024-09-09 08:18:56

输入图像描述这里

你可以在最后添加一个 \multirow 。这是一个例子:

\begin{table}[]
    \centering
    \caption{Caption}
    \label{tab:my_label}
    \begin{tabular}{l c c}  
    \toprule
\multirow{2}{*}{Propriedades}                 & \multicolumn{2}{c}{Resultados do modelo} & Dados \\
                                              & MN S    & MN F      &  experimentais \\ \midrule
Resistência de entrada ($R_{in}$), M$\Omega$  & 2,2     & 0,9       & \\
Constante de tempo ($\tau$), ms               & 10,3    & 5,6       & \\
Reobase ($I_{rheo}$), nA                      & 4,5     & 17        & \\
Duração da AHP, ms                            & 137,2   & 66,2      & \\ \bottomrule
\multicolumn{4}{l}{\small *THIS IS A NICE FOOTNOTE.} \\
    \end{tabular}

\end{table}

enter image description here

you could just add a \multirow at the end. Here is an example:

\begin{table}[]
    \centering
    \caption{Caption}
    \label{tab:my_label}
    \begin{tabular}{l c c}  
    \toprule
\multirow{2}{*}{Propriedades}                 & \multicolumn{2}{c}{Resultados do modelo} & Dados \\
                                              & MN S    & MN F      &  experimentais \\ \midrule
Resistência de entrada ($R_{in}$), M$\Omega$  & 2,2     & 0,9       & \\
Constante de tempo ($\tau$), ms               & 10,3    & 5,6       & \\
Reobase ($I_{rheo}$), nA                      & 4,5     & 17        & \\
Duração da AHP, ms                            & 137,2   & 66,2      & \\ \bottomrule
\multicolumn{4}{l}{\small *THIS IS A NICE FOOTNOTE.} \\
    \end{tabular}

\end{table}
葬花如无物 2024-09-09 08:18:56

如果您的表格已经使用 tabular,那么最简单的方法是将其切换到 longtable,记住添加

\usepackage{longtable}

例如:

\begin{longtable}{ll}
  2014--2015 & Something cool\footnote{first footnote} \\
  2016-- & Something cooler\footnote{second footnote}
\end{longtable}

If your table is already working with tabular, then easiest is to switch it to longtable, remembering to add

\usepackage{longtable}

For example:

\begin{longtable}{ll}
  2014--2015 & Something cool\footnote{first footnote} \\
  2016-- & Something cooler\footnote{second footnote}
\end{longtable}
迷离° 2024-09-09 08:18:56

使用小型页面环境。这是一个例子:

\begin{minipage}{6cm}
\begin{tabular}{|l|c|c|}
    \hline
    A & 1 & 2 \footnote{This is a footnote.} \\
    \hline
    B & 2 & 1 \\
    \hline
    C & 3 & 3 \\
    \hline
\end{tabular}
\end{minipage}

Use minipage environment. Here is an example:

\begin{minipage}{6cm}
\begin{tabular}{|l|c|c|}
    \hline
    A & 1 & 2 \footnote{This is a footnote.} \\
    \hline
    B & 2 & 1 \\
    \hline
    C & 3 & 3 \\
    \hline
\end{tabular}
\end{minipage}
梅倚清风 2024-09-09 08:18:56
\begin{figure}[H]
\centering
{\includegraphics[width=1.0\textwidth]{image}}
\caption{captiontext\protect\footnotemark}
\label{fig:}
\end{figure}
\footnotetext{Footnotetext} 
\begin{figure}[H]
\centering
{\includegraphics[width=1.0\textwidth]{image}}
\caption{captiontext\protect\footnotemark}
\label{fig:}
\end{figure}
\footnotetext{Footnotetext} 
素衣风尘叹 2024-09-09 08:18:56

也许最好的解决方案是查看 Threeparttable/ Threeparttablex 包。

Probably the best solution is to look at the threeparttable/threeparttablex packages.

余生再见 2024-09-09 08:18:56

在表格中我使用了 \footnotetext。

In tables I have used \footnotetext.

酒废 2024-09-09 08:18:56

我对 tabularx 脚注也有同样的问题,这些脚注没有出现在页面底部。最后,我可以使用以下结构在 PDF 文件的同一页面下显示带有适当计数器的表格脚注。

\begin{table}
\begin{tabularx}{\textwidth }{SCCC}
\toprule
\shortstack{A} & B & C & D\\
\midrule
item 1 \footnotemark{} & item 2\footnotemark{} & item 3 & item 4\\ \hline
...
 \bottomrule
\end{tabularx}
\end{table}
\addtocounter{footnote}{-2} %n=2
\stepcounter{footnote}\footnotetext{text foot 1}
\stepcounter{footnote}\footnotetext{text foot 2}

I had a same problem with tabularx footnotes which are not appeared on the bottom of the page. Finally, I could use the following structure to appear the table's footnotes with proper counters under the same page of the PDF file.

\begin{table}
\begin{tabularx}{\textwidth }{SCCC}
\toprule
\shortstack{A} & B & C & D\\
\midrule
item 1 \footnotemark{} & item 2\footnotemark{} & item 3 & item 4\\ \hline
...
 \bottomrule
\end{tabularx}
\end{table}
\addtocounter{footnote}{-2} %n=2
\stepcounter{footnote}\footnotetext{text foot 1}
\stepcounter{footnote}\footnotetext{text foot 2}
婴鹅 2024-09-09 08:18:56

@dmckee 说的话。

编写您自己的定制脚注排队代码并不困难。你需要做的是:

  1. 编写代码来排队 Latex 代码 - 就像 emacs 中的钩子:非常标准的技术,如果不是每个 Latex 黑客都能真正做到这一点;
  2. 暂时重新定义 \footnote 以将脚注宏添加到队列中;
  3. 确保当表格/图形退出并且我们返回到常规垂直模式时调用钩子。

如果这很有趣,我会展示一些执行此操作的代码。

What @dmckee said.

It's not difficult to write your own bespoke footnote-queuing code. What you need to do is:

  1. Write code to queue Latex code — like a hook in emacs: very standard technique, if not every Latex hacker can actually do this right;
  2. Temporarily redefine \footnote to add a footnote macro to your queue;
  3. Ensure that the hook gets called when the table/figure exits and we return to regular vertical mode.

If this is interesting, I show some code that does this.

等风也等你 2024-09-09 08:18:56

使用“表格笔记”

\begin{table*}

\centering
\caption{}
\begin{tabular}{|c|c|}
--------
\end{tabular}

##################
\begin{tablenotes}
   \item[*] \\Insert footnote here
\end{tablenotes}
################## 

\label{tab: label}
\end{table*}

Use "tablenotes"

\begin{table*}

\centering
\caption{}
\begin{tabular}{|c|c|}
--------
\end{tabular}

##################
\begin{tablenotes}
   \item[*] \\Insert footnote here
\end{tablenotes}
################## 

\label{tab: label}
\end{table*}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文