Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using the scrartcl document class, I would like to put the section number into the page margin, as is seen for example in the famous l2tabu document. That should be easily possible with KOMA Script, but I can not find how.

Also, how can the same be done with page numbers, as is done for example in the good old LaTeX Companion?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The source code of l2tabu is available on CTAN. There you can read it:

  \makebox[0pt][r]{\csname the#1\endcsname\autodot\enskip}}

The section number is put into a box of width 0, right aligned. So it runs into the left margin.

share|improve this answer
I found the command for setting the pagenumber in the margin. \setheadwidth[0pt]{textwithmarginpar} Want to add it to your answer? –  Ingo Jan 11 '12 at 11:53
The definition is flawed: \othersectionlevelsformat has three arguments. The KOMA-Script documentation (p. 109 of a current version) suggests \renewcommand*\othersectionlevelsformat[3]{\makebox[0pt][r]{#3\autodot\enskip}}‌​ –  clemens Aug 20 '14 at 7:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.