0

I have this code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[skip=0.33\baselineskip]{caption}
\captionsetup[figure]{
    font=bf,
    size=normalsize,
    justification=centerlast,
    %labelsep=newline
    }
\begin{document}
\newcommand{\figurewidth}{0.95}
\newcommand{\figureheight}{0.375}
\begin{figure}[ht]
    \centering
    \begin{minipage}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
        \caption{The first frog}
    \end{minipage}%
    \begin{minipage}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
        \caption{The second frog}
    \end{minipage}
        \centering
    \begin{minipage}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
        \caption{The third frog}
    \end{minipage}%
    \begin{minipage}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
        \caption{The fourth frog}
    \end{minipage}
    \vspace{2ex}
\caption{A couple of frogs}
\parbox{\linewidth}{\small\lipsum[1]\vspace{2ex}}
\end{figure}
\end{document}

which produces this output: frogs

I have two issues:

(i) Is is possible to add a small amount of vertical space between the top (Figure 1 and 2) and the bottom (Figure 3 and 4)?

(ii) Is it possible to create a sub-level within the minipage environment? Say the overall page/figure is labeled "Figure 5: A couple of frogs", then I would like to name the individual frogs something like: "Panel 5.A: The first frog", "Panel 5.B: The second frog", etc. In addition, I would like the individual picture caption (in this case the captions for figure 1, 2, 3 and 4) to be in a normal font instead of a bold font.

  • The subcaption package uses \subcaption to do what you want. In also uses a subfigure environment which is basicially a minipage with subcaptions. As for vertical spaces, you can also play with \abovecaptionskip and \belowcaptionskip (lengths). – John Kormylo Apr 29 '18 at 15:30
  • Thank you for your comment, Mr. @JohnKormylo. This seems to be in line with what was written by leandriis. – Andreas Apr 29 '18 at 17:40
1

Regarding your first question, you can use a \vspace of your choice. (In the following example, the contents do not fit onto the page any longer due to the space that I intruduced.)

The second part can easily be achieved by using a package that is dedicated to subfigures. In the following example, I use the subcaption package and simply replaced all occurences of minipage by subfigure. Additionally, I have changed the appearence of the subfigure's captions to match your description:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[skip=0.33\baselineskip]{caption}
\captionsetup[figure]{
    font=bf,
    size=normalsize,
    justification=centerlast,
    }
\usepackage[labelformat=simple]{subcaption}
    \captionsetup[subfigure]{
    font=normal,
    size=normalsize,
    justification=centerlast,
    }
\renewcommand*{\thesubfigure}{Panel \thefigure\Alph{subfigure}:}

\begin{document}
\newcommand{\figurewidth}{0.95}
\newcommand{\figureheight}{0.375}
\begin{figure}[ht]
    \centering
    \begin{subfigure}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
        \caption{The first frog}
    \end{subfigure}%
    \begin{subfigure}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
        \caption{The second frog}
    \end{subfigure}
     \vspace{1cm}

    \begin{subfigure}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
        \caption{The third frog}
    \end{subfigure}%
    \begin{subfigure}{0.5\textwidth}
        \centering
        \includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
        \caption{The fourth frog}
    \end{subfigure}
    \vspace{2ex}
\caption{A couple of frogs}
\parbox{\linewidth}{\small\lipsum[1]\vspace{2ex}}
\end{figure}
\end{document}

enter image description here

  • Perfect, this is exactly what I wanted! Thank you very much, @leandriis. – Andreas Apr 29 '18 at 17:38

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.