12

I am using the suggestion from here to change the background color of a page using the MWE example from frabjous. This works in Texlive 2016, but it gives an error in Texlive 2017:

! Undefined control sequence.
\set@color ...e@color \current@color \ifundefined
                                              {GPT@outputbox}{\csname ne...
l.7 \pagecolor{yellow}
                  \afterpage{\nopagecolor}

Does anyone else get this error and is there a fix?

Thank you.

user41974
  • 841

2 Answers2

13

This is a typo in an update: will be fixed probably by tomorrow. For the present, add

\usepackage{etoolbox}
\makeatletter
\patchcmd\set@page@color{\ifundefined}{\@ifundefined}{}{}
\makeatother

after loading xcolor.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
0

I have adjourned texlive, the file compiles but it doesn't work

\documentclass[10pt,a4paper]{book}

\usepackage{graphicx}
\usepackage{xcolor}

\definecolor{light-blue}{rgb}{0.8,0.85,1}

\begin{document}

\pagecolor{light-blue}

ciao    

\newpage

\pagecolor{white}

ciao

\end{document}
user13225
  • 719
  • Curiously, adding \usepackage[]{crop} makes this work successfully. (MacTeX 2017, updated this morning with new graphics-def.) – sgmoye Jun 17 '17 at 12:10
  • This would make an entirely good new question: I'll fix it today but still will be useful. – Joseph Wright Jun 17 '17 at 13:53
  • Temporary fix: \makeatletter \edef\GPT@pagecolortrue{\global\unexpanded\expandafter{\GPT@pagecolortrue}} \edef\GPT@pagecolorfalse{\global\unexpanded\expandafter{\GPT@pagecolorfalse}} \makeatother – Joseph Wright Jun 17 '17 at 14:06
  • @JosephWright copying pasting from your comment there are invisible characters around the @ which will be problematic to innocents (by the way, it does work but you know that ;-) ) –  Jun 17 '17 at 20:39
  • @jfbu The invisible char business is by-design, unfortunately (it's to do with rendering the site and non-breakable blocks ...). It's inserted by the site 'back end' when rendering the HTML and is not in my code as-posted (so not there if you edit the comment, for example). – Joseph Wright Jun 17 '17 at 20:45
  • @JosephWright I guessed it was not in your code ;-) although one never knows what kind of smart tricks Bruno could have propagated into it... I see about editing not displaying the invisible characters. –  Jun 17 '17 at 20:51