<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to HowTo_SingleLinePart</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_SingleLinePart/</link><description>Recent changes to HowTo_SingleLinePart</description><atom:link href="https://sourceforge.net/p/koma-script/wiki-en/HowTo_SingleLinePart/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 29 Jul 2025 08:38:10 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/koma-script/wiki-en/HowTo_SingleLinePart/feed" rel="self" type="application/rss+xml"/><item><title>HowTo_SingleLinePart modified by Markus Kohm</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_SingleLinePart/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="how-to-print-the-headings-of-the-part-level-part-without-a-prefix-line"&gt;How to print the headings of the part level (\part) without a prefix line&lt;/h1&gt;
&lt;p&gt;In &lt;code&gt;scrartcl&lt;/code&gt;, the headings of the &lt;code&gt;part&lt;/code&gt; level are the only ones that are output with a prefix line, i.e. where "Part" followed by the number is always on a separate line. If you want this heading to be output like the headings of the &lt;code&gt;section&lt;/code&gt; level, you can simply change the style:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\RedeclareSectionCommand&lt;/span&gt;&lt;span class="na"&gt;[style=section]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;However, by default, no space is inserted after the number, as this would not make sense for a prefix line. Therefore, &lt;code&gt;\partformat&lt;/code&gt; must also be changed:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrartcl&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[english]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;babel&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;blindtext&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% \part with line break after the number and hanging indent like \section&lt;/span&gt;
&lt;span class="k"&gt;\RedeclareSectionCommand&lt;/span&gt;&lt;span class="na"&gt;[style=section]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\renewcommand*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\partformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\partname&lt;/span&gt;~&lt;span class="k"&gt;\thepart\autodot\&lt;/span&gt; &lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\part&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Example Heading on Level  &lt;span class="k"&gt;\partnumdepth&lt;/span&gt;&lt;span class="nb"&gt;{}&lt;/span&gt; (part)&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\blinddocument&lt;/span&gt;

&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If the heading text is multi-line, as in the example, this solution uses a hanging indent just like &lt;code&gt;\section&lt;/code&gt;. If this hanging indent is to be omitted, a solution without changing the style is recommended:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrartcl&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[english]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;babel&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;blindtext&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% \part without hanging indent but also without line break after the number&lt;/span&gt;
&lt;span class="k"&gt;\renewcommand*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\partheadmidvskip&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\enskip&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\setkomafont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;partprefix&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\usekomafont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}}&lt;/span&gt;

&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\part&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Example Heading on Level  &lt;span class="k"&gt;\partnumdepth&lt;/span&gt;&lt;span class="nb"&gt;{}&lt;/span&gt; (part)&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\blinddocument&lt;/span&gt;

&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you define headings yourself with &lt;code&gt;\DeclareNewSectionCommand&lt;/code&gt;, you should note that, unlike the first solution, this second solution also has an effect on other headings in the &lt;code&gt;part&lt;/code&gt; style, as &lt;code&gt;\partheadmidvskip&lt;/code&gt; is a statement from the &lt;code&gt;part&lt;/code&gt; style and not only from the &lt;code&gt;\part&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;The second solution works not only for &lt;code&gt;scrartcl&lt;/code&gt;, but also for &lt;code&gt;scrbook&lt;/code&gt; and &lt;code&gt;scrreprt&lt;/code&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrbook&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[english]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;babel&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;blindtext&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% \part without hanging indent but also without line break after the number&lt;/span&gt;
&lt;span class="k"&gt;\renewcommand*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\partheadmidvskip&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\enskip&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\setkomafont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;partprefix&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\usekomafont&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}}&lt;/span&gt;

&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\part&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Example Heading on Level  &lt;span class="k"&gt;\partnumdepth&lt;/span&gt;&lt;span class="nb"&gt;{}&lt;/span&gt; (part)&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\blinddocument&lt;/span&gt;

&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For &lt;code&gt;scrbook&lt;/code&gt; or &lt;code&gt;scrreprt&lt;/code&gt;, you should replace &lt;code&gt;style=section&lt;/code&gt; with &lt;code&gt;style=chapter&lt;/code&gt; when using the first solution, but then you would no longer automatically have a separate page with a blank back:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrbook&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[english]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;babel&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;blindtext&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% \part like \chapter&lt;/span&gt;
&lt;span class="k"&gt;\RedeclareSectionCommand&lt;/span&gt;&lt;span class="na"&gt;[style=chapter]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\renewcommand*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\partformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\partname&lt;/span&gt;~&lt;span class="k"&gt;\thepart\autodot\&lt;/span&gt; &lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\part&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Example Heading on Level &lt;span class="k"&gt;\partnumdepth&lt;/span&gt;&lt;span class="nb"&gt;{}&lt;/span&gt; (part)&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\blindtext&lt;/span&gt;

&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;However, as long as &lt;code&gt;\part&lt;/code&gt; is always followed by &lt;code&gt;\chapter&lt;/code&gt; and option &lt;code&gt;open=right&lt;/code&gt; (this is the default setting for &lt;code&gt;scrbook&lt;/code&gt;) is used, this is not a problem because &lt;code&gt;\chapter&lt;/code&gt; then takes care of the empty back:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrbook&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[english]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;babel&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;blindtext&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% \part like \chapter&lt;/span&gt;
&lt;span class="k"&gt;\RedeclareSectionCommand&lt;/span&gt;&lt;span class="na"&gt;[style=chapter]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\renewcommand*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\partformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\partname&lt;/span&gt;~&lt;span class="k"&gt;\thepart\autodot\&lt;/span&gt; &lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\part&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Example Heading on Level &lt;span class="k"&gt;\partnumdepth&lt;/span&gt;&lt;span class="nb"&gt;{}&lt;/span&gt; (part)&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\blinddocument&lt;/span&gt;

&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Otherwise you may have to insert &lt;code&gt;\cleardoubleoddpage&lt;/code&gt; yourself:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="na"&gt;[open=any]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrbook&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[english]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;babel&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;blindtext&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% \part like \chapter&lt;/span&gt;
&lt;span class="k"&gt;\RedeclareSectionCommand&lt;/span&gt;&lt;span class="na"&gt;[style=chapter]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;part&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\renewcommand*&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\partformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\partname&lt;/span&gt;~&lt;span class="k"&gt;\thepart\autodot\&lt;/span&gt; &lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\tableofcontents&lt;/span&gt;

&lt;span class="k"&gt;\cleardoubleoddpage&lt;/span&gt;&lt;span class="c"&gt;% So that the part is on a right-hand side.&lt;/span&gt;
&lt;span class="k"&gt;\part&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Example Heading on Level &lt;span class="k"&gt;\partnumdepth&lt;/span&gt;&lt;span class="nb"&gt;{}&lt;/span&gt; (part)&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\cleardoubleoddpage&lt;/span&gt;&lt;span class="c"&gt;% So that the part has a blank back.&lt;/span&gt;

&lt;span class="k"&gt;\blinddocument&lt;/span&gt;

&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;document&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It should be noted that when using the &lt;code&gt;chapter&lt;/code&gt; style for &lt;code&gt;\part&lt;/code&gt; headings, these naturally also take the &lt;code&gt;chapterprefix&lt;/code&gt; option into account. It is therefore not possible in this way to set the &lt;code&gt;\part&lt;/code&gt; headings without a prefix line and the &lt;code&gt;\chapter&lt;/code&gt; headings with a prefix line. Strictly speaking, however, this would make little sense anyway.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Markus Kohm</dc:creator><pubDate>Tue, 29 Jul 2025 08:38:10 -0000</pubDate><guid>https://sourceforge.net199d7c245c548169cc9ca458af0323b37bb5bd7f</guid></item></channel></rss>