2

I need to fit 6 pictures in two lines in Latex (3 figures per line). The method I am using now makes them too small

\documentclass[12 pt,a4paper, oneside, openany, notitlepage]{article}
\usepackage{subcaption}
\usepackage{mathtools}
\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}
\newcounter{mathematicapage}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{multicol}
\usepackage[inner=1in,outer=1in,bottom=1in,top=1in]{geometry}
\usepackage{setspace}
\onehalfspacing
\usepackage{changepage}
\usepackage{caption}



\begin{document}



\begin{figure}
 \begin{adjustwidth}{-2cm}{}
\centering
    \begin{subfigure}[b]{0.37\textwidth}            
            \includegraphics[width=\textwidth]{case1_1.jpg}
    \end{subfigure}
    \begin{subfigure}[b]{0.37\textwidth}
            \centering
            \includegraphics[width=\textwidth]{case1_2.jpg}
    \end{subfigure}
   \begin{subfigure}[b]{0.37\textwidth}
            \centering
            \includegraphics[width=\textwidth]{case1_3.jpg}
    \end{subfigure}

    \begin{subfigure}[b]{0.37\textwidth}            
            \includegraphics[width=\textwidth]{case1_4.jpg}
    \end{subfigure}
    \begin{subfigure}[b]{0.37\textwidth}
            \centering
            \includegraphics[width=\textwidth]{case1_5.jpg}
    \end{subfigure}
   \begin{subfigure}[b]{0.37\textwidth}
            \centering
            \includegraphics[width=\textwidth]{case1_6.jpg}
    \end{subfigure}
\caption{Blah. }
\label{case1_fig}
\end{adjustwidth}
\end{figure}


\end{document}

If I increase 0.37the 3 figures are set into 2 rows. I tried to play with adjustwidth but without success. I think I need to find a way to reduce the space between the 3 figures in each line but I can't see how.

I can't find a way to attach my 6 pictures to the question, to explain better. Please let me know what can I do to clarify further my question.

Zarko
  • 296,517
Star
  • 186
  • You can use \begin{subfigure}[b]{\textwidth/3}, so they will be as large as possible. Take a look here: https://tex.stackexchange.com/a/407620/134574 The problem is the same. – Phelype Oleinik Jan 21 '19 at 17:36
  • Thanks, but the output does not change: 1) if I keep \begin{adjustwidth}{-2cm}{} no difference at all with my output; 2) if I remove \begin{adjustwidth}{-2cm}{}, the 3 figures are set into 2 lines. – Star Jan 21 '19 at 17:39

3 Answers3

1

You can use \textwidth/3 if you add a % after each \end{subfigure}:

enter image description here

\documentclass[12 pt,a4paper, oneside, openany, notitlepage]{article}
\usepackage{subcaption}
\usepackage{mathtools}
\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}
\newcounter{mathematicapage}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{multicol}
\usepackage[inner=1in,outer=1in,bottom=1in,top=1in]{geometry}
\usepackage{setspace}
\onehalfspacing
\usepackage{changepage}
\usepackage{caption}

\begin{document}

\begin{figure}
    \centering
    \begin{subfigure}[b]{\textwidth/3}
            \includegraphics[width=\textwidth]{example-image-a}
    \end{subfigure}%
    \begin{subfigure}[b]{\textwidth/3}
            \includegraphics[width=\textwidth]{example-image-b}
    \end{subfigure}%
    \begin{subfigure}[b]{\textwidth/3}
            \includegraphics[width=\textwidth]{example-image-c}
    \end{subfigure}

    \begin{subfigure}[b]{\textwidth/3}
            \includegraphics[width=\textwidth]{example-image-c}
    \end{subfigure}%
    \begin{subfigure}[b]{\textwidth/3}
            \includegraphics[width=\textwidth]{example-image-b}
    \end{subfigure}%
    \begin{subfigure}[b]{\textwidth/3}
            \includegraphics[width=\textwidth]{example-image-a}
    \end{subfigure}
    \caption{Blah. }
    \label{case1_fig}
\end{figure}

\end{document}
1

enter image description here

since images hasn't own sub captions you can placed them in table with zero tablcosep and reduce distance between rows for 3pt:

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{setspace}
\onehalfspacing
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{caption}

\begin{document}
    \begin{figure}
    \centering
    \setlength\tabcolsep{0pt}
    \begin{tabularx}{\textwidth}{XXX}
\includegraphics[width=\linewidth]{example-image-a}
    &   \includegraphics[width=\linewidth]{example-image-b}
        &   \includegraphics[width=\linewidth]{example-image-c} \\[-3pt]
\includegraphics[width=\linewidth]{example-image-c}
    &   \includegraphics[width=\linewidth]{example-image-b}
        &   \includegraphics[width=\linewidth]{example-image-a}
    \end{tabularx}
\caption{Blah. }
\label{case1_fig}
    \end{figure}
\end{document}
Zarko
  • 296,517
1

Unnecessarily enfolded. Just use the right image size:

enter image description here

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics[width=.333\linewidth]{example-image}%
\includegraphics[width=.333\linewidth]{example-image}%
\includegraphics[width=.333\linewidth]{example-image}\\
\includegraphics[width=.333\linewidth]{example-image}%
\includegraphics[width=.333\linewidth]{example-image}%
\includegraphics[width=.333\linewidth]{example-image}%
\caption{Blah. }
\end{figure}
\end{document}
Fran
  • 80,769