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 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!