如何「統一」RefTeX 標籤預設值?

如何「統一」RefTeX 標籤預設值?

當您在 AUCTeX 中建立新部分(使用C-c C-s)並為該部分命名時,RefTeX 將提示您輸入標題、插入該部分,然後提示您輸入標籤。此標籤會自動填入合理的預設值:

\section{Mathematical Definitions}
\label{sec:math-defin}

所有標頭命令都會發生這種情況:

\subsection{Graphs}
\label{sec:graphs}

當您只深入層次結構的一層或有一篇更短或更多樣化的論文時,這些預設值就完全沒問題。然而,在撰寫本科論文初稿時,我發現自己在不同的標題下再次使用相同的副標題:

\section{Implementation}
\label{sec:implementation}

\subsection{Graphs}
\label{sec:graphs-1}

如何獲得二級標題的標籤sec:graphssec:graphs-1,如下所示?

\section{Mathematical Definitions}
\label{sec:math-defin}

\subsection{Graphs}
\label{sec:math-defin:graphs}

\section{Implementation}
\label{sec:implementation}

\subsection{Graphs}
\label{sec:implementation:graphs}

理想情況下,我希望這種行為保持一致:

\section{Graphs}
\label{sec:graphs}
\label{fig:graphs:diagram}

\section{Math}
\label{sec:math}
\subsection{Contrived}
\label{sec:math:contrived}
\begin{example} % an environment AUCTeX doesn't know about
  \label{ex:math:contrived:example}
  ...
\end{example}

相關內容