From ccf040d96181d615c8b14bda5d3179efbf9124fd Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 28 Nov 2010 23:53:33 +0000 Subject: pdftex-def git-svn-id: svn://tug.org/texlive/trunk@20593 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/pdftex-def/pdftex.def | 68 ++++++++++++++--------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/Master/texmf-dist/tex/latex/pdftex-def/pdftex.def b/Master/texmf-dist/tex/latex/pdftex-def/pdftex.def index 73a980372b1..d409db4071c 100644 --- a/Master/texmf-dist/tex/latex/pdftex-def/pdftex.def +++ b/Master/texmf-dist/tex/latex/pdftex-def/pdftex.def @@ -1,4 +1,4 @@ -\ProvidesFile{pdftex.def}[2010/09/14 v0.05b Graphics/color for pdfTeX] +\ProvidesFile{pdftex.def}[2010/11/26 v0.05c Graphics/color for pdfTeX] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% LaTeX Colour and Graphics support for PDFTeX @@ -235,6 +235,8 @@ % * Tiff support removed for driver versions between 1.10a and 1.30. % 2010/09/14 v0.05b (HO) % * Fix, \pagecolor got broken accidentally (in v0.05a). +% 2010/11/26 v0.05c (HO) +% * \stockwidth and \stockheight of class `memoir' respected. % % Prefix of internal commands for this file `pdftex.def': % \GPT@ (Graphics bundle PdfTex driver) @@ -425,37 +427,54 @@ \ifx\Gin@log\@undefined \def\Gin@log{\message}% \fi +\def\GPT@ifundefined#1{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname#1\endcsname\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} % Are we running under PDFTeX? -\ifx\pdftexversion\@undefined +\GPT@ifundefined{pdftexversion}{% \GPT@error{% Option `pdftex' requires pdfTeX,\MessageBreak but pdfTeX features are missing.\MessageBreak Loading of this driver file is aborted% }\@ehc \expandafter\GPT@endinput -\else - \ifx\paperwidth\@undefined - \else - \ifdim\paperheight=0pt\relax - \else - \pdfpageheight\paperheight +}{} + +% Ensure PDF mode +\ifnum\pdfoutput<1 % + \GPT@error{% + PDF mode expected, but DVI mode detected!\MessageBreak + If you are using `latex', then call `pdflatex'.\MessageBreak + Otherwise check and correct the driver options.\MessageBreak + Error recovery by switching to PDF mode% + }\@ehc + \pdfoutput=1 % +\fi + +\GPT@ifundefined{stockwidth}{% + \GPT@ifundefined{paperwidth}{% + }{% + \ifdim\paperwidth>0pt\relax + \ifdim\paperheight>0pt\relax + \pdfpagewidth=\paperwidth + \pdfpageheight=\paperheight + \fi \fi - \ifdim\paperwidth=0pt\relax - \else - \pdfpagewidth\paperwidth + }% +}{% + \ifdim\stockwidth>0pt\relax + \ifdim\stockheight>0pt\relax + \pdfpagewidth=\stockwidth + \pdfpageheight=\stockheight \fi \fi - \ifnum\pdfoutput<1 % - \GPT@error{% - PDF mode expected, but DVI mode detected!\MessageBreak - If you are using `latex', then call `pdflatex'.\MessageBreak - Otherwise check and correct the driver options.\MessageBreak - Error recovery by switching to PDF mode% - }\@ehc - \pdfoutput=1 % - \fi -\fi +} % Colour Support. The following models may be used. % * cmyk supported directly. @@ -512,8 +531,7 @@ }% } -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname pdfcolorstack\endcsname\relax +\GPT@ifundefined{pdfcolorstack}{% \def\set@color{% \pdfliteral{\current@color}% \aftergroup\reset@color @@ -521,7 +539,7 @@ \def\reset@color{% \pdfliteral{\current@color}% }% -\else +}{% \chardef\main@pdfcolorstack=0 % \@ifundefined{@pdfcolorstack}{% \def\@pdfcolorstack{\main@pdfcolorstack}% @@ -533,7 +551,7 @@ \def\reset@color{% \pdfcolorstack\@pdfcolorstack pop\relax }% -\fi +} \def\define@color@named#1#2{% \expandafter\edef\csname col@#1\endcsname{#2}% } -- cgit v1.2.3