I'm experiencing a glitch with a decoration command, which moves a bit the text on the page. Here's a stripped down version of the code I'm trying to fix:


% Main header :
    \sethead[\thepage][][\itshape\small\MakeUppercase{\chaptername\ \thechapter. \chaptertitle}]{\itshape\small\MakeUppercase{\thesection\ \sectiontitle}}{}{\thepage}

% Add ornementations to corners :

\begin{tikzpicture}[remember picture,overlay]
    \node[anchor=north west,xshift=0.5in+2mm,yshift=-2mm] at (current page.north west){% 
    \node[anchor=north east,xshift=-2mm,yshift=-2mm] at (current page.north east){%
    \node[anchor=south west,xshift=0.5in+2mm,yshift=2mm] at (current page.south west){% 
    \node[anchor=south east,xshift=-2mm,yshift=2mm] at (current page.south east){% 



\chapter{Chapter title}


Some funny line\footnote{Some weird footnote text.}


Another line


Here's a preview of what this code is doing (we need two compilations to see the result) :

enter image description here

If you desactivate the decoration command \pageornament{41}{gray} (just after the chapter's title), the text moves back to its proper position. Why is the ornament command moving the block of text? How can I prevent this to happen?

  • I suggest using eso-pic to place the ornament.
    – Symbol 1
    Oct 28, 2020 at 22:51
  • This is the normal indentation at the beginning of a paragraph. Note that the first paragraph of a section/chapter is not indented. Oct 28, 2020 at 22:53
  • @Andreas Matthias, the command change also the vertical position of the text. I don’t want this to happen. How can I change the command to prevent the text Motion ?
    – Cham
    Oct 28, 2020 at 22:56
  • @Symbol, how? Could you suggest a macro to do the same decoration ?
    – Cham
    Oct 28, 2020 at 22:58
  • 1
    @Cham: Your first paragraph is more or less empty, but nevertheless it is a complete paragraph. Actually it contains two spaces from your macro where you did not comment all newline characters. Your ornament is put into a box, and even if the dimensions of your box would be 0pt x 0pt it would still be a box, ie a complete paragaph. And the second paragaph is shifted down. -- Don't go this way. Try it with eso-pic. Oct 28, 2020 at 23:21

1 Answer 1


Use the \AddToHook macro to extend the \shipout macro to output the contents of a zero-sized picture, at the top left (0,0) of the page.

% pagedecoprob.tex  Try for decorative page margins

\documentclass{book} \usepackage{geometry}  %%%% SE 568730  or
%\documentclass{memoir}  %%%% SE 568730



% seems like picture can now cope with actual values
% inset from page edges, change this to suit
\newlength{\linset} \setlength{\linset}{\baselineskip} 
% x coordinate of RHS 
\newlength{\rloc} \setlength{\rloc}{\paperwidth} \addtolength{\rloc}{-\linset}
% (-) y coordinate of bottom location
\newlength{\bloc} \setlength{\bloc}{\paperheight} \addtolength{\bloc}{-\linset}

% the decorative elements and their placements
  \put(\linset,-\linset){\makebox(0,0)[tl]{linset, -linset}}  % top left
  \put(\rloc,-\linset){\makebox(0,0)[tr]{rloc, -linset}}      % top right
  \put(\linset,-\bloc){\makebox(0,0)[bl]{linset, -bloc}}      % bottom left
  \put(\rloc,-\bloc){\makebox(0,0)[br]{rloc, -bloc}}          % bottom right

% use LaTeX arrows as the decorative elements
  \put(\linset,-\linset){\makebox(0,0)[tl]{\Huge$\nearrow$}}  % top left
  \put(\rloc,-\linset){\makebox(0,0)[tr]{\Huge$\nwarrow$}}    % top right
  \put(\linset,-\bloc){\makebox(0,0)[bl]{\Huge$\searrow$}}    % bottom left
  \put(\rloc,-\bloc){\makebox(0,0)[br]{\Huge$\swarrow$}}      % bottom right

% put decorative elements on this and future pages 

\textbf{Added To Hook}

\textbf{Removed from Hook}



\textbf{Added to Hook}



With thanks to @ulrikefischer for showing me the \...Hook code (answer to How do I put (or not) something on every page independently of headers and footers?).

enter image description here

You must log in to answer this question.

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