0

I have six figures drawn on a page with minipage, I have limitations to use this subfloat and minipage environment to fit a journal requirement. The problem is that there is a lot of space left before and after figures at the top and bottom. I was able to remove space at the top by using \vspace{} but now there is space at the bottom and latex not putting text on this space. How can i put text in this space. My article is based double column format.

\begin{figure*}[]
    \vspace{-5.1cm}
    \begin{minipage}{\columnwidth}
        \centering
        \subfloat[This is Fig 1]{   \label{fig:1} \includegraphics[width=\columnwidth]{1.eps} }
        \subfloat[This is Fig 2]{   \label{fig:2} \includegraphics[width=6.3cm,height=4.5cm]{2.eps} }\hfill
        \subfloat[This is Fig 3]{   \label{fig:3} \includegraphics[width=\columnwidth,keepaspectratio]{3.eps} }
        \subfloat[This is Fig 4]{   \label{fig:4} \includegraphics[width=6.3cm,height=4.5cm]{4.eps} }   \hfill
        \subfloat[This is Fig 5]{   \label{fig:5} \includegraphics[width=\columnwidth]{5.eps}}      
        \subfloat[This is Fig 6]{   \label{fig:6} \includegraphics[width=6.3cm,height=4.5cm]{6.eps} }
    \end{minipage}%
    \caption[.]{Test values.} 
    \label{fig:test}        
\end{figure*}

EDIT

This is the code that produces blank spaces at the top and bottom of the page. If i use vskip after begin figure then top white space is removed but still text is not put in the bottom blank white space. When producing MWE on a seperate tex file with journal template the blank spaces are not shown. In my document i am facing this issue. The format of journal is double column, document class is ccjnl.

\documentclass{ccjnl}% Journal template Do not delete this line
\usepackage{multirow}
\begin{document}
\begin{figure*}[]
    %\vspace{-5.1cm}
    %\begin{minipage}{\columnwidth}
    \centering
    \subfloat[First]{   \label{fig:1} \includegraphics[width=\columnwidth]{figures/first.png} }
    \subfloat[Second]{      \label{fig:2} \includegraphics[width=6.3cm,height=4.5cm]{figures/second.png} }\hfill
    \subfloat[Third]{   \label{fig:3} \includegraphics[width=\columnwidth,keepaspectratio]{figures/third.png} }
    \subfloat[Fourth]{      \label{fig:4} \includegraphics[width=6.3cm,height=4.5cm]{figures/fourth.png} }  \hfill
    \subfloat[Fifth]{   \label{fig:5} \includegraphics[width=\columnwidth]{figures/fifth.png}}      
    \subfloat[Sixth.]{  \label{fig:6}
        \includegraphics[width=6.3cm,height=4.5cm]{figures/sixth.png} }
    %\end{minipage}%
    \caption[.]{\textcolor{red}{The caption spans in two lines. It is a double column template. using vskip after begin figure the top white space is reduced but still text not appearing in the bottom blank space}} 
    \label{fig:slotFreeNFree2}      
\end{figure*}
The caption spans in two lines. It is a double column template. using vskip after begin figure the top white space is reduced but still text not appearing in the bottom blank space.  the text goes to the next page so this extra blank space to be utilized. typesetting is not done this way.
\end{document}
3
  • Please show us complete small document, called MWE (Minimal Working Example) which reproduce your problem. From your code fragment is not possible to see, what is cause of your problem.
    – Zarko
    Jul 19, 2023 at 9:34
  • 1
    It always scares me to see minpages, especially inside a figure environment. How about removing the minipage environment and just use the subfloats in the figure environment?
    – Gargantuar
    Jul 19, 2023 at 13:27
  • Please test proposed solution in my answer where replace used article documentclass with one you use in your document. Where it can be obtain?
    – Zarko
    Jul 20, 2023 at 3:04

1 Answer 1

0

Since you not provide MWE(minimal Working Example) which reproduce your problem is hard to say what is your problem and by what it is cause.

Anyway:

  • Use of the minipage is superfluous.
  • Sum of images widths can be greater than is size of \textwidth, consequently they are not positioned on page as desired.
  • Use of the figure* indicate that you have two column document where figure should span both columns. It always appear on the next page from point of its insertion in text.
  • In the next page, figure* without position option will be at top of page, if it occupies less than 30% of page, otherwise it will use the whole page. That it be at top of page with followed text, you need to add to figure* position option [t].

Edit:

  • or in preamble insert command
\renewcommand{\dblfloatpagefraction}{.66}

If I assume, that width of images are equal the following MWE gives result without any unnecessary white space:

enter image description here

(red lines indicate page layout)

\documentclass[twocolumn]{article}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}                             % for dummy text
%---------------------------------------------------------------%
\usepackage[demo]{graphicx}
\usepackage{subfig}

\usepackage{lipsum}

\begin{document}
\lipsum[1]
    \begin{figure*}[t]  % <---
\setkeys{Gin}{width=0.3\linewidth}

\subfloat[This is Fig 1 \label{fig:1}]{\includegraphics{1.eps}}\hfill%
\subfloat[This is Fig 2 \label{fig:2}]{\includegraphics[height=4.5cm]{2.eps}}\hfill%
\subfloat[This is Fig 3 \label{fig:3}]{\includegraphics[keepaspectratio]{3.eps}}

\subfloat[This is Fig 4 \label{fig:4}]{\includegraphics[height=4.5cm]{4.eps}}\hfill%
\subfloat[This is Fig 5 \label{fig:5}]{\includegraphics{5.eps}}\hfill%
\subfloat[This is Fig 6 \label{fig:6}]{\includegraphics[height=4.5cm]{6.eps}}

\caption{Test values.}
\label{fig:test}
    \end{figure*}
\lipsum[2-9]
\end{document}
    \end{minipage}%
    \caption{Test values.}
    \label{fig:test}
\end{figure*}
\end{document}

Addendum:

  • Instead of subfig package you can use subfloat macro as is defined in subcaption package version 1.3 or newest. In this case you need protect labels inserted in captions.
  • The following MWE not use figure position options but rather has inserted command \renewcommand{\dblfloatpagefraction}{.66} in document preamble
\documentclass[twocolumn]{article}
\usepackage{lipsum}                             % for dummy text

\usepackage[demo]{graphicx}
\usepackage[skip=1ex]{subcaption}
\renewcommand{\dblfloatpagefraction}{.66} % added

\usepackage{lipsum}

\begin{document}
\lipsum[1]
    \begin{figure*} % <--- no position options
\setkeys{Gin}{width=0.3\linewidth}
\subfloat[This is Fig 1 \protect\label{fig:1}]{\includegraphics{1.eps}}\hfill%
\subfloat[This is Fig 2 \protect\label{fig:2}]{\includegraphics[height=4.5cm]{2.eps}}\hfill%
\subfloat[This is Fig 3 \protect\label{fig:3}]{\includegraphics[keepaspectratio]{3.eps}}

\medskip
\subfloat[This is Fig 4 \protect\label{fig:4}]{\includegraphics[height=4.5cm]{4.eps}}\hfill%
\subfloat[This is Fig 5 \protect\label{fig:5}]{\includegraphics{5.eps}}\hfill%
\subfloat[This is Fig 6 \protect\label{fig:6}]{\includegraphics[height=4.5cm]{6.eps}}

\caption{Test values.}
\label{fig:test}
    \end{figure*}
\lipsum[2-12]
\end{document}

You must log in to answer this question.

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