How can I exclude a custom titling command (sectioning command) from the table of contents? Note that I do not want to simply inherit the \paragraph, because it is reserved for and extra deeper layer of sectioning.


I would like to create a section called \minisec with titlesec, that is

  • numbered, yet does not show the number (for possible future decisions regarding numbering).
  • It does not show up in the table of contents.
  • It is lower than \paragraph

Sample Code

\titlespacing*{\minisec}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

I adapted this code from https://tex.stackexchange.com/a/17278/13552

  • 1
    Whether \titleclass{\minisec}{straight}[\paragraph] \newcounter{minisec} \setcounter{secnumdepth}{5} \titleformat{name=\minisec,numberless}[hang]{\normalsize\bfseries}{}{0pt}{#1} \titlespacing*{\minisec}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex} is OK for you? – user11232 Feb 4 '15 at 13:01
  • That causes an error !Missing number, treated as zero. \minisec{Presettings}. Could that have something to do with the fact that I am using the explicit option in titlesec? – Jonathan Komar Feb 4 '15 at 13:28
  • You should use \minisec*{Presettings} Note the star. – user11232 Feb 4 '15 at 13:47
  • Ok, I found the problem and it is just caused by the setcounter{secnumdepth}{5}. Using starred commands are not an option for me. Also, my \paragraph has been reassigned to work like a \subsubsubsection, so the code you provided will not work. – Jonathan Komar Feb 4 '15 at 13:51
  • KOMA-script provides a command minisec by default ;-) – Johannes_B Feb 4 '15 at 15:29

The following example addresses all three questions (the code includes comments):




% Change 0pt to a positive value once the representation for the counter has been established
  {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

% minisecs will be numebered
% minisecs won't appear in the ToC

% Provisional empty definition for the counter representation

% Settings for the bookmarks and the ToC entries (change the second 
% and third arguments of \@dottedtocline if minisecs should go to the ToC)



\section{A test section}
In \autoref{sec:minitest} we have an example of
\subsection{A test subsection}
\subsubsection{A test subsubsection}
\paragraph{A test paragraph}
\minisec{A test minisec}


enter image description here

  • Thank you very much for such a thorough answer that explains each part! Very helpful :) – Jonathan Komar Feb 4 '15 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.