如何在文本中书写类似图 1(a)的标签而不是图 1a。
\documentclass[a4paper,aps,12pt]{revtex4-1}
\usepackage{floatrow}
\usepackage{subfig}
\usepackage{caption}
\floatsetup[figure]{style=plain,subcapbesideposition=top}
\usepackage{amsmath}
\usepackage{amsfonts} %for \mathfrak & \mathbb
\usepackage[top=2cm, bottom=2cm,left=1.5cm, right=2cm]{geometry}
\usepackage{graphicx}
\graphicspath{ {myfigures/} }
\usepackage{fancyhdr}
\usepackage{afterpage}
\usepackage{setspace}
\usepackage{mathtools}
\usepackage[modulo]{lineno}
\modulolinenumbers[5]%prints every 5 lines
\renewcommand\linenumberfont{\normalfont\footnotesize\sffamily}
\renewcommand{\baselinestretch}{1.5}
\usepackage{hyperref} %To hyperlink
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
citecolor=blue
}
\usepackage{placeins} % for \FloatBarrier
\renewcommand{\baselinestretch}{1.5}
\setlength{\parindent}{.6cm}
\setlength{\parskip}{0cm}% line spacing for first line in paragraph
\newcommand{\Author}[2][2]{\begin{center}{{#1, #2}}\end{center}}
\def\Faculty#1#2{\begin{center}{{#1}}, {#2}\end{center}}
\usepackage{ragged2e}
\DeclareCaptionJustification{justified}{\justifying}
\captionsetup{justification=justified,singlelinecheck=false, position=top, labelfont=large, labelformat=simple}
\begin{document}
\begin{figure}[h]\centering
\sidesubfloat[]{\includegraphics[width = 0.5\textwidth]{1a.pdf} \label{fig:figzoda}}\\[-30pt]
\sidesubfloat[]{\includegraphics[width = 0.5\textwidth]{1b.pdf} \label{fig:figzodb}}\\[-30pt]
\sidesubfloat[]{\includegraphics[width = 0.5\textwidth]{1c.pdf} \label{fig:figzodc}}
\end{figure}
\end{document}
答案1
默认情况下,对子图的引用将仅为字母(例如“a”),标题标签将用括号括起来。因此,如果您想将括号移到引用中,则需要通过将其添加到通用显示格式并将其从标题标签格式中删除来更改此设置,例如:
\documentclass[a4paper,aps,12pt]{revtex4-1}
\usepackage[demo]{graphicx}
\usepackage[caption=false,labelformat=simple]{subfig}
% "labelformat=simple" removes the parenthesis from the caption label
\renewcommand\thesubfigure{(\alph{subfigure})}
% This one adds parenthesis to the display format
\begin{document}
\ref{fig:figzoda} % Prints now "1(a)"
\begin{figure}[h]\centering
\subfloat[]{\includegraphics[width = 0.5\textwidth]{1a.pdf} \label{fig:figzoda}}
\subfloat[]{\includegraphics[width = 0.5\textwidth]{1b.pdf} \label{fig:figzodb}}
\subfloat[]{\includegraphics[width = 0.5\textwidth]{1c.pdf} \label{fig:figzodc}}
\caption{Test}
\end{figure}
\end{document}
caption=false
请注意,我在加载包时添加了该选项subfig
(并删除了包的显式加载caption
),因为该caption
包目前与 RevTeX 文档类不完全兼容:
Package caption Warning: Unsupported document class (or package) detected,
(caption) usage of the caption package is not recommended.
See the caption package documentation for explanation.