summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/pgfutil-latex.def
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-29 03:02:54 +0000
committerNorbert Preining <norbert@preining.info>2020-09-29 03:02:54 +0000
commitd043a18e288914d3c46a1b10af1f30ce2df00588 (patch)
tree888d8c0677d7b328602f1ec5c09d324a325043ec /graphics/pgf/base/tex/pgfutil-latex.def
parent34310603e5253ef5742542e3f0123b341a70ee20 (diff)
CTAN sync 202009290302
Diffstat (limited to 'graphics/pgf/base/tex/pgfutil-latex.def')
-rw-r--r--graphics/pgf/base/tex/pgfutil-latex.def116
1 files changed, 62 insertions, 54 deletions
diff --git a/graphics/pgf/base/tex/pgfutil-latex.def b/graphics/pgf/base/tex/pgfutil-latex.def
index 2ac8ec4212..e2ed750368 100644
--- a/graphics/pgf/base/tex/pgfutil-latex.def
+++ b/graphics/pgf/base/tex/pgfutil-latex.def
@@ -1,4 +1,4 @@
-% Copyright 2006 by Till Tantau
+% Copyright 2019 by Till Tantau
%
% This file may be distributed and/or modified
%
@@ -119,61 +119,69 @@
}
\let\pgfutil@abe\pgfutil@empty%
-\RequirePackage{everyshi}
-\EveryShipout{%
- % Add at begin page stuff
- \setbox\@cclv=\vbox{%
- \setbox\z@=\hbox{%
- % the boxes \pgfutil@abe ("every page") and \pgfutil@abb ("current page")
- % are used to generate pdf objects / dictionaries which are
- % required for the graphics which are somewhere in the "real"
- % page content.
- % BUT: these pdf objects MUST NOT be affected by text layout
- % shifts! Consequently, we have to undo \hoffset and \voffset
- % (which are h/v shifts to the page layout).
- %
- % Note that this of importance for shadings. To be more
- % specific: try out shadings with standalone (which uses
- % \hoffset) and with xdvipdfmx (which appears to be more
- % fragile than pdflatex) - they break unless we undo \hoffset
- % and \voffset.
- \ifdim\hoffset=0pt \else \hskip-\hoffset\fi
- \pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty
- \ifdim\hoffset=0pt \else \hskip+\hoffset\fi
+\@ifl@t@r\fmtversion{2020/10/01}{%
+ \AddToHook{shipout/background}{%
+ \put(\hoffset-1in,\voffset-1in){%
+ \pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty
}%
- \wd\z@=\z@%
- \ht\z@=\z@%
- \dp\z@=\z@%
- % ... see remark above regarding \hoffset/\voffset:
- \ifdim\voffset=0pt \else \vskip-\voffset\fi
- \box\z@%
- \ifdim\voffset=0pt \else \vskip+\voffset\fi
- %
- % if TeX changes into vertical mode, it inserts \parskip and
- % \lineskip. Disable it here:
- \nointerlineskip%
- \ifvbox\@cclv \unvbox\@cclv \else\hsize=\wd\@cclv \noindent\unhbox\@cclv \fi%
- %\box\@cclv
- % using \box instead of \unhbox or \unvbox
- % has the advantage that glue settings won't be
- % altered (as for \unhbox/\unvbox). But \box breaks compatibility
- % with the 'remember picture' feature.
}%
-}
-
-% Preview hack: preview.sty hacks into \shipout (which is ok), but
-% does not honour everyshi.sty (which is not ok). This causes everyshi
-% material to get lost.
-\AtBeginDocument{
- \@ifpackageloaded{preview}{%
- % Ok, package loaded. Swap definitions of everyshi.sty's shipout
- % and preview.sty's shipout:
- \ifPreview
- \let\shipout\@EveryShipout@Org@Shipout%This is the null version of \shipout, created by preview and saved by everyshi
- \let\@EveryShipout@Org@Shipout\pr@shipout% This is the original shipout
- \let\pr@shipout\@EveryShipout@Shipout%
- \fi
- }{}%
+}{%
+ \RequirePackage{everyshi}
+ \EveryShipout{%
+ % Add at begin page stuff
+ \setbox\@cclv=\vbox{%
+ \setbox\z@=\hbox{%
+ % the boxes \pgfutil@abe ("every page") and \pgfutil@abb ("current page")
+ % are used to generate pdf objects / dictionaries which are
+ % required for the graphics which are somewhere in the "real"
+ % page content.
+ % BUT: these pdf objects MUST NOT be affected by text layout
+ % shifts! Consequently, we have to undo \hoffset and \voffset
+ % (which are h/v shifts to the page layout).
+ %
+ % Note that this of importance for shadings. To be more
+ % specific: try out shadings with standalone (which uses
+ % \hoffset) and with xdvipdfmx (which appears to be more
+ % fragile than pdflatex) - they break unless we undo \hoffset
+ % and \voffset.
+ \ifdim\hoffset=0pt \else \hskip-\hoffset\fi
+ \pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty
+ \ifdim\hoffset=0pt \else \hskip+\hoffset\fi
+ }%
+ \wd\z@=\z@%
+ \ht\z@=\z@%
+ \dp\z@=\z@%
+ % ... see remark above regarding \hoffset/\voffset:
+ \ifdim\voffset=0pt \else \vskip-\voffset\fi
+ \box\z@%
+ \ifdim\voffset=0pt \else \vskip+\voffset\fi
+ %
+ % if TeX changes into vertical mode, it inserts \parskip and
+ % \lineskip. Disable it here:
+ \nointerlineskip%
+ \ifvbox\@cclv \unvbox\@cclv \else\hsize=\wd\@cclv \noindent\unhbox\@cclv \fi%
+ %\box\@cclv
+ % using \box instead of \unhbox or \unvbox
+ % has the advantage that glue settings won't be
+ % altered (as for \unhbox/\unvbox). But \box breaks compatibility
+ % with the 'remember picture' feature.
+ }%
+ }
+
+ % Preview hack: preview.sty hacks into \shipout (which is ok), but
+ % does not honour everyshi.sty (which is not ok). This causes everyshi
+ % material to get lost.
+ \AtBeginDocument{
+ \@ifpackageloaded{preview}{%
+ % Ok, package loaded. Swap definitions of everyshi.sty's shipout
+ % and preview.sty's shipout:
+ \ifPreview
+ \let\shipout\@EveryShipout@Org@Shipout%This is the null version of \shipout, created by preview and saved by everyshi
+ \let\@EveryShipout@Org@Shipout\pr@shipout% This is the original shipout
+ \let\pr@shipout\@EveryShipout@Shipout%
+ \fi
+ }{}%
+ }
}
% Guess the driver: