Graphics, Figures & Tables ⇒ Long tables in twocolumn mode
-
- Posts: 23
- Joined: Mon Aug 20, 2012 5:12 pm
Long tables in twocolumn mode
I should produce a long table in a twocolumn book, but the longtable package only works with onecolumn documents.
I found that REVTeX 4.1 contains patches that enable the longtable package to work in two-column mode. In particular, it provides the additional environment longtable* which allows a longtable to span the whole page width.
Is there a way of including only those patches in my document, without having to change the class from "book" to "revtex4-1"?
Thanks!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Long tables in twocolumn mode
Welcome to the LaTeX Community!
I would if possible simply place the long table on pages of its own started with
\onecolumn
and use \twocolumn
after it again.Is that a possibility for you?
As far as I know revtex is incompatible with quite a few packages. So changing from book is probably not a good way to go.
(I'm not sure there are many people here going to dig into longtable to find a patch.)
Best regards
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Long tables in twocolumn mode
longtable*
work. Thus you are best going with @cgnieder's approach.-
- Posts: 23
- Joined: Mon Aug 20, 2012 5:12 pm
Re: Long tables in twocolumn mode
At the moment I fixed the problem by switching to \onecolumn, as suggested by cgnieder; the only drawback I care (the creation of a new page is not really a problem for me) is that footnotes appear in one-column style.
From what you said, I guess that there is no chance for me to import the new environment definitions from revtex4-1.cls into my preamble. Do you agree?
Best regards!
Long tables in twocolumn mode
As for the footnotes: the following is not a perfect solution but might work for you in this special case (as long as you have only one footnote in the onecolumn part):
Code: Select all
\documentclass[twocolumn]{article}
\usepackage{lipsum}% for dummy text
\usepackage{etoolbox}% provides \patchcmd
\makeatletter
\patchcmd[\long]{\@footnotetext}
{\hsize\columnwidth}% search
{\if@twocolumn\else\divide\columnwidth\tw@\fi\hsize\columnwidth}% replace
{}{}% success, failure
\makeatother
\begin{document}
\twocolumn
\lipsum[1]
A small text with a footnote\footnote{\lipsum[4]} \lipsum[2-6]
\onecolumn
\lipsum[1]
A small text with a footnote\footnote{\lipsum[4]} \lipsum[2-6]
\end{document}
Long tables in twocolumn mode
Code: Select all
\documentclass[twocolumn]{article}
\usepackage{lipsum}% for dummy text
\usepackage{dblfnote}
\begin{document}
\twocolumn
\lipsum[1]
A small text with a footnote\footnote{\lipsum[4]} \lipsum[2-3]
A small text with a footnote\footnote{\lipsum[4]} \lipsum[4-5]
\onecolumn
\lipsum[1]
A small text with a footnote\footnote{\lipsum[4]} \lipsum[2-4]
A small text with a footnote\footnote{\lipsum[4]} \lipsum[5-6]
\end{document}
-
- Posts: 23
- Joined: Mon Aug 20, 2012 5:12 pm
Long tables in twocolumn mode
thanks a lot for your suggestion! The dblfnote package would have been perfect (I compiled your code), if only I had not to manage two footnote systems:
Code: Select all
\documentclass[a4paper,twocolumn]{book}
\usepackage{array}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage[norule,multiple,stable]{footmisc}
\usepackage{manyfoot}
\usepackage{dblfnote}
\usepackage{longtable}
\DeclareNewFootnote{B}[alph]
\newcommand{\footnoteBin}[1]
{\footnotemarkB\newcounter{#1}\setcounter{#1}{\value{footnoteB}}}
\newcommand{\footnoteBout}[2]
{\parbox{0pt}{}\footnotetextB[\value{#1}]{#2}}
Regards
Long tables in twocolumn mode
It seems that whatever dblfnote does to footnotes it doesn't do to others defined by manyfoot (or for any of bigfoot for that matter).
For the moment I'm out of suggestions I'm afraid. Maybe I'll have a look into the code of
dblfnote
the other day but I can't promise anything.Regards
-
- Posts: 23
- Joined: Mon Aug 20, 2012 5:12 pm
Long tables in twocolumn mode
In order to make \footnoteB work within the parboxes (implicitely defined by the p-columns of the longtable) I defined two new commands (
\footnoteBin
and \footnoteBout
):-
\footnoteBin
defines a footnote label and places a footnotemark within the p-column text;-
\footnoteBout
is placed within the next l-column of the table and prints the footnotetext of a given footnote label.(This procedure is not required for standard footnotes; the very manyfoot apparatus seem to work within l-, c- or r-columns).
Thanks for the help and regards!