summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/graphics-def/pdftex.def
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/graphics-def/pdftex.def')
-rw-r--r--macros/latex/contrib/graphics-def/pdftex.def38
1 files changed, 22 insertions, 16 deletions
diff --git a/macros/latex/contrib/graphics-def/pdftex.def b/macros/latex/contrib/graphics-def/pdftex.def
index e9fd01833b..35eb376cfd 100644
--- a/macros/latex/contrib/graphics-def/pdftex.def
+++ b/macros/latex/contrib/graphics-def/pdftex.def
@@ -3,7 +3,7 @@
%% Hans Hagen, Heiko Oberdiek and
%% Martin Schr\"oder
%% Copyright (C) 2016-2018 LaTeX3 project and Heiko Oberdiek
-%% Copyright (C) 2018-2020 LaTeX3 project
+%% Copyright (C) 2018-2022 LaTeX3 project
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -20,7 +20,7 @@
%% https://github.com/latex3/graphics-def/issues
%%
\ProvidesFile{pdftex.def}
- [2020/10/05 v1.2a Graphics/color driver for pdftex]
+ [2022/09/22 v1.2b Graphics/color driver for pdftex]
\def\GPT@space{ }
\def\c@lor@arg#1{%
\dimen@#1\p@
@@ -555,30 +555,36 @@ E \else
{\expandafter\let\csname ifGin@setpagesize\expandafter\endcsname
\csname iftrue\endcsname}
{}
+\@ifundefined{stockwidth}{\newdimen\stockwidth}{}
+\@ifundefined{stockheight}{\newdimen\stockheight}{}
\ifGin@setpagesize
\ifx\paperwidth\@undefined\else
\AtBeginDocument{%
% If a package has changed \mag, assume it knows what it is doing
% and leave page size alone
\ifnum\mag=\@m
- \@ifundefined{stockwidth}{%
- \@ifundefined{paperwidth}{%
- }{%
- \ifdim\paperwidth>0pt\relax
- \ifdim\paperheight>0pt\relax
- \pdfpagewidth=\paperwidth
- \pdfpageheight=\paperheight
- \fi
- \fi
- }%
-}{%
\ifdim\stockwidth>0pt\relax
\ifdim\stockheight>0pt\relax
- \pdfpagewidth=\stockwidth
- \pdfpageheight=\stockheight
+ \setlength{\pdfpagewidth}{\stockwidth}%
+ \setlength{\pdfpageheight}{\stockheight}%
+ \else
+ \ifdim\paperwidth>0pt\relax
+ \ifdim\paperheight>0pt\relax
+ \setlength{\pdfpagewidth}{\paperwidth}%
+ \setlength{\pdfpageheight}{\paperheight}%
+ \fi
+ \fi
+ \fi
+ \else
+ \ifdim\stockwidth=0pt\relax
+ \ifdim\paperwidth>0pt\relax
+ \ifdim\paperheight>0pt\relax
+ \setlength{\pdfpagewidth}{\paperwidth}%
+ \setlength{\pdfpageheight}{\paperheight}%
+ \fi
+ \fi
\fi
\fi
-}%
\fi
}
\fi