2

I want to decorate pages in my document by using the package pgfornaments. To make things easier, I created the command \pageornament:

\newcommand{\pageornament}[2]{% 
\begin{tikzpicture}[remember picture, overlay] 
\color{#2}
\node[anchor=north west] at (current page.north west){% 
    \pgfornament[width=2cm]{#1}}; 
\node[anchor=north east] at (current page.north east){%
    \pgfornament[width=2cm,symmetry=v]{#1}}; 
\node[anchor=south west] at (current page.south west){% 
    \pgfornament[width=2cm,symmetry=h]{#1}}; 
\node[anchor=south east] at (current page.south east){% 
    \pgfornament[width=2cm,symmetry=c]{#1}}; 
\end{tikzpicture} }

When calling it with \pageornament{61}{Maroon} (for example) the page gets the four ornaments in the corners. But if I want to add a text to it the text appears below the bottom ornaments, shifting everything away. Why? How can I include the text in the middle of the page (or the top left, as I would have expected it)?

Edit: MWE:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc} 
\usepackage{songs}
\usepackage[T1]{fontenc} 
\usepackage[dvipsnames]{xcolor} 
\usepackage[object=vectorian]{pgfornament}
\usetikzlibrary{calc}
\definecolor{fondpaille}{cmyk}{0,0,0.1,0}

\newcommand{\pageornament}[2]{% 
\begin{tikzpicture}[remember picture, overlay] 
\color{#2}
\node[anchor=north west] at (current page.north west){% 
    \pgfornament[width=2cm]{#1}}; 
\node[anchor=north east] at (current page.north east){%
    \pgfornament[width=2cm,symmetry=v]{#1}}; 
\node[anchor=south west] at (current page.south west){% 
    \pgfornament[width=2cm,symmetry=h]{#1}}; 
\node[anchor=south east] at (current page.south east){% 
    \pgfornament[width=2cm,symmetry=c]{#1}}; 
\end{tikzpicture} }

\begin{document}
\pageornament{63}{MidnightBlue}
This is a test for a page
\end{document} 
  • Can you supply a full MWE, instead of a snippet? – Alenanno Feb 1 '16 at 16:55
  • @Alenanno: I added it, hope it helps – arc_lupus Feb 1 '16 at 18:21
  • 1
    \begin{document}\newpage does not make sense. – Sigur Feb 1 '16 at 18:22
  • Did you compile twice? The background package would probably be useful here. – cfr Feb 1 '16 at 18:33
  • @Sigur: That happens when I do not remove all from my working sheet... – arc_lupus Feb 1 '16 at 19:46
0

Solution was simply to compile it twice.

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.