使用 pgfornaments 装饰页面

使用 pgfornaments 装饰页面

我想使用包来装饰文档中的页面pgfornaments。为了方便起见,我创建了以下命令\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} }

例如,当使用 调用它时\pageornament{61}{Maroon},页面会在角落显示四个装饰。但如果我想在其中添加文本,文本就会出现在底部装饰下方,从而将所有内容移开。为什么?我怎样才能将文本包含在页面中间(或我预期的左上角)?

编辑: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} 

答案1

解决方案很简单,就是编译两次。

相关内容