# Subsection numbering with prefix

How to set custom subsection numbering? I want to have prefix "KAT/" before number, it should look like this:

KAT/001 Client - blablabla

KAT/002 Visit - blablabla

KAT/003 User - blablabla

What is important - I used

\setcounter{secnumdepth}{0}


in order to turn off numbering, I just want to have that custom numbering inside one specific section.

• Do you need the leading zeros too? – Count Zero Apr 11 '13 at 22:02
• Yes, this is necessary – user1091733 Apr 11 '13 at 22:04
• Do you have subsection numbering elsewhere? What about subsubsections or paragraphs? You could use the paragraph numbering/setting to obtain the output you're after... – Werner Apr 11 '13 at 22:17
• In general, I don't want to have numbering of sections/subsections/subsubsections in my document at all, except there are few sections that should containt such custom subsection numbering. – user1091733 Apr 11 '13 at 22:21

\documentclass{article}

\renewcommand\thesubsection{KAT/%
\ifnum\value{subsection}<100 0\fi
\ifnum\value{subsection}<10 0\fi
\arabic{subsection}}

\begin{document}

\setcounter{secnumdepth}{0}

\subsection{aaa}
xxx
\subsection{bbb}
xxx
\setcounter{secnumdepth}{2}
\subsection{aaa}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx
\subsection{bbb}
xxx

\end{document}