如何将子标题“图1a”修改为“图1(a)”?
\documentclass[12pt]{article}
\usepackage{blindtext}
\usepackage{graphicx,psfrag,epsf}
\usepackage{epstopdf}
\usepackage{float}
\usepackage[export]{adjustbox}
\usepackage{mathtools}
\usepackage{verbatim}
%\usepackage[subrefformat=parens,labelformat=parens, labelsep=quad]{subfig}
\usepackage{subfigure}
\usepackage{caption}
%\usepackage{subcaption}
\newcommand{\bs}{\boldsymbol}
\renewcommand\thesubfigure{\alph{subfigure}}
% correct bad hyphenation here
%\pdfminorversion=4
% NOTE: To produce blinded version, replace "0" with "1" below.
\newcommand{\blind}{0}
% DON'T change margins - should be 1 inch all around.
\addtolength{\oddsidemargin}{-.5in}%
\addtolength{\evensidemargin}{-.5in}%
\addtolength{\textwidth}{1in}%
\addtolength{\textheight}{-.3in}%
\addtolength{\topmargin}{-.8in}%
\begin{document}
The Figure~\ref{descriptive1} is composed by Figure~\ref{fig:hist_longair} and Figure~\ref{fig:curve_longair}.
\begin{figure}[H]
\center
\subfigure[Histogram]{\includegraphics[width = .42\linewidth]{hist_longair.eps} \label{fig:hist_longair}}%
\quad%
\subfigure[Contour curve]{\includegraphics[width = .42\linewidth]{curve_longair.eps}\label{fig:curve_longair}}%
\caption{Histogram, contour curve and symbolic scatterplot of $\bs{Y}$}
\label{descriptive1}
\end{figure}
\end{document}
答案1
该subfigure
软件包已弃用,并且caption
与您的文档中加载的软件包完全不兼容。我建议您放弃加载该subfigure
软件包,而是加载该subcaption
软件包并利用其机制。(subcaption
软件包也会自动加载该caption
软件包。)
这种方法的另一个优点是它允许您使用cleveref
包及其“聪明的”交叉引用命令。下面的示例显示了一个应用程序。
我理解您的写作是希望在图形标签和子图形标签之间留一些空白。这是通过\,
在 的(重新)定义中使用 (thinspace)来实现的\thesubfigure
。如果您希望拥有完整的单词间空间,只需将其替换\,
为~
(non-breaking space)。但我不建议这样做;事实上,如果这是我的文档,我根本不会提供任何空间。
\documentclass[12pt]{article}
% I've tried to slim the preamble down to the essentials.
\usepackage{mathtools}
\let\bs\boldsymbol
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage[labelformat=simple]{subcaption} % default is 'labelformat=parens'
\renewcommand\thesubfigure{\,(\alph{subfigure})} % thinspace before subfigure label
\usepackage[noabbrev]{cleveref} % just for this example
\begin{document}
Figure~\ref{descriptive1} consists of Figure~\ref{fig:hist_longair} and Figure~\ref{fig:curve_longair}.
\Cref{descriptive1} consists of \Cref{fig:hist_longair,fig:curve_longair}.
\begin{figure}[ht!]
\begin{subfigure}{.45\textwidth}
\includegraphics[width=\linewidth]{hist_longair.eps}
\caption{Histogram}\label{fig:hist_longair}
\end{subfigure}
\hfill % maximize the spread between the subfigures
\begin{subfigure}{.45\textwidth}
\includegraphics[width=\linewidth]{curve_longair.eps}
\caption{Contour curve}\label{fig:curve_longair}
\end{subfigure}
\caption{Histogram, contour curve and symbolic scatterplot of $\bs{Y}$}
\label{descriptive1}
\end{figure}
\end{document}