我正在尝试设置两个子图 a 并采用以下方式:
\begin{figure}
\centering
\begin{subfigure}[a]{0.475\textwidth}
\includegraphics[width=1\linewidth]{Figures/performance-deltasize-1.pdf}
\caption{Minimal change}
\label{fig:performance:deltasize:1}
\end{subfigure}
\begin{subfigure}[b]{0.475\textwidth}
\includegraphics[width=1\linewidth]{Figures/performance-deltasize-2.pdf}
\caption{Real-life author changes}
\label{fig:performance:deltasize:2}
\end{subfigure}
\caption{Delta size---minimal vs. real-life author changes: Delta size per algorithm applied to the same original JATS---once on the modified JATS with minimal text edit and once with real-life author changes}
\label{fig:performance:deltasize}
\end{figure}
我已经检查了标签和标题的顺序,但仍然存在相同的对齐问题。
答案1
我相信您正在使用 subcaption 包,它被设置为包含最少的 LaTeX 代码来说明您的问题。subfigure 环境的可选参数处理定位,而不是将子图标记为“a”或“b”,这是自动完成的。如果删除“[a]”和“[b]”,则图形应该对齐。
\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figure1.png}
\caption{Minimal change}
\label{fig:performance:deltasize:1}
\end{subfigure}\hfill{}
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figure2.png}
\caption{Real-life author changes}
\label{fig:performance:deltasize:2}
\end{subfigure}
\caption{Delta size---minimal vs. real-life author changes: Delta size per algorithm applied to the same original JATS---once on the modified JATS with minimal text edit and once with real-life author changes}
\label{fig:performance:deltasize}
\end{figure}
\end{document}
这是输出。