# Paragraph numbers with titlesec

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:

Why is that paragraph number does not appear and why is its value equal to 0, notwithstanding I set the counter to 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: