無法引用補充文件中的部分

無法引用補充文件中的部分

解決方案:事實證明這是一個文檔類問題。透過prl從中刪除\documentclass[reprint,aps,prl,superscriptaddress,notitlepage]{revtex4-2}解決了我的問題。

我遇到一個問題,我可以參考圖形/方程式/表格等,但不能參考補充文件中的部分。作為補充,我想在所有內容之前添加“S”前綴,因此我在開頭重新定義了它們。但是,這似乎不適用於這些部分,我不知道為什麼。我在下面創建了一個最小的工作範例。

問題可能在於這些部分本身沒有數字,但是我沒有看到任何地方會出於任何原因在這裡明確關閉它們。

\documentclass[reprint,aps,prl,superscriptaddress,notitlepage]{revtex4-2}

\usepackage{lipsum}

\newcommand\startsupplement{%
       \setcounter{table}{0}
       \renewcommand{\thetable}{S\arabic{table}}
       \setcounter{figure}{0}
       \renewcommand{\thefigure}{S\arabic{figure}}
       \setcounter{equation}{0}
       \renewcommand{\theequation}{S\arabic{equation}}
       \setcounter{section}{0}
       \renewcommand{\thesection}{S\arabic{section}}
    }

\begin{document}
    
\title{\textbf{\fontfamily{phv}\selectfont 
Supplemental Material: \\ My Supplement Name}}
\author{Me}
\affiliation{Department of Physics}

\maketitle
\startsupplement

\section{First Section}
\label{sec:section1}

Referring to Section~\ref{sec:section1} \\
Referring to Section~\ref{sec:section2} \\

\thesection

\begin{equation}
\label{eq:linear}
y = mx + b
\end{equation}

\begin{equation}
\label{eq:exponential}
y = y_0 + e^{ax}
\end{equation}

Referring to Eqn.~\ref{eq:linear} \\
Referring to Eqn.~\ref{eq:exponential} \\

\lipsum[1]

\section{Second Section}
\label{sec:section2}
    

Referring to Section~\ref{sec:section1} \\
Referring to Section~\ref{sec:section2} \\

Referring to Eqn.~\ref{eq:linear} \\
Referring to Eqn.~\ref{eq:exponential} \\

\lipsum[2]

\end{document}

相關內容