165

I want a table that is as wide as the whole page in a document with option twocolumn. The table has to be inserted on the bottom of the page, but that is not necessary.

I've tried:

\begin{table*}[b]
  ...
\end{table*}

But that puts the table at the end of the document instead of on the same page. I also tried:

\twocolumn[
  \begin{table}[b]
    ...
  \end{table}
]

But that gives me an error: ! Argument of \@xfloat has an extra }. Combining \twocolumn and the star mark gives the same error.

What's the right way to do this?

Keelan
  • 5,425

1 Answers1

163

For table* and figure*, the only available options are t (top of next page) or p (end of document). b and h have been disabled on purpose, there is probably a strong typographical reason behind it.

Since you state that the placement on the bottom of the page is "not necessary", I suggest you use the [t] option instead of [b].

Note that the table may appear one the next page instead of the current one. If you really need to control on what page the table is, you may have to move the table definition up in the source code.

MWE

\documentclass[twocolumn]{article}

\usepackage{lipsum}

\begin{document}

\lipsum[1-10] % To create a random first page

\lipsum[1-3]

[Location of the table in source code]

\begin{table*}[t]
  \centering
  \begin{tabular}{lcr}
    1 & 2 & 3 \\
    4 & 5 & 6 \\
    7 & 8 & 9
  \end{tabular}
  \caption{Blabla}
  \label{tab:1}
\end{table*}

\lipsum[1-6]

\end{document}

The table will be on the third page, you'd have to move it up the code to get it in 2nd page.

Further reading: How to influence the position of float environments like figure and table in LaTeX?

Moriambar
  • 11,466
T. Verron
  • 13,552
  • 2
    Works! Irritating that [b] doesn't give an error, but okay. I've tried this by the way, guess I missed that it worked because I didn't have much text after the table. Now trying with lipsum and it works! :-) – Keelan Jan 05 '13 at 14:27
  • 1
    [t] includes this page not just following pages (unless you use flafter package) so the note above about moving the source code should not be needed. – David Carlisle Jan 05 '13 at 15:15
  • 2
    @DavidCarlisle : I'm not sure to understand what you mean, but I included a MWE as an example for the need to move the table in source code. If I remember correctly, the problem is not that the float is placed on the next page, but rather that (as any float) it is placed after its location in the source code. So as a result, if we ask that place to be the top of a page, it is necessarily the next one (except maybe if the table is the very first thing to appear in the page). – T. Verron Jan 05 '13 at 15:49
  • 1
    Your statement "but rather that (as any float) it is placed after its location in the source code. " is what I was referring to, LaTeX by default does not do that, floats may appear before their position in the source code (not on earlier pages, but they can appear at top of the current page). – David Carlisle Jan 05 '13 at 15:52
  • 2
    Hmm what I say is true for one column (take your example without [twocolumn] and you will see the figure appear before its source position) In two column I think it is supposed to work if the source appears in the first column (if it appears in the second column it is too late to change the height of the first column) but actually on this example the figure doesn't move unless you move the source to the first page. hmmmm – David Carlisle Jan 05 '13 at 16:03
  • 1
    @DavidCarlisle : That's why your comment surprised me : I have had lots of trouble with double-column floats in the past months, but I never saw any appearing on the current page. Anyway, that doesn't mean it is impossible, so I editted the answer to avoid any confusion. – T. Verron Jan 05 '13 at 16:05
  • 1
    I never really ever used two column mode in actual documents:-), just looking at the sources now..... Sorry I think that in twocolumn mode you are right and t never includes the current page % If @firstcolumn = false, then it puts out the current % two-column page, any possible two-column float pages, % and determines \@dbltoplist for the next page. % – David Carlisle Jan 05 '13 at 16:14
  • @DavidCarlisle -- even if the full-width figure with [t] is at the very top of the file, it's never going to be placed at the top of the first page -- one or two columns. for a horrible hack that will put a full-width figure at the bottom of a two-column page, see How to put a full-width table at the top or bottom of the same two-column page as the reference text? – barbara beeton Sep 07 '14 at 16:11
  • Even when I use t the table is shown at the end of the document; neither h nor t does not work for me. The question is here: (https://tex.stackexchange.com/q/676825/148579) Is there a solution for it? – Questioner Mar 01 '23 at 13:26