0

I have 12 images of different sizes which I added in my latex document. But their positions are somewhat random and the captions are also not at proper positions. I would like to have 4 rows of images in 3 columns and their captions below. How do I do that? Here is what I have tried:

\documentclass[a4paper, 10pt, conference]{ieeeconf}   
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage[lofdepth,lotdepth]{subfig}

\begin{document}

\begin{figure}[h]
\centering
\subfloat[][22q11]{
\includegraphics[width=0.1\textwidth]{22q11.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Angelman]{
\includegraphics[width=0.1\textwidth]{angelman.jpg}
\label{fig:subfig2}}
\subfloat[]Apert]{
\includegraphics[width=0.1\textwidth]{apert.jpg}
\label{fig:subfig3}}
\qquad
\subfloat[][CDL]{
\includegraphics[width=0.1\textwidth]{CDL.jpg}
\label{fig:subfig4}}

\label{fig:globfig}
\subfloat[]Down]{
\includegraphics[width=0.1\textwidth]{down.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Marfan]{
\includegraphics[width=0.1\textwidth]{marfan.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Progeria]{
\includegraphics[width=0.1\textwidth]{progeria.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Sotos]{
\includegraphics[width=0.1\textwidth]{sotos.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Turner]{
\includegraphics[width=0.1\textwidth]{turner.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Williams]{
\includegraphics[width=0.1\textwidth]{williams.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][FragileX]{
\includegraphics[width=0.1\textwidth]{fragileX.jpg}
\label{fig:subfig1}}
\qquad
\subfloat[][Treacher Collins]{
\includegraphics[width=0.1\textwidth]{Treacher_collins.jpg}
\label{fig:subfig1}}
\qquad
\end{figure}

\end{document}

This is how the images look like in my document:enter image description here

1
  • Please consider using a general class like article. We don't have these pictures, so please use draft mode or MWE example images for MWEs.
    – nox
    Jun 25, 2018 at 14:52

1 Answer 1

0

There are some missing opening brackets [ in your code. Also, there is a missing \qquad and no manual \\s for new lines. If you do that, you could come up with:

\documentclass[a4paper, 10pt, conference]{ieeeconf}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage[lofdepth,lotdepth]{subfig}

\begin{document}

    \begin{figure}[h]
        \centering
        \subfloat[][22q11]{
            \includegraphics[width=0.1\textwidth]{22q11.jpg}
            \label{fig:subfig1}}
        \qquad
        \subfloat[][Angelman]{
            \includegraphics[width=0.1\textwidth]{angelman.jpg}
            \label{fig:subfig2}}
        \qquad
        \subfloat[][Apert]{
            \includegraphics[width=0.1\textwidth]{apert.jpg}
            \label{fig:subfig3}}
        \\
        \subfloat[][CDL]{
            \includegraphics[width=0.1\textwidth]{CDL.jpg}
            \label{fig:subfig4}}
        \qquad
        \subfloat[][Down]{
            \includegraphics[width=0.1\textwidth]{down.jpg}
            \label{fig:subfig1}}
        \qquad
        \subfloat[][Marfan]{
            \includegraphics[width=0.1\textwidth]{marfan.jpg}
            \label{fig:subfig1}}
        \\
        \subfloat[][Progeria]{
            \includegraphics[width=0.1\textwidth]{progeria.jpg}
            \label{fig:subfig1}}
        \qquad
        \subfloat[][Sotos]{
            \includegraphics[width=0.1\textwidth]{sotos.jpg}
            \label{fig:subfig1}}
        \qquad
        \subfloat[][Turner]{
            \includegraphics[width=0.1\textwidth]{turner.jpg}
            \label{fig:subfig1}}
        \\
        \subfloat[][Williams]{
            \includegraphics[width=0.1\textwidth]{williams.jpg}
            \label{fig:subfig1}}
        \qquad
        \subfloat[][FragileX]{
            \includegraphics[width=0.1\textwidth]{fragileX.jpg}
            \label{fig:subfig1}}
        \qquad
        \subfloat[][Treacher Collins]{
            \includegraphics[width=0.1\textwidth]{Treacher_collins.jpg}
            \label{fig:subfig1}}
    \end{figure}

\end{document}

edit: Assuming you want aligned pictures of the same height, the width of your pictures varies. You can use a table to get the (probably) desired result (this time I used a MWE configuration, please get used to change your code to a MWE if you post a question):

\documentclass[a4paper, 10pt]{article}
\usepackage{graphicx}
\usepackage[lofdepth,lotdepth]{subfig}

\begin{document}

\begin{figure}[h]
    \centering
    \begin{tabular}{ccc}
        \subfloat[][22q11]{
        \includegraphics[height=2cm]{example-image-a}
        \label{fig:subfig1}}%
    &\subfloat[][Angelman]{
        \includegraphics[height=2cm]{example-image-1x1}
        \label{fig:subfig2}}%
    &\subfloat[][Apert]{
        \includegraphics[height=2cm]{example-image-10x16}
        \label{fig:subfig3}}%
    \\
    \subfloat[][CDL]{
        \includegraphics[height=2cm]{example-image-9x16}
        \label{fig:subfig4}}%
    &\subfloat[][Down]{
        \includegraphics[height=2cm]{example-image-a}
        \label{fig:subfig1}}%
    &\subfloat[][Marfan]{
        \includegraphics[height=2cm]{example-image-1x1}
        \label{fig:subfig1}}%
    \\
    \subfloat[][Progeria]{
        \includegraphics[height=2cm]{example-image-golden}
        \label{fig:subfig1}}%
    &\subfloat[][Sotos]{
        \includegraphics[height=2cm]{example-image-golden-upright}
        \label{fig:subfig1}}%
    &\subfloat[][Turner]{
        \includegraphics[height=2cm]{example-image-a}
        \label{fig:subfig1}}%
    \\
    \subfloat[][Williams]{
        \includegraphics[height=2cm]{example-image-a}
        \label{fig:subfig1}}%
    &\subfloat[][FragileX]{
        \includegraphics[height=2cm]{example-image-a}
        \label{fig:subfig1}}%
    &\subfloat[][Treacher Collins]{
        \includegraphics[height=2cm]{example-image-a}
        \label{fig:subfig1}}%
    \end{tabular}
\end{figure}

\end{document}

result

5
  • That seems to have taken care of all the alignments. Thank you! Is there a way to make their sizes similar? I mean resize them to the same size? Or do I have to do that manually?
    – ZER-0-NE
    Jun 25, 2018 at 14:58
  • @ZER-0-NE Could you specify what you mean by same size? Since they don't have the same format, this is not clear. You could adjust the height to be equal (in case this is what you want, use height=... rather than width as argument in includegraphics).
    – nox
    Jun 25, 2018 at 15:13
  • same dimensions? I'll check that out.
    – ZER-0-NE
    Jun 25, 2018 at 15:15
  • The ratio is not equal. So I assume you want them to have the same height.
    – nox
    Jun 25, 2018 at 15:16
  • @ZER-0-NE see my edited answer, maybe this is what you want.
    – nox
    Jun 25, 2018 at 15:38

You must log in to answer this question.

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