1

I am using titlesec in order to redefine \paragraph to appear hanging as a \section. Strangely (to me, at least), the paragraph numbers do not appear. This is a minimal working example:

\documentclass{article}
\usepackage{titlesec}
\titleformat{\paragraph}{\normalfont\large\bfseries}{\S.\theparagraph}{1em}{}
\counterwithout{paragraph}{section}
\setcounter{paragraph}{1}

\begin{document}
\section{A section}
\paragraph{A paragraph}
This is the paragraph n.\ \theparagraph

Some text.

\end{document}

This is how it is compiled on my system:

enter image description here

Why is that paragraph number does not appear and why is its value equal to 0, notwithstanding I set the counter to 1?

1

By default counter paragraph is reset when counter subsubsection changes which is reset when counter subsection changes ... So you have to use \counterwithout{paragraph}{subsubsection}.

To get numbered paragraphs change counter secnumdepth to 4.

\documentclass{article}
\usepackage{titlesec}
\titleformat{\paragraph}{\normalfont\large\bfseries}{\S.\theparagraph}{1em}{}
\counterwithout{paragraph}{subsubsection}
\setcounter{secnumdepth}{4}

\begin{document}
\section{A section}
\paragraph{A paragraph}
This is the paragraph n.\ \theparagraph

Some text.
\end{document}

Result:

enter image description here

| improve this answer | |

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.