2

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
1
  • I don't think that piece of code does anything, as \paragraph and \subparagraph are both defined in the default document classes. The only thing you may have to do is add \renewcommand{\theparagraph}{\thesubsubsection.\alph{paragraph}} and \renewcommand{\thesubparagraph}{\theparagraph.\alph{subparagraph}}. If you're having more than 26 paragraphs or subparagraphs, then you need to considering using the alphalph package for higher-order alphabetic enumeration.
    – Werner
    Commented Dec 31, 2015 at 2:08

2 Answers 2

4

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.

0

Please refer to the picture attached in the question:

Limiting the width of the verbatim text

The following packages & commands (in the preamble) will help enumerate the paragraphs and subparagraphs:

\usepackage{AlphAlph}
\usepackage{alphalph}
\setcounter{secnumdepth}{5}
% For capital letters
\renewcommand{\theparagraph}{\thesubsubsection.\AlphAlph{\value{paragraph}}}
\renewcommand{\thesubparagraph}{\theparagraph.
\AlphAlph{\value{subparagraph}}}
1
  • 2
    Contributions are very welcome, but answers should not be simple links. In this case, you've linked to a poor quality question which includes an image of code which wouldn't be compilable even if retyped. Moreover, the substance of this answer is already in Werner's. Please either delete or improve this answer.
    – cfr
    Commented Dec 6, 2023 at 4:11

You must log in to answer this question.

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