我在一份 LaTex 文档中为一本双列模式的期刊写了一张多页、两列宽的长表格(后续页面的标题上有“继续”注释)。编写这种表格的唯一方法是使用 xtab 包。然而,结果是几个表格部分相互重叠。我该如何修复这个错误?
笔记:我不想要在两列文档中使用一列宽的表格。
\documentclass[twocolumn]{article} % in real case: {svjour3} % twocolumn
\usepackage{xtab, lipsum, array}
\begin{document}
\section{Introduction}
\label{intro}
\lipsum*[2]
\subsection{Subsection}
\label{sec:1.1}
\lipsum*[2]
\topcaption{The caption} \label{tab:1}
\tablefirsthead{
\hline
\textbf{Column1} & \textbf{Column2} \\
\hline}
\tablehead{
\multicolumn{2}{@{}l}{\em Table \ref{tab:1}, cont'd\strut}\\
\hline
\textbf{Column1} & \textbf{Column2} \\
\hline}
\tabletail{\hline}
\tablelasttail{\hline}
\begin{xtabular}[b]{@{}p{0.2\textwidth}@{\hspace{0.01\textwidth}}p{0.79\textwidth}}
1st Row First Column & \lipsum*[2]\\
2nd Row Second Column & \lipsum*[2]\\
3rd Row Third Column & \lipsum*[2]\\
4th Row Fourth Column & \lipsum*[2]\\
5th Row Fourth Column & \lipsum*[2]\\
6th Row Fourth Column & \lipsum*[2]\\
7th Row Fourth Column & \lipsum*[2]\\
8th Row Fourth Column & \lipsum*[2]\\
9th Row Fourth Column & \lipsum*[2]\\
10th Row Fourth Column & \lipsum*[2]\\
11th Row Fourth Column & \lipsum*[2]\\
12th Row Fourth Column & \lipsum*[2]\\
13th Row Fourth Column & \lipsum*[2]\\
14th Row Fourth Column & \lipsum*[2]\\
\end{xtabular}
\lipsum*[2]
\lipsum*[2]
\lipsum*[2]
\lipsum*[2]
\end{document}
答案1
您实际上希望在文本中间的某个地方更改页面布局。简单粗暴的解决方案是\onecolumn
在表格前添加,并在其末尾添加\twocolumn
。然而,这会导致在新页面上开始新的布局。因此表格前后的空白空间可能相当大(直到整个页面)。
为了解决您的问题我想到以下几种可能性:
- 将您的表格设置为单独的文档,然后借助
pdfpages
包将其包含在内(例如在附录中)。 - 将表格缩小到列宽并将其重新设计为一列,并将第一列的内容作为第二列内容之前的行
description
代替表格使用
\onecolumn
作为使用/解决方案的说明\twocolumn
以及description
可能的解决方案的使用,请测试以下 MWE:
\documentclass[twocolumn]{article} % in real case: {svjour3} twocolumn
\usepackage{xtab,lipsum,array,ragged2e}
\begin{document}
\section{Introduction}
\label{intro}
\lipsum[1-5]
\begin{description}\RaggedRight
\item[1st Row First Column]~\\ \lipsum*[2]
\item[2nd Row Second Column] \lipsum*[2]
\item[3rd Row Third Column] \lipsum*[2]
\item[4th Row Fourth Column] \lipsum*[2]
\item[5th Row Fourth Column] \lipsum*[2]
\item[6th Row Fourth Column] \lipsum*[2]
\item[7th Row Fourth Column] \lipsum*[2]
\item[8th Row Fourth Column] \lipsum*[2]
\end{description}
\section{Section}
\label{sec:1}
\lipsum*[1]
\subsection{Subsection}
\label{sec:1.1}
\lipsum*[2]
\onecolumn
\topcaption{The caption} \label{tab:1}
\tablefirsthead{
\hline
\textbf{Column1} & \textbf{Column2} \\
\hline}
\tablehead{
\multicolumn{2}{@{}l}{\em Table \ref{tab:1}, cont'd\strut}\\
\hline
\textbf{Column1} & \textbf{Column2} \\
\hline}
\tabletail{\hline}
\tablelasttail{\hline}
\begin{xtabular}[b]{@{}p{0.2\textwidth}@{\hspace{0.01\textwidth}}p{0.79\textwidth}}
1st Row First Column & \lipsum*[2]\\
2nd Row Second Column & \lipsum*[2]\\
3rd Row Third Column & \lipsum*[2]\\
4th Row Fourth Column & \lipsum*[2]\\
5th Row Fourth Column & \lipsum*[2]\\
6th Row Fourth Column & \lipsum*[2]\\
7th Row Fourth Column & \lipsum*[2]\\
8th Row Fourth Column & \lipsum*[2]\\
\end{xtabular}
\twocolumn
\end{document}