2

enter image description here

How can I put insert figures in a grid? Each figures will have 4 captions. I tried using subfloat but it doesn't seem to work.

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}

\begin{figure}[ht] \label{ fig7} 
  \begin{minipage}[b]{0.5\linewidth}
   \includegraphics[width=0.35\linewidth,valign=c]{1.jpg} 
\caption{The first caption}
\caption{The second caption}
\caption{The third caption}
\caption{The fourth caption}
  \end{minipage} 
  \begin{minipage}[b]{0.5\linewidth}
   \includegraphics[width=0.35\linewidth,valign=c]{2.jpg} 
\caption{The first caption}
\caption{The second caption}
\caption{The third caption}
\caption{The fourth caption}
  \end{minipage} 
  \begin{minipage}[b]{0.5\linewidth}
   \includegraphics[width=0.35\linewidth,valign=c]{2.jpg} 
\caption{The first caption}
\caption{The second caption}
\caption{The third caption}
\caption{The fourth caption}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.5\linewidth}
    \includegraphics[width=0.35\linewidth,valign=c]{3.jpg} 
\caption{The first caption}
\caption{The second caption}
\caption{The third caption}
\caption{The fourth caption}
  \end{minipage} 
\end{figure}

\end{document}
11
  • 1
    Welcome to TeX.SE. You could see here, for example, tex.stackexchange.com/questions/126818/… or here tex.stackexchange.com/questions/162824/…
    – Sebastiano
    Commented Mar 1, 2019 at 17:15
  • one figure with four captions? please, show a sketch of how this should look like.
    – Zarko
    Commented Mar 1, 2019 at 18:02
  • @Zarko, added. sorry about the orientation.
    – blues
    Commented Mar 1, 2019 at 18:33
  • and where are captions? how they are numbered? and really each image has four caption? i never seen something like this demand ... (to my opinion, it does not make sense)
    – Zarko
    Commented Mar 1, 2019 at 18:37
  • 1
    Hey @blues5, are you sure you need actual captions? Wouldn't 4 simple lines of text be sufficient?
    – sheß
    Commented Mar 1, 2019 at 18:39

2 Answers 2

3

edit: still guessing ... but now images are in array of 2 x 2 images:

enter image description here

\documentclass[twocolumn]{article}
\usepackage[export]{adjustbox}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{subcaption}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}    
    \begin{figure*}
    \setkeys{Gin}{width=\linewidth}
    \captionsetup{font=footnotesize, labelfont=bf, 
                  justification=raggedright,
                  skip=0.5ex, singlelinecheck=false}
    \setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{@{} *{4}{X} @{}}
\includegraphics[valign=T]{example-image-duck}
    &   \caption{The first caption}
        \caption{The second caption}
        \caption{The third caption}
        \caption{The fourth caption}
        &   \includegraphics[valign=T]{example-image-duck}
                &   \caption{The first caption}
                    \caption{The second caption}
                    \caption{The third caption}
                    \caption{The fourth caption}    \\
\includegraphics[valign=T]{example-image-duck}
    &   \caption{The first caption}
        \caption{The second caption}
        \caption{The third caption}
        \caption{The fourth caption}
        &   \includegraphics[valign=T]{example-image-duck}
                &   \caption{The first caption}
                    \caption{The second caption}
                    \caption{The third caption}
                    \caption{The fourth caption}    
\end{tabularx}
    \end{figure*}
\end{document}
9
  • This seems to me is a very correct answer to the literal question the OP asked, but I doubt that this is actually what the OP wants to do. @blues5, please correct me if I'm wrong.
    – sheß
    Commented Mar 1, 2019 at 18:54
  • posted the new code. but it still looks terrible. inserting a minipage within minipage might take care for the alignment i guess
    – blues
    Commented Mar 1, 2019 at 19:06
  • @blues, your mwe contain errors (missed packages, etc}. anyway, see, if my edited answer is close to what you like to have.
    – Zarko
    Commented Mar 1, 2019 at 19:26
  • @sheß, you are right. meanwhile i correct my answer (according to quite unclear sketch in question}. i still woundering about four captions per images ... mabe op looks for \caption*{< some description>} or simple list of options. who knows. let us wait what will op say.
    – Zarko
    Commented Mar 1, 2019 at 19:37
  • sorry for the poor description. there would be four system output corresponding to each image. say for image 1, i have the original description and three system output.
    – blues
    Commented Mar 1, 2019 at 19:44
3

enter image description here

The above shown output is achieved using nested tables as shown in the following MWE:

\documentclass{article}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage[export]{adjustbox}
\usepackage{ragged2e}
\newcolumntype{L}[1]{>{\RaggedRight\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

\begin{document}

\begin{tabularx}{\textwidth}{p{2cm}Xp{2cm}X}
\includegraphics[width=\linewidth,valign=t]{example-image} &
\begin{tabular}[t]{lL{3cm}}
Original:&  Two people walking on the beach.\\ 
Model21:&   Zwei Personen gehen am Strand. \\
Model2:&   Zwei Personen gehen am Strand. \\
Model23:&  Zwei Personen gehen am Strand. \\
\end{tabular} &
\includegraphics[width=\linewidth,valign=t]{example-image} &
\begin{tabular}[t]{lL{3cm}}
Original:&  Two people walking on the beach.\\ 
Model21:&   Zwei Personen gehen am Strand. \\
Model2:&   Zwei Personen gehen am Strand. \\
Model23:&  Zwei Personen gehen am Strand. \\
\end{tabular}\\
\\
\includegraphics[width=\linewidth,valign=t]{example-image} &
\begin{tabular}[t]{lL{3cm}}
Original:&  Two people walking on the beach.\\ 
Model21:&   Zwei Personen gehen am Strand. \\
Model2:&   Zwei Personen gehen am Strand. \\
Model23:&  Zwei Personen gehen am Strand. \\
\end{tabular} &
\includegraphics[width=\linewidth,valign=t]{example-image} &
\begin{tabular}[t]{lL{3cm}}
Original:&  Two people walking on the beach.\\ 
Model21:&   Zwei Personen gehen am Strand. \\
Model2:&   Zwei Personen gehen am Strand. \\
Model23:&  Zwei Personen gehen am Strand. \\
\end{tabular}
\end{tabularx}
\end{document}

enter image description here

Here is a variant using the description environment instead of nested tables:

\documentclass{article}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{ragged2e}

\newcolumntype{Z}{>{\RaggedRight\let\newline\\\arraybackslash\hspace{0pt}}X}

\usepackage{enumitem}
\setlist[description]{after=\vspace{-\baselineskip},before=\vspace{-\baselineskip},topsep=0pt,partopsep=0pt}

\begin{document}

\begin{tabularx}{\textwidth}{p{2cm}Zp{2cm}Z}
\includegraphics[width=\linewidth,valign=t]{example-image} &
\begin{description}
\item[Original]  Two people walking on the beach.
\item[Model21]   Zwei Personen gehen am Strand. 
\item[Model2]   Zwei Personen gehen am Strand. 
\item[Model23]  Zwei Personen gehen am Strand. 
\end{description} &
\includegraphics[width=\linewidth,valign=t]{example-image} &
\begin{description}
\item[Original]  Two people walking on the beach.
\item[Model21]   Zwei Personen gehen am Strand. 
\item[Model2]   Zwei Personen gehen am Strand. 
\item[Model23]  Zwei Personen gehen am Strand. 
\end{description}
\end{tabularx}


\end{document}

You must log in to answer this question.

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