Latex figure on top of two column page năm 2024

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.

Latex figure on top of two column page năm 2024

\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

Latex figure on top of two column page năm 2024

\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

\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}

0 package is loaded. It “fixes” an issue with the floating environment and allows placing figures and tables at the bottom of a page.

Latex figure on top of two column page năm 2024

\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

\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}

0 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

\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}

2 package.

I want to place figures on the front page of a two column document, something like http://frank.dellaert.com/pubs/Dellaert10iros.pdf and this(pdf).

The figure* allows to include images spread across full width of two column documents. But it has some limitations. Only top(t) placement works, and does not appear on the same page where they are defined. I found stfloats package, which solves the top placement restriction, but it still demands to be defined 1 page prior.

Any suggestions on how to solve this?

Last edited by abhijit8 on Wed Nov 03, 2010 10:31 am, edited 1 time in total.


Latex figure on top of two column page năm 2024

localghost Site Moderator Posts: 9202 Joined: Fri Feb 02, 2007 12:06 pm

Latex figure on top of two column page năm 2024

by localghost » Tue Nov 02, 2010 9:32 pm

I see two approaches which only differ in the caption for the image right beneath the title.

  1. For the first document with caption. \documentclass[11pt,a4paper,english]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{babel} \usepackage[font=small,labelfont=bf,tableposition=top]{caption} \usepackage{multicol} \usepackage{blindtext} \title{Two column document with figure underneath title} \author{abhijit8} \begin{document} \maketitle \noindent \begin{minipage}{\textwidth}
    \centering\noindent  
    \rule{0.75\linewidth}{0.5\linewidth}  
    \captionof{figure}{\blindtext}  
    
    \end{minipage} \begin{multicols}{2}
    \blinddocument  
    
    \end{multicols} \end{document}
  2. For the second document without caption. \documentclass[11pt,a4paper,english]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{babel} \usepackage[font=small,labelfont=bf,tableposition=top]{caption} \usepackage{multicol} \usepackage{blindtext} \title{Two column document with image underneath title\ \normalsize Approach 1} \author{abhijit8} \begin{document} \maketitle \noindent \begin{minipage}{\textwidth}
    \centering\noindent  
    \rule{0.9\linewidth}{0.2\linewidth}  
    
    \end{minipage} \begin{multicols}{2}
    \blinddocument  
    
    \end{multicols} \end{document}
    
    
    For this case there is a second solution. \documentclass[11pt,a4paper,twocolumn,english]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{babel} \usepackage[font=small,labelfont=bf,tableposition=top]{caption} \usepackage{blindtext} \title{Two column document with image underneath title\ \normalsize Approach 2} \author{abhijit8} \date{\rule{0.9\linewidth}{0.2\linewidth}} \begin{document} \maketitle \blinddocument \end{document}

The rest depends on the used document class.

Note that the blindtext package is only loaded for creating dummy text thus is not part of the solution.

Best regards and welcome to the board Thorsten


abhijit8 Posts: 4 Joined: Tue Nov 02, 2010 12:08 pm

by abhijit8 » Wed Nov 03, 2010 10:20 am

Thanks a lot for the solutions. Is there a way to do away with the multiciols environment, since i need to use floats like figures. I tried /twocolumn instead of \begin{multicols}{2}, but it forces a new page.

I have found an another solution, by the use of \begin{strip}..\end{strip} environment, included in the cuted package.

\documentclass[11pt,a4paper,two column,english]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{babel} \usepackage[font=small,labelfont=bf,tableposition=top]{caption} \usepackage{blindtext} \usepackage{cuted} \title{Two column document with figure underneath title} \author{abhijit8} \begin{document} \maketitle \noindent \begin{strip} \centering\noindent \rule{0.75\linewidth}{0.5\linewidth} \captionof{figure}{\blindtext} \end{strip} \blinddocument \end{document}



abhijit8 Posts: 4 Joined: Tue Nov 02, 2010 12:08 pm

by abhijit8 » Wed Nov 03, 2010 10:46 am

Sorry for the confusion. I was trying to say that I am not able to use standard figure/table (non-starred) in the multicols environment. I get an error:

./new.tex:0:Floats and marginpars not allowed inside `multicols'environment!.

Is there a way to use the standard floats inside multicols environment? Otherwise, I am now able to get the desired output with the strip environment.


Latex figure on top of two column page năm 2024

localghost Site Moderator Posts: 9202 Joined: Fri Feb 02, 2007 12:06 pm

Latex figure on top of two column page năm 2024

by localghost » Wed Nov 03, 2010 11:22 am

abhijit8 wrote:[…] I was trying to say that I am not able to use standard figure/table (non-starred) in the multicols environment. […] Is there a way to use the standard floats inside multicols environment? […]

Perhaps you should be more precise about what you are after. The unstarred versions can't be used here. But if we are talking about figures and tables within one column of a multicolumn environment, you can use an approach that works with the caption package.

\documentclass[11pt,a4paper,twocolumn,english]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage[font=small,labelfont=bf,tableposition=top]{caption} \usepackage{blindtext} \usepackage{cuted} \title{Two column document with figure underneath title} \author{abhijit8} \begin{document} \maketitle \begin{strip}

\centering\noindent
\rule{0.75\linewidth}{0.5\linewidth}
\captionof{figure}{\blindtext}
\end{strip} \blindtext[2] \medskip \noindent \begin{minipage}{\linewidth}
\centering
\rule{0.75\linewidth}{0.5\linewidth}
\captionof{figure}{The quick brown fox jumps over the lazy dog}
\end{minipage} \medskip \blindtext[4] \end{document}

And thanks for bringing the very useful cuted package to my attention. It could be the solution to some older discussions about related problems here.

How do you put a figure at the top of the page in latex?

You can control the position of the figure on the page or within the chapter by including letters between the brackets after the \begin{figure} declarations. The options are h = right here, t = top of the page, b = bottom of the page, and p = separate page of figures.

How do I insert a figure into two columns in latex?

With this disclaimer in mind, the use of the environment is straightforward, as in the following example:.

% Wide figure in two column document LaTeX. \documentclass[twocolumn]{article}.

% For including images. ... .

% For dummy text. ... .

\lipsum..

\begin{figure*} ... .

\caption{This is a wide figure that spans both columns.} ... .

\lipsum..

How to use multicolumn in latex?

The \multicolumn is used to make an entry that spans several columns. The first mandatory argument, cols , specifies the number of columns to span. The second mandatory argument, pos , specifies the formatting of the entry; c for centred, l for flushleft, r for flushright.