我已经尝试了好几个小时来寻找一个令人满意的表格脚注问题解决方案。我遇到的所有方法似乎都无法正常工作。不过,tabularx
软件包文档中说明tabularx
支持\footnote
。
我尝试过使用
\footnote{footnote text}
命令tabularx
,它肯定会显示表格中的脚注(哈利路亚!),但不显示脚注文本(哈利路亚不是那么多)。
我也尝试过
\footnotemark[footnote#]
和
\footnotetext[footnote#]{footnote text}
表格下面的某个地方,它工作得很好,只是你必须自己跟踪计数器,当你\footnote
在页面的文本的其他位置插入正常时会导致悲剧。
最好的解决方案是,如果可以在表格中添加字母脚注并为文本编号,但\footnotemark
不支持使用字母作为数字。
那么...有人了解tabularx
脚注是如何工作的吗?
一位 MWE 表示:
\begin{table}[!h]
\centering
\caption{Characteristics of the most common reactor types}
\label{tab:reactor-properties}
\begin{tabularx}{0.8\textwidth}{*{4}{L}}
\toprule
Type & Fuel \footnotemark[1] & Moderator & Coolant \\
\midrule
LGR \footnotemark[2] & \ce{UO2}, enr. & Graphite, \ce{H2O} & \ce{H2O}(\emph{l}) \\
\bottomrule
\end{tabularx}
\end{table}
\footnotetext[1]{enr. = enriched in \ce{^{235}U}, nat. = natural}
\footnotetext[2]{There were four such reactors at the Chernobyl plant at the time of the accident \cite{nuclear-energy}}
编辑:David Carisle 提供的解决方案在一天左右的时间内运行良好。我不知道它为什么停止工作,但脚注文本和参考资料在 minipage-tabularx 环境中都停止工作了。MWE:
\documentclass[a4paper,11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry,parskip,setspace,amsmath,amssymb,amsfonts,gensymb}
\usepackage[english]{babel}
\usepackage[per-mode=symbol]{siunitx}
\usepackage{graphicx,tabularx,booktabs,multirow,url,hyperref}
\usepackage[hang,small,bf]{caption}
\usepackage[version=3]{mhchem}
\usepackage[page,toc]{appendix}
\usepackage[ref]{cite}
\usepackage{fancyhdr}
%Footnotes in table
\makeatletter
\newtoks\FTN@ftn
\def\pushftn{%
\let\@footnotetext\FTN@ftntext\let\@xfootnotenext\FTN@xftntext
\let\@xfootnote\FTN@xfootnote}
\def\popftn{%
\global\FTN@ftn\expandafter{\expandafter}\the\FTN@ftn}
\long\def\FTN@ftntext#1{%
\edef\@tempa{\the\FTN@ftn\noexpand\footnotetext
[\the\csname c@\@mpfn\endcsname]}%
\global\FTN@ftn\expandafter{\@tempa{#1}}}%
\long\def\FTN@xftntext[#1]#2{%
\global\FTN@ftn\expandafter{\the\FTN@ftn\footnotetext[#1]{#2}}}
\def\FTN@xfootnote[#1]{%
\begingroup
\csname c@\@mpfn\endcsname #1\relax
\unrestored@protected@xdef\@thefnmark{\thempfn}%
\endgroup
\@footnotemark\FTN@xftntext[#1]}
\makeatother
%End footnotes in table
% ---------- New Commands ----------
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\begin{document}
\begin{table}[!h]
\begin{minipage}{1\textwidth}
\centering
\caption{Characteristics of the most common desalination processes \cite{ref1} \label{tab:desalination-properties}}
\begin{tabularx}{1\textwidth}{l l L L}
\toprule
Property & Reverse Osmosis & MSF\footnote{For large MSF plants} & MED \\
\midrule
El.\footnote{El. = electrical} energy consumption [\si{\kilo\watt\per\cubic\metre}] & $6.5-12$ & $4-6$ \ref{ref1} & $4.5-12.5$ \\
Th.\footnote{Th. = thermal} energy consumption [\si{\kilo\watt\per\cubic\meter}] & & $55-120$ \ref{ref1} & \\
Plant cost & High & Medium & Low \\
Product quality & Medium\footnote{Energy dependent} & High & High \\
Feed pretreatment & High & Medium & Low \\
Maintenance & High & Low & Low \\
\bottomrule
\end{tabularx}
\end{minipage}
\end{table}
\begin{thebibliography}{9}
\bibitem{ref1} Some reference
\end{thebibliography}
\end{document}
如下面的屏幕转储所示,脚注文本和参考资料(注意,我在文档中导入了一个 bib 文件)在 tabularx 环境中不起作用:
提供 \listfiles 给出的文件列表:
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
inputenc.sty 2008/03/30 v1.1d Input encoding file
latin1.def 2008/03/30 v1.1d Input encoding file
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
geometry.sty 2010/09/12 v5.6 Page Geometry
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
ifvtex.sty 2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
parskip.sty 2001/04/09 non-zero parskip adjustments
setspace.sty 2011/12/19 v6.7a set line spacing
amsmath.sty 2000/07/18 v2.13 AMS math features
amstext.sty 2000/06/29 v2.01
amsgen.sty 1999/11/30 v2.0
amsbsy.sty 1999/11/29 v1.2d
amsopn.sty 1999/12/14 v2.01 operator names
amssymb.sty 2009/06/22 v3.00
amsfonts.sty 2009/06/22 v3.00 Basic AMSFonts support
gensymb.sty 2003/07/02 v1.0 (WaS)
babel.sty 2008/07/08 v3.8m The Babel package
english.ldf 2005/03/30 v3.3o English support from the babel system
siunitx.sty 2012/01/19 v2.4i A comprehensive (SI) units package
expl3.sty 2012/01/19 v3209 L3 Experimental code bundle wrapper
l3names.sty 2011/12/30 v3113 L3 Experimental namespace for primitives
l3bootstrap.sty 2011/12/29 v3110 L3 Experimental bootstrap code
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
color.sty 2005/11/14 v1.0j Standard LaTeX Color (DPC)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/message (HO)
ltxcmds.sty 2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
l3basics.sty 2012/01/15 v3196 L3 Experimental basic definitions
l3expan.sty 2012/01/15 v3196 L3 Experimental argument expansion
l3tl.sty 2012/01/09 v3158 L3 Experimental token lists
l3seq.sty 2012/01/09 v3158 L3 Experimental sequences and stacks
l3int.sty 2012/01/07 v3139 L3 Experimental integers
l3quark.sty 2012/01/08 v3148 L3 Experimental quarks
l3prg.sty 2011/12/31 v3122 L3 Experimental control structures
l3clist.sty 2012/01/09 v3157 L3 Experimental comma separated lists
l3token.sty 2011/12/31 v3123 L3 Experimental token manipulation
l3prop.sty 2012/01/09 v3158 L3 Experimental property lists
l3msg.sty 2012/01/08 v3153 L3 Experimental messages
l3io.sty 2012/01/09 v3160 L3 Experimental input-output operations
l3file.sty 2012/01/09 v3158 L3 Experimental file operations
l3skip.sty 2012/01/07 v3139 L3 Experimental dimensions and skips
l3keys.sty 2011/12/22 v3086 L3 Experimental key-value interfaces
l3fp.sty 2012/01/08 v3154 L3 Experimental floating-point operations
l3box.sty 2012/01/09 v3158 L3 Experimental boxes
l3coffins.sty 2012/01/08 v3155 L3 Experimental coffin code layer
l3color.sty 2011/09/07 v2776 L3 Experimental colour support
l3luatex.sty 2012/01/09 v3158 L3 Experimental LuaTeX-specific functions
array.sty 2008/09/09 v2.4c Tabular extension package (FMi)
l3keys2e.sty 2012/01/19 v3207 LaTeX2e option processing using LaTeX3 keys
xparse.sty 2012/01/19 v3209 L3 Experimental document command parser
translator.sty 2010/06/12 ver 1.10
translator-language-mappings.tex
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
tabularx.sty 1999/01/07 v2.07 `tabularx' package (DPC)
booktabs.sty 2005/04/14 v1.61803 publication quality tables
multirow.sty
url.sty 2006/04/12 ver 3.3 Verb mode for urls, etc.
hyperref.sty 2011/12/04 v6.82m Hypertext links for LaTeX
hobsub-hyperref.sty 2011/04/23 v1.4 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2011/04/23 v1.4 Bundle oberdiek, subset generic (HO)
hobsub.sty 2011/04/23 v1.4 Subsetting bundle oberdiek (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
intcalc.sty 2007/09/27 v1.1 Expandable integer calculations (HO)
etexcmds.sty 2011/02/16 v1.5 Prefix for e-TeX command names (HO)
kvsetkeys.sty 2011/04/07 v1.13 Key value parser (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Defining keys (HO)
pdftexcmds.sty 2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)
pdfescape.sty 2011/04/04 v1.12 Provides string conversions (HO)
bigintcalc.sty 2011/01/30 v1.2 Expandable big integer calculations (HO)
bitset.sty 2011/01/30 v1.1 Data type bit set (HO)
uniquecounter.sty 2011/01/30 v1.2 Provides unlimited unique counter (HO)
letltxmacro.sty 2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
hopatch.sty 2011/01/30 v1.0 Wrapper for package hooks (HO)
xcolor-patch.sty 2011/01/30 xcolor patch
atveryend.sty 2011/04/23 v1.7 Hooks at very end of document (HO)
atbegshi.sty 2011/01/30 v1.15 At begin shipout hook (HO)
refcount.sty 2010/12/01 v3.2 Data extraction from references (HO)
hycolor.sty 2011/01/30 v1.7 Color options of hyperref/bookmark (HO)
kvoptions.sty 2010/12/23 v3.10 Keyval support for LaTeX options (HO)
pd1enc.def 2011/12/04 v6.82m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
hpdftex.def 2011/12/04 v6.82m Hyperref driver for pdfTeX
rerunfilecheck.sty 2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
caption.sty 2011/11/10 v3.2e Customizing captions (AR)
caption3.sty 2011/11/01 v1.4a caption3 kernel (AR)
mhchem.sty 2011/06/03 v3.11 for typesetting chemical formulae
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
twoopt.sty 2008/08/11 v1.5 Definitions with two optional arguments (HO)
appendix.sty 2009/09/02 v1.2b extra appendix facilities
cite.sty 2010/09/10 v 5.3
fancyhdr.sty
supp-pdf.mkii
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2010/08/19 v1.1 Managing graphics extensions (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
translator-basic-dictionary-English.dict
siunitx-abbreviations.cfg 2012/01/19 v2.4i siunitx: Abbreviated units
siunitx-binary.cfg 2012/01/19 v2.4i siunitx: Binary units
nameref.sty 2010/04/30 v2.40 Cross-referencing by name of section
gettitlestring.sty 2010/12/03 v1.4 Cleanup title references (HO)
"Test document".out
"Test document".out
umsa.fd 2009/06/22 v3.00 AMS symbols A
umsb.fd 2009/06/22 v3.00 AMS symbols B
***********
答案1
我认为这是一个拉皮条的好机会parnotes
:
\documentclass[a4paper,11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry,parskip,setspace,amsmath,amssymb,amsfonts,gensymb}
\usepackage[english]{babel}
\usepackage[per-mode=symbol]{siunitx}
\usepackage{graphicx,tabularx,booktabs,multirow,url,hyperref}
\usepackage[hang,small,bf]{caption}
\usepackage[version=3]{mhchem}
\usepackage[page,toc]{appendix}
\usepackage[ref]{cite}
\usepackage{fancyhdr}
\usepackage[roman]{parnotes}
%
% This will go in the next version
%
\makeatletter
\def\parnoteclear{%
\gdef\PN@text{}%
\parnotereset
}
\makeatother
% ---------- New Commands ----------
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\begin{document}
\begin{table}[!h]
\centering
\caption{Characteristics of the most common desalination processes \cite{ref1} \label{tab:desalination-properties}}
\begin{tabularx}{1\textwidth}{l l L L}
\toprule
\parnoteclear % tabularx will otherwise add each note thrice
Property & Reverse Osmosis & MSF\parnote{For large MSF plants} & MED \\
\midrule
El.\parnote{El. = electrical} energy consumption [\si{\kilo\watt\per\cubic\metre}] & $6.5-12$ & $4-6$ \ref{ref1} & $4.5-12.5$ \\
Th.\parnote{Th. = thermal} energy consumption [\si{\kilo\watt\per\cubic\meter}] & & $55-120$ \ref{ref1} & \\
Plant cost & High & Medium & Low \\
Product quality & Medium\parnote{Energy dependent} & High & High \\
Feed pretreatment & High & Medium & Low \\
Maintenance & High & Low & Low \\
\bottomrule
\end{tabularx}
\parnotes
\end{table}
\begin{thebibliography}{9}
\bibitem{ref1} Some reference
\end{thebibliography}
\end{document}
答案2
大概某人明白tabularx
:-)
中的脚注tabularx
旨在使页脚注与文本一起放在页面末尾。如果您没有看到文本,则很可能是您将表格放在了其他框中(例如浮动框),无论脚注是否在表格中,都会阻止脚注。
如果您想要表格注释,标准的乳胶方式是将其放入tabular
,minipage
然后脚注出现在小页面的末尾。
或者你可能更喜欢这个答案中的代码
\footnotetext 为许多 \footnotemark 编号 - 自动解决方案
您编辑的 MWE 作品为我提供了脚注:
文件列表显示你的 MWE 加载了 166 个文件,其中大约所有文件都是不是这个例子需要它,所以要求任何人调试都太过分了。我在下面附上了我的清单。我会先删除你不使用的所有内容在这个例子中从其他答案 siunits 中推送/弹出脚注(以及所有 l3exp 代码),事实上据我所知,您的 MWE仅有的使用tabularx
后,您很可能会得到脚注,然后只需放回您认为需要的软件包即可。如果脚注消失,则说明该软件包存在问题。
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
inputenc.sty 2008/03/30 v1.1d Input encoding file
latin1.def 2008/03/30 v1.1d Input encoding file
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
geometry.sty 2010/07/13 v5.5 Page Geometry
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
ifpdf.sty 2010/01/28 v2.1 Provides the ifpdf switch (HO)
ifvtex.sty 2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)
parskip.sty 2001/04/09 non-zero parskip adjustments
setspace.sty 2000/12/01 6.7 Contributed and Supported LaTeX2e package
amsmath.sty 2000/07/18 v2.13 AMS math features
amstext.sty 2000/06/29 v2.01
amsgen.sty 1999/11/30 v2.0
amsbsy.sty 1999/11/29 v1.2d
amsopn.sty 1999/12/14 v2.01 operator names
amssymb.sty 2009/06/22 v3.00
amsfonts.sty 2009/06/22 v3.00 Basic AMSFonts support
gensymb.sty 2003/07/02 v1.0 (WaS)
babel.sty 2008/07/06 v3.8l The Babel package
english.ldf 2005/03/30 v3.3o English support from the babel system
siunitx.sty 2010/07/15 v2.0n A comprehensive (SI) units package
expl3.sty 2010/07/13 v1982 L3 Experimental code bundle wrapper
l3names.sty 2010/07/11 v1981 L3 Experimental Naming Scheme for TeX Primitiv
es
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty 2010/06/07 v1942 L3 Experimental basic definitions
l3expan.sty 2010/06/10 v1948 L3 Experimental Argument Expansion module
l3tl.sty 2010/05/22 v1919 L3 Experimental Token Lists
l3intexpr.sty 2010/06/15 v1957 L3 Integer Expressions
l3quark.sty 2010/03/21 v1853 L3 Experimental Quark Commands
l3seq.sty 2010/03/29 v1879 L3 Experimental sequences and stacks
l3toks.sty 2010/05/25 v1933 L3 Experimental Token Registers
l3int.sty 2010/05/25 v1933 L3 Experimental Integer module
l3prg.sty 2010/03/21 v1853 L3 Experimental control structures
l3clist.sty 2010/03/29 v1878 L3 Experimental comma separated lists
l3token.sty 2010/04/11 v1890 L3 Experimental token investigation and manipu
lation
l3prop.sty 2010/03/21 v1857 L3 Experimental Property Lists
l3msg.sty 2010/03/23 v1866 L3 Experimental LaTeX Messages module
l3io.sty 2010/05/22 v1923 L3 Experimental i/o module
l3skip.sty 2010/05/25 v1933 L3 Experimental skip registers
l3box.sty 2010/05/22 v1919 L3 Experimental Box module
l3keyval.sty 2010/04/11 v1890 L3 Experimental keyval processing
l3keys.sty 2010/05/24 v1931 L3 Experimental key-value support
l3precom.sty 2010/02/09 v1793 L3 Experimental precompilation module
l3xref.sty 2010/02/09 v1786 L3 Experimental cross referencing
l3file.sty 2010/03/21 v1853 L3 Experimental file loading
l3fp.sty 2010/07/08 v1979 L3 Experimental floating-point operations
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
array.sty 2008/09/09 v2.4c Tabular extension package (FMi)
l3keys2e.sty 2009/08/24 v1494 Parsing LaTeX3 keyvals as LaTeX2e package opti
ons
xparse.sty 2010/05/23 v1927 Generic document command parser
translator.sty 2010/06/12 ver 1.10
translator-language-mappings.tex
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
pdftex.def 2010/02/14 v0.04n Graphics/color for pdfTeX
tabularx.sty 1999/01/07 v2.07 `tabularx' package (DPC)
booktabs.sty 2005/04/14 v1.61803 publication quality tables
multirow.sty
url.sty 2006/04/12 ver 3.3 Verb mode for urls, etc.
hyperref.sty 2010/06/18 v6.81g Hypertext links for LaTeX
ltxcmds.sty 2010/04/26 v1.7 LaTeX kernel commands for general use (HO)
kvsetkeys.sty 2010/03/01 v1.9 Key value parser (HO)
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/message (HO)
etexcmds.sty 2010/01/28 v1.3 Prefix for e-TeX command names (HO)
pdfescape.sty 2010/03/01 v1.9 Provides hex, PDF name and string conversions
(HO)
pdftexcmds.sty 2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
ifxetex.sty 2009/01/23 v0.5 Provides ifxetex conditional
hycolor.sty 2009/12/12 v1.6 Color options of hyperref/bookmark (HO)
xcolor-patch.sty 2009/12/12 xcolor patch
letltxmacro.sty 2008/06/24 v1.3 Let assignment for LaTeX macros (HO)
pd1enc.def 2010/06/18 v6.81g Hyperref: PDFDocEncoding definition (HO)
intcalc.sty 2007/09/27 v1.1 Expandable integer calculations (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty 2010/02/22 v3.7 Keyval support for LaTeX options (HO)
bitset.sty 2007/09/28 v1.0 Data type bit set (HO)
bigintcalc.sty 2011/01/30 v1.2 Expandable big integer calculations (HO)
atbegshi.sty 2010/03/25 v1.12 At begin shipout hook (HO)
hpdftex.def 2010/06/18 v6.81g Hyperref driver for pdfTeX
atveryend.sty 2010/03/24 v1.5 Hooks at very end of document (HO)
rerunfilecheck.sty 2010/03/16 v1.6 Rerun checks for auxiliary files (HO)
uniquecounter.sty 2009/12/18 v1.1 Provides unlimited unique counter (HO)
caption.sty 2010/01/09 v3.1m Customizing captions (AR)
caption3.sty 2010/01/14 v3.1m caption3 kernel (AR)
mhchem.sty 2010/06/16 v3.08 for typesetting chemical formulae
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
twoopt.sty 2008/08/11 v1.5 Definitions with two optional arguments (HO)
appendix.sty 2009/09/02 v1.2b extra appendix facilities
cite.sty 2009/08/29 v 5.2
fancyhdr.sty
translator-basic-dictionary-English.dict
supp-pdf.mkii
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2007/09/30 v1.0 Managing graphics extensions (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
nameref.sty 2010/04/30 v2.40 Cross-referencing by name of section
refcount.sty 2008/08/11 v3.1 Data extraction from references (HO)
gettitlestring.sty 2009/12/18 v1.3 Cleanup title references (HO)
tab77.out
tab77.out
umsa.fd 2009/06/22 v3.00 AMS symbols A
umsb.fd 2009/06/22 v3.00 AMS symbols B