I need help in the following, I am trying to make all pages facing the chapter openings contain a gray of x% when they do not contain text (exclusive condition) only for the mainmatter section. The frontmatter and the backmatter are excluded from this condition.

the image below shows the result in two openings

imagen de muestra

I get this result by reviewing the opening of each chapter and placing the instruction at the end of the chapter


and then at the beginning of the chapter


to retake the color white

But what I am looking for is that this can be achieved automatically, since it is common to modify the texts and the box widths, which leads to having to constantly check the chapter openings

  • 1
    Please show us a short compilable code (that is usual here!) we can play with ... – Mensch Jan 9 '19 at 1:31

Something like this?



%% Adapted from fancyhdr, section 14
%% http://ctan.triasinformatica.nl/macros/latex/contrib/fancyhdr/fancyhdr.pdf
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else





enter image description here


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.