I am writing my Master's thesis and I have a LaTeX template for that. I'm using XeTeX compiler. When I try to include a PDF with pdfpages, I get blank pages. I'm aware of the issue with pagecolor (as described in the package's documentation section 2.5), which the template uses in a few places. However, the fix of putting the first \pagecolor command before \usepackage{pdfpages} does not seem to work for me. The minimal extract from the code looks like this:
Preamble.tex
\usepackage{xcolor}
\pagecolor{white}
\usepackage{pdfpages}
main.tex
\RequirePackage[2020-02-02]{latexrelease} % Quick fix for https://tex.stackexchange.com/questions/581907/extra-endgroup-error
\documentclass[a4paper,twoside,11pt]{report} %openright
\input{Setup/Statics.tex}
\input{Setup/Preamble.tex}
\input{Setup/Settings.tex}
\begin{document}
\pagenumbering{roman}
\input{Frontmatter/Frontpage.tex}
\pagecolor{white}
\newgeometry{top=2.81cm, bottom=2.75cm, outer=2.5cm, inner=3.5cm}
\pagestyle{empty}
\cleardoublepage
\input{Frontmatter/Copyright.tex}
\clearpage
\pagestyle{main}
\input{Frontmatter/Approval.tex}
\clearpage
\input{Frontmatter/Abstract.tex}
\clearpage
\input{Frontmatter/Acknowledgements.tex}
\cleardoublepage
\tableofcontents
\cleardoublepage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{arabic}
\input{Chapters/01_Introduction.tex}
\cleardoublepage
\input{Chapters/02_Methods.tex}
\cleardoublepage
\input{Chapters/03_Results.tex}
\cleardoublepage
\input{Chapters/04_Discussion.tex}
\cleardoublepage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\printbibliography[heading=bibintoc,title={Bibliography}]
\cleardoublepage
\appendix
\includepdf[pages=-]{Backmatter/Graphics_Engines_for_Mixed_Reality.pdf}
\input{Backmatter/Appendix.tex}
\cleartoleftpage
\input{Backmatter/Backpage.tex}
\end{document}
I have seen this similar question, but as mentioned, the fix from the documentation does not work for me, and the \nopagecolor command is not recognized (apparently it's not available on XeTeX).
What am I doing wrong here?
\RequirePackage[2020/02/02]{latexrelease}. The date (argument of latexrelease) seems to matter too. But so far I don't know what's going wrong. Maybe someone else more knowledgeable inlatexreleasecan help out. – Andreas Matthias Jan 10 '22 at 22:20