TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to layout a text book where each page in a given chapter has a thin coloured sidebar that starts at the top of the page and is some fixed length long. Each chapter will have a differently coloured sidebar of differing lengths. For example, chapter 1 might have a green sidebar of length 5cm, chapter 2, red of length 3cm and so on. The sidebars will in an ideal world be in addition to any margin notes. Would appreciate any help anyone could give with this. The best option I can see at the moment is to use tikz, but maybe there's a simpler solution.

share|improve this question
beamer also has those sidebars, how is beamer doing it, and is there a way of doing it the same way as beamer? – white_gecko Nov 17 '14 at 20:56
up vote 4 down vote accepted

One option would be to use the background package (http://www.ctan.org/pkg/background); in the following example, all you have to do for each chapter is to set the color and length of the vertical bar (through the \VerBar command) and then redefine \SetBgContents:




\chapter{Test chapter one}

\chapter{Test chapter one}

share|improve this answer
Brilliant ! many thanks and very much appreciated :) – manwyddan Mar 10 '11 at 8:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.