5

How can one draw a box on each page (KOMA class srcreprt) to show a user defined print margin. E.g. the box should be 25 mm from each page margin (which might be different from the actual layout setting which can be shown with \usepackage{showframe})

\documentclass{scrreprt}
\usepackage{blindtext}
\usepackage{showframe}

\begin{document}

\Blinddocument

\end{document}
1

3 Answers 3

4

Try this code:

\documentclass{scrreprt}
\usepackage{blindtext}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}

\usepackage{eso-pic}

\AddToShipoutPicture{%
\begin{tikzpicture}[remember picture, overlay]
    \draw[line width=1pt]
         ($(current page.north west) +(25mm,-25mm)$)
         rectangle
         ($(current page.south east) +(-25mm,25mm)$);
\end{tikzpicture}%
}
\begin{document}

\Blinddocument

\end{document} 

Output:

enter image description here

4

With background:

\documentclass{scrreprt}
\usepackage{blindtext}
\usepackage{background}
\backgroundsetup{
angle=0,
scale=1,
opacity=1,
color=black,
contents={%
\begin{tikzpicture}[remember picture, overlay]
\draw ([xshift=25mm,yshift=25mm]current page.south west) rectangle ([xshift=-25mm,yshift=-25mm)]current page.north east);
\end{tikzpicture}%
}
}

\begin{document}
\Blinddocument

\end{document}

enter image description here

2

After a few modification of the karlkoeller's code I came up with the solution I was looking for:

\documentclass{scrreprt}
\usepackage{blindtext}

\usepackage{tikzpagenodes}
\usetikzlibrary{calc}

\usepackage{eso-pic}

\AddToShipoutPicture{%
\begin{tikzpicture}[remember picture, overlay]
    \draw[line width=1pt]
         ($(current page.north west) +(25mm,-25mm)$)
         rectangle
         ($(current page.south east) +(-25mm,25mm)$);
\end{tikzpicture}%
}

\begin{document}

\Blinddocument

\end{document}
2
  • Sorry, I didn't read "from page margin". I've modified my answer. Apr 15, 2014 at 9:40
  • @karlkoeller Eh!. I too followed suit. Damn. :)
    – user11232
    Apr 15, 2014 at 9:59

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.