サブセクションの番号はABCではなくアラビア数字(1.1、1.2など)にする必要があります。

サブセクションの番号はABCではなくアラビア数字(1.1、1.2など)にする必要があります。

私のセクションはアラビア語で番号付けされています。サブセクションの番号もアラビア語で 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}

revtex4-1、デフォルト

ただし、カウンター マクロを再定義すると、\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}

結果

関連情報