XeLaTeX Section Modifications

Back in college I was working in a group project where we produced a document which was quite large, as well as deep… and we had a need for a subsubsubsection. One of the group members, Ruslan Hristov (who was also the project leader where I worked on Skipper) cobbled together an early version of this, which I have kept since, modifying it as needed. It works as you would expect.

\makeatletter
\newcounter{subsubsubsection}[subsubsection]
\def\subsubsubsectionmark#1{} % Just list the number
\def\thesubsubsubsection {\thesubsubsection.\arabic{subsubsubsection}}
\def\subsubsubsection{
\vspace{0.1in}
\@startsection
{subsubsubsection} % NAME
{4} % LEVEL
{\z@} % INDENT
{-3.25ex\@plus -0.1ex \@minus -.2ex} % BEFORESKIP
{0.2ex \@plus .01ex} % AFTERSKIP
{\normalsize\bf} % STYLE
}
\def\l@subsubsubsection{\@dottedtocline{4}{4.8em}{4.2em}} % TOC Entry
view raw subsubsubsection.tex hosted with ❤ by GitHub

This is also an opportune time to show how I add custom fonts to all of my sections using XeLaTeX’s excellent font rendering capabilities. Much of this code is originally from Manas Tungare’s original scripts.

Then you need to set your fonts:

Now you have extended section depth and custom styling, and can forget you even changed anything.