# Using pgfornament

I use pgfornament package to put decorations in the corner as shown in the following MWE:

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\usepackage{lipsum}

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

\newcommand\AtPageUpperRight[1]{\AtPageUpperLeft{%
\put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
}}%
\newcommand\AtPageLowerRight[1]{\AtPageLowerLeft{%
\put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
}}%

\AtPageUpperLeft{\put(0,-25){\pgfornament[width=1.75cm]{61}}}
\AtPageUpperRight{\put(-50,-25){\pgfornament[width=1.75cm,symmetry=v]{61}}}
\AtPageLowerLeft{\put(0,25){\pgfornament[width=1.75cm,symmetry=h]{61}}}
\AtPageLowerRight{\put(-50,25){\pgfornament[width=1.75cm,symmetry=c]{61}}}
}

\begin{document}
\title{Magnificent title}
\maketitle
\frontmatter
\tableofcontents
\mainmatter

\chapter{New chapter}
\lipsum[5]
\chapter{Another chapter}
\lipsum[4]

\end{document}


But I would like to put these decorations from a particular page onwards only, say from Chapter 1. How can I modify the above code, preferably without adding new packages?

Just put the code after \mainmatter (or any where from which point you want it)

.
.
\mainmatter
\AtPageUpperLeft{\put(0,-25){\pgfornament[width=1.75cm]{61}}}
\AtPageUpperRight{\put(-50,-25){\pgfornament[width=1.75cm,symmetry=v]{61}}}
\AtPageLowerLeft{\put(0,25){\pgfornament[width=1.75cm,symmetry=h]{61}}}
\AtPageLowerRight{\put(-50,25){\pgfornament[width=1.75cm,symmetry=c]{61}}}
}

\chapter{New chapter}
.
.


You can also define macros to put the ornaments for a number of pages:

 \newcommand{\beautify}{%
\AtPageUpperLeft{\put(0,-25){\pgfornament[width=1.75cm]{61}}}
\AtPageUpperRight{\put(-50,-25){\pgfornament[width=1.75cm,symmetry=v]{61}}}
\AtPageLowerLeft{\put(0,25){\pgfornament[width=1.75cm,symmetry=h]{61}}}
\AtPageLowerRight{\put(-50,25){\pgfornament[width=1.75cm,symmetry=c]{61}}}
}
}

\newcommand{\simplify}{%
\cleardoublepage\ClearShipoutPictureBG
}


and use it like

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
%\usepackage{fontspec}
\usepackage{lipsum}

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

\newcommand\AtPageUpperRight[1]{\AtPageUpperLeft{%
\put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
}}%
\newcommand\AtPageLowerRight[1]{\AtPageLowerLeft{%
\put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
}}%

\newcommand{\beautify}{%
\AtPageUpperLeft{\put(0,-25){\pgfornament[width=1.75cm]{61}}}
\AtPageUpperRight{\put(-50,-25){\pgfornament[width=1.75cm,symmetry=v]{61}}}
\AtPageLowerLeft{\put(0,25){\pgfornament[width=1.75cm,symmetry=h]{61}}}
\AtPageLowerRight{\put(-50,25){\pgfornament[width=1.75cm,symmetry=c]{61}}}
}
}

\newcommand{\simplify}{%
\cleardoublepage\ClearShipoutPictureBG
}

\begin{document}
\title{Magnificent title}
\maketitle
\frontmatter
\tableofcontents
\mainmatter

\beautify
\chapter{New chapter}
\lipsum[5]
\simplify
\chapter{Another chapter}
\lipsum[4]

\end{document}


• As simple as that! :-) I did not try it at all. Thank you. Aug 3, 2015 at 13:57
• @usr203050 I have added some more. You may like that too :-)
– user11232
Aug 3, 2015 at 14:01
• Very good, that is exactly what I secretly wanted also! Thank you very much. Aug 3, 2015 at 14:04