我怎样才能将插入图形放入网格中?每个图形将有 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}