# Numbering sections

I want my sections, subsections and subsubsections in revtex to be marked by arabic numbers and 1.1., 1.1.1. etc. Instead I'm having roman numbers and letters. Can somebody help me?

-
The revtex4-1 class is meant for submissions to some physics journals, and the format is the one required by those journals. – egreg Dec 15 '12 at 17:17

\documentclass{article}

\def\thesection{\Roman{section}}
\def\thesubsection{\Roman{section}.\Roman{subsection}}
\def\thesubsubsection{\Roman{section}.\Roman{subsection}.\Roman{subsubsection}}

\begin{document}
\tableofcontents
\section{aaa}
\subsection{bbb}
\subsubsection{ccc}
\end{document}

-
Thanks.I have manage to get wanted numbering style (actually I've replaced Roman with arabic),but still having one problem.My subsection (only in first section) starts counting from 0 instead from 1. – Boki Dec 15 '12 at 18:39
My mistake.I wrote subsubsection instead of subsection.All good.Thx – Boki Dec 15 '12 at 21:20

With the important premise that this change should not be made for papers that are meant for submissions to journals requiring revtex, here's how you can do:

\documentclass{revtex4-1}

% Usual (decimal) numbering
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}

% Fix references
\makeatletter
\renewcommand{\p@subsection}{}
\renewcommand{\p@subsubsection}{}
\makeatother

\begin{document}

\section{SECTION}\label{section}

\subsection{SUBSECTION}\label{sub}

\subsubsection{SUBSUBSECTION}\label{subsub}

Section: \ref{section}

Subsection: \ref{sub}

Subsubsection: \ref{subsub}

\end{document}


It's very important to change also \p@subsection and \p@subsubsection or the references would be completely wrong.

-

In relation to the previous posts, Shouldn't you take advantage of recursion here?

Instead of: (Which, for the record, I think is just plainly wrong)

\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}


I would write it as:

\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}


In principal, you can see that each macro should call the parent macro. Else you run the risk of having an inconsistent document. Changing from Arabic to Roman at the section level, here requires only one code modification as opposed to three in the previous posts....

-

(Sub(sub))section numbering is done by LaTeX by keeping a separate counter for each one. (Conveniently named section, subsection, and subsubsection). The formatting of the header numbering is controlled by the \thesection, \thesubsection and \thesubsubsection macros. So if you want arabic numbers, you can just use the \arabic command to number them.

\documentclass{article}