I'm trying to create these environments but without much success ... I wonder if it will be better to create it with tikz or if it is easier to customize the title of a tcolorbox and rotate it a bit ?

Env 1 Env 2

\usetikzlibrary{intersections, patterns}



\begin{tikzpicture}[overlay,remember picture]
    % container 
    \draw[fill=darkblue,draw=none] (0,0) -- ++(5cm,0) -- ++(0,1cm)
    arc (0:90:0.5) -- ++(-4.5cm,0) -- cycle;
    % Horizontal line 
    \draw[darkblue, line width=2pt] (0,0) -- (\textwidth,0);
    % title of container 
    \node[scale=1.2] at (0.2cm,0.2cm)  {\textcolor{white}{Environment
        Title }};


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
  • 3
    tcolorbox allows title overlays, so that would be a good start. In general tcolorbox is very versatile while every own TikZ solution will be very restricted (of course depending on your needs). – TeXnician Sep 24 '18 at 8:48

I propose an other answer quite similar to the one given by @Ignasi but not exactly the same:

(reedited with the improvement proposed by @TeXnician related to the vertical shift of the top line)



  (title.south east)
  to[curve to,out=90,in=0]($(A)+(-5mm,5mm)$)
      --($(title.north west)+(5mm,0mm)$)coordinate(B)
to[curve to,out=180,in=90]($(B)+(-5mm,-5mm)$)coordinate(C)
      to[curve to,out=90,in=180]($(title.south west)+(+5mm,0mm)$)coordinate(F)
      \draw[titleboxcolor,ultra thick]
      ([yshift=.5\pgflinewidth]title.south east)--

  frame empty,
  title=Exercice résolu,
  attach boxed title to top left={xshift=-5mm},
  boxed title style={empty},
  underlay boxed title=\titlepath



  Soit \(f\) une fonction définie sur ...


enter image description here

  • Thank you both for your answers, would you have a tutorial on tikz or tcolorbox to start, the official documentation is too long to start ? – Clifford Sep 25 '18 at 3:49
  • Just for the protocol: The usage of \[ and \] in this answer is blatantly wrong. – TeXnician Sep 26 '18 at 6:28
  • 1
    And please remove the vertical offset by using \draw[titleboxcolor,ultra thick]([yshift=.5\pgflinewidth]title.south east)--([yshift=.5\pgflinewidth]title.south-|interior.east); instead of your draw command. – TeXnician Sep 26 '18 at 6:30
  • I don't know why but every square bracket in the code I proposed is prefixed with a backslash. I am not sure if that was (or not) the case when I posted it. I will reedit – Hafid Boukhoulda Sep 26 '18 at 7:09

Something to start working:


        sharp corners,
        rounded corners=northwest,
        frame hidden,
        attach boxed title to top left,
        boxed title size=standard,
        boxed title style={%
                rounded corners=north, 
          underlay boxed title={%
                \filldraw[rounded corners=\kvtcb@arc, orange!80!black, line width=.5mm]
                    (title.south east)--++(93:\tcboxedtitleheight)--++(183:\tcboxedtitlewidth)--++(-87:\tcboxedtitleheight)|-cycle;
                \draw[tcbcolframe, line width=.5mm] (title.south)|-(frame.north east);

\begin{mybox}{Exercice résolu}


enter image description here

Note Previous code has been updated for compatibility with tcolorbox v4.20. If you're using previous versions, rename colors with form tcbcol... to older form tcbcol@....


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.