
我的章節用阿拉伯語編號。我想獲得阿拉伯語的小節編號,如 1.1、1.2、1.3 等。人們說這對我們有用。我正在使用這段程式碼。
\def\thesection{\arabic{section}}
\def\thesubsection{\arabic{section}.\arabic{subsection}}
\def\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}
只有第一條指令有效。我也用\renewcommand
代替\def
.
答案1
有些類別用於\Alph
小節。例子revtex4-1
:
\documentclass{revtex4-1}
\begin{document}
\tableofcontents
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\end{document}
然而,重新定義計數器巨集\the<counter>
通常會如預期般運作:
\documentclass{revtex4-1}
\makeatletter
\renewcommand*{\thesection}{\arabic{section}}
\renewcommand*{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand*{\p@subsection}{}
\renewcommand*{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\renewcommand*{\p@subsubsection}{}
\makeatother
\begin{document}
\tableofcontents
\section{Section}
\label{sec}
\subsection{Subsection}
\label{subsec}
\subsubsection{Subsubsection}
\label{subsubsec}
References: \ref{sec}, \ref{subsec}, and \ref{subsubsec}.
\end{document}