Page LayoutKOMA-Script | Dot after SubSubSection Heading

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
pingu
Posts: 3
Joined: Fri Aug 22, 2014 7:44 pm

KOMA-Script | Dot after SubSubSection Heading

Post by pingu »

How can I add a dot after the subsubsection headings without using the Titlesec package?

This post is similar to http://latex-community.org/forum/viewto ... 47&t=20564 but only asks for adding a dot after the subsubsection's title.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

KOMA-Script | Dot after SubSubSection Heading

Post by Stefan Kottwitz »

Hi pingu!

As the headings are written by you, I would simply add a dot when writing. It would be a real issue with generated numbers or headings.

But no problem, it's a bit hackish, but here's a way, similar to my suggestion in the linked thread:

Code: Select all

\makeatletter
\let\std@sect\@sect
\let\std@subsubsect\subsubsection
\renewcommand\subsubsection{%
  \def\@sect##1##2##3##4##5##6[##7]##8{%
    \std@sect{##1}{##2}{##3}{##4}{##5}{##6}[##7.]{##8.}}
  \std@subsubsect
}
\makeatother
Here, I redefine the internal \@sect command temporarily (locally) right before a subsubsection call, adding a dot.

Stefan
LaTeX.org admin
pingu
Posts: 3
Joined: Fri Aug 22, 2014 7:44 pm

KOMA-Script | Dot after SubSubSection Heading

Post by pingu »

Thank you Stefan, your solution works up to the first subsubsection heading. After that, all section, subsection and subsubsection headings are followed by a dot.

In fact, the idea is to turn the subsubsection heading into an inline heading (explained at http://www.golatex.de/viewtopic,p,63257.html), followed by a dot. For this purpose, the dot after the ##7 argument, which accounts for the TOC, is not necessary.

How about the following hack ?

Code: Select all

      \renewcommand\subsubsection{%
        \@startsection{subsubsection}{\subsubsectionnumdepth}{\z@}%
        {-3.25ex\@plus -1ex \@minus -.2ex}%
        {-1.5ex \@plus .2ex} % -1.5ex INSTEAD OF +1.5ex TO MAKE HEADING INLINE
        {\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
          \setlength{\parfillskip}{\z@ plus 1fil}\fi
          \raggedsection\normalfont\sectfont\nobreak\size@subsubsection
          \appendDot % APPEND DOT
        }%
      }
Post Reply