Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the book class. My chapters are numbered with 1,2,3,... I have already managed to have my sections be numbered with only 1,2,3,... (they reset upon a new chapter).

How can I number my subsections with A,B,C,... such that they reset to A upon new sections/chapters?

share|improve this question

1 Answer 1

up vote 10 down vote accepted

Since by default the counter for subsections will reset every new section, all you have to do is to redefine the \thesubsection command controlling the representation of the subsection counter:

\renewcommand\thesubsection{\Alph{subsection}}

A little example:

\documentclass{book}

\renewcommand\thesubsection{\Alph{subsection}}

\begin{document}

\chapter{test}
\section{test}
\subsection{test}
\subsection{test}
\section{test}
\subsection{test}
\subsection{test}

\end{document}

enter image description here

The above solution won't work as expected if you use a \subsection immediately after a \chapter command (without issuing a \section in between); to cope for this situation, you can use the chngcntr package to make the subsection counter reset also when the chapter counter is incremented:

\documentclass{book}
\usepackage{chngcntr}

\counterwithin{subsection}{chapter}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\Alph{subsection}}

\begin{document}

\chapter{test}
\section{test}
\subsection{test}
\subsection{test}
\section{test}
\subsection{test}
\subsection{test}

\chapter{test}
\subsection{test}
\subsection{test}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.