0

I would like to know if it is possible to adjust a 6-row, 3-column matrix of figures to fit completely on one side of the IEEE format.

Right now what I have is the following:

\documentclass{IEEEconf}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\newcommand\extralabel[2]{{\edef\@currentlabel{\@currentlabel#2}\label{#1}}}
\begin{document}

\begin{figure*}[t]\centering
\captionsetup{justification=centering}
    \begin{tabular}{cccc}
        \includegraphics[width=0.315\linewidth,height=\textheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=0.315\linewidth,height=\textheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=0.315\linewidth,height=\textheight,keepaspectratio]{example-image-c} \\
        \textbf{(a)}  & \textbf{(b)} & \textbf{(c)}\\[6pt]
    \end{tabular}

    \begin{tabular}{cccc}
        \includegraphics[width=0.315\linewidth]{example-image-a} &
        \includegraphics[width=0.315\linewidth]{example-image-b} &
        \includegraphics[width=0.315\linewidth]{example-image-c} \\
        \textbf{(d)}  & \textbf{(e)} & \textbf{(f)}\\[6pt]
    \end{tabular}
    
    \begin{tabular}{cccc}
        \includegraphics[width=0.315\linewidth]{example-image-a} &
        \includegraphics[width=0.315\linewidth]{example-image-b} &
        \includegraphics[width=0.315\linewidth]{example-image-c} \\
        \textbf{(g)}  & \textbf{(h)} & \textbf{(i)}\\[6pt]
    \end{tabular}
    
    \begin{tabular}{cccc}
        \includegraphics[width=0.315\linewidth]{example-image-a} &
        \includegraphics[width=0.315\linewidth]{example-image-b} &
        \includegraphics[width=0.315\linewidth]{example-image-c} \\
        \textbf{(j)}  & \textbf{(k)} & \textbf{(l)}\\[6pt]
    \end{tabular}

    \begin{tabular}{cccc}
        \includegraphics[width=0.315\linewidth]{example-image-a} &
        \includegraphics[width=0.315\linewidth]{example-image-b} &
        \includegraphics[width=0.315\linewidth]{example-image-c} \\
        \textbf{(m)}  & \textbf{(n)} & \textbf{(o)}\\[6pt]
    \end{tabular}
    
    \begin{tabular}{cccc}
        \includegraphics[width=0.315\linewidth]{example-image-a} &
        \includegraphics[width=0.315\linewidth]{example-image-b} &
        \includegraphics[width=0.315\linewidth]{example-image-c} \\
        \textbf{(p)}  & \textbf{(q)} & \textbf{(r)}\\[6pt]
    \end{tabular}

    \caption
    { 
    \textbf{(a)} 
    \textbf{(b)}
    \textbf{(c)}
    \textbf{(d)}
    \textbf{(e)}
    \textbf{(f)}
    \textbf{(g)}
    \textbf{(h)}
    \textbf{(i)}
    \textbf{(j)}
    \textbf{(k)}
    \textbf{(l)}
    \textbf{(m)}
    \textbf{(n)}
    \textbf{(o)}
    \textbf{(p)}
    \textbf{(q)}
    \textbf{(r)}
    }
    \label{fig:test_figure}
    \extralabel{fig:test_figure:a}{(a)}
    \extralabel{fig:test_figure:b}{(b)}
    \extralabel{fig:test_figure:c}{(c)}
    \extralabel{fig:test_figure:d}{(d)}
    \extralabel{fig:test_figure:e}{(e)}
    \extralabel{fig:test_figure:f}{(f)}
    \extralabel{fig:test_figure:g}{(g)}
    \extralabel{fig:test_figure:h}{(h)}
    \extralabel{fig:test_figure:i}{(i)}
    \extralabel{fig:test_figure:j}{(j)}
    \extralabel{fig:test_figure:k}{(k)}
    \extralabel{fig:test_figure:l}{(l)}
    \extralabel{fig:test_figure:m}{(m)}
    \extralabel{fig:test_figure:n}{(n)}
    \extralabel{fig:test_figure:o}{(o)}
    \extralabel{fig:test_figure:p}{(p)}
    \extralabel{fig:test_figure:q}{(q)}
    \extralabel{fig:test_figure:r}{(r)}
\end{figure*}

\end{document}

enter image description here

And what I would like is for all of them to fit and for the title of the figure to be inside the page as well.

2
  • 1
    What about defining \newlength{\figureheight} \setlength{\figureheight}{3cm} and the use \includegraphics[height=\figureheight]{example-image-a} for every \includegraphics?
    – Ivan
    Apr 29, 2021 at 22:35
  • Yes! It can be an option, thanks @Ivan Apr 30, 2021 at 6:43

1 Answer 1

2

BTW, IEEE does not appreciate messing with their caption format.

\documentclass{IEEEconf}
\usepackage{graphicx}
%\usepackage{caption}
%\usepackage{subcaption}
\newcommand\extralabel[2]{{\edef\@currentlabel{\@currentlabel#2}\label{#1}}}
\newlength{\mywidth}
\newlength{\myheight}
\usepackage{showframe}
\begin{document}

\begin{figure*}[t]\centering
%\captionsetup{justification=centering}
\setbox0=\vbox{\caption
    { 
    \textbf{(a)} 
    \textbf{(b)}
    \textbf{(c)}
    \textbf{(d)}
    \textbf{(e)}
    \textbf{(f)}
    \textbf{(g)}
    \textbf{(h)}
    \textbf{(i)}
    \textbf{(j)}
    \textbf{(k)}
    \textbf{(l)}
    \textbf{(m)}
    \textbf{(n)}
    \textbf{(o)}
    \textbf{(p)}
    \textbf{(q)}
    \textbf{(r)}
    }
    \label{fig:test_figure}
    \extralabel{fig:test_figure:a}{(a)}
    \extralabel{fig:test_figure:b}{(b)}
    \extralabel{fig:test_figure:c}{(c)}
    \extralabel{fig:test_figure:d}{(d)}
    \extralabel{fig:test_figure:e}{(e)}
    \extralabel{fig:test_figure:f}{(f)}
    \extralabel{fig:test_figure:g}{(g)}
    \extralabel{fig:test_figure:h}{(h)}
    \extralabel{fig:test_figure:i}{(i)}
    \extralabel{fig:test_figure:j}{(j)}
    \extralabel{fig:test_figure:k}{(k)}
    \extralabel{fig:test_figure:l}{(l)}
    \extralabel{fig:test_figure:m}{(m)}
    \extralabel{fig:test_figure:n}{(n)}
    \extralabel{fig:test_figure:o}{(o)}
    \extralabel{fig:test_figure:p}{(p)}
    \extralabel{fig:test_figure:q}{(q)}
    \extralabel{fig:test_figure:r}{(r)}
  }% labels are local to \vbox
  \setlength{\mywidth}{\dimexpr \textwidth - 8\tabcolsep}%
  \divide\mywidth by 3
  \setlength{\myheight}{\dimexpr \textheight-\ht0-\dp0}%
  \divide\myheight by 6
  \advance\myheight by -\arraystretch\dp\strutbox% added to bottom of this row
  \advance\myheight by -\arraystretch\baselineskip% row containing labels
  \advance\myheight by -6pt% from \\[6pt]
  %
    \begin{tabular}{ccc}
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-c} \\
        \textbf{(a)}  & \textbf{(b)} & \textbf{(c)}\\[6pt]
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-c} \\
        \textbf{(d)}  & \textbf{(e)} & \textbf{(f)}\\[6pt]
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-c} \\
        \textbf{(g)}  & \textbf{(h)} & \textbf{(i)}\\[6pt]
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-c} \\
        \textbf{(j)}  & \textbf{(k)} & \textbf{(l)}\\[6pt]
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-c} \\
        \textbf{(m)}  & \textbf{(n)} & \textbf{(o)}\\[6pt]
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-a} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-b} &
        \includegraphics[width=\mywidth,height=\myheight,keepaspectratio]{example-image-c} \\
        \textbf{(p)}  & \textbf{(q)} & \textbf{(r)}\\[6pt]
    \end{tabular}
\unvbox0
\hrule% show bottom of caption
\end{figure*}

\end{document}
1

You must log in to answer this question.

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