0

I have a document with several large figures. I know the Latex algorithm does not want to place text on a page with a large figure but I need to find a way to force it that still allows me to use the elsarticle package from Elsevier. Currently, I end up with an unacceptable amount of white space in the article as LaTex tries to fit it as seen in the following figure:

enter image description here

You will notice that the last figure switches to a single column, this is a workaround I tried using a \includegraphic outside a figure environment and \onecomumn. However, when I try to change it back to a two column environment the figure slips to the next page. I am happy with the amount of text that is positioned under the figure and if I can get this to reproduce as two columns, in addition to the caption and the figure label, I would be satisfied.

The figure is the example is 7.5 inches x 5.5 inches but has been replaced with a \rule here for to allow it to compile. The MWE includes just one image size for simplicity. I have a few different figure sizes and yes, I have tried to compress them as much as I dare.

\documentclass[a4paper,10pt,twocolumn,preprint,3p]{elsarticle}
\usepackage{lineno,hyperref}
\modulolinenumbers[5]
\journal{Journal of Tex - Stack Exchange}
\renewcommand{\textfraction}{0.00000001} 
% Packages added by Ausitn Downey
\usepackage{placeins}    % used to allow \floatbarrier
\usepackage[english]{babel}
\usepackage{blindtext}
%% `Elsevier LaTeX' style
\bibliographystyle{elsarticle-num}
%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{frontmatter}
\title{Fitting a large figure on a page}
%% Group authors per affiliation:
\author[add1]{Austin Downey}
\address[add1]{Stack exchange;}
\begin{abstract}
\blindtext
\end{abstract}
\begin{keyword}
figures, fitting
\end{keyword}
\end{frontmatter}
\linenumbers

\section{Introduction}
\blindtext 
\blindtext
\section{Methodology}
\blindtext

\begin{equation}
Q(x) = a * \mathrm{e} ^ {b/x} + c * \mathrm{e} ^ {d/x}
\label{eq:4_parameter_equation}
\end{equation} 

\noindent where $Q$  is the model, $x$ is the number of cycles and $a,b,c$ and $d$ are the parameters that need to be fitted.

\begin{equation}
Q(x) = a * \mathrm{e} ^ {b/x} + c * (1 - \mathrm{e} ^ {d/x})
\label{eq:3_parameter_equation}
\end{equation} 

\noindent  $a,b$ and $c$ and are the parameters that need to be fitted and $b=0$ is considered a constant. 

\begin{figure*}[tp!]
    \centering
    \rule{\linewidth}{5.5 in} \\
    \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
    \label{fig:Predictions}
\end{figure*}





\blindtext
\begin{figure*}[tp!]
    \centering
    \rule{\linewidth}{5.5 in} \\
    \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
    \label{fig:Predictions}
\end{figure*}
\blindtext
\blindtext

\begin{figure*}[tp!]
    \centering
    \rule{\linewidth}{5.5 in} \\
    \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
    \label{fig:Predictions}
\end{figure*}

\onecolumn
\rule{\linewidth}{5.5 in} \\
\blindtext
\blindtext
\blindtext
\blindtext

\FloatBarrier
\section*{Acknowledgements}
This work is supported by the Stack Exchange.
\end{document}
  • it's impossible to use your test file as there are no figures, please replace them by \rule{\linewidth}{some height} where the height are chosen to show the problem. It isn't clear why you can't just use figure* for the last figure. – David Carlisle Jul 28 '17 at 11:32
  • @DavidCarlisle I replaced the figures with a rule to allow them to compile. The last figure was my attempt to get the figure on the same page as a text. If I use the figure float environment Latex will simply push it to the next page, as it did on the other figures. – Austin Downey Jul 28 '17 at 11:45
  • If I just use figure* and remove the floatbarrier I get this which doesn't seem unreasonable – David Carlisle Jul 28 '17 at 12:02
1

with the document using [!tp] as in the question, you get

enter image description here

If you change the figure options to [t] then you get

enter image description here

Neither of which seem unreasonable.

\documentclass[a4paper,10pt,twocolumn,preprint,3p]{elsarticle}
\usepackage{lineno,hyperref}
\modulolinenumbers[5]
\journal{Journal of Tex - Stack Exchange}
\renewcommand{\textfraction}{0.00000001} 
% Packages added by Ausitn Downey
\usepackage{placeins}    % used to allow \floatbarrier
\usepackage[english]{babel}
\usepackage{blindtext}
%% `Elsevier LaTeX' style
\bibliographystyle{elsarticle-num}
%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{frontmatter}
\title{Fitting a large figure on a page}
%% Group authors per affiliation:
\author[add1]{Austin Downey}
\address[add1]{Stack exchange;}
\begin{abstract}
\blindtext
\end{abstract}
\begin{keyword}
figures, fitting
\end{keyword}
\end{frontmatter}
\linenumbers

\section{Introduction}
\blindtext 
\blindtext
\section{Methodology}
\blindtext

\begin{equation}
Q(x) = a * \mathrm{e} ^ {b/x} + c * \mathrm{e} ^ {d/x}
\label{eq:4_parameter_equation}
\end{equation} 

