2

So I copied the example at page 34 of https://ctan.math.illinois.edu/macros/latex/contrib/tkz/pgfornament/doc/ornaments.pdf

assuming these packages:

\documentclass{article}
\usepackage{pgfornament}
\usepackage{eso-pic}

\begin{document}

\newpgfornamentfamily{pgfhan}
\newbox{\fortyseven}
\savebox{\fortyseven}{\pgfornament[scale=0.20,color=black!]{47}}
\tikzset{every node/.append style={inner sep=0pt}}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[overlay,remember picture,color=black!]
\node[anchor=north west,shift={(0.7,-0.85)}] at (current page.north west)
(nw) {\pgfornament[scale=0.2]{25}};
\node[anchor=north east,shift={(-0.7,-0.85)}] at (current page.north east)
(ne) {\pgfornament[scale=0.2,symmetry=v]{25}};
\node[anchor=south west,shift={(0.7,0.85)}] at (current page.south west)
(sw) {\pgfornament[scale=0.2,symmetry=h]{25}};
\node[anchor=south east,shift={(-0.7,0.85)}] at (current page.south east)
(se) {\pgfornament[scale=0.2,symmetry=c]{25}};
\begin{scope}[start chain,node distance=-3pt]
\node[anchor=north west,on chain] at (nw.north east)
{\usebox{\fortyseven}};
\foreach \i in {1,...,14} {\node[on chain]{\usebox{\fortyseven}};}
\end{scope}
\begin{scope}[start chain,node distance=-3pt]
\node[anchor=south west,on chain] at (sw.south east)
{\usebox{\fortyseven}};
\foreach \i in {1,...,6} \node[on chain]{\usebox{\fortyseven}};
\end{scope}
\begin{scope}[start chain=going left,node distance=-3pt]
\node[anchor=south east,on chain,xshift={3pt}] at (se.south west)
{\usebox{\fortyseven}};
\foreach \i in {1,...,6} \node[on chain]
{\usebox{\fortyseven}};
\end{scope}
\foreach \i in {0,...,22}
\node[anchor=south west,rotate=-90,
shift={($\i*(31bp,0)$)}] at (nw.south west)
{\usebox{\fortyseven}};
\foreach \i in {0,...,22}
\node[anchor=south east,rotate=90,shift={($\i*(-31bp,0)$)}] at
([yshift={+3pt}]ne.south east){\usebox{\fortyseven}};
\node[yshift=32pt] at (current page.south){\pgfornament[scale=0.1]{51}};
\node[yshift=32pt,text=black] at (current page.south){\large\thepage};
\end{tikzpicture}
}

\end{document}

However it doesn't work. Do you know how to make it work?

1
  • 1
    it does nothing as your document has no content. add x before \end{document} so the tikz is executed and you get ! Package pgfkeys Error: I do not know the key '/tikz/start chain' and I am goi ng to ignore it. Perhaps you misspelled it. presumably misisng some tikz libraries Feb 26 at 20:38

1 Answer 1

5

You are missing the chains and calc libraries. Furthermore the layout of your example seems to be optimised for the page geometry of the tufte-handout class:

\documentclass[a4paper,nofonts]{tufte-handout}
\usepackage[object=vectorian]{pgfornament}
\usetikzlibrary{chains,
                calc}
\usepackage{eso-pic}

\pagestyle{empty}

\begin{document}

\newpgfornamentfamily{pgfhan}
\newbox{\fortyseven}
\savebox{\fortyseven}{\pgfornament[scale=0.20,color=MidnightBlue]{47}}
\tikzset{every node/.append style={inner sep=0pt}}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[overlay,remember picture,color=MidnightBlue]
\node[anchor=north west,shift={(0.7,-0.85)}] at (current page.north west)
  (nw) {\pgfornament[scale=0.2]{25}};
\node[anchor=north east,shift={(-0.7,-0.85)}] at (current page.north east)
  (ne) {\pgfornament[scale=0.2,symmetry=v]{25}};
\node[anchor=south west,shift={(0.7,0.85)}] at (current page.south west)
  (sw) {\pgfornament[scale=0.2,symmetry=h]{25}};
\node[anchor=south east,shift={(-0.7,0.85)}] at (current page.south east)
  (se) {\pgfornament[scale=0.2,symmetry=c]{25}};
\begin{scope}[start chain,node distance=-3pt]
\node[anchor=north west,on chain] at (nw.north east)
{\usebox{\fortyseven}};
\foreach \i in {1,...,14} {\node[on chain]{\usebox{\fortyseven}};}
\end{scope}
 \begin{scope}[start chain,node distance=-3pt]
 \node[anchor=south west,on chain] at (sw.south east)
 {\usebox{\fortyseven}};
 \foreach \i in {1,...,6} \node[on chain]{\usebox{\fortyseven}};
 \end{scope}
\begin{scope}[start chain=going left,node distance=-3pt]
\node[anchor=south east,on chain,xshift={3pt}] at (se.south west)
 {\usebox{\fortyseven}};
\foreach \i in {1,...,6} \node[on chain]
{\usebox{\fortyseven}};
\end{scope}
\foreach \i in {0,...,22}
\node[anchor=south west,rotate=-90,
      shift={($\i*(31bp,0)$)}] at (nw.south west)
      {\usebox{\fortyseven}};
\foreach \i in {0,...,22}
\node[anchor=south east,rotate=90,shift={($\i*(-31bp,0)$)}] at
 ([yshift={+3pt}]ne.south east){\usebox{\fortyseven}};
\node[yshift=32pt] at (current page.south){\pgfornament[scale=0.1]{51}};
\node[yshift=32pt,text=black] at (current page.south){\large\thepage};
\end{tikzpicture}
}

\newpage

test

\end{document}  

enter image description here

3
  • How can I create it around a box of text though? I can't change easily the location from the page now
    – Matteo
    Feb 26 at 23:13
  • @Matteo If you have a new question, please ask a new question. Feb 26 at 23:24
  • well, the example was about a box around a text, so i find it in topic. The thing you wrote really helped me, though
    – Matteo
    Feb 27 at 16:40

You must log in to answer this question.

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