# Creating a subsubparagraph

I want to create a subsubparagraph heading (in order to comply with phd guidlines for formatting). I've copied code from article.cls and just made everything 'lower'. However, when I do, although the subsubparagraph exists, it prints the title twice.

MWE

\documentclass{article}
\makeatletter
\newcounter{subsubparagraph}[subparagraph]
\renewcommand\thesubsubparagraph{\thesubparagraph.\@arabic\c@subsubparagraph}
\newcommand\subsubparagraph{\@startsection{subsubparagraph}{6}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\newcommand*\l@subsubparagraph{\@dottedtocline{6}{10em}{5em}}
\makeatother

\begin{document}
\paragraph{Foo}
\subparagraph{Bar}
\subsubparagraph{Foo bar!!!}

\end{document}


The subsubparagraph needs to have all the properties of subparagraph, with possible additional indentation (which currently I've omitted to keep the new code as close to that found in article.cls)

-
Possible duplicate of tex.stackexchange.com/questions/66349/…, although the answer was not spelt out, only pointed to. Also, this behaviour is still bizarre. – Nathanael Farley Jan 18 '13 at 16:41
Add \newcommand{\subsubparagraphmark}[1]{}. I don't see why an additional sectional unit is needed, as already five below \chapter are provided. – egreg Jan 18 '13 at 16:47

There is no need to load new packages.

In order to define a new sectional unit "foo" you need:

1. the command \foo, usually defined in terms of \@startsection
2. a counter, usually with the same name, foo
3. a command for setting the entry in the table of contents, \l@foo
4. a command for possibly setting the mark, \foomark

So the complete definition would be

\makeatletter
\newcounter{subsubparagraph}[subparagraph]
\renewcommand\thesubsubparagraph{%
\thesubparagraph.\@arabic\c@subsubparagraph}
\newcommand\subsubparagraph{%
\@startsection{subsubparagraph}    % counter
{6}                              % level
{\parindent}                     % indent
{3.25ex \@plus 1ex \@minus .2ex} % beforeskip
{-1em}                           % afterskip
{\normalfont\normalsize\bfseries}}
\newcommand\l@subsubparagraph{\@dottedtocline{6}{10em}{5em}}
\newcommand{\subsubparagraphmark}[1]{}
\makeatother

-

Using the titlesec package:

\documentclass{article}

\usepackage{titlesec}
\titleclass{\subsubparagraph}{straight}[\subparagraph]
\newcounter{subsubparagraph}
\renewcommand{\thesubsubparagraph}{\Alph{subsubparagraph}}
\titleformat{\subsubparagraph}[runin]{\normalfont\normalsize\bfseries}{\thesubsubparagraph}{1em}{}
\titlespacing*{\subsubparagraph} {\parindent}{3.25ex plus 1ex minus .2ex}{1em}

\begin{document}
\paragraph{Foo}
\subparagraph{Bar}
\subsubparagraph{Foo bar!!!}

\end{document}


If for some reason you add \setcounter{tocdepth}{6} to get subsubparagraph to appear in the table of contents and include the hyperref package, you will need to include

\makeatletter
\def\toclevel@subsubparagraph{6}
\makeatother


In order for the pdf index to be made properly.

-