I am formatting a document for someone, and he wants each section number to be three digits long, starting with 000, and with padding zeros when needed.
I found a similar question, and tried to adapt the example, but it gives me a
! TeX capacity exceeded, sorry [input stack size=5000].
\thesection ->\thesection
.\three@digits {\value {section}}
l.11 \section{Synopsis}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
My MNWE is:
\documentclass[letterpaper]{article}
%Padding the leading zeros \makeatletter
\renewcommand\thesection{\thesection.\three@digits{\value{section}}}
\makeatother
\begin{document} \setcounter{section}{-1} \tableofcontents
\section{Synopsis} foo
\section{Language} bar
\section{Legal} baz
\end{document}

\thesection, since\thesectioncontains\thesection, which contained\thesection, which contains\thesection, ... – Werner Jul 12 '13 at 18:58