我已重新定义我的部分如下:
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}
这看起来很棒,直到我想引用不同部分中的某个部分。
小节参考(2 2.4,其中应该是 2.4):
我对标签和引用的定义非常简单,即
\subsubsection{Dataset} \label{p:dataset}
和
For the training and evaluation of the CNNs we used the ADNI dataset described in \ref{p:dataset}
我想保留引用的最后一部分。对于一个部分,这应该是 N;对于一个子部分,这应该是 NN;对于一个子子部分,这应该是 NNN
有什么建议么?
这是我的序言和快速参考部分:
\documentclass[%
superscriptaddress,
showpacs,preprintnumbers,
amsmath,
amssymb,
aps,
pra,
showkeys,
onecolumn,
notitlepage,
11pt,
tightenlines % uncomment for double space
]{revtex4-1}
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{hyperref}% add hypertext capabilities
\usepackage{enumitem}
\renewcommand*\footnoterule{}
\usepackage[
centering,
a4paper,
margin=2.0cm,
a4paper,
]{geometry}
\usepackage{fontspec}
\setsansfont[
BoldFont=ArialBold.ttf,
BoldItalicFont=ArialBoldItalic.ttf,
ItalicFont=ArialItalic.ttf
]{Arial.ttf}
\renewcommand*\familydefault{\sfdefault}
\setmainfont{Arial}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% COLOR %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xcolor}
\usepackage{soul}
\definecolor{reddish}{HTML}{FBB4AE}
\definecolor{blueish}{HTML}{B3CDE3}
\definecolor{magentish}{HTML}{FF00AA}
\definecolor{greenish}{HTML}{a1d99b}
\DeclareRobustCommand{\red}[1]{{\sethlcolor{reddish}\hl{#1}}}
\DeclareRobustCommand{\flow}[1]{\noindent{\sethlcolor{greenish}\hl{\textbf{FLOW} #1}}}
\DeclareRobustCommand{\blue}[1]{{\sethlcolor{blueish}\hl{#1}}}
\DeclareRobustCommand{\magenta}[1]{{\sethlcolor{magentish}\hl{#1}}}
% \linespread{1.}
% \linespread{1.6}
%%%% modifying APS template a bit:
% times
% \usepackage{mathptmx}
% arabic number section
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}
% section left-side and title style
\usepackage{titlesec}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\large\bfseries}
\titleformat*{\subsubsection}{\bfseries}
% FIG. -> Fig.
\renewcommand{\figurename}{Fig.}
% spacing after and before section headers
\titlespacing*{\section}{0pt}{1ex plus 1ex minus .5ex}{0.5ex}
\titlespacing*{\subsection}{0pt}{1ex plus 1ex minus .5ex}{0.5ex}
\titlespacing*{\subsubsection}{0pt}{1ex plus 1ex minus .5ex}{0.5ex}
\usepackage{natbib}
\setcitestyle{sort&compress, super}
\definecolor{blueish2}{HTML}{0830Bb}
\hypersetup{colorlinks = true,
linkcolor = blueish2,
urlcolor = blueish2,
citecolor = blueish2,
anchorcolor = blueish2}
% section left-side and title style
\renewcommand{\bibsection}{\section{References}}
\makeatletter
\renewcommand*{\fnum@figure}{{\normalfont\bfseries \figurename~\thefigure}}
\makeatother
\setlength{\bibsep}{2mm}
\setlength\bibhang{0.1in}
\usepackage{changepage}
\usepackage{setspace}
\usepackage{placeins}
\usepackage{array}
\renewcommand{\arraystretch}{1.5} % Adjust the vertical padding here
\usepackage{multirow}
\usepackage{tabularray}
\usepackage{caption} % add caption package
\usepackage{tabularx}
\UseTblrLibrary{siunitx}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\begin{document}
\section{Intro}
my reference to the subsubsection \ref{p:dataset}
\section{Design}
\subsection{Datasets \& Preprocessing}
\subsubsection{Dataset} \label{p:dataset}
my text for this subsection
\end{document}
平均能量损失
\documentclass{revtex4-1}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}
\begin{document}
\section{Intro}
my reference to the subsubsection \ref{p:dataset}
\section{Design}
\subsection{Datasets \& Preprocessing}
\subsubsection{Dataset} \label{p:dataset}
my text for this subsection
\end{document}
答案1
revtex 在标题中使用无前缀的子节编号,并在引用中添加前缀。由于您要为标题添加前缀,因此无需为引用添加前缀
\documentclass{revtex4-2}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}
\makeatletter
\let\p@section\@empty
\let\p@subsection\@empty
\let\p@subsubsection\@empty
\makeatother
\begin{document}
\section{Intro}
my reference to the subsubsection \ref{p:dataset}
\section{Design}
\subsection{Datasets \& Preprocessing}
\subsubsection{Dataset} \label{p:dataset}
my text for this subsection
\end{document}
但不要对期刊投稿这样做。revtex 的重点是出版商(而不是作者)选择内部风格。