Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to use somehow command \eachpageornament to place ornament border on every page of my document. I can do that using that new command on each page, but suppose our document have 200 pages, then there is problem. I found this (not exactly) code here http://altermundus.com/pages/downloads/packages/pgfornament/ornaments.pdf. It is on 12 page. On page 11 they are talking on some other solution, but I failed (because I am pretty new to LaTeX) to implement that way. You can show me that way if it is easier.

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[object=vectorian]{pgfornament}
\usepackage{lipsum}

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

\begin{document}

\eachpageornament

\lipsum

\eachpageornament

\lipsum

\eachpageornament

\lipsum

\eachpageornament

\end{document} 

You have to compile twice to see effect.

And I would like, if it is possible to do this for article A4, not scrartcl.

share|improve this question
3  
Have you tried the background or eso-pic packages? Do a quick search here and you will find similar questions. –  azetina Dec 14 '13 at 21:34
add comment

1 Answer

up vote 13 down vote accepted

Here is MWE using the background and the eso-pic package:

enter image description here

\documentclass[dvipsnames,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[object=vectorian]{pgfornament}
\usepackage{lipsum}

% Comment below if you are using the eso-pic version
%--------------------------------------------------------------------
\usepackage{background}
%--------------------------------------------------------------------

%--------------------------------------------------------------------
% Uncomment below to obtain the same effect using the eso-pic package
%\usepackage{eso-pic}
%\AddToShipoutPictureBG{%
%   \AtPageUpperLeft{\eachpageornament}}
%--------------------------------------------------------------------

% Comment below if you are using the eso-pic version
%--------------------------------------------------------------------
\backgroundsetup{%
contents=\eachpageornament,%
position=current page.north east,%
angle=0,%
scale=1,%
opacity=1%
}
%--------------------------------------------------------------------
\newcommand{\eachpageornament}{%
\begin{tikzpicture}[remember picture, overlay,color=BrickRed]
\node[anchor=north west] at (current page.north west){%
\pgfornament[width=2cm]{63}};
\node[anchor=north east] at (current page.north east){%
\pgfornament[width=2cm,symmetry=v]{63}};
\node[anchor=south west] at (current page.south west){%
\pgfornament[width=2cm,symmetry=h]{63}};
\node[anchor=south east] at (current page.south east){%
\pgfornament[width=2cm,symmetry=c]{63}};
\end{tikzpicture}
}

\begin{document}

\lipsum

\lipsum

\lipsum

\end{document} 

NOTE: The pgfornament package by Alain Matthes needs to be installed manually. Click here to download the package.

share|improve this answer
    
Thank you azetina. Two question: for what is dvipsnames and when I use second method (with eso-pic) I have word Draft in red color on every my page, diagonal, over my text, do you know why? –  Cortizol Dec 14 '13 at 22:30
    
@Cortizol dvipsnames is used simple to change the color of the ornament to BrickRed. For the second example, you should not get no draft thingy. At least I don't get it in my compilation. Are you sure? –  azetina Dec 14 '13 at 22:36
    
Yes, am I sure. I uncomment that part and comment \backgroundsetup part. But, all works well with first method (\backgroundsetup), so everything is ok. –  Cortizol Dec 14 '13 at 22:46
1  
@Cortizol Oh oh ok, you need to comment \usepackage{background} as well. The background package automatically place draft as the default background. –  azetina Dec 14 '13 at 22:48
    
Exactly, now everything is working! :) –  Cortizol Dec 14 '13 at 22:52
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.