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?

  • Related, although a different problem (i.e., for future visitors, but not too far into the future, because it is a fixed bug): https://tex.stackexchange.com/questions/299969/titlesec-loss-of-section-numbering-with-the-new-update-2016-03-15 – Marijn Jul 16 '18 at 11:30

1 Answers1

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

esdd
  • 85,675