I am compiling a multilingual book (Arabic+English), ~1400 pages, using the memoir class, and have been trying to frame each page with a simple black border using the following:
\usepackage{background}
\usetikzlibrary{calc}
\usepackage{lipsum}% just to generate some text
\SetBgScale{1}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgOpacity{1}
\SetBgVshift{-4}
\SetBgContents{
\begin{tikzpicture}[thick]
\draw (0.55\textwidth,10) -- (0.55\textwidth,0.52\textheight) -- (0.4\textwidth,0.52\textheight);
\draw (-0.55\textwidth,10) -- (-0.55\textwidth,0.52\textheight) -- (-0.4\textwidth,0.52\textheight);
\draw (-0.55\textwidth,-10) -- (-0.55\textwidth,-0.52\textheight) -- (-0.4\textwidth,-0.52\textheight);
\draw (0.55\textwidth,-10) -- (0.55\textwidth,-0.52\textheight) -- (0.4\textwidth,-0.52\textheight);
\end{tikzpicture}
}
\pagestyle{empty}
The border seems Ok, but I get random empty pages with missing content. I have no idea what is causing this behaviour - I've tried scrpage2 as well, but to the same effect.
Any help will be much appreciated - many thanks for reading.
p.s. I am using TeXLive 2010.