如何在小页面内对齐两个 tikzpicture 图像而不使正文重叠?

如何在小页面内对齐两个 tikzpicture 图像而不使正文重叠?

在此处输入图片描述

为什么以下内容会导致正文与图片/图片标题重叠?我该如何修复?抱歉,我没有提供 MWE,但这是使用《achemso美国化学学会杂志》的文档类。

\begin{figure}
\centering
\begin{minipage}[b][5cm][s]{.45\textwidth}
    \centering
    \vfill
    \begin{tikzpicture}  
    \draw[->] (-0.5,0) -- (4,0) node[right] {$x$};  
    \draw[->] (0,-0.5) -- (0,4) node[above] {$y$};  
    \draw (0,0.5) -- (4,2.5);  
    \draw [dashed] (0,1.5) -- (4,3.5);  
    \end{tikzpicture} 
    \vfill
    \caption{Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange.}\label{fig:simple2}
    \vspace{\baselineskip}
\end{minipage}\qquad
\begin{minipage}[b][5cm][s]{.45\textwidth}
    \centering
    \vfill
    \begin{tikzpicture}  
    \draw[->] (-0.5,0) -- (4,0) node[right] {$x$};  
    \draw[->] (0,-0.5) -- (0,4) node[above] {$y$};  
    \draw (0,0.5) -- (4,2.5);  
    \draw [dashed] (0,1.5) -- (4,3.5);  
    \end{tikzpicture} 
    \vfill
    \caption{Partial three-site exchange.}\label{fig:partial3}
\end{minipage}
\end{figure}    

答案1

代替

\begin{minipage}[b][5cm][s]{.45\textwidth}

\begin{minipage}[t]{.45\textwidth} 

并删除所有\vfill命令以获得以下结果:

在此处输入图片描述

\documentclass{achemso}
\usepackage{tikz}
\title{title}
\usepackage{lipsum} % Only for dummy text. Do not use in actual document.
\begin{document}

\begin{figure}
\centering
\begin{minipage}[t]{.45\textwidth}
    \centering
    \begin{tikzpicture}  
    \draw[->] (-0.5,0) -- (4,0) node[right] {$x$};  
    \draw[->] (0,-0.5) -- (0,4) node[above] {$y$};  
    \draw (0,0.5) -- (4,2.5);  
    \draw [dashed] (0,1.5) -- (4,3.5);  
    \end{tikzpicture} 
    \caption{Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange. Two-site exchange.}\label{fig:simple2}
\end{minipage}\qquad
\begin{minipage}[t]{.45\textwidth}
    \begin{tikzpicture}  
    \draw[->] (-0.5,0) -- (4,0) node[right] {$x$};  
    \draw[->] (0,-0.5) -- (0,4) node[above] {$y$};  
    \draw (0,0.5) -- (4,2.5);  
    \draw [dashed] (0,1.5) -- (4,3.5);  
    \end{tikzpicture} 
    \caption{Partial three-site exchange.}\label{fig:partial3}
\end{minipage}
\end{figure}    
\lipsum[1]
\end{document}

相关内容