<?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_NumbersAtLeftMargin</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/</link><description>Recent changes to HowTo_NumbersAtLeftMargin</description><atom:link href="https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 02 Aug 2021 14:52:50 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/feed" rel="self" type="application/rss+xml"/><item><title>HowTo_NumbersAtLeftMargin modified by Markus Kohm</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,4 +1,4 @@
-#  How to print the heading numbers into the left margin
+#  How to print the heading numbers in the left margin

 KOMA-Script offers the experienced typographer possibilities that are not to be suspected at first sight. For example, with the redefinition of a few macros, which are also documented in the manual, it is possible to place the heading numbers in the left margin in such a way that the text of the heading is left-aligned with the text area. However, this approach is only recommended if the left margin is appropriately wide. As a rule, this is only the case with single-page documents.
 ```latex
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Markus Kohm</dc:creator><pubDate>Mon, 02 Aug 2021 14:52:50 -0000</pubDate><guid>https://sourceforge.net87c815180cb10ac65c58b7e51e9da0660d89a224</guid></item><item><title>HowTo_NumbersAtLeftMargin modified by Markus Kohm</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -5,10 +5,10 @@
 \documentclass{scrreprt}
 \usepackage{blindtext}

+% How to print the heading numbers into the left margin
+% → &amp;lt;https: sourceforge.net="" p="" koma-script="" wiki-en="" howto_headings="" howto_numbersatleftmargin=""&amp;gt;
 % Wie die Überschriftennummern in den linken Rand ausgerückt werden können
 % → &amp;lt;https: sourceforge.net="" p="" koma-script="" wiki-de="" howto_headings="" howto_numbersatleftmargin=""&amp;gt;
-% How to print the heading numbers into the left margin
-% → &amp;lt;https: sourceforge.net="" p="" koma-script="" wiki-en="" howto_headings="" howto_numbersatleftmargin=""&amp;gt;

 \Ifundefinedorrelax{chapterformat}{}{%
   \renewcommand*{\chapterformat}{\makebox[0pt][r]{\chapappifchapterprefix{\ }\thechapter\autodot\hspace{\marginparsep}}}%
@@ -19,7 +19,6 @@

 \setcounter{secnumdepth}{\subsubsectionnumdepth}% For demonstration number down to \subsubsections.

-\reversemarginpar
 \begin{document}
 \tableofcontents

&amp;lt;/https:&amp;gt;&amp;lt;/https:&amp;gt;&amp;lt;/https:&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Markus Kohm</dc:creator><pubDate>Mon, 02 Aug 2021 13:57:36 -0000</pubDate><guid>https://sourceforge.netcbbcb37522f1b4138f4c03e004473fff23808ce6</guid></item><item><title>HowTo_NumbersAtLeftMargin modified by Markus Kohm</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,4 +1,4 @@
-# How to move the heading numbers out to the left margin.
+#  How to print the heading numbers into the left margin

 KOMA-Script offers the experienced typographer possibilities that are not to be suspected at first sight. For example, with the redefinition of a few macros, which are also documented in the manual, it is possible to place the heading numbers in the left margin in such a way that the text of the heading is left-aligned with the text area. However, this approach is only recommended if the left margin is appropriately wide. As a rule, this is only the case with single-page documents.
 ```latex
@@ -7,7 +7,7 @@

 % Wie die Überschriftennummern in den linken Rand ausgerückt werden können
 % → &amp;lt;https: sourceforge.net="" p="" koma-script="" wiki-de="" howto_headings="" howto_numbersatleftmargin=""&amp;gt;
