两张图片对齐

两张图片对齐

如何才能让两张图片完美对齐。我的代码如下。

\begin{figure}[t!]
\centering
\begin{minipage}{3.3cm}
    \centering
    \subtop[]{\includegraphics[height=0.25\textheight]{figa/ParameterSpace}\label{figa}}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}{3.3cm}
    \centering
    \subtop[]{\includegraphics[height=0.25\textheight]{figa/StringMotion}\label{figb}}
\end{minipage}
\mycaption[Motion of open string in spacetime.]{%
  (a) Parameter space for open strings.
  (b) Open string worlsheet in target space.}
\label{figA}
\end{figure}

在此处输入图片描述

答案1

您将子图放在minipages 内的做法是这里的问题所在。s 创建的块minipage太窄,无法容纳图像,因此它们重叠。minipage完全放弃使用 s:

在此处输入图片描述

\documentclass{memoir}

\usepackage{graphicx}

\newsubfloat{figure}

\begin{document}

\chapter{A chapter}

\begin{figure}[!ht]
  \centering
%  \begin{minipage}{3.3cm}
%    \centering
    \subtop[]{\includegraphics[height=0.2\textheight]{example-image-a}}
%  \end{minipage}
  \hspace{0.5cm}
%  \begin{minipage}{3.3cm}
%    \centering
    \subtop[]{\includegraphics[height=0.2\textheight]{example-image-b}}
%  \end{minipage}
  \caption[Motion of open string in spacetime.]{%
    (a) Parameter space for open strings.
    (b) Open string worlsheet in target space.}
\end{figure}

\end{document}

相关内容