1

Similar to this question, Include section number in list number, I would like to prepend the paragraph number to the list item labels in a enumerate environment, e.g.

Paragraph 1. Some text

1.1. item 1
1.2. item 2

Paragraph 2. Some more text

2.1. item 1
2.2. item 2

etc...

I have tried to achieve this using

\renewcommand{\theenumi}{\theparagraph.\arabic{enumi}}

but this ends up with the full sectioning number, e.g.

3.1.2.0.0.1. item 1 in ch.3, s.1, subs.2, para 1.

So there are two questions about this:

  • how come the paragraph number always stays at 0?
  • how do I get just the paragraph number?

Edit

I am using \paragraph commands. Here is the general structure of my section.

\section{foo}
text
\subsection{bar}
more text
\paragraph{baz} paragraph text
\begin{enumerate}
  \item bla
  \item blob
\end{enumerate}

\paragraph{another} second para text
\begin{enumerate}
  \item bla again
  \item blob
\end{enumerate}
  • 1
    what about \renewcommand{\theenumi}{\arabic{paragraph}.\arabic{enumi}} – touhami Jun 24 '15 at 23:16
  • Are you using \paragraph commands? For the second question, instead of \theparagraph (which is typically defined in terms of the hierarchical section structure), use \arabic{paragraph}. – Werner Jun 24 '15 at 23:16
  • Your \theparagraph is strangely defined then, since it seems to always end with 0.0... – Werner Jun 24 '15 at 23:27
  • Yes, it seems so. I tried using \arabic{paragraph}, which helps, but still displays 0 for the para number. – nik Jun 24 '15 at 23:29
  • The secnumdepth decides whether relevant counters are increased or not. If the article standard value is used, then this is 3, paragraphs however need a value of 4. If it's still set to 3, the paragraph counter is fixed to 0. I assume, that your \theparagraph outputs some other counter value – user31729 Jun 24 '15 at 23:42
2

A solution with enumitem package, here without changing the paragraph counter format, only the enumi label is prepended with \arabic{paragraph} in the \setlist command. This will be applied for all enumerate environments.

If the change should be local only, just say \begin{enumerate}[label={\arabic{paragraph}.\arabic*}] then.

\documentclass{article}


\usepackage{enumitem}
\begin{document}

\setcounter{secnumdepth}{4}

\setlist[enumerate,1]{label={\arabic{paragraph}.\arabic*}}

\section{First section}
\subsection{First subsection}
\subsubsection{First subsubsection}
\paragraph{Some Paragraph}
\begin{enumerate}
  \item text text text
  \item text text text
\end{enumerate}

\paragraph{Some other paragraph}
\begin{enumerate}
  \item text text text
  \item text text text
\end{enumerate}


\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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