0

I am writing a double-paged document.

I would like to add a bleeding colored area on the exterior of each page after some page.

I know how to add the bleeding area on the left of the pages or on the right of the pages, but I don't know how to add it on the exterior of each page.

How can I do that?

Here is a MWE.

\documentclass[doublepage]{book}

\usepackage{everypage} \usepackage{tikz}

\def\exteriorBleeding{
\begin{tikzpicture}[remember picture,overlay] \fill[blue] ([xshift=-2cm]current page.north east) rectangle (current page.south east); \end{tikzpicture}}

\begin{document}

This is the first page. \newpage \AddEverypageHook{\exteriorBleeding} On even pages, the bleeding margin should be on the left. \newpage On odd pages, the bleeding margin should be on the right. \newpage

\end{document}

enter image description here

Colas
  • 6,772
  • 4
  • 46
  • 96
  • 1
    Make the command check for odd and even pages, see this question and its answers: https://tex.stackexchange.com/questions/6143/if-then-else-for-odd-page-even-page – Tommiie Feb 26 '23 at 10:44

1 Answers1

0

Inspired by this answer, here is a solution.

\documentclass[doublepage]{book}

\usepackage{everypage} \usepackage{tikz} \usepackage{changepage}

\def\exteriorBleeding{ \checkoddpage \ifoddpage {% \begin{tikzpicture}[remember picture,overlay] \fill[blue] ([xshift=2cm]current page.north west) rectangle (current page.south west); \end{tikzpicture} } \else {% \begin{tikzpicture}[remember picture,overlay] \fill[blue] ([xshift=-2cm]current page.north east) rectangle (current page.south east); \end{tikzpicture} } \fi}

\begin{document}

This is the first page. \newpage \AddEverypageHook{\exteriorBleeding} On even pages, the bleeding margin should be on the left. \newpage On odd pages, the bleeding margin should be on the right. \newpage

\end{document}

Colas
  • 6,772
  • 4
  • 46
  • 96