\noindent where $Q$  is the model, $x$ is the number of cycles and $a,b,c$ and $d$ are the parameters that need to be fitted.

\begin{equation}
Q(x) = a * \mathrm{e} ^ {b/x} + c * (1 - \mathrm{e} ^ {d/x})
\label{eq:3_parameter_equation}
\end{equation} 

\noindent  $a,b$ and $c$ and are the parameters that need to be fitted and $b=0$ is considered a constant. 

\begin{figure*}[t]
    \centering
    \rule{\linewidth}{5.5 in}

    \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
    \label{fig:Predictions}
\end{figure*}





\blindtext
\begin{figure*}[t]
    \centering
    \rule{\linewidth}{5.5 in}

    \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
    \label{fig:Predictions}
\end{figure*}
\blindtext
\blindtext

\begin{figure*}[t]
    \centering
    \rule{\linewidth}{5.5 in}

    \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
    \label{fig:Predictions}
\end{figure*}

\begin{figure*}[t]
   \centering
\rule{\linewidth}{5.5 in} 
\end{figure*}
\blindtext
\blindtext
\blindtext
\blindtext


\section*{Acknowledgements}
This work is supported by the Stack Exchange.
\end{document}
  • Yeah, changing the [tp] to [t] is what I needed. Seems so simple now. – Austin Downey Jul 28 '17 at 12:22
1

Here are two solutions, from the sttools bundle: stfloatsallows to use the [b] placement option for large figures in two-column documents, places them, as much as possible, on the same page as the command and checks they appear in the right order.

As a last resort, you can make the figure non-floating, with the strip environment, from the cuted package (also in the sttools bundle). To have a caption and label, use the \captionof command from caption:

\documentclass[a4paper,10pt,twocolumn,preprint,3p]{elsarticle}
\usepackage{lineno,hyperref}
\modulolinenumbers[5]
\journal{Journal of Tex - Stack Exchange}
\renewcommand{\textfraction}{0.00000001}
% Packages added by Ausitn Downey
\usepackage{placeins} % used to allow \floatbarrier
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{stfloats, cuted, caption}
%% `Elsevier LaTeX' style
\bibliographystyle{elsarticle-num}
%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{frontmatter}
  \title{Fitting a large figure on a page}
  %% Group authors per affiliation:
  \author[add1]{Austin Downey}
  \address[add1]{Stack exchange;}
  \begin{abstract}
    \blindtext
  \end{abstract}
  \begin{keyword}
    figures, fitting
  \end{keyword}
\end{frontmatter}
\linenumbers

\section{Introduction}
\blindtext
\blindtext
\section{Methodology}
\blindtext

\begin{equation}
  Q(x) = a * \mathrm{e} ^ {b/x} + c * \mathrm{e} ^ {d/x}
  \label{eq:4_parameter_equation}
\end{equation}

\noindent where $Q$ is the model, $x$ is the number of cycles and $a,b,c$ and $d$ are the parameters that need to be fitted.

\begin{equation}
  Q(x) = a * \mathrm{e} ^ {b/x} + c * (1 - \mathrm{e} ^ {d/x})
  \label{eq:3_parameter_equation}
\end{equation}

\noindent $a,b$ and $c$ and are the parameters that need to be fitted and $b=0$ is considered a constant.

\begin{figure*}[t]
  \centering
  \includegraphics[width=1.0\linewidth]{Predictions.jpg} \\
  \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (a)-(f.)}
  \label{fig:Predictions1}
\end{figure*}

\blindtext
\blindtext
\blindtext
\begin{figure*}[tb]
  \centering
  \includegraphics[width=1.0\linewidth]{Predictions.jpg} \\
  \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (b)-(g.)}
  \label{fig:Predictions2}
\end{figure*}
\blindtext
\blindtext
\blindtext
\blindtext

\begin{figure*}[tb]
  \centering
  \includegraphics[width=1.0\linewidth]{Predictions.jpg} \\
  \caption{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (c)-(h.)}
  \label{fig:Predictions3}
\end{figure*}

\blindtext
\blindtext
\blindtext
\blindtext

\begin{strip}
  \includegraphics[width=1.0\linewidth]{Predictions.jpg}
  \captionof{figure}{Capacity life prediction figure used for fitting a figure onto a larger page. My subcaption needs to be this long to explaine all the subplot that are in the figure, including plots (c)-(h.)}
  \label{fig:Predictions4}
\end{strip}

\blindtext
\blindtext
\blindtext
\blindtext

\FloatBarrier
\section*{Acknowledgements}
This work is supported by the Stack Exchange.
\end{document} 

enter image description here

enter image description here

  • Thanks, both of these solutions work. However, while copying the packages over to my document I found that changing my float option from [tp] to [t] also worked as well, without the use of any packages. Thanks again. – Austin Downey Jul 28 '17 at 12:18
  • 1
    These are the only options that work without any package in two column mode. However stfloats tries in addition to place the floats at the right place and in the right order. – Bernard Jul 28 '17 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.