1
\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?

1 Answers1

1

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 06 '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 06 '17 at 14:39