I am trying to get this kind of result with tikz. However I don' have any idea how to align the text with the bottom of the rectangles or how to anchor the 2nd rectangle with the line of the title Final result

In this example, the fist title is a section title, the 2nd, a subsection title.

%!TEX program = xelatex
    \usepackage\[paperwidth=10.5cm,paperheight=15.5cm, margin=0.9cm\]{geometry}

    % \newfontfamily{\helveticacdl}{Helvetica-CondensedLight}


      \llap{\vrule width0.7cm height 0.7cm depth0ex\hskip0.25ex}%
      \rlap{\vrule width\textwidth height 0.7cm    depth0ex}%

      \raisebox{0.222ex}{\hbox to \textwidth{%
      \vrule width1.3ex height1ex depth0ex\hskip0.5ex%
      \leaders\vrule height 0.2cm depth0ex\hfil}}}\[\smallskip\]


    % Remove the header while starting a new section
    % \renewcommand{\sectionmark}\[1\]{\markright{#1}{}}
    \renewcommand{\sectionmark}\[1\]{\markboth{\chaptername \ \thesection. #1}{}}
    % \lhead{\leftmark}

    % Start sections on a new page
      \ifnum\value{section}=0 \else\clearpage\fi
    % manage multicolumns after each section title



    \section\[Politique et économie\]{Politique\\ et économie}
        \subsubsection{First subsub}



Remaining issues:

  • Clear the page number each time a new section appears.
  • Stick the left orange square to the left border page.
  • You can create them with overlay pictures that are positioned relative to the start and end of the text and the current page. Have a look at overlays in the TikZ picture. The following draws an arrow from the current position, to the left margin. \begin{tikzpicture}[overlay,remember picture] \draw[->] coordinate (here) (here) -- (current page.west|-here); \end{tikzpicture} When you implement this, make sure the rectangles bleed into the margin. – user10274 Aug 27 '15 at 4:24
  • How can I get the coordinates of the point at the west part of the page and under the header ? – celli Aug 27 '15 at 5:25
  • Additionally to Marc van Dongen (using page. coordinates) you can use titlesec to change font sizes of the section/subsection and the TikZ option baseline (see e.g. here tex.stackexchange.com/a/89827/8042) to align the boxes with respect to the bottom line or the center line of the text accordingly. – Ronny Aug 27 '15 at 6:33
  • After \tikz coordinate (first reference point);Your section title here\tikz coordinate (second reference point); You can then add your rectangles using the labels first reference pint and second reference point and positioning relative to current page.east and current page.west. – user10274 Aug 27 '15 at 6:39
  • @Ronny I'm sure this is possible but that's not what the OP was asking. I just wanted to show something to get started with. – user10274 Aug 27 '15 at 6:41

Without TikZ. Still far from perfect though.



  \llap{\vrule width\textwidth height1ex depth0ex\hskip0.75ex}%
  \rlap{\vrule width\textwidth height1ex depth0ex}%

  \raisebox{0.222ex}{\hbox to 0.975\textwidth{%
  \vrule width2ex height1ex depth0ex\hskip0.5ex%
  \leaders\vrule height1ex depth0ex\hfil}}}[\smallskip]

\section[Politique et \'economie]{Politique \\ et \'economie}

Blablabla \ldots le politique et l'\'economie


Quelle horreur!


enter image description here

| improve this answer | |
  • One remaining issue: how can I get a left square collapsing the left border of the page. – celli Aug 29 '15 at 1:28

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.