Lately, I was trying to fit a long multi-column table with a lot of text in a double-column single-file document. The document is making heavy use of single-column tabularxs in two-column mode, my long table is in one-column mode. I struggled in conveniently getting the multi-page table to work with tabularx-like column formatting up to page-width.
As for the convenience/automation part (thanks to the nice overview), I know of
tabularx, awesome for column formatting but not for multi-page tablesltablex, awesome for combiningtabularxwithlongtablebut not well matching with double-column documents (at least I haven't managed to get around the changesltablexdoes to thetabularxpackage)xtab(enhancement ofsupertabular), awesome features but without supportingtabularx-style column formatting (at least I haven't managed)tabulary, which nicely automates column formatting but is not the right thing to do multi-page tables
I found some answers on multi-page tables with tabularx (e.g. here, here) and an answer using tabulary (here), not quite doing what I intent.
The following MWE using ltablex does almost what I want:
\documentclass[twocolumn]{article}
\usepackage{lipsum}
% \usepackage{tabularx} % works for 1st table only
\usepackage{ltablex} % works for 2nd table only
\begin{document}
\title{Title}
\author{Author}
\maketitle
\lipsum[1-4]
\begin{table}
\caption{A small table in twocolumn mode}
\begin{tabularx}{\columnwidth}{lllXX}
\textbf{C1} & \textbf{C2} & \textbf{C3} & \textbf{C4} & \textbf{C5} \\
A & 1 & a & Quite a bit of text here as well, though. & Quite a bit of text here as well, though. \\
A & 1 & a & Quite a bit of text here as well, though. & Quite a bit of text here as well, though.
\end{tabularx}
\end{table}
\newpage
\onecolumn
\begin{tabularx}{\linewidth}{l>{\hsize.2\hsize}XXX}
\caption{Full-width multi-page table in one-column mode}\\
\textbf{C1} & \textbf{C2} & \textbf{C3} & \textbf{C4} \\
\endfirsthead
\textbf{C1} & \textbf{C2} & \textbf{C3} & \textbf{C4} \\
\endhead
\multicolumn{4}{r}{{Continued on next page}} \\
\endfoot
\multicolumn{4}{r}{{End}} \\
\endlastfoot
Text & Some other text here & \lipsum[11] & \lipsum[11] \\
Text & Some other text here & \lipsum[11] & \lipsum[11] \\
Text & Some other text here & \lipsum[11] & \lipsum[11] \\
Text & Some other text here & \lipsum[11] & \lipsum[11] \\
Text & Some other text here & \lipsum[11] & \lipsum[11] \\
Text & Some other text here & \lipsum[11] & \lipsum[11]
\end{tabularx}
\newpage
\twocolumn
\lipsum[10-14]
\end{document}
The MWE works with either the first table and tabularx or the second table and ltablex. However, with ltablex (which uses longtable), I am getting:
Package longtable Error: longtable not in 1-column mode.
Also, I got aware of the ltxtable package, however, it requires a split of files. Can I get ltablex to deal better with twocolumn mode or do I have to switch to ltxtable?
Thank you!
tabularxin astripenvironment from thecutedpackage (sttoolsbundle). – Bernard Aug 25 '18 at 09:13\onecolumnbefore the table and do as you would do for a single column document. that said I thinktabularxis over-used and I probably wouldn't use it on a document I was writing by hand in latex (it is more useful for automated production where you have less control over the formatting) – David Carlisle Aug 25 '18 at 10:20\onecolumnis already in place. I will make this clear in the question. Asltablexcame closest to what I wanted but was interfering AND I wanted to keep my othertabularxchunks, I was wondering whether there is a package/a way to do it without this sort of conflict? I read thatltablexhas a\setlongtableswitch. Believing that this would changeltablex's mode of usinglongtableandtabularxI tried to set it but couldn't get it to work. – mfg Aug 25 '18 at 10:31tabularxin the first place would be an option. – mfg Aug 25 '18 at 10:34tabularx? – David Carlisle Aug 25 '18 at 10:370.2 \hsize. Without that the three variable-width columns (specified with X) would be split evenly, that is,1/3 \hsizeeach. – mfg Oct 13 '19 at 17:33