1

I'm using scrartcl and trying to mix and match numbered and unnumbered sections and sub-sections. It appears that in scrartcl the unnumbered variants of \section still reset the counters for \subsection and \subsubsection, however I would like to prevent that from happening. The standard article document class works how I'd expect.

\documentclass[
  paper=letter,fontsize=12pt]{scrartcl}
\usepackage{mwe}

\setcounter{secnumdepth}{5}

\begin{document}

\tableofcontents

\section{Section 1}

Lorem ipsum dolor sit amet

\subsection{SubSection 1.1}

Lorem ipsum dolor sit amet

\subsubsection{SubSubSection 1.1.1}

Lorem ipsum dolor sit amet

\section*{Section with no Number}

\subsubsection{SubSubSection 1.1.2}

Lorem ipsum dolor sit amet

\end{document}

scrartcl example

Here's the example with standard article:

\documentclass{article}
\usepackage{mwe}

\setcounter{secnumdepth}{5}

\begin{document}

\tableofcontents

\section{Section 1}

Lorem ipsum dolor sit amet

\subsection{SubSection 1.1}

Lorem ipsum dolor sit amet

\subsubsection{SubSubSection 1.1.1}

Lorem ipsum dolor sit amet

\section*{Section with no Number}

\subsubsection{SubSubSection 1.1.2}

Lorem ipsum dolor sit amet

\end{document}

article example

I've played around with various options but I do not want the un-numbered variants to appear in the ToC. I thought about using \minisec but I need to support the different levels of text sizing available from the section header types.

Happy to take other suggestions on ways to handle these \minisec-like annotations at various levels if that makes more contextual sense than trying to avoid the counter resets. I also eventually want to use hyperref to link ToC entries to sections (but kept that out of them we for simplicity), so any solution would ideally be compatible with that.

1 Answer 1

1

You could use the compatibility option version=3.30:

\documentclass[paper=letter,fontsize=12pt,
  version=3.30% <- added
]{scrartcl}
\setcounter{secnumdepth}{5}

\begin{document}
\tableofcontents
\section{Section 1}
Lorem ipsum dolor sit amet
\subsection{SubSection 1.1}
Lorem ipsum dolor sit amet
\subsubsection{SubSubSection 1.1.1}
Lorem ipsum dolor sit amet
\addsec*{Section with no Number}
\subsubsection{SubSubSection 1.1.2}
Lorem ipsum dolor sit amet
\end{document}

enter image description here

Or you define new section commands:

\documentclass[paper=letter,fontsize=12pt]{scrartcl}
\setcounter{secnumdepth}{5}

\DeclareNewSectionCommand[
  style=section,
  level=\sectionnumdepth,
  indent=0pt,
  afterskip=2.3ex plus .2ex,
  beforeskip=-3.5ex plus -1ex minus -.2ex,
  font=\usekomafont{section},
  tocstyle=gobble% because there will be no ToC entry
]{mysection}

\DeclareNewSectionCommand[
  style=section,
  level=\subsectionnumdepth,
  indent=0pt,
  afterskip=1.5ex plus .2ex,
  beforeskip=-3.25ex plus -1ex minus -.2ex,
  font=\usekomafont{subsection},
  tocstyle=gobble% because there will be no ToC entry
]{mybubsection}

\begin{document}
\tableofcontents
\section{Section 1}
Lorem ipsum dolor sit amet
\subsection{SubSection 1.1}
Lorem ipsum dolor sit amet
\subsubsection{SubSubSection 1.1.1}
Lorem ipsum dolor sit amet
\mysection*{Section with no Number}
\subsubsection{SubSubSection 1.1.2}
Lorem ipsum dolor sit amet
\end{document}

enter image description here

1
  • Thank you so much! I'm leaning towards defining new sections but appreciate you pointing out the other compatibility option as well. This works great.
    – SteveB
    Apr 25, 2022 at 13:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .