Bounding box example

enter image description here

Can you tell me the package to use to make the irregular shape for bounding the text, as in the example just above ?

3 Answers 3


The example image is from the page 16 of the French initiation to LaTeX by Stéphane Pasquet.

The source of the PDF is not available. But his mathbook class, available on his website, has on pages 12-14 of the documentation a similar border with the mathbook class environment demonstration.

The code of mathbook.cls is available in this zipped file, and for the demonstration environment, precisely in the file commandes.tex.

You could then see that the author uses the TikZ package and the decorations.pathmorphing tikzlibrary, with random steps.

With this code:


\tikz\node[draw,thick,inner sep=0.25cm,decorate,decoration={random steps,segment length=3pt, amplitude=1pt}] {{\Large Mon texte en Large} et maintenant en taille normale.};


you will obtain: enter image description here

  • Very clear and precise answer. Thank you
    – Idefix
    Jun 20, 2019 at 0:43

You can also draw the randomized box with MetaFun.


input rboxes ;

beginfig(0) ;
    numeric amplitude, segment_length, n ;
    path p, q ;

    amplitude := 1pt ;
    segment_length := 3pt ;

    boxit.a("{\Large Mon texte en Large} et maintenant en taille normale.");
    p := bpath a ;
    n := arclength p / segment_length ;
    q := for i = 0 upto n: point (i/n) along p -- endfor cycle;
    draw q randomized amplitude ;
endfig ;


enter image description here


So at the end of it


  \node[inner sep=1em,text width=.85\linewidth,align=flush left] (A) {#1};  
  \draw[decoration={random steps,segment length=0.4cm,amplitude=.1cm},decorate]
        (A.north west) -- (A.north east) -- (A.south east) -- (A.south west) -- cycle;

    {\Large Mon text en large} mon text


Which gives the result

enter image description here

Thanks to samcarter for this code


You must log in to answer this question.

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