I am trying to figure out how to make a full page-width table, which continues over multiple pages in two column document. I got it working for the standard article, unfortunately the journal I want to publish in, requires revtex4-1. I've found some questions on that topic. Non of them, however, mentions revtex environment and not many answers are satisfying to be honest, when it comes to longtable* (probably not the way to go with two columns – document formatting crashes afterwards), xtabular* or supertabular*.
One more thing, can I get it working without page break afterwards?
My only working example without revtex unfortunately:
%\documentclass[twocolumn]{article}
\documentclass[aip, amsmath, amssymb, reprint]{revtex4-1}%
\usepackage{xtab,afterpage}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]
\afterpage{\onecolumn
\begin{xtabular*}{\textwidth}{l@{\extracolsep{\fill}}lllll}
\hline
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
col1 & col2 & col3 & col4 & col5 & col6 \\
\end{xtabular*}
\twocolumn
}
\lipsum[6-14] % more filler text
\end{document}
Best Answer
The underlying problem is that
revtex4-1
loads theltxgrid
package, which makes a number of changes to the latex kernel. In particular, the handling of multicolumn material is changed. The latex commands\onecolumn
andtwocolumn
are replaced by\onecolumngrid
and\twocolumngrid
. In addition,ltxgrid
modifies thelongtable
macro.The
widetext
environment ofrevtex4-1
packages the switch from two columns to one column so that single column material can be placed into an environment which begins and ends with leaders (or adornments). The adornments are intended to guide the reader across the column breaks. This environment is mainly aimed at wide equations or passages of text that need visual emphasis, but you can also put a table into it.You can also just use
onecolumngrid
andtwocolumngrid
directly, which may be preferred if you don't want the adornments around the table.First, I'll illustrate with your MWE and
widetext
. Then, I'll show a solution usinglongtable
to continue the headers and footers across page breaks, without the adornments.The
widetext
environment adds the adornments automatically; and, because they are set as leaders, they will drop out at page breaks. So, we see an adornment at the end of this table and not at the starting page break.For the
longtable
case, I'll switch to using\onecolumngrid
and\twocolumngrid
. We wantlongtable
to reach the full width of the page, so we again include@{\extracolsep{\fill}}
. Ordinary, we would also useto remove the default
\fill
on either side of the table (seelongtable
documentation, page 7). However,ltxgrid
has rewritten part of the macro, overriding these manual selections. Instead, we can define another alignment option forlongtable
, analogous to the [c], [l], and [r] that are already defined. I'll call this option [e] (i.e., we have extracolsep):(I had thought that I would also need to use
xpatch
as follows, but it seems unnecessary in this case:I'm not sure why this patch isn't also needed).
Putting all this together, we have the following code:
Finally, it may be of interest that this particular table will fit into a two column format (under
ltxgrid
) withlongtable
if you comment out\onecolumngrid
and\twocolumngrid
.