4

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.

4
  • Do you need the leading zeros too?
    – Count Zero
    Apr 11, 2013 at 22:02
  • Yes, this is necessary
    – polmarex
    Apr 11, 2013 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, 2013 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.
    – polmarex
    Apr 11, 2013 at 22:21

1 Answer 1

9

enter image description here

\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}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .