Another user asked asked a similar question; yet I just need the top header and not the full design from edp. And I provide a minimal working example.

This is how it should look like:

Edp LaTeX deisgn header.

If you press one of the upper header boxes, they will redirect you to the right chapter. I thought it was really nice, so I wanted it for private purpose. Yet I have trouble with recreating the effect.

Here is what I tried with tikz:



\begin{tikzpicture}[overlay, remember picture]
\foreach \x in {1,...,7};
\draw let \p1 = (current page.west), \p2 = (current page.east) in node[minimum width=\x2-\x1, minimum height=2cm, draw, rectangle, fill=black!90, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {\Large\bfseries \quad #1};

\chapter{Chapter one}

Well, it creates a big black box in the header with no text in it. So it doesn't work at all. I thought of using the \foreach function, but had trouble with it.

Basically I need help with creating the boxes at the top and I have problems with letting them redirect to the chapter.

Hopefully you can help me?

  • You have fill=black!90 so you create a line of almost completely black rectangles.
    – cfr
    Commented Mar 26, 2016 at 20:09
  • 1
    Your code does not compile for me. Don't you get an error rather than black boxes?
    – cfr
    Commented Mar 26, 2016 at 20:14
  • here an idea tex.stackexchange.com/questions/298006/…
    – touhami
    Commented Mar 26, 2016 at 20:30
  • I am no TikZ expert, but what's the replacement for #1 here? Something from the \foreach loop?
    – user31729
    Commented Mar 26, 2016 at 20:45

2 Answers 2


Here's a tcolorbox version with automatic linking to the chapters. Since tcolorbox is TikZ package much additions can be done to those boxes with over- or underlays.





  enhanced jigsaw,
  sharp corners,
  equal height group=headerboxes,



\begin{tcbraster}[%raster valign=center,
  raster row skip=0pt,
  raster before skip=0pt,
  raster columns={5}, 
  raster equal height=all, 
  raster equal height group=headerboxes,
  raster column skip=0pt,
  raster left skip=0pt, 
  raster right skip=0pt]
  \foreach \x in {1,...,\totvalue{chapter}} {%




enter image description here

  • it's not good idea to hundle labels this way, you can think for some thing that does this automatic.
    – touhami
    Commented Mar 27, 2016 at 14:03
  • @touhami: Yes, of course, but I wanted to provide a quick solution
    – user31729
    Commented Mar 27, 2016 at 14:35
  • it's my bad , i am so sorry.
    – touhami
    Commented Mar 27, 2016 at 15:17
  • @touhami: Sorry, why? You're completely right, but I had no time yesterday evening
    – user31729
    Commented Mar 27, 2016 at 15:19
  • cfr below said that the point in the question was about box creating.
    – touhami
    Commented Mar 27, 2016 at 15:24

This draws the tabs at the top and inserts the chapter numbers using LaTeX's \label/\ref system. In my opinion, that is quite enough for one question and hyperlinking is left as an exercise for the reader.

In other words, I can make TikZ do some stuff, but I can't make hyperref behave when it doesn't want to and it didn't want to.

However, there really is more than one question here, so I think it is worth answering one of the questions even if I cannot answer the other.


\begin{tikzpicture}[overlay, remember picture]
  \path [fill=red] (current page.north west) rectangle +(\paperwidth,-20mm);
  \path (current page.north west) foreach \i [evaluate=\i as \j using {25*(mod(\i,2)}] in {1,...,7} {%
    +({(\i-1)*\tabwidth},0) node [minimum width=\tabwidth, minimum height=2cm, rectangle, fill=white!\j!red, font=\Large\bfseries, text=white, anchor=north west] {\ref{ch:\i}}
\chapter{Chapter one}\label{ch:1}
  • Thank your for your answer, but I get a lotof errors: like missing semicolon, number and illegal unit. Commented Mar 26, 2016 at 21:13
  • @AmabileScientius All I can say is that it works for me and I do not get errors. Do you get errors when you copy just my code into a new, empty .tex file and compile that? If so, precisely which error? The first error is the important one. Most of the others are probably consequences of the first and, if any aren't, you can't tell which until you've fixed the first.
    – cfr
    Commented Mar 26, 2016 at 21:19
  • 2
    @AmabileScientius: This works for me out of the box! Maybe you need to update your TeX distribution
    – user31729
    Commented Mar 26, 2016 at 21:35
  • it's not good idea to hundle labels this way, you can think for some thing that does this automatic
    – touhami
    Commented Mar 27, 2016 at 14:03
  • @touhami I just meant it to demonstrate the TikZ part i.e. drawing the tabs. as I said, it doesn't address the linking part of the question so the content of the tabs is only intended for demonstration purposes. If the question were just getting the content into the tabs, I would have worked on a way to automatise it. But since that would still leave the linking question, I assume it would be better to address the content along with the linking.
    – cfr
    Commented Mar 27, 2016 at 14:41

You must log in to answer this question.

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