具有多行文字的網格中的數字

具有多行文字的網格中的數字

在此輸入影像描述

如何在網格中插入圖形?每個圖都有 4 個標題。我嘗試使用 subfloat 但它似乎不起作用。

\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}

答案1

編輯: 仍在猜測...但現在圖像位於 2 x 2 圖像數組中:

在此輸入影像描述

\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}

答案2

在此輸入影像描述

上面顯示的輸出是使用巢狀表實現的,如以下 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}

在此輸入影像描述

description這是使用環境而不是巢狀表的變體:

\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}

相關內容