summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/graphics-def/dvips.def
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/graphics-def/dvips.def')
-rw-r--r--macros/latex/contrib/graphics-def/dvips.def35
1 files changed, 23 insertions, 12 deletions
diff --git a/macros/latex/contrib/graphics-def/dvips.def b/macros/latex/contrib/graphics-def/dvips.def
index 204ec64293..f5ba5bfc46 100644
--- a/macros/latex/contrib/graphics-def/dvips.def
+++ b/macros/latex/contrib/graphics-def/dvips.def
@@ -1,6 +1,6 @@
%% dvips.def Copyright (C) 1994 David Carlisle Sebastian Rahtz
%% Copyright (C) 1995-1999 David Carlisle
-%% Copyright (C) 2000-2017 David Carlisle, LaTeX3 Project
+%% Copyright (C) 2000-2022 David Carlisle, LaTeX3 Project
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -17,7 +17,7 @@
%% https://github.com/latex3/graphics-def/issues
%%
\ProvidesFile{dvips.def}
- [2017/06/20 v3.1d Graphics/color driver for dvips]
+ [2022/09/22 v3.1e Graphics/color driver for dvips]
\def\GPT@space{ }
\def\c@lor@arg#1{%
\dimen@#1\p@
@@ -146,24 +146,35 @@
{\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
+ \ifnum\mag=\@m
\AtBeginDvi{%
\begingroup
- \@ifundefined{stockwidth}{}
- {%
- \paperwidth\stockwidth
- \paperheight\stockheight
- }%
- \ifdim\paperwidth>\z@
- \ifdim\paperheight>\z@
- \special{papersize=\the\paperwidth,\the\paperheight}%
+ \ifdim\stockwidth>\z@
+ \ifdim\stockheight>\z@
+ \special{papersize=\the\stockwidth,\the\stockheight}%
+ \else
+ \ifdim\paperwidth>\z@
+ \ifdim\paperheight>\z@
+ \special{papersize=\the\paperwidth,\the\paperheight}%
+ \fi
+ \fi
+ \fi
+ \else
+ \ifdim\stockwidth=\z@
+ \ifdim\paperwidth>\z@
+ \ifdim\paperheight>\z@
+ \special{papersize=\the\paperwidth,\the\paperheight}%
+ \fi
+ \fi
+ \fi
\fi
- \fi
\endgroup}%
\fi
}