2

I want the paragraphs in my document numerated with lowercase letters, followed by a period. So I added the line \renewcommand{\theparagraph}{\alph{paragraph}} to my document which created the numbering I wanted. A side effect of this was however that periods also appeared after the Chapter/Section/Float numbers in their label (but not their reference!).

MWE:

\documentclass{scrartcl}
\renewcommand{\theparagraph}{\alph{paragraph}}
\setcounter{secnumdepth}{4}

\begin{document}
\section{Foo}\label{sec:foo}
\ref{sec:foo}
\paragraph{Bar}\label{sec:bar}
\end{document}

produces:

enter image description here

I noticed that this extra period is not added if I redefine \theparagraph with \arabic. Also, it appears only after the second compilation of the document.

Any suggestions on how to get rid of them are much appreciated.

9
  • Welcome to TeX.SE.
    – citsahcots
    Commented Aug 2, 2021 at 12:54
  • That period has nothing to do with \theparagraph, it is specified by who \paragraph is typeset.
    – daleif
    Commented Aug 2, 2021 at 13:31
  • @daleif It is merely my observation that this period is a direct consequence of the \renewcommand and \setcounter commands in my MWE. Unfortunately I know little about the inner workings. Could you maybe elaborate on your comment? Commented Aug 2, 2021 at 14:23
  • Delete your \renewcommand... and section etc., numbers are still followed by a period. This is the default for the class you are using. I have no idea how to remove the periods you object to. Commented Aug 2, 2021 at 16:44
  • @PeterWilson that is not true. If I delete the \renewcommand..., the trailing periods do not appear. Although indeed the described behaviour appears only with the scr... KOMA-classes. Commented Aug 2, 2021 at 16:51

2 Answers 2

3

It is a KOMA Script feature to add a period after (all sectioning) numbers as soon as there is a non-Arabic number at some level. To quote the documentation (pp. 99-100 in 2021-06-25)

According to DUDEN, if only Arabic numerals are used to number section headings, the German practice is to have no point at the end (see [DUD96, R3]). On the other hand, if Roman numerals or letters appear in the numbering, then a point should appear at the end of the numbering (see [DUD96, R4]). KOMA-Script has a mechanism that tries to automate this somewhat complex rule. The result is that normally after the sectioning commands \part and \appendix the numbering switches to using a final point. This information is saved in the .aux file and takes effect on the next LaTeX run.

Sometimes the mechanism for placing or omitting the final point may fail. Sometimes other languages have different rules. Therefore you can force the use of the final point with the option numbers=endperiod or to prohibit it with numbers=noendperiod.

Note that this mechanism only takes effect on the next LaTeX run. Therefore, before you try to use these options to force the correct numbering format, you should always perform another LaTeX run without modifying the document.

If you want to stick to the Duden rules, you have to do nothing.

If you want to get rid of the period, use numbers=noendperiod.

If you want to retain the period for the paragraph heading, you can additionally redefine \paragraphformat and replace \autodot with . to force a period.

\documentclass[numbers=noendperiod]{scrartcl}

\renewcommand*{\theparagraph}{\alph{paragraph}}
\renewcommand*{\paragraphformat}{\theparagraph.\enskip}
\setcounter{secnumdepth}{4}


\begin{document}
\section{Foo}\label{sec:foo}
\ref{sec:foo}
\paragraph{Bar}\label{sec:bar}
\end{document}

1 Foo
1
a. Bar

3

How about using article instead of scrartcl?

enter image description here

%\documentclass{scrartcl}
\documentclass{article}
\renewcommand{\theparagraph}{\alph{paragraph}}
\setcounter{secnumdepth}{4}

\begin{document}
\section{Foo}\label{sec:foo}
\ref{sec:foo}
\paragraph{Bar}\label{sec:bar}
\paragraph{Barr}\label{sec:barr}

Paragraph~\ref{sec:bar} gives the proof.
Paragraph~\ref{sec:barr} gives an example.
\end{document}
3
  • Firstly, I'm a fan of the inline style of Paragraph headings. Secondly, unfortunately it doesn't seem to solve the issue. This additional period seems to be a consequence of the \alph. It doesn't appear if I redefine using \arabic (or \fnsymbol) Commented Aug 2, 2021 at 16:49
  • @NielsKarschin, How about using article as shown in my updated answer?
    – citsahcots
    Commented Aug 2, 2021 at 18:18
  • That's not an option. I do use scrartcl over article (or scrbook over book, for that matter) for a variety of reasons. I cannot switch to a whole different document class for my PhD thesis for every small issue that appears along the way ;) Commented Aug 3, 2021 at 9:37

You must log in to answer this question.

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