我有下图,水平显示 3 个图形:
\begin{figure}[bth]
\myfloatalign
\subfloat[A]{\label{fig:a}%
\includegraphics[width=.31\linewidth]{a}} \enskip
\subfloat[B]{\label{fig:b}%
\includegraphics[width=.31\linewidth]{b}} \enskip
\subfloat[C]{\label{fig:c}%
\includegraphics[width=.31\linewidth]{c}}
\caption{Stackexchange example.}
\label{fig:timer}
\end{figure}
然后我继续使用\autoref{fig:b}
,它仅输出1a。通常当我自动引用数字时,我会得到图1。
我使用 arsclassica,它源自 classicthesis。
有什么方法可以制作 LaTeX 输出图 1a,图 1b等等,而不仅仅是1a,1b?
以下是我的序言:
\documentclass[10pt,a4paper,twoside,openright,titlepage,fleqn,headinclude,,footinclude,BCOR5mm,numbers=noenddot,cleardoublepage=empty]{scrreprt}
\usepackage[american]{babel}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{varioref}
\usepackage[style=numeric,natbib,hyperref,maxbibnames=99]{biblatex}
\usepackage{chngpage}
\usepackage{calc}
\usepackage{listings}
\usepackage{csquotes}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{multicol}
\usepackage{makeidx}
\usepackage{fixltx2e}
\usepackage{relsize}
\usepackage{lipsum}
\usepackage[scaled]{beramono}
\usepackage[eulerchapternumbers,subfig,eulermath,pdfspacing,listings]{classicthesis}
\usepackage{arsclassica}
\usepackage{todonotes}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\pgfplotsset{compat=1.7}
\usepackage{tabularx}
\input{arsclassica-settings}
\usepackage{xcolor}
\newcommand\Small{\fontsize{8}{8.2}\selectfont}
\newcommand*\LSTfont{\Small\ttfamily\SetTracking{encoding=*}{-60}\lsstyle}
\colorlet{punct}{red!60!black}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}
\lstdefinelanguage{json}{
basicstyle=\LSTfont,
columns=fixed,
numbers=left,
numberstyle=\scriptsize,
stepnumber=1,
numbersep=8pt,
showstringspaces=false,
literate=
*{:}{{{\color{punct}{:}}}}{1}
{,}{{{\color{punct}{,}}}}{1}
{\{}{{{\color{delim}{\{}}}}{1}
{\}}{{{\color{delim}{\}}}}}{1}
{[}{{{\color{delim}{[}}}}{1}
{]}{{{\color{delim}{]}}}}{1},
}
\newcommand\chap[1]{%
\chapter*{#1}%
\addcontentsline{toc}{chapter}{#1}}
\begin{document}
\pagenumbering{roman}
\pagestyle{plain}
\end{document}
非常感谢!
答案1
我自己不使用该autoref
命令,但我使用该cleveref
包。有什么原因不能使用它吗?我刚刚尝试过autoref
,得到了和你一样的行为(即它打印
图1
对于整个图形和
1a
对于子图。Cleveref
我认为会产生您想要的输出。这是一个您可能可以适应的最小示例。
\documentclass[12pt, a4paper, oneside, fleqn]{report}
\usepackage{hyperref}
\usepackage[noabbrev]{cleveref} % reference object types automatically
%Things to do with figures
%-------------------------
\usepackage{graphicx} % needed for including graphics
\usepackage{grffile}
\usepackage{epstopdf}
\graphicspath{{figures/}}
\usepackage[singlelinecheck=0,font={sf,small},labelfont=bf]{caption, subfig}
\captionsetup[subfigure]{subrefformat=simple,labelformat=simple,listofformat=subsimple,justification=raggedright}
\begin{document}
\begin{figure}
\centering
\subfloat[{Subfig 1}]{\label{fig:part1}\includegraphics[clip=true, scale=0.3]{figures/fig1.eps}}\qquad
\subfloat[{Subfig 2}]{\label{fig:part2}\includegraphics[clip=true, scale=0.3]{figures/fig2.eps}}
\caption{Caption}
\label{fig:full_fig}
\end{figure}
Refer to \autoref{fig:part1} and \autoref{fig:full_fig} and \cref{fig:part1}
\end{document}