Generalfigure* at the bottom of the page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
me_here_me
Posts: 46
Joined: Mon Feb 05, 2007 5:19 pm

figure* at the bottom of the page

Post by me_here_me »

Can i have a figure that spans the two columns placed at the bottom of the page?

I tried the following code, but latex sends the figure at the end of the document on an empty page.

Code: Select all

\begin{figure*}[!hb]
	\centering
		\subfloat[]{\includegraphics[width=2.0in]{Images/overview3}}
		\hspace{5mm}
		\subfloat[Test-part-1]{\includegraphics[width=1.7in]{Images/part1}}
		\hspace{5mm}
		\subfloat[test-part-2]{\includegraphics[width=1.7in]{Images/part2}}
	\caption{the caption goes here}
\label{fig:un}
\end{figure*}


any ideas
regards

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

N00bDaan
Posts: 14
Joined: Tue Feb 27, 2007 4:44 pm

Re: figure* at the bottom of the page

Post by N00bDaan »

I dont know exactly how you use the two column option, but the simpelest way is I think to end the two column enviroment somehow and then put the figure beneath that... This is just a wild guess though, with more info more can me said...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

Re: figure* at the bottom of the page

Post by Stefan Kottwitz »

Hi me_here_me,

if this problem was not solved or if you still have questions concerning figures spanning two columns or something else, let us know.
In the meantime I will move this topic from LaTeX Distributions/MiKTeX to LaTeX/General because it's not depending on the (MiKTeX) distribution, it's a general subject.

Stefan
LaTeX.org admin
mmika
Posts: 1
Joined: Thu May 15, 2008 4:17 pm

Re: figure* at the bottom of the page

Post by mmika »

Hi,

I would very much like to know this too! Does anyone know how to do this?

cheers, mmika
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

figure* at the bottom of the page

Post by Stefan Kottwitz »

Hi mmika,

welcome to the LaTeX Community board!
When I want to place a doublecolumn float at the bottom I remember two things: use the dblfloatfix package and declare the float before the page where it should appear. Here is one example:

Code: Select all

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{graphicx,dblfloatfix}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\begin{figure*}[!b]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture}
\label{fig:1}
\end{figure*}
\newpage~\newpage
\section{One}
\blindtext[2]
\newpage
\section{Two}
\blindtext[2]
\end{document}
Stefan
LaTeX.org admin
sdaau
Posts: 26
Joined: Fri Feb 19, 2010 2:08 pm

figure* at the bottom of the page

Post by sdaau »

Hi Stefan_K, all,

Thanks for a very nice example! I too am having a problem with figure* at bottom of page, and I managed to rework your example into a MWE that demonstrates this problem:

Code: Select all

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{graphicx,dblfloatfix}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\section{Zero}
\blindtext[1]

\blindtext[1]

\blindtext[1]

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 1}
\label{fig:1}
\end{figure}

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 2}
\label{fig:2}
\end{figure}

\blindtext[1]

\begin{figure*}[!b]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture dbl}
\label{fig:dbl}
\end{figure*}

%\newpage

\section{One}
A bit of bla bla bla here...

A bit of bla bla bla...

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 3}
\label{fig:3}
\end{figure}

\blindtext[1]

\blindtext[1]

\section{Two}
\blindtext[4]
\end{document}
What I'd want to get, is that "test picture 3" appears on page 2, right below the 'bla bla bla' text (i.e., "here"); and I'd want the 'dblfloat', "test picture dbl" to be on bottom of page 2 - and the rest of the text should 'wrap'/extend/'flow' beyond to page 3..

Currently, the above code does page 1 as I want it; page 2 is text only; and page 3 is a float page (where "test picture 3" is stuck to the right, and "test picture dbl" is indeed at the bottom). If I enable the \newpage, then additionally the first column on page 2 gets erased.

Would anyone know if what I want to do is possible at all?

Thanks,
Cheers!

EDIT: This code is close to what I want:

Code: Select all

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{graphicx,dblfloatfix,caption,afterpage}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\section{Zero}
\blindtext[1]

\blindtext[1]

%\afterpage{\newpage} % bottom on third page
%\afterpage{\clearpage} % cuts a column, bottom on third page

\blindtext[1]

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 1}
\label{fig:1}
\end{figure}

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 2}
\label{fig:2}
\end{figure}

%\afterpage{\newpage} % bottom on third page
%\afterpage{\clearpage} % bottom on third page

\blindtext[1]

%\afterpage{\clearpage % alone
\begin{figure*}[!b]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture dbl}
\label{fig:dbl}
\end{figure*}
%}

\newpage~\newpage % clears everything prematurely, but manages to put minipage and bottom on same page

\section{One}
A bit of bla bla bla here...

A bit of bla bla bla...

%\begin{figure}[!h]
%  \centering
%  \includegraphics{test.jpg}
%  \caption{test picture 3}
%\label{fig:3}
%\end{figure}

\noindent\begin{minipage}{\columnwidth}
\captionsetup{type=figure}
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 3}
\label{fig:3}
\end{minipage}


\blindtext[1]

\blindtext[1]

\section{Two}
\blindtext[4]
\end{document}
... with minipage instead of figure, I can get both the bottom and fig:3 to show together on page 3 - however page 2 has only a single paragraph and is blank...

EDIT2: I think I got it solved:

Code: Select all

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{graphicx,dblfloatfix,caption,afterpage}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\section{Zero}
\blindtext[1]

\blindtext[1]

%\afterpage{\newpage} % bottom on third page
%\afterpage{\clearpage} % cuts a column, bottom on third page

