我有下图想要在我的论文中重现(由于许可原因有些模糊):
我的 MWE 是这样的:
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
\begin{document}
\begin{figure}[tb]
\centering
\caption{asd}
\label{}
\begin{tabularx}{\textwidth}{ c c }
\includegraphics[width=.45\linewidth,keepaspectratio]{example-image-a} & {\begin{tabularx}{.45\linewidth}{ c c }
\includegraphics[width=.225\linewidth,keepaspectratio]{example-image-b} & \includegraphics[width=.225\linewidth,keepaspectratio]{example-image-c} \\
\includegraphics[width=.225\linewidth,keepaspectratio]{example-image-b} & \includegraphics[width=.225\linewidth,keepaspectratio]{example-image-c} \\
\end{tabularx}} \\
\end{tabularx}
\end{figure}
\end{document}
这导致了丑陋的布局,我不知道具体原因:
我该如何修复它?
答案1
按表格形式组织图像,并测量较小图像的高度:
\documentclass{article}
\usepackage[export]{adjustbox}
\usepackage[skip=1ex]{caption}
\usepackage{booktabs, multirow}
\newsavebox\image
\begin{document}
\begin{figure}[tb]
\centering
\caption{asd}
\label{fig:myimportantfigure}
\setlength\tabcolsep{1pt}
\setkeys{Gin}{keepaspectratio}
\sbox\image{\includegraphics[width=0.225\linewidth,valign=t]{example-image-a}}
\begin{tabular}{c p{0.225\linewidth}p{0.225\linewidth}}
\multirow{2}{*}{\includegraphics[height=\dimexpr2\ht\image+2\dp\image+2pt,valign=t]{example-image-duck}}
& \usebox\image & \includegraphics[width=\linewidth,valign=t]{example-image-b} \\
\addlinespace[2pt]
& \includegraphics[width=\linewidth,valign=t]{example-image-a} & \includegraphics[width=\linewidth,valign=t]{example-image-b}
\end{tabular}
\end{figure}
\end{document}
答案2
使用minipage
s 和valign=t
来自adjustbox
包:
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\begin{document}
\begin{figure}
\caption{asd}
\label{label}
\begin{minipage}[t]{0.5\textwidth}
\includegraphics[width=.9\linewidth,valign=t]{example-image-a}
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
\includegraphics[width=.45\linewidth,valign=t]{example-image-b}\hfill
\includegraphics[width=.45\linewidth,valign=t]{example-image-c}
\includegraphics[width=.45\linewidth,valign=t]{example-image-b}\hfill
\includegraphics[width=.45\linewidth,valign=t]{example-image-c}
\end{minipage}
\end{figure}
\end{document}
答案3
使用 时tabularx
,您必须至少使用一X
列,实际上这里是 3 X 列。我给出的代码使 X
列宽按比例不同2:1:1
。除此之外,您需要使用\multirow
。垂直调整是通过它应该跨越的等效行数完成的:
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{caption, multirow}
\begin{document}
\begin{figure}[tb]
\centering
\renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}
\caption{asd}
\label{}
\begin{tabularx}{\textwidth}{@{} >{\hsize=1.5\hsize\centering}X *{2}{>{\hsize=0.75\hsize\centering\arraybackslash}X} @{}}
& \includegraphics[width=0.225\textwidth,keepaspectratio]{example-image-b} & \includegraphics[width=0.225\textwidth,keepaspectratio]{example-image-c} \tabularnewline
\multirow{-8.22}{=}{\includegraphics[width=0.45\textwidth,keepaspectratio]{example-image-a}} & \includegraphics[width=0.225\textwidth,keepaspectratio]{example-image-b} & \includegraphics[width=0.225\textwidth,keepaspectratio]{example-image-c}
\end{tabularx}
\end{figure}
\end{document}