I'm trying to highlight some parts (paragraphs) in a document. For this I want to use a box, with the paragraph number hanging out into the left margin. However, I don't really know how to pull this off! Can someone help out? This is what I have so far. I'm using scrbook, with pdflatex to compile it. The issue is that first, the indentation of the text is not correct (you can see, it's a bit too far indented), and I'd really like that paragraph sign to be right-aligned and in the top (which it isn't right now). I hope someone can help fix this, or maybe suggest a package for this that I wasn't able to find? I'll also gladly take stylistic suggestions!

Here's the minimal example code:

\documentclass[paper=a5, parskip=half, 12pt]{scrbook}

    Vi Frederik den Niende, af Guds Nåde Konge til Danmark, de Venders og Goters, Hertug til Slesvig, Holsten, Stormarn, Ditmarsken, Lauenborg og Oldenborg, Gør vitterligt: I overensstemmelse med bestemmelserne i § 94 i Danmarks Riges Grundlov af 5. juni 1915 med ændringer af 10. september 1920 har rigsdagen 2 gange vedtaget, og folketingsvælgerne ved en den 28. maj 1953 afholdt folkeafstemning godkendt, hvorefter Vi nu ved Vort allerhøjeste samtykke stadfæster DANMARKS RIGES GRUNDLOV 

    \hspace{-1cm}\colorbox{gray!10!white}{\parbox{1cm}{\sffamily\bfseries § 8}\parbox{\textwidth}{ Bestemmelser angående regeringens førelse i tilfælde af kongens umyndighed, sygdom eller fraværelse fastsættes ved lov. Er der ved tronledighed ingen tronfølger, vælger folketinget en konge og fastsætter den fremtidige arvefølge.}}

And here is what it looks like:

Failed attempt at creating a paragraph box

Thanks a lot in advance!

1 Answer 1


You could make use of the tcolorbox package as shown in this example:


  sidebyside align=top,
  lower separated=true,
  lefthand width=2em,
  sidebyside gap=5pt,
  enlarge left by=-2em-13pt




enter image description here

Colors, font sizes, margins, ... of the box (that was inspired by this answer) can of course be changed to suit your needs.

  • Thanks a lot, this is much better than me rolling my own implementation. And more customizable, too. I only had to add \usepackage[T1]{fontenc} and \usepackage[utf8]{inputenc} to get this to work – otherwise the § wouldn't show up.
    – xfbs
    Jul 8, 2018 at 19:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .