# How to show section number shown in \paragraph?

\usepackage{titlesec}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\titleformat{\paragraph} [hang] {\normalfont\normalsize\bfseries {\theparagraph} {1em} {} %%


When I use \paragraph underneath a \subsubsection, the \paragraph doesn't have a section number before it.

For example, if I have

\subsubsection{Yo}
\paragraph{Test}


The PDF would look something like:

4.4.3 Yo
Test


But what I want to have is:

4.4.3 Yo
4.4.3.1  Test


Does anyone have any idea how to?

• Works properly for me, once you add a closing } after \bfseries. – Steven B. Segletes Jan 6 '17 at 13:46
• welcome to the site, but questions are always a lot easier to answer if you provide a complete small document that shows the problem, not just fragments of code. – David Carlisle Jan 6 '17 at 13:47

## 1 Answer

Thanks for the comments, it helped me debug the problem!

I used a latex template, and found this:

\addtocounter{secnumdepth}{1}
\renewcommand{\theparagraph}{\hspace*{-1em}}


I'm new to Latex, so not sure what it does, but I commented them out and it fixed my problem.

• The code \renewcommand{\theparagraph}{\hspace*{-1em}} basically redefined what happens when \paragraph gets invoked, essentially removing the standard numbered label, and replacing it with a negative horizontal tab. – Steven B. Segletes Jan 6 '17 at 14:37
• secnumdepth defines how deep in the sectioning scheme (\section, \subsection, \subsubsection, \paragraph, etc.) the label numbering goes. The default value depends on the documentclass – Steven B. Segletes Jan 6 '17 at 14:39