[Tex/LaTex] Enumerate paragraphs and subparagraphs like sections but with letters

numberingparagraphssectioning

I'm using pandoc and in my template.tex exists this code to make the paragraphs and subparagraphs to behave like sections.

% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi

This code generate number like this:

1. chapter

1.1 section

1.1.1 subsection

1.1.1.1 subsubsection

1.1.1.1.1 paragraph

1.1.1.1.1.1 subparagraph

How to change this code to enumerate with letter like this:

1. chapter

1.1 section

1.1.1 subsection

1.1.1.1 subsubsection

1.1.1.1.a paragraph

1.1.1.1.a.a subparagraph

Best Answer

Your code snippet seems completely unrelated as both \paragraphs and \subparagraphs are both defined under the default document classes.

The only thing you may want to add to your preamble is:

\setcounter{secnumdepth}{5}% Display enumeration up to \subparagraph (level 5)
\renewcommand{\theparagraph}{\thesubsubsection.\alph{paragraph}}
\renewcommand{\thesubparagraph}{\theparagraph.\alph{subparagraph}}

If you have more than 26 paragraphs or subparagraphs, you need to consider using the alphalph package which allows for higher-order alphabetic enumeration.

Related Question