3

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} 
7
  • Can you supply a full MWE, instead of a snippet?
    – Alenanno
    Feb 1, 2016 at 16:55
  • @Alenanno: I added it, hope it helps
    – arc_lupus
    Feb 1, 2016 at 18:21
  • 1
    \begin{document}\newpage does not make sense.
    – Sigur
    Feb 1, 2016 at 18:22
  • Did you compile twice? The background package would probably be useful here.
    – cfr
    Feb 1, 2016 at 18:33
  • 1
    Any time you use remember picture etc. you need to compile at least twice for things to end up in the right places. It typically looks a complete mess first time (or things don't show up at all).
    – cfr
    Feb 1, 2016 at 21:15

1 Answer 1

1

Solution was simply to compile it twice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .