我正在使用文档类编写论文的补充材料revtex4-1
,并且我想包含一个超过一页的长数字表。
我阅读了 ReVTeX 手册,他们建议使用选项 [H] 或 longtable 环境。第一个选项不起作用。第二个选项生成的表格行间距非常小,使得表格很难阅读。除此之外,在双列模式下,此表和前一个表的显示顺序也会切换。我附上了一个可以重现该问题的小文件(至少在我的系统中,使用 pdflatex 编译)。我将非常感激任何有关此问题的线索。
问候,Curro
文件输出
]1
\documentclass[aps,prl,a4,preprint]{revtex4-1}
\usepackage{amsmath,amssymb}
\usepackage{longtable}
%%%%%%%%
\begin{document}
\title{Supplementary Material:\\XXXXX}
\author{LF}
\affiliation{Dipartimento di Fisica}
\maketitle
We try and collect in the present Supplementary Material section, additional details about technical aspects of the algebraic formalism (such as matrix elements) that are necessary to reproduce our calculations and we give further information on the fitting procedure.
\section*{Supplementary material}
\begin{table*}
\caption{Residuals for fits $F_0$ and $F_1$.\label{tab_residuals}}
\begin{ruledtabular}
\begin{tabular}{c|c|c|c|c||c|c|c|c|c}
Initial & Final & Exp. & Calc.\ $F_0$ & Calc.\ $F_1$&Initial & Final & Exp. & Calc.\ $F_0$ & Calc.\ $F_1$\\
\hline
0 1 0 0 1 & 2 0 0 0 0 & 128.6& -2.42& -2.16 & 0 1 2 0 1 & 1 1 1 1 1 & 44.4& -0.76& -1.96\\
\end{tabular}
\end{ruledtabular}
\end{table*}
\begin{center}
\begin{longtable*}{crc|crc|crc}
\caption[Calculated energy levels]{Calculated energy levels}
\label{tab_calcs}\\
\hline
$v$ & Calc. & $|C_{v}|^2$ &$v$ & Calc. & $|C_{v}|^2$ &$v$ & Calc. & $|C_{v}|^2$ \\
\hline
\endfirsthead
\multicolumn{9}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline
$v$ & Calc. & $|C_{v}|^2$ &$v$ & Calc. & $|C_{v}|^2$ &$v$ & Calc. & $|C_{v}|^2$ \\
\hline
\endhead
\hline \multicolumn{9}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
0 & 0.00000 & 1.00000 & 1 & 440.3463 & 1.00000 & 2 &829.6073 & 0.99660\\
001 & 16.44050 & 1.00000 & 222 & 452.27921 & 0.99876 & 222 & 373.31953 & 0.99979\\
\end{longtable*}
\end{center}
\end{document}
答案1
另一个解决方案,我并不完全理解:该cellspace
包允许定义单元格周围的最小垂直填充,但本身不定义任何最小值,并且相关列说明符必须以字母为前缀S
(或者C
如果使用该siunitx
包)。现在,使用revtex
,只需加载包即可获得正确的垂直间距。据我所知,revtex
包不是加载cellspace
…
此外,我还擅自使用了siunitx
长表,以便正确对齐各列中的数字:
\documentclass[aps,prl,a4,preprint]{revtex4-1}%
\usepackage{amsmath,amssymb}
\usepackage{siunitx} \sisetup{table-format=1.5,table-number-alignment=center}
\newcolumntype{T}{S[table-format=3.5]}
\usepackage{longtable}
\usepackage{cellspace}%
%%%%%%%%
\begin{document}
\title{Supplementary Material:\\XXXXX}
\author{LF}
\affiliation{Dipartimento di Fisica}
\maketitle
We try and collect in the present Supplementary Material section, additional details about technical aspects of the algebraic formalism (such as matrix elements) that are necessary to reproduce our calculations and we give further information on the fitting procedure.
\section*{Supplementary material}
\begin{table*}
\caption{Residuals for fits $F₀$ and $F₁$.\label{tab_residuals}}
\begin{ruledtabular}
\begin{tabular}{c|c|c|c|c||c|c|c|c|c}
Initial & Final & Exp. & Calc.\ $F₀$ & Calc.\ $F₁$ & Initial & Final & Exp. & Calc.\ $F₀$ & Calc.\ $F₁$ \\
\hline
0 1 0 0 1 & 2 0 0 0 0 & 128.6 & $ -2.42 $ & $ -2.16 $ & 0 1 2 0 1 & 1 1 1 1 1 & 44.4 & $ -0.76 $ & $ -1.96 $ \\
\end{tabular}
\end{ruledtabular}
\end{table*}
\begin{center}
\setlength\tabcolsep{6pt}
\begin{longtable}{cTS|cTS|cTS}
\caption[Calculated energy levels]{Calculated energy levels}
\label{tab_calcs}\\
\hline
$v$ & { (Calc.)} & {$|C_{v}|²$} & $v$ & {Calc.} & {$|C_{v}|²$} & $v$ & {Calc.} & {$|C_{v}|²$} \\
\hline
\endfirsthead
\multicolumn{9}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline
$v$ & { Calc.} & {$|C_{v}|²$} & $v$ & { Calc.} & {$|C_{v}|²$} & $v$ & {Calc.} & {$|C_{v}|²$} \\
\hline
\endhead
\hline \multicolumn{9}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
0 & 0.00000 & 1.00000 & 1 & 440.3463 & 1.00000 & 2 & 829.6073 & 0.99660 \\
001 & 16.44050 & 1.00000 & 222 & 452.27921 & 0.99876 & 222 & 373.31953 & 0.99979 \\
\end{longtable}
\end{center}
\end{document}
我建议使用另一种布局,不采用垂直线。不幸的是,booktabs
似乎不适用,revtex
所以我不得不用小boldline
包装模拟其可变粗细的线条。我还建议更改和的值\tabcolsep
,以便为包含两个部分的较短表格(如表格 I)插入一些分隔符(此处为灰色矩形):
\documentclass[aps,prl,a4,preprint]{revtex4-1}%
\usepackage{amsmath,amssymb}
\usepackage[x11names]{xcolor} \usepackage{siunitx} \sisetup{table-format=1.5,table-number-alignment=center}
\newcolumntype{T}{S[table-format=3.5]}
\usepackage{longtable, booktabs, boldline}
\usepackage{cellspace}%
%%%%%%%%
\begin{document}
\title{Supplementary Material:\\XXXXX}
\author{LF}
\affiliation{Dipartimento di Fisica}
\maketitle
We try and collect in the present Supplementary Material section, additional details about technical aspects of the algebraic formalism (such as matrix elements) that are necessary to reproduce our calculations and we give further information on the fitting procedure.
\section*{Supplementary material}
\begin{table*}
\caption{Residuals for fits $F₀$ and $F₁$.\label{tab_residuals}}\medskip
\setlength\tabcolsep{4pt}
\begin{ruledtabular}
\begin{tabular}{@{}*{5}{c} >{\color{lightgray!30}\vrule width12pt}c*{5}{c}@{}}
Initial & Final & Exp. & Calc.\ $F₀$ & Calc.\ $F₁$ & & Initial & Final & Exp. & Calc.\ $F₀$ & Calc.\ $F₁$ \\
\cline{1-5}\cline{7-11}
0 1 0 0 1 & 2 0 0 0 0 & 128.6 & $ -2.42 $ & $ -2.16 $& & 0 1 2 0 1 & 1 1 1 1 1 & 44.4 & $ -0.76 $ & $ -1.96 $ \\
\end{tabular}
\end{ruledtabular}
\end{table*}
\begin{center}
\setlength\tabcolsep{6pt}
\begin{longtable}{cTS >{\qquad}ccTS >{\qquad}ccTS}
\caption[Calculated energy levels]{Calculated energy levels}
\label{tab_calcs}\\
\hlineB{2}
$v$ & { (Calc.)} & {$|C_{v}|²$} & & $v$ & {Calc.} & {$|C_{v}|²$} & & $v$ & {Calc.} & {$|C_{v}|²$} \\
\cline{1-3} \cline{5-7} \cline{9-11}
\endfirsthead
\multicolumn{9}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline
$v$ & { Calc.} & {$|C_{v}|²$} & & $v$ & { Calc.} & {$|C_{v}|²$} & & $v$ & {Calc.} & {$|C_{v}|²$} \\
\hline
\endhead
\hline \multicolumn{9}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hlineB{2}
\endlastfoot
0 & 0.00000 & 1.00000 & & 1 & 440.3463 & 1.00000 & & 2 & 829.6073 & 0.99660 \\
001 & 16.44050 & 1.00000 & & 222 & 452.27921 & 0.99876 & & 222 & 373.31953 & 0.99979 \\
\end{longtable}
\end{center}
\end{document}
答案2
revtex4-1 文档类修改了 LaTeX 的一些低级表格生成参数。以下建议并非完全补救措施,但应该效果不错。首先,array
在序言中加载包。其次,\setlength{\extrarowheight}{-3pt}
立即发出指令前 \begin{longtable}
。
由于longtable
环境自动居中,因此请删除center
当前包围longtable
环境的环境。