Here's what I want to do, and cannot find a simple way to do it:


The important thing is to have the section numbers "hanging" within the left margin, ie. not above the text and not inside the text.

  • And no section title? – Bernard Dec 27 '17 at 22:20
  • 1
    There is a problem in that things like \listoffigures and \appendix use \section*{\listfigurename}. – John Kormylo Dec 27 '17 at 22:26

Something like this?



  \needspace{\dimexpr 5\baselineskip}%
    \makebox[0pt][r]{{\Huge\bfseries\thesection} }%
  \vbox to\dimexpr 2\baselineskip{%
    \hrule width \textwidth height \seprulethickness
  }\vskip\dimexpr 2\baselineskip





enter image description here

The separation rule would disappear if not followed by another section in the same page.

Image added to answer the comment by Barbara Beeton below.

enter image description here

  • please check (i can't) ... is the baseline distance between the first and second text lines in section 2 the same as between lines two and three? it looks a bit tighter. – barbara beeton Dec 27 '17 at 23:24
  • @barbarabeeton That's just an optical effect due to image scaling, I added a magnified image. However, I added \nointerlineskip to get even space around the rule. – egreg Dec 27 '17 at 23:32
  • thanks. i was ready to delete comment, but since you've mentioned the comment in your edit, i guess i can't. (i know my laptop may be suspect, and the first section did look okay. it's not fun being separated from a dependable system.) – barbara beeton Dec 27 '17 at 23:49
    \mysection \lipsum[1-2]
    \mysection \lipsum[1-2]


enter image description here

  • very nice. i like that the base of the section number sits on the same baseline as the second text line. but the transition between the sections isn't as distinct as it might be. i think the op's idea of a divider rule is sound. – barbara beeton Dec 27 '17 at 23:53
  • @barbarabeeton The question title was about hanging numbers, the question itself also sounded as if the hanging numbers was the main point so I ignored the rule. – Ulrike Fischer Dec 28 '17 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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