如何多次向表格文本添加脚注

如何多次向表格文本添加脚注

我正在使用\tablefootnote。我需要多次引用一个脚注,这就是我label在里面使用的原因\tablefootnote。问题是脚注没有出现在表格的同一页中。在原始文档中,它出现在下一页,而在此示例中,它出现在上一页。我需要此脚本中的解决方案或为我提供另一个简单的解决方案。

以下是屏幕截图:

在此处输入图片描述

以下是代码:

\documentclass[compsoc, conference, letterpaper, 10pt, times]{IEEEtran}
\ifCLASSOPTIONcompsoc
  % IEEE Computer Society needs nocompress option
  % requires cite.sty v4.0 or later (November 2003)
  \usepackage[nocompress]{cite}
\else
  % normal IEEE

  \usepackage{cite}
\fi
\ifCLASSINFOpdf
\else
\fi

\usepackage{colortbl}       
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{tablefootnote}
\usepackage{lipsum}

\begin{document}
\title{Test}
\lipsum
\maketitle

\begin{table}
\caption{mytable}
\label{table:mytable}
\centering
\begin{tabular}{ cccc}
\toprule
&   \multicolumn{3}{c}{B} \\
\cmidrule(lr){2-4}
\multicolumn{1}{c}{\multirow{-2}{*}[0.5ex]{A}}
&   AAA & BBB & CCC \\
\midrule
\rowcolor[gray]{.9}
Text1\tablefootnote{\label{note1}footnote} &   \cmark & \cmark & \cmark \\
Text2\textsuperscript{\ref{note1}} &   \xmark & \cmark & \xmark \\
\rowcolor[gray]{.9}
Text3 &   \cmark & \xmark & \xmark \\
Text4 &   \cmark & \cmark & \cmark \\
\bottomrule
\end{tabular}

\lipsum
\end{table}
\end{document}

答案1

我最终采用了一种相当手动的方法。\tnote宏用于在表格本身中排版脚注标记,并\item使用匹配的可选参数来执行实际的表格注释。

这是一个简化的例子:

\documentclass{article}
\usepackage{threeparttable}

\begin{document}
\begin{threeparttable}
    \caption{A table}
    \begin{tabular}{lll}
        \hline\\
        A column\tnote{a}&another column&column 3\\
        \hline\\
        1\tnote{b}&2&3\\
        4&5\tnote{b}&6\\
        7&8&9\\
        \hline\\
    \end{tabular}
    \begin{tablenotes}
        \raggedright
        \item[a] A table note.
        \item[b] A rather longer table note referred to in multiple places.
    \end{tablenotes}
\end{threeparttable}
\end{document}

示例表

这是我论文中的一个表格,经过了一些调整,可以自行编译(这使得在一些脚注标记前出现了一些虚假的空格):

\documentclass{article}
\usepackage{threeparttable}
\usepackage{siunitx}
\usepackage{etoolbox}
\usepackage{booktabs}
\usepackage{hyphenat}
\usepackage{multicol}
\DeclareRobustCommand{\Wmk}{\si{\watt\per\metre\per\kelvin}}
\newcommand*\rfrac[2]{{}^{#1}\!/_{#2}}%running fraction with slash - requires math mode.
\robustify\tnote %for using siunitx and threeparttable
\appto\TPTnoteSettings{\footnotesize} %and for making threeparttable's footnotes footnotesize
\sisetup{tight-spacing=true,scientific-notation=false}%

\begin{document}
\begin{threeparttable}
    \caption[High\hyp{}frequency\hyp{}related material parameters.]{\label{tab_Theory_Materials}High\hyp{}frequency\hyp{}related material parameters.  Based on a table in reference \emph{dummy}, some data from reference \emph{dummy}.}
    \small{
    \begin{tabular}{@{}l@{}S@{}S@{}S@{}S@{}S@{}S@{}S@{}S@{}}
        \toprule
        &\multicolumn{1}{c}{$E_g$\tnote{a}}&\multicolumn{1}{c}{$n_i$\tnote{b}}&\multicolumn{1}{c}{$\epsilon_r$\tnote{c}}&\multicolumn{1}{c}{$\mu_n$\tnote{d}}& \multicolumn{1}{c}{$v_\mathrm{sat}$\tnote{e}}&\multicolumn{1}{c}{$E_\mathrm{br}$\tnote{f}}&\multicolumn{1}{c}{$\mathit{TC}$\tnote{g}}& \multicolumn{1}{c}{$\mathit{JM}$\tnote{h}}\\
        &\multicolumn{1}{c}{\small{\si{\eV}}}&\multicolumn{1}{c}{\small{\si{\cm^{-3}}}}&\multicolumn{1}{c}{}&\multicolumn{1}{c}{\small{\si{\cm\per\volt\per\s}}}& \multicolumn{1}{c}{\small{$\times 10^7$\si{\cm\per\s}}}&\multicolumn{1}{c}{\small{\si{\mega\volt\per\cm}}}&\multicolumn{1}{c}{\small{\Wmk}}&\multicolumn{1}{c}{}\\
        \midrule\\
        Si&1.1&1.5e10&11.8&1350&1.0&0.3&150&1\\
        GaAs&1.42&1.5e5&13.1&8500&1.0&0.6&43&2.7\\
        SiC (4H)&3.26&8.2e-9&10&700&2.0&3.0&450\tnote{~i}&20\\
        GaN&3.4&1.9e-10&9.0&2000\tnote{~j}&2.5&3.3&130&27.5\\
        Diamond&5.4&1.6e-27&5.5&1900&2.7&5.6&2000&50\\
        \bottomrule 
    \end{tabular}}
    \begin{tablenotes}
        \setlength{\columnsep}{0.8cm}
        \setlength{\multicolsep}{0cm}
        \begin{multicols}{2}\raggedright
            \item[a] Bandgap.
            \item[b] Intrinsic carrier density at room temperature.
            \item[c] Relative permittivity.
            \item[d] Electron mobility.
            \item[e] Saturation velocity.
            \item[f] Breakdown field. 
            \item[g] Thermal conductivity at room temperature. The thermal conductivity reduces with temperature at typical operating temperatures. For GaN $\mathit{TC}\propto T^{-1.4}$ is often used, though values vary.
            \item[h] Johnson figure of merit, which compares the power\hyp{}frequency performance of materials, normalised to the value for Si. $JM=\rfrac{E_\mathrm{br}v_\mathrm{sat}}{2\pi}$.
            \item[i] In-plane; parallel to the $c$-axis the thermal conductivity is 330~\Wmk.
            \item[j] Within the 2DEG; the bulk value is \SI[scientific-notation=false]{1200}{\cm\per\volt\per\s}.
        \end{multicols}
    \end{tablenotes}
\end{threeparttable}
\end{document}

根据以上代码制作表格

如果您正在使用它,siunitx我建议您查看更长示例的代码。

相关内容