2

I am trying to clearpage and then immediately have the figure on top, then the text below the figure on this new page. However, what shows are the following: the figure is right in the middle of the second page, and the text is on the third page. I wish to erase the 3rd page, and that the text on the 3rd page at the moment will be on the second page along with the figure.

If I do not use the /clearpage or /FloatBarrier, then the text will go to the first page, and that is the least I wanted. I also tried \afterpage, but it was not working either. I probably did something wrong. Thank you so much for helping!
Current I would like the page to be this: Expected

Below are my code sample:

\documentclass[twoside,twocolumn]{article}
\usepackage{subcaption}
\usepackage{afterpage}
\usepackage[section]{placeins}
\begin{document}
 .....
\renewcommand\thesubfigure{\alph{subfigure}}
\graphicspath{ {Data/N-DImensional(0<r_i<1)/r_i_0dot0262955/} }
\begin{figure*}[h]
\centering
\begin{subfigure}{0.5\textwidth}
\centering
  \includegraphics[width=0.85\linewidth]{0dot348731M}
  \caption{Biomass vs. Biodiversity}
  \label{fig:sub41}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
  \centering
  \includegraphics[width=0.85\linewidth]{0dot348731D}
  \caption{Biomass vs. Biodiversity}
  \label{fig:sub42}
\end{subfigure}
\caption{4-Dimensional Lokta-Volterra model with different growth rates $(x_0=0.348731)$.}
\end{figure*}

\FloatBarrier

\noindent Text Sample

\end{document}

Here are the links of what the 2 pages I imported:

This is what the pages look like right now

And this is what they look like without \clearpage

17
  • Welcome to TeX.SE! what you try so far? Please, provide small but complete document with \documentclass{...}` on beginning and \end{document} on the end. Usual help to add position option [t] to figure environment (\begin{figure}[t]).
    – Zarko
    Apr 23, 2017 at 23:57
  • @Zarko Hi, Thanks for looking through. Would this much code be sufficient? I tried using \afterpage, clearpage as well as FloatBarrior, but I could't get the Text Sample be right below the figure. Currently the figure and the text are displaying in two separate pages.
    – Valia
    Apr 24, 2017 at 0:17
  • In your MWE a preambel is missing. You should add all relevant packages and also \begin{document} ...
    – Zarko
    Apr 24, 2017 at 0:46
  • You have two column document and environment figure* (for span two columns) , which is always on the top of the next page where it is inserted. Consequently at them the positioning option hasn't sense. Please, can you explain again, what is your problem?
    – Zarko
    Apr 24, 2017 at 0:53
  • @Zarko Yeah I completely understand what you mean. It's slightly complicated and I can't really describe it well. So I have three pages. The first page consists of 3 figures, and the second page has 1 figure, and the third page has the Text. My goal is to let the first page has 3 figures, and the second page has the 4th figure and the text right below it. If I don't use \clearpage, then the 3rd figure in the first page will be in the second page, and the text will go up to the first page: so 2 figures in first page and the text, 2 figures in second page.
    – Valia
    Apr 24, 2017 at 0:59

1 Answer 1

1

Carrying this over from our chat conversation. I think the underlying issue is trying to prevent a float page from being created when both text and image would fit onto the same page.

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\begin{figure*}
    \centering
    \includegraphics[height=0.25\textwidth,width=0.75\linewidth]{pic}
    \caption{Picture}
    \label{fig:1}
\end{figure*}
\lipsum[1]

\end{document}

This will yield:float page

I have fiddled around with the float parameters of LaTeX (like \dblfloatpagefraction and friends), but no luck. Maybe a potential workaround would be to avoid putting that \includegraphics inside a floating environment at all?

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\twocolumn[{%
    \centering
    \includegraphics[height=0.25\textwidth,width=0.75\linewidth]{pic}
    \vspace{1em}
}]

\lipsum[1]

\end{document}

Result:

twocolumn-no-floatpage

A caption could be added via \captionof from the caption package, for example.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .