summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-28 23:53:33 +0000
committerKarl Berry <karl@freefriends.org>2010-11-28 23:53:33 +0000
commitccf040d96181d615c8b14bda5d3179efbf9124fd (patch)
tree18b9f55757b07253c986395633141c0299cda697 /Master/texmf-dist/tex
parent05278b88c29ac95af37ba1c14e2f589a2108c6b9 (diff)
pdftex-def
git-svn-id: svn://tug.org/texlive/trunk@20593 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/pdftex-def/pdftex.def68
1 files 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}%
}