I want to have a section style like in the below picture.

The size of corners should be flexible with the length of the section title.

enter image description here

  • 1
    what you try so far? – Zarko Mar 26 '17 at 19:34

You can use tikz to draw the corners and titlesec to customize the format of headings:


        \node (title) {\thesection\hspace{1em}#1};
        \draw[double] (title.west) |- (title.south) (title.north) -| (title.east);

% default values copied from titlesec documentation page 23
% parameters of \titleformat command are explained on page 4
    {\section}% <command> is the sectioning command to be redefined, i. e., \part, \chapter, \section, \subsection, \subsubsection, \paragraph or \subparagraph.
    {\normalfont\Large\bfseries}% <format>
    {}% <label> the number
    {0em}% <sep> length. horizontal separation between label and title body
    {\sectionformat}% code preceding the title body  (title body is taken as argument)



Edit: Please note that long headings will not break automatically. If you add a [align=left] after the \node you can insert line breaks by hand with \\.

|improve this answer|||||

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.