The standard book
and report
document classes give you \chapter
which does what you need by default.
The standard book
and report
document classes give you \chapter
which does what you need by default.
You can use the kernel's \two@digits
.
The code:
\documentclass{book}
\makeatletter
\renewcommand\thechapter{\two@digits{\value{chapter}}}
\makeatother
\begin{document}
\chapter{Test chapter}
\end{document}

In case what you are trying to achieve is a running title, use titlesec
to change the formatting from display
to block
:
\documentclass{book}
\usepackage{titlesec}
\makeatletter
\renewcommand\thechapter{\two@digits{\value{chapter}}}
\makeatother
\titleformat{\chapter}[block]
{\normalfont\huge\bfseries}
{\chaptertitlename\ \thechapter}
{1em}
{}
\begin{document}
\chapter{Test chapter}
\end{document}

\chapter
,\section
?