\blindtext[1]

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 1}
\label{fig:1}
\end{figure}

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 2}
\label{fig:2}
\end{figure}

%\afterpage{\newpage} % bottom on third page
%\afterpage{\clearpage} % bottom on third page

% figure* MUST be declared before first \newpage!
% so in this case, it is declared (still) within pg1.
\begin{figure*}[!b]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture dbl}
\label{fig:dbl}
\end{figure*}

\afterpage{\newpage} % first newpage: goes from pg1:col2 to pg2:col1

\blindtext[1]

%\afterpage{\clearpage % alone
%}

%\newpage~\newpage % clears everything prematurely, but manages to put minipage and bottom on same page
%\afterpage{\clearpage} % 

\section{One}
A bit of bla bla bla here...

A bit of bla bla bla...

%\begin{figure}[H]
%  \centering
%  \includegraphics{test.jpg}
%  \caption{test picture 3}
%\label{fig:3}
%\end{figure}

\noindent\begin{minipage}{\columnwidth}
\captionsetup{type=figure}
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 3}
\label{fig:3}
\end{minipage}


\blindtext[1]

\afterpage{\newpage}  % second newpage: goes from pg2:col1 to pg2:col2

\blindtext[1]

\section{Two}
\blindtext[1]

\afterpage{\newpage} % third newpage: goes from pg2:col2 to pg3:col1; AND 
% seemingly this 'flushes' the bottom float, which will now appear on pg2!

\blindtext[1]

\blindtext[1]

\blindtext[1]


\end{document}
I first started inserting \newpage close to end of each column, and it turns out that:
  • the

    Code: Select all

    {figure*}[b]
    needs to be defined on first page, before the first \newpage
  • first \newpage changes from pg1:col2 to pg2:col1
  • second \newpage changes from pg2:col1 to pg2:col2
  • third \newpage changes from pg2:col2 to pg3:col1, and this seemingly causes a 'flush' of the bottom figure* on page 2 (I otherwise thought that should flush at end of pg3!)
As soon as it looked like it started working with this strategy, I changed the \newpage to \afterpage{\newpage} - and that helped the flow of text to go correctly (the only thing is a lack of space around the minipage; however, with this "three step newpage" one can go back to {figure}[h] (not {figure}[H]), it will work OK).

And the biggest problem now, is that the fig:3 actually gets the caption "Figure 4" - and the bottom figure that appears afterwards gets "Figure 3" :( I tried fixltx2e:

Code: Select all

% either
\usepackage{graphicx,fixltx2e,dblfloatfix,caption,afterpage}
% or
\usepackage{graphicx,dblfloatfix,caption,afterpage,fixltx2e}
... but none of that seems to correct the order of figure captions... Any ideas how to solve that?

EDIT3: well, a 'hard' solution is to pre-increase and post-increase the figure counter (saving the value in a temporary counter), as show below:

Code: Select all

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage{graphicx,dblfloatfix,caption,afterpage,fixltx2e}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\section{Zero}
\blindtext[1]

\blindtext[1]

%\afterpage{\newpage} % bottom on third page
%\afterpage{\clearpage} % cuts a column, bottom on third page

\blindtext[1]

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 1}
\label{fig:1}
\end{figure}

\blindtext[1]

\begin{figure}[!h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 2}
\label{fig:2}
\end{figure}

%\afterpage{\newpage} % bottom on third page
%\afterpage{\clearpage} % bottom on third page

% save counter
\newcounter{savefig}
\setcounter{savefig}{\value{figure}}
% step preemptively
\stepcounter{figure}

% figure* MUST be declared before first \newpage!
% so in this case, it is declared (still) within pg1.
\begin{figure*}[!b]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture dbl}
\label{fig:dbl}
\end{figure*}

% reset counter
\setcounter{figure}{\value{savefig}}

\afterpage{\newpage} % first newpage: goes from pg1:col2 to pg2:col1

\blindtext[1]

%\afterpage{\clearpage % alone
%}

%\newpage~\newpage % clears everything prematurely, but manages to put minipage and bottom on same page
%\afterpage{\clearpage} %

\section{One}
A bit of bla bla bla here...

A bit of bla bla bla...

\begin{figure}[h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 3}
\label{fig:3}
\end{figure}

%\noindent\begin{minipage}{\columnwidth}
%\captionsetup{type=figure}
%  \centering
%  \includegraphics{test.jpg}
%  \caption{test picture 3}
%\label{fig:3}
%\end{minipage}


\blindtext[1]

\afterpage{\newpage}  % second newpage: goes from pg2:col1 to pg2:col2

\blindtext[1]

\section{Two}
\blindtext[1]

\afterpage{\newpage} % third newpage: goes from pg2:col2 to pg3:col1; AND
% seemingly this 'flushes' the bottom float, which will now appear on pg2!

% step post-emptively 
% (as here the bottom, Fig4 should be inserted - so we're ready for Fig5 next)
\stepcounter{figure}

\blindtext[1]

\blindtext[1]

\begin{figure}[h]
  \centering
  \includegraphics{test.jpg}
  \caption{test picture 5}
\label{fig:5}
\end{figure}

\blindtext[1]

\end{document}
Well - if anyone knows an easier way to solve this, I'd love to know :) Cheers!
chemenger
Posts: 1
Joined: Thu Oct 13, 2011 10:11 am

figure* at the bottom of the page

Post by chemenger »

Try stfloats.sty at http://www.ctan.org/tex-archive/macros/ ... ib/sttools

put

Code: Select all

\usepackage{stfloats}
in the preamble

Code: Select all

\begin{figure*}[bp]
...
\end{figure*}
worked for me!
Post Reply