# Put section and page numbers in the margin with KOMA Script

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`?

-

``````\renewcommand*{\othersectionlevelsformat}[1]{%
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}}‌​` –  cgnieder Aug 20 at 7:53