-% How to print the headings numbers into the left margin
+% How to print the heading numbers into the left margin
 % → &amp;lt;https: sourceforge.net="" p="" koma-script="" wiki-en="" howto_headings="" howto_numbersatleftmargin=""&amp;gt;

 \Ifundefinedorrelax{chapterformat}{}{%
&amp;lt;/https:&amp;gt;&amp;lt;/https:&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Markus Kohm</dc:creator><pubDate>Mon, 02 Aug 2021 13:35:41 -0000</pubDate><guid>https://sourceforge.net6f1c00455cf98c4e9dc016f949604332e8ed0168</guid></item><item><title>HowTo_NumbersAtLeftMargin modified by Markus Kohm</title><link>https://sourceforge.net/p/koma-script/wiki-en/HowTo_NumbersAtLeftMargin/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="how-to-move-the-heading-numbers-out-to-the-left-margin"&gt;How to move the heading numbers out to the left margin.&lt;/h1&gt;
&lt;p&gt;KOMA-Script offers the experienced typographer possibilities that are not to be suspected at first sight. For example, with the redefinition of a few macros, which are also documented in the manual, it is possible to place the heading numbers in the left margin in such a way that the text of the heading is left-aligned with the text area. However, this approach is only recommended if the left margin is appropriately wide. As a rule, this is only the case with single-page documents.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;scrreprt&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;% Wie die Überschriftennummern in den linken Rand ausgerückt werden können&lt;/span&gt;
&lt;span class="c"&gt;% → &amp;lt;https://sourceforge.net/p/koma-script/wiki-de/HowTo_Headings/HowTo_NumbersAtLeftMargin&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;% How to print the headings numbers into the left margin&lt;/span&gt;
&lt;span class="c"&gt;% → &amp;lt;https://sourceforge.net/p/koma-script/wiki-en/HowTo_Headings/HowTo_NumbersAtLeftMargin&amp;gt;&lt;/span&gt;

&lt;span class="k"&gt;\Ifundefinedorrelax&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;chapterformat&lt;span class="nb"&gt;}{}{&lt;/span&gt;&lt;span class="c"&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;\chapterformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\makebox&lt;/span&gt;&lt;span class="na"&gt;[0pt][r]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\chapappifchapterprefix&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\ &lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="k"&gt;\thechapter\autodot\hspace&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\marginparsep&lt;/span&gt;&lt;span class="nb"&gt;}}}&lt;/span&gt;&lt;span class="c"&gt;%&lt;/span&gt;
&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;\sectionformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\makebox&lt;/span&gt;&lt;span class="na"&gt;[0pt][r]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\thesection\autodot\hspace&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\marginparsep&lt;/span&gt;&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;\subsectionformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\makebox&lt;/span&gt;&lt;span class="na"&gt;[0pt][r]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\thesubsection\autodot\hspace&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\marginparsep&lt;/span&gt;&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;\subsubsectionformat&lt;/span&gt;&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\makebox&lt;/span&gt;&lt;span class="na"&gt;[0pt][r]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\thesubsubsection\autodot\hspace&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\marginparsep&lt;/span&gt;&lt;span class="nb"&gt;}}}&lt;/span&gt;

&lt;span class="k"&gt;\setcounter&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;secnumdepth&lt;span class="nb"&gt;}{&lt;/span&gt;&lt;span class="k"&gt;\subsubsectionnumdepth&lt;/span&gt;&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="c"&gt;% For demonstration number down to \subsubsections.&lt;/span&gt;

&lt;span class="k"&gt;\reversemarginpar&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;\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;/pre&gt;&lt;/div&gt;


&lt;p&gt;The trick in the solution shown here is to set the heading numbers right-justified in a box of the alleged zero width. This places them to the left of the current position. Unless an indent is explicitly defined with &lt;code&gt;\RedeclareSectionCommand&lt;/code&gt;, the current position when the number is output is normally the left edge of the text area. At the end of the output a space of &lt;code&gt;\marginparsep&lt;/code&gt; is added. This is the space that is normally also inserted between the text column and margin notes. Of course, users can choose any other spacing instead.&lt;/p&gt;
&lt;p&gt;The redefinition of the output of the chapter number, &lt;code&gt;\chapterformat&lt;/code&gt;, is done only if the statement was also defined before. With the &lt;code&gt;scrreprt&lt;/code&gt; class used in the example, this restriction would not be necessary. The same is true for &lt;code&gt;scrbook&lt;/code&gt;. However, with &lt;code&gt;scrartcl&lt;/code&gt;, redefining &lt;code&gt;\chapterformat&lt;/code&gt; would result in an error. By testing with &lt;code&gt;\Ifundefinedorrelax&lt;/code&gt;, however, the code can be used unchanged for &lt;code&gt;scrartcl&lt;/code&gt; as well.&lt;/p&gt;
&lt;p&gt;For documents with option &lt;code&gt;chapterprefix=true&lt;/code&gt; or with option &lt;code&gt;appendixprefix=true&lt;/code&gt; the formatting shown here makes no sense. The redefinition should not be used in this case.&lt;/p&gt;
&lt;p&gt;Theoretically, the method shown could also be applied to &lt;code&gt;\paragraph&lt;/code&gt; and &lt;code&gt;\subparagraph&lt;/code&gt;. However, it is very unusual to in-line headings at all and then possibly move the number out into the margin. Furthermore, the headings of the &lt;code&gt;\subparagraph&lt;/code&gt; layer are additionally indented, so it would be completely nonsensical to put the number in the margin. I therefore advise against using similar definitions with these two levels. Alternatively, one should then also redefine these levels as free-standing headings instead of as in-line headings. This is easily done with &lt;code&gt;\RedeclareSectionCommand&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Markus Kohm</dc:creator><pubDate>Mon, 02 Aug 2021 13:34:47 -0000</pubDate><guid>https://sourceforge.net3bed36ef4fe833e57a33aaefb115ff46296893e2</guid></item></channel></rss>