2

I'm trying to include a not too lengthy table of mathematical notation definitions in a paper I'm writing. The paper is in twocolumn mode, the definition table has to span both columns, because otherwise it is far too narrow to be readable, but even so (and with the table font reduced as much as I can) it still ends up being longer than a page (it's about a page and a half long).

This is an MWE (hopefully, since it wasn't working I ended up simply breaking the table into two instead), of what I tried to do. Unlike how I expected it to work, \afterpage didn't do it's job, and the text page was immediately broken off at that point (leaving the page significantly empty), the two page table worked nice in its spanned column (if I recall right), and then it went back to two column mode and the text after flowed fine.

\documentclass[letterpaper,twoside,twocolumn,10pt]{article}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{ltablex}
\usepackage{afterpage}

\begin{document}
\twocolumn[
    Title block goes here.

    So does the abstract, but let's ignore those for now.
]

\section{Foo}
Insert much text here.

\afterpage{
    \onecolumn
    \begin{tabularx}{\textwidth}{
        >{$\displaystyle}c<{$}
        >{}l<{}
        >{}p{0.45\textwidth}<{}
    }
        \multicolumn{3}{c}{Magical table goodness happens here} \\
        \round(x) & Round & Nearest integer to \( x \), that is \( \lfloor x + 0.5 \rfloor \) \\
    \end{tabularx}
    \twocolumn
}

More text happens here.
\end{document}

Essentially, what I'm trying to do, is make what amounts to a float that's two pages long, within which I can stick a longtable or something similar.

I'm open to any suggestions for alternative methods. I don't have to use this method, but it's what came to mind. (And if worse comes to worse, I'll just shove the definitions over to the very end of the paper, flip to one column, and call it an appendix.)

5
  • 3
    afterpage is working as documented in two column mode. The footnote to the first sentence of the documentation says: This implementation does not work in two column mode Jan 27, 2015 at 14:12
  • You don't need to move the table to an appendix if you do not want to, leave it until document edits are more or less done then put \onecolumn to force a page break and switch to single column at the point that latex breaks the two column page anyway, then have the longtable over 2 or more pages, then back to \twocolumn Jan 27, 2015 at 14:14
  • @DavidCarlisle I completely missed that in the footnote in the afterpage documentation. As to the way to make it work, I had thought of that as a method, but it's very much an "ugly" way of doing things; it feels almost like what you'd have to do with Word than LaTeX.
    – CMG
    Jan 27, 2015 at 14:20
  • 1
    Yes sure it's "ugly" but any system you eventually reach a feature that is not currently supported and so have to push a bit at the boundaries of what might be considered "ugly". Jan 27, 2015 at 14:24
  • @DavidCarlisle very true. Thanks for the help. If you put it in an answer (even if it's basically just a "sorry, but no, here's how to do it manually") I'll be glad to upvote and accept it.
    – CMG
    Jan 27, 2015 at 15:49

1 Answer 1

3

afterpage doesn't support twocolumn (I never thought anyone was going to use it at all:-) and making it do so would be quite a bit of work.

If you use \onecolumn at the point where latex would have broken the text page had there been no table, you can then add the longtable in 1-column mode, then issue \twocolumn and resume the text.

This is more hand work that desirable, but if you leave it until other document edits are done it's not so bad, and anyway sometimes that's just the way it is: the requested feature isn't unreasonable it's just not implemented...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.