12

I have two pictures and I'm using \usepackage{subcaption} to place them beside each other. The output might look like the following .

enter image description here

The problem in the above picture is that it is difficult to read the description of each picture. My question is that is there a way to reduce the width of each subcaption?

\documentclass[12pt]{article}

\usepackage{graphicx}
\usepackage{subcaption}

\usepackage{blindtext}

\begin{document}


\begin{figure}[H]
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=0.9\linewidth, height=6cm]{rose.png} 
\caption{\blindtext}
\label{fig:subim1}
\end{subfigure}
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=0.9\linewidth, height=6cm]{rose.png}
\caption{\blindtext}
\label{fig:subim2}
\end{subfigure}
\caption{Caption for this figure with two images}
\label{fig:image2}
\end{figure}



\end{document}
CroCo
  • 5,902
  • Right now, the picture has a width of 90 percent linewidth. You could just as well make the outer minipages a bit smaller and do a full linewidth picture. – Johannes_B Mar 16 '15 at 21:38
  • @Johannes_B, would you please elaborate a bit? I have changed the width and reduced the minipage size but still having same problem. – CroCo Mar 16 '15 at 21:47
  • 1
    \begin{subfigure}{0.48\textwidth}\includegraphics[width=\linewidth, same for the other subfigure, and between the minipages, a simple hfill. – Johannes_B Mar 16 '15 at 21:48
  • Look into the package description, it is fully customizable. A possible solution is e.g. \captionsetup[subfigure]{margin=5pt} which puts a margin, alternatively you could also use indent... – DerWeh Mar 13 '18 at 14:15
  • Nice pciture you got! – hola May 18 '19 at 16:51

1 Answers1

13

Two possible ways to choose from. The first is making the whole subfigure a bit smaller, which will also make the figure a little bit smaller. If that is undesired, just make the caption width a bit smaller. No matter which way you choose, it looks kind of odd without centering the picture.

crocoSmallerSubfigure

crocoSmallerCapwidth

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{blindtext}
\begin{document}

\begin{figure}
    \begin{subfigure}{0.45\textwidth}
    \centering
        \includegraphics[width=0.9\linewidth,
        height=5cm]{example-image-a} 
        \caption{\blindtext}
    \end{subfigure}\hfill
    \begin{subfigure}{0.45\textwidth}
    \centering
        \includegraphics[width=0.9\linewidth,
        height=5cm]{example-image-b}
        \caption{\blindtext}
    \end{subfigure}
    \caption{Caption for this figure with two images}
\end{figure}

\begin{figure}
    \begin{subfigure}{0.5\textwidth}%
    \centering\captionsetup{width=.8\linewidth}%
        \includegraphics[width=0.9\linewidth,height=5cm]{example-image-a}%
        \caption{\blindtext}
    \end{subfigure}% Ensure no space and avoid warning
    \begin{subfigure}{0.5\textwidth}%
    \centering\captionsetup{width=.8\linewidth}%
        \includegraphics[width=0.9\linewidth,height=5cm]{example-image-b}%
        \caption{\blindtext}
    \end{subfigure}
    \caption{Caption for this figure with two images}
\end{figure}
\end{document}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248