5

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}%
 }}%

\AddToShipoutPictureBG{%
   \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} 

Corner flowery

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?

6

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

.
.
\mainmatter
\AddToShipoutPictureBG{%
   \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}
.
.

enter image description here

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

 \newcommand{\beautify}{%
 \AddToShipoutPictureBG{%
   \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}{%
 \AddToShipoutPictureBG{%
   \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}

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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