我正在寻找一种方法来在两个图形及其标题周围添加一个框/框架。我将其用于subfloat
子图,因为这是将两个图形放在一个标题下的简单方法。有人知道如何在两个图形及其标题周围添加一个框架吗?
\begin{figure}[!h]
\centering
\textbf{Factor 1: Industrial Solvents}\par\medskip
\subfloat{\includegraphics[width=1 \textwidth]{Images.png}}\,
\subfloat{\includegraphics[width=1 \textwidth]{Images.png}} \,
\caption{PCE is apportioned $\approx 60$ \% to factor 1 and a small contribution from refrigerants (HFCs), CH\textsubscript{2}Cl\textsubscript{2}, ethyne, propane, i-octane, and toluene. A high peak and higher annual variability is observed in factor contribution the beginning of the timeseries, indicating year 2015.}
\label{fig:a}
\end{figure}
答案1
您可以使用包mdframed
并将图形+标题放在mdframed
环境中。
\begin{figure}
\begin{mdframed}
\includegraphics{...}
\caption{...}
\end{mdframed}
\end{figure}
答案2
使用fbox
和minipage
:
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[version=4]{mhchem}
\usepackage{siunitx}
\begin{document}
\begin{figure}[!h]
\setkeys{Gin}{width=\linewidth}
\setlength\fboxsep{1ex}
\setlength\fboxrule{1pt}
\fbox{\begin{minipage}{\linewidth}
\centering
\textbf{Factor 1: Industrial Solvents}
\subfloat{\includegraphics{example-image-duck}}
\subfloat{\includegraphics{example-image-duck}}
\end{minipage}}
\caption{PCE is apportioned \SI{\sim\,60}{\%} to factor 1 and a small contribution from refrigerants (HFCs), \ce{CH2Cl2}, ethyne, propane, i-octane, and toluene. A high peak and higher annual variability is observed in factor contribution the beginning of the timeseries, indicating year 2015.}
\label{fig:a}
\end{figure}
\end{document}
或者
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[version=4]{mhchem}
\usepackage{siunitx}
\begin{document}
\begin{figure}[!h]
\setkeys{Gin}{width=0.48\linewidth}
\setlength\fboxsep{1ex}
\setlength\fboxrule{1pt}
\fbox{\begin{minipage}{\linewidth}
\centering
\textbf{Factor 1: Industrial Solvents}
\subfloat{\includegraphics{example-image-duck}}
\hfill
\subfloat{\includegraphics{example-image-duck}}
\end{minipage}}
\caption{PCE is apportioned \SI{\sim\,60}{\%} to factor 1 and a small contribution from refrigerants (HFCs), \ce{CH2Cl2}, ethyne, propane, i-octane, and toluene. A high peak and higher annual variability is observed in factor contribution the beginning of the timeseries, indicating year 2015.}
\label{fig:a}
\end{figure}
\end{document}