我正在尝试按照标题所述进行操作。以下代码返回
\begin{figure*}
\centering
\subfloat[]{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.2\textwidth,trim={0 0 0 0},clip]{example-image-a}}
\end{tikzpicture}}\\
\subfloat[]{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.2\textwidth,trim={0 0 0 0},clip]{example-image-a}}
\end{tikzpicture}}
\subfloat[]{\includegraphics[width=0.4\textwidth,trim={0 0 0 0},clip]{example-image-a}
}
\end{figure*}
\begin{figure*}
\centering
但我想要的是下图
我使用了迷你页面,但现在所有图片都相互重叠。我该如何修复代码?
\begin{figure*}
\centering
\begin{minipage}{0.5\textwidth}
\subfloat[]{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.2\textwidth,trim={0 0 0 0},clip]{example-image-a}}
\end{tikzpicture}}\\
\subfloat[]{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.2\textwidth,trim={0 0 0 0},clip]{example-image-a}}
\end{tikzpicture}}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\subfloat[]{\includegraphics[width=0.4\textwidth,trim={0 0 0 0},clip]{example-image-a}}
\end{minipage}
\end{figure*}
答案1
外部有两列\hbox
,每列都是。第一列\vbox
有两个对象,第二列只有一个对象。每个内部都包含一张图片。您可以在内部设置垂直和水平。es 中的材料必须没有不需要的空格(行尾)。你的情况是:\hbox
\vbox
\hbox
\vbox
\hbox
\kern
\vbox
\kern
\hbox
\hbox
\hbox{%
\vbox{
\hbox{...first small image...}
\kern 5mm % vertical space between images
\hbox{... second small image ...}
}%
\kern 5mm % horizontal space between columns
\vbox{
\hbox{... third high image ...}
}%
}
如果您想自动计算小图像之间的垂直空间(取决于第三张图像的高度),那么您可以使用\valign
原始:
\hbox{\valign{#\cr
\hbox{... first image ...}\vfil
\hbox{... second image ...}\cr
\noalign{\kern 5mm} % the space between columns
\hbox{... third height image...}\cr
}}
答案2
对齐底部很容易。要对齐顶部,请使用\raisebox{-\height}{...}
on each。
顺便说一句,我抛弃了很多无功能的代码。
\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure*}
\begin{minipage}[b]{\columnwidth}
\centering
\subfloat[]{%
\includegraphics[width=0.4\linewidth]{example-image-a}}
\par\vskip\floatsep
\subfloat[]{%
\includegraphics[width=0.4\linewidth]{example-image-b}}
\end{minipage}\hfill
\subfloat[]{\includegraphics[width=\columnwidth]{example-image-c}}
\end{figure*}
\end{document}
只是为了好玩,这样就可以对齐两个顶部和底部。
\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure*}
\sbox0{\subfloat[]{\includegraphics[width=0.4\columnwidth]{example-image-a}}}%
\sbox1{\subfloat[]{\includegraphics[width=0.4\columnwidth]{example-image-b}}}%
\sbox2{\subfloat[]{\includegraphics[width=\columnwidth]{example-image-c}}}%
\begin{minipage}[b]{\columnwidth}
\centering
\usebox0
\par\vspace{\dimexpr \ht2+\dp2-\ht0-\dp0-\ht1-\dp1}%
\usebox1
\end{minipage}\hfill
\usebox2
\end{figure*}
\end{document}