Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Determination of the current page colour

12 views
Skip to first unread message

Martin Muench

unread,
Jul 16, 2011, 6:34:31 AM7/16/11
to
Dear TeXnicians,

is there a way to determine the current page colour, please?
Or do I need to redefine \pagecolor to get \thepagecolor?

\let\origpagecolor\pagecolor

\renewcommand{\pagecolor}[1]{%
\global\edef\thepagecolor{#1}
\origpagecolor{\thepagecolor}
}

Thanks for your help!

Martin
--
Martin dot Muench at Uni-Bonn dot de

Heiko Oberdiek

unread,
Jul 16, 2011, 8:59:40 AM7/16/11
to
Martin Muench <lo...@signature.invalid> wrote:

> is there a way to determine the current page colour, please?

It's driver dependent assuming package `color'.
pdftex.def stores the color in \current@page@color in the
same format as the normal color setting is stored in \current@color
(i.e. the color is the driver dependend low level color string).

> Or do I need to redefine \pagecolor to get \thepagecolor?
>
> \let\origpagecolor\pagecolor
>
> \renewcommand{\pagecolor}[1]{%
> \global\edef\thepagecolor{#1}
> \origpagecolor{\thepagecolor}
> }

pdftex.def also supports \nopagecolor.

--
Heiko Oberdiek

GL

unread,
Jul 16, 2011, 9:16:55 AM7/16/11
to
Le 16/07/2011 14:59, Heiko Oberdiek a �crit :

And TeX also support \xdef ;-)

Heiko Oberdiek

unread,
Jul 16, 2011, 11:36:16 AM7/16/11
to
GL <goua...@gmail.com> wrote:

And what's the relation to the page color?
After \nopagecolor \thepagecolor shows a value
that is then invalid, thus \nopagecolor must also be
redefined.

--
Heiko Oberdiek

GL

unread,
Jul 16, 2011, 12:55:48 PM7/16/11
to

?? Just when I read \global\edef I think \xdef ...
... unless something like \global \iftrue \edef \else \mytoken \fi {...}

Martin Muench

unread,
Jul 16, 2011, 2:48:54 PM7/16/11
to

Ok, thanks!

0 new messages