aboutsummaryrefslogtreecommitdiff
path: root/model_7/resources/10_decoration.tex
blob: b9516cec1de6915d6a6e3514e2e92f9f37d4a52a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% Add a decoration in the corner of each page
% The image is selected using pdfornament, and is positionned using the margin
% of the pages.

\usepackage{tikz}
\usepackage{eso-pic}
\usepackage{pgfornament}
\usepackage{tikzpagenodes}
\usepackage{ifthen}
\usetikzlibrary{positioning}

% Apply a decoration over each page
% Arguments
%   1: the size of the decoration
%   2: the distance to the page (not the text margin but the page itself
%   3: the color
\providecommand{\pageornament}[3]{%
   \begin{tikzpicture}[remember picture, overlay]
       \node[yshift=-#2,xshift=-#2, anchor=north east] at (current page.north east){%
           \pgfornament[color=#3,width=#1,symmetry=v]{41}
       };
       \node[yshift=#2,xshift=-#2,anchor=south east] at (current page.south east){%
           \pgfornament[color=#3,width=#1,symmetry=c]{61}};
       \node[yshift=-#2,xshift=#2,anchor=north west] at (current page.north west){%

           \pgfornament[color=#3,width=#1]{41}
       };
       \node[yshift=#2,xshift=#2,anchor=south west] at (current page.south west){%
           \pgfornament[color=#3,width=#1,symmetry=h]{61}
       };
   \end{tikzpicture} 
}

\AddToShipoutPictureBG{%
    \pageornament{1.75cm}{0.5cm}{altColor}
}