The floating environments figure*
and table*
allow adding wide, single-column tables or figures in a two- or multicolumn document.
Here is an example.
Wide figure in a 3-column-document
The example makes use of the multicol package. For two columns, it is sufficient to use the documentclass-option twocolumn
. The starred version of figure, figure*
, and table, table*
are floating environments. Therefore, LaTeX will place the figure only on the second page, rather than at the beginning of the document.
\documentclass[11pt]{article} \usepackage{multicol, blindtext} \begin{document} \begin{multicols}{3} \begin{figure*}[ht] \centering \rule{\linewidth}{3cm} \caption{Wide single column figure in a twocolumn document.} \end{figure*} \Blindtext \end{multicols} \end{document}
It works exactly the same way for tables.
Wide table in a 2-column-document
\documentclass[twocolumn]{article} \usepackage{blindtext} \begin{document} \begin{table*}[ht] \caption{Wide single-column table in a twocolumn document.} \centering \begin{tabular}{p{0.25\linewidth}p{0.25\linewidth}p{0.25\linewidth}} \hline column 1 & column 2 & column 3\\ \hline cell 1 & cell 2 & cell 3\\ cell 1 & cell 2 & cell 3\\ \hline \end{tabular} \end{table*} \Blindtext\Blindtext \end{document}
Side-by-side figures with subfig
It works exactly the same for side-by-side figures and tables (subfig package). See my post on that topic for more details. In this example, the dblfloatfix
package is loaded. It “fixes” an issue with the floating environment and allows placing figures and tables at the bottom of a page.
\documentclass[twocolumn]{article} \usepackage{blindtext, subfig} \usepackage{dblfloatfix} % fix for bottom-placement of figure \setlength{\columnseprule}{0.5pt} \begin{document} \begin{figure*}[hb] \centering \subfloat[][]{ \rule{0.45\linewidth}{3cm} } \subfloat[][]{ \rule{0.45\linewidth}{3cm} } \caption{Wide single column figure in a twocolumn document.} \end{figure*} \Blindtext\Blindtext \end{document}
Additional notes
By default, figures and table will always be placed either at the top of a page or occupy a whole page. In the last example, we saw that it is possible to “fix” the float issue using the dblfloatfix
package. However, there is no way to place the figure in the middle of the page, using the option [b].
Mixing “starred” and “non-starred” figures/tables is possible. For LaTeX to display the floats in the right order, load the fixltx2e
package.
You can change the horizontal space between columns through:
\setlength{\columnsep}{2cm}
The following code adds a separation line between columns:
\setlength{\columnseprule}{0.5pt}
Allan
Hey could you help me with a make file that compiles a TeX document with eps images, my make file takes around 7minutes to compile a document with eps images, I think it has a bug. Looking forward to your reply
now.
tom
Hi Allan,
Please post a minimal example of your MakeFile so I have a starting point.
Thanks, Tom
jasleen
i am getting various paragraphs of no meaning if i use
\blindtext\blindtext
. but if i delete that statement. my table is added at the last i.e. after references . what to dotom
Hi Jasleen,
I sometimes use
\blindtext
to insert placeholder text for illustration. See the Blindtext package documentation for more details. Please remove it when using code from my site.TeX/LaTeX will try to find the best location for floating environments such as
table
. This might not always be where you might want them, especially large tables. You can control placement of floating environments to some extend.Try either this:
or use
\clearpage
to print the table and start a new page.workoffice464
Thanks a lot.
Jorge
Hi Tom. It is possible to have a figure with a width of just two, in a three columns document?
tom
Hi Jorge,
I’m sorry to say that I don’t think this is possible in a fully automated way. My suggestion would be to use all three columns, possibly placing the caption on either side of the figure.
HTH, Tom
Tom
The link to your post about subfigs contains a typo. Cheers though, helped me out!
tom
Thanks for letting me know. I appreciate it. Cheers, Tom
nouky
best comment so far! thanks
Ponnapa Musikapun
Thank you very much