# Page border coloured

How to create a coloured page border for a document using KOMA-Script scrbook class?

Something like this:

(image taken from the memoir tutorial)

-
Have a look on Page Bordering with an image?, which seems to be similar enough. –  Martin Scharrer May 14 '11 at 13:16
You could have e-mailed me or left a comment to ask how I did it - I wrote that blog post and that sample page! ^_^ Anyway @Toby gave the correct answer, and it's true that I wrote about the memoir way, the book way (using fancyhdr) but not the scrbook way. –  LianTze Lim May 16 '11 at 9:28

You could use TikZ

This example can give an idea how to use it:

\documentclass[english]{scrbook}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel,blindtext}

\usepackage{scrpage2}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\pageframe}{%
\begin{tikzpicture}[remember picture, overlay]
% page frame
\fill [red] (current page.north west)
rectangle (current page.south east);
\fill [white, rounded corners=1cm] ($(current page.north west)+(1cm,-1cm)$)
rectangle ($(current page.south east)+(-1cm,4cm)$);
\node [fill=green, text width=1.5cm, align=center] at
($(current page.south)+(0,4cm)$) {\strut\pagemark};
% \strut gives all page mark nodes the same hight.
\end{tikzpicture}
}
% set page style

\begin{document}
\Blinddocument
\end{document}


When using different definitions of \cehead and \lefoot (or other heading-commads) you can define different borders for left and right pages. You can even “draw” the pagemark with the TikZ way.

Note that TikZ needs two latex-runs to get the right positions.

See PGF Manual, section 16.13.2 Referencing the Current Page Node – Absolute Positioning and the KOMA-Script Manual about using scrpage2.

-
As mentioned in “Tikz rectangle hiding text!” theres a problem when using the foot to define the border so I changed the example. No it uses the center head instead of left foot to draw the frame (an everything else) behind the text body. This makes it even easier to draw the frame cause we can use two overlaying rectangles instead of four arbors which gives us the opportunity to make the inner rectangle with rounded corners. –  Tobi May 16 '11 at 9:05
+1 for \strut! –  LianTze Lim May 16 '11 at 9:32