我正在使用以下代码来放置两个子图:
\documentclass[a4paper, 12pt]{article}
\usepackage[margin=0.8in]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\newcommand{\rulesep}{\unskip\ \vrule\ }
\begin{document}
\begin{figure}[H]
\centering
\begin{subfigure}{.48\linewidth}
\centering
\includegraphics[width=\linewidth]{subfigure_1.jpeg}
\caption[caption]{This is the caption\\Isosurface corresponding to \, $\lambda_{2,m} = -3$.}
\label{subfig1}
\end{subfigure}
\hfill
\rulesep
\begin{subfigure}{.48\linewidth}
\centering
\includegraphics[width=\linewidth]{subfigure_2.jpeg}
\caption[caption]{This is the caption\\Isosurface corresponding to \, $\lambda_{2,m} = -3$.}
\label{subfig2}
\end{subfigure}
\caption{Figure 1}
\end{figure}
\end{document}
该代码的输出是:
有人能告诉我该怎么做吗?
答案1
像这样?
(红色规则表示文本区域边框)
\documentclass[12pt]{article}
\usepackage[margin=0.8in]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{figure}[ht]
\centering
\setkeys{Gin}{width=\linewidth,height=95mm}
\captionsetup[subfigure]{justification=centerlast}
\begin{subfigure}{65mm}
\includegraphics{example-image}
\caption[Short caption]{Top view.\\ Isosurface corresponding to $\lambda_{2,m} = -3$}
\label{subfig1}
\end{subfigure}
\hfil
\begin{subfigure}{65mm}
\includegraphics{example-image-duck}
\caption[Short caption]{Top view.\\ Isosurface corresponding to \mbox{$\lambda_{2,m} = -3$}
\label{subfig2}
\end{subfigure}
\caption{Figure 1}
\end{figure}
\end{document}