Longtable 的标题与脚注混在一起

Longtable 的标题与脚注混在一起

我使用 longtable 在文本中构建表格,并在底部添加标题。我喜欢这种多页表格环境。但有时,我发现一个问题:糟糕!我的标题和脚注混在一起了…… 

在我的上下文中举一个例子,你可以看到第 7 个脚注和标题混合:

这里有一个最小的示例代码:

% !TEX encoding = UTF-8 Unicode 
% !TEX TS-program = arara
\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{caption}\captionsetup[table]{name=\scshape Tableau, position=bottom}
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{footnote}

\begin{document}
\lipsum[1]\footnote{\lipsum[2]}
\begin{longtable}{|c|c|c|c|}
\hline W&X&Y&Z\\\hline\endfirsthead
\hline W&X&Y&Z\\\hline\multicolumn{4}{|l|}{\emph{suite}}\\\hline\endhead
\hline\multicolumn{4}{|r|}{\emph{suite}}\\\hline\caption[]{Test}\\\endfoot
\caption{Test}\label{tab:test}\\\endlastfoot
A\footnote{ABCD}&B&C&D\\\hline
A\footnote{\lipsum[4]}&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
\end{longtable}
\end{document}
% arara: xelatex
% arara: xelatex

有什么解决办法吗?谢谢您的帮助。

答案1

这一回应得益于@UlrikeFischer评论。

解决方案是删除caption包。要保留标题的选项,请使用babel类似 的选项captionsfrench

% !TEX encoding = UTF-8 Unicode 
% !TEX TS-program = arara
\documentclass{scrbook}
%\usepackage{caption}\captionsetup[table]{name=\scshape Tableau, position=bottom}
\usepackage[frenchb]{babel} %
  \addto\captionsfrench{\def\tablename{\textsc{Tableau}}}% to conserve my caption style
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{footnote}

\begin{document}
\lipsum[1]\footnote{\lipsum[2]}
\begin{longtable}{|c|c|c|c|}
\hline W&X&Y&Z\\\hline\endfirsthead
\hline W&X&Y&Z\\\hline\multicolumn{4}{|l|}{\emph{suite}}\\\hline\endhead
\hline\multicolumn{4}{|r|}{\emph{suite}}\\\hline\caption[]{Test}\\\endfoot
\caption{Test}\label{tab:test}\\\endlastfoot
A\footnote{ABCD}&B&C&D\\\hline
A\footnote{\lipsum[4]}&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
A&B&C&D\\\hline
\end{longtable}
\end{document}
% arara: xelatex
% arara: xelatex

相关内容