# Numbering sections as 1A, 1B, 2A, 2B, etc

I use scrartcl. I would like the sections to be numbered 1A, 1B, 2A, 2B, etc. I would like subsections etc. to be numbered 1A.1, 1A.2, etc. the idea is to present theory in the "A" sections and examples in the "B" sections.

-
Are all sections divided into two parts? –  egreg Jul 12 '12 at 23:21
@egreg: yes, all sections are divided into "A" and "B" parts. Your solution, posted below, seems to do the trick. –  Shay Jul 13 '12 at 12:45
One might think to redefine directly \section so that it produces alternately \sectionA and \sectionB, but I believe that having a specific mark up is better. –  egreg Jul 13 '12 at 12:48

You can define appropriate commands for introducing the two types of sections:

\documentclass{scrartcl}

% This part is necessary when hyperref is needed
\usepackage{hyperref}

\newcounter{Hsection}
\renewcommand{\theHsection}{\thesection}
\newcounter{Hsubsection}
\renewcommand{\theHsubsection}{\thesection.\arabic{subsection}}
% end of hyperref part

\begin{document}
\tableofcontents

\sectionA{First, theory}
\subsection{One}
\subsection{Two}

\sectionB{First, examples}
\subsection{One}
\subsection{Two}

\sectionA{Second, theory}
\subsection{One}
\subsection{Two}

\sectionB{Second, examples}
\subsection{One}
\subsection{Two}

\end{document}


As you see, one has to do some adjustments when hyperref is loaded. Add all the desired options to it, of course.

-
Thanks, this is a very compact and useful solution. –  Shay Jul 13 '12 at 12:46

If you're just considered sectional headings, then you can use \sections, \subsections and \subsubsections with the following counter redefinitions way:

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


The above changes the numbering scheme representation for sections to \arabic (actually, the default), subsections to \Alph (for theory and examples) and subsubsections to \arabic (also, the default). It also makes sure that the display conforms to your requirements in terms of concatenation.

-