Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Andrew Swann for Titlesec: Redefinition of sectioning command leads to endless execution of latex

The problem in both cases is that

\titleclass{\subsubsection}{straight}[\subsection]

tries to move section levels under \subsection down before inserting the new \subsubsection level. A way to work around this is to define a level with a new name, e.g. ssubsection, and then put \subsubsection to be a copy of \ssubsection; because of optional arguments etc. you will need to use \LetLtxMacro from the package of the same name to do this:

Image may be NSFW.
Clik here to view.
Sample output

\documentclass{tufte-book}\usepackage{letltxmacro}\titleclass{\ssubsection}{straight}[\subsection]\newcounter{ssubsection}\titleformat{\ssubsection}{%  \normalfont\normalsize\bfseries\selectfont%}{\thessubsection}{1em}{}[]\titlespacing{\ssubsection}{0pt}{*3.25}{*1.5}\LetLtxMacro\subsubsection\ssubsection\begin{document}  \subsection{Bar} Text.  \subsubsection{Foo} Text.\end{document} 

Viewing all articles
Browse latest Browse all 3

Trending Articles