我有这个代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[skip=0.33\baselineskip]{caption}
\captionsetup[figure]{
font=bf,
size=normalsize,
justification=centerlast,
%labelsep=newline
}
\begin{document}
\newcommand{\figurewidth}{0.95}
\newcommand{\figureheight}{0.375}
\begin{figure}[ht]
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
\caption{The first frog}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
\caption{The second frog}
\end{minipage}
\centering
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
\caption{The third frog}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{frog.jpg}
\caption{The fourth frog}
\end{minipage}
\vspace{2ex}
\caption{A couple of frogs}
\parbox{\linewidth}{\small\lipsum[1]\vspace{2ex}}
\end{figure}
\end{document}
我有两个问题:
(i)是否可以在顶部(图 1 和 2)和底部(图 3 和 4)之间添加少量垂直空间?
(ii) 是否可以在 minipage 环境中创建子级别?假设整个页面/图形标记为“图 5:一对青蛙”,那么我想将单个青蛙命名为:“面板 5.A:第一只青蛙”、“面板 5.B:第二只青蛙”等。此外,我希望单个图片标题(在本例中为图 1、2、3 和 4 的标题)采用普通字体,而不是粗体字体。
答案1
关于第一个问题,您可以使用\vspace
您选择的。(在下面的例子中,由于我引入了空间,内容不再适合页面。)
第二部分可以通过使用专用于子图的包轻松实现。在下面的示例中,我使用包subcaption
并简单地将所有出现的替换为minipage
。subfigure
此外,我还更改了子图标题的外观以符合您的描述:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=2.5cm, showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[skip=0.33\baselineskip]{caption}
\captionsetup[figure]{
font=bf,
size=normalsize,
justification=centerlast,
}
\usepackage[labelformat=simple]{subcaption}
\captionsetup[subfigure]{
font=normal,
size=normalsize,
justification=centerlast,
}
\renewcommand*{\thesubfigure}{Panel \thefigure\Alph{subfigure}:}
\begin{document}
\newcommand{\figurewidth}{0.95}
\newcommand{\figureheight}{0.375}
\begin{figure}[ht]
\centering
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
\caption{The first frog}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
\caption{The second frog}
\end{subfigure}
\vspace{1cm}
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
\caption{The third frog}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=\figurewidth\linewidth, height=\figureheight\textheight]{example-image}
\caption{The fourth frog}
\end{subfigure}
\vspace{2ex}
\caption{A couple of frogs}
\parbox{\linewidth}{\small\lipsum[1]\vspace{2ex}}
\end{figure}
\end{document}