我有下表:
\documentclass[a4paper,preprint,aps,
unsortedaddress]{revtex4}
\usepackage[top=2.5cm,bottom=2.5cm,
left=3.5cm,right=2.5cm]{geometry}
\usepackage{longtable,array,booktabs}
\ifdefined\mc
\renewcommand{\mc}{\multicolumn}
\else
\newcommand{\mc}{\multicolumn}
\fi
\begin{document}
\setlength\LTleft{-3.0cm}
\setlength\LTright{-2.0cm}
\scriptsize
\begin{longtable}{ l r @{--} p{1.3cm} >{\centering}p{2.6cm}
*{4}{p{1.25cm}} p{2.1cm}}
%% headers and footers
\caption{Table} \\
\hline\hline
\endfirsthead
\mc{9}{c}{\tablename\ \thetable\ -- \emph{Continued from previous page}} \\
\hline
aaaaaaaaaaaaaaaaaaaaaaaa & \mc{2}{c}{bbb--ccc} & ddd & eee & fff & ggg & hhh & iii \\
\hline
\endhead
\hline
\mc{9}{r}{\emph{Continued on next page}} \\
\endfoot
\hline\hline
\endlastfoot
%% body of table
aaaaaaaaaaaaaaaaaaaaaaaa & \mc{2}{c}{bbb--ccc} & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
\end{longtable}
\end{document}
我想通过设置\setlength\LTleft{-3.0cm}
和将其向左移动\setlength\LTright{-2.0cm}
。此外,我必须申请\scriptsize
表格。但是,这些命令都无法与revtex4
。您能提供此问题的解决方案吗?(此问题与\LTleft、\LTright 和 \scriptsize 无法与 revtex4 配合使用,但我无法使用该用户名注册。)如果不可能,替代解决方案对我也有用。对于这种情况,我附上了我的真实表格的第一页。
答案1
类revtex4
(顺便说一下,当前版本是)在构建时revtex4-2
发出。 的标准值为。\table@hook
longtable
\table@hook
\small
\documentclass[a4paper,preprint,aps,unsortedaddress]{revtex4-2}
\usepackage{longtable,array,booktabs}
\newcommand{\mc}{\multicolumn}
\makeatletter
\newenvironment{xlongtable}[1]
{\appdef\table@hook{#1}\longtable}
{\endlongtable}
\begin{document}
\begin{xlongtable}{\scriptsize}{
l r @{--} p{1.3cm} >{\centering}p{2.6cm}
*{4}{p{1.25cm}} p{2.1cm}
}
%% headers and footers
\caption{Table} \\
\toprule
\endfirsthead
\mc{9}{c}{\tablename\ \thetable\ -- \emph{Continued from previous page}} \\
\midrule
aaaaaaaaaaaaaaaaaaaaaaaa & \mc{2}{c}{bbb--ccc} & ddd & eee & fff & ggg & hhh & iii \\
\midrule
\endhead
\midrule
\mc{9}{r}{\emph{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
%% body of table
aaaaaaaaaaaaaaaaaaaaaaaa & \mc{2}{c}{bbb--ccc} & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
\end{xlongtable}
\end{document}
我删除了条件重新定义\mc
:如果命令已定义,则在不知道它来自何处的情况下重新定义它将是一个错误。
设置\LTleft
并\LTright
需要破解。请注意,此类技巧可能会被拒绝,因为它们会改变文档的形状,使其与revtex
人们的预期不符。
\documentclass[a4paper,preprint,aps,unsortedaddress]{revtex4-2}
\usepackage{longtable,array,booktabs}
\usepackage{showframe}
\newcommand{\mc}{\multicolumn}
\makeatletter
\newenvironment{xlongtable}[1]
{\appdef\table@hook{#1}\longtable}
{\endlongtable}
\newcommand\tobirgobblefour[4]{}
\makeatother
\begin{document}
\begin{xlongtable}{%
\scriptsize % this table is in script size
\setlength{\LTleft}{-3cm plus 1fill}% move to left
\tobirgobblefour % remove the setting of \LTleft and \LTright
}{
l r @{--} p{1.3cm} >{\centering}p{2.6cm}
*{4}{p{1.25cm}} p{2.1cm}
}
%% headers and footers
\caption{Table} \\
\toprule
\endfirsthead
\mc{9}{c}{\tablename\ \thetable\ -- \emph{Continued from previous page}} \\
\midrule
aaaaaaaaaaaaaaaaaaaaaaaa & \mc{2}{c}{bbb--ccc} & ddd & eee & fff & ggg & hhh & iii \\
\midrule
\endhead
\midrule
\mc{9}{r}{\emph{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
%% body of table
aaaaaaaaaaaaaaaaaaaaaaaa & \mc{2}{c}{bbb--ccc} & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
aaaaaaaaaaaaaaaaaaaaaaaa & bbb & ccc & ddd & eee & fff & ggg & hhh & iii \\
\end{xlongtable}
\end{document}
这里我使用showframe
只是为了使页面边界清晰。