diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-28 20:57:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-28 20:57:36 +0000 |
commit | e752903a9ad1c74190305384230882402822846a (patch) | |
tree | 8d60a64b66091d1c8e34e5af76d413268603b25d /Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def | |
parent | c452dea4584e1a0650f1ba1f87262a85b511057c (diff) |
pgf (28sep20)
git-svn-id: svn://tug.org/texlive/trunk@56462 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def | 116 |
1 files changed, 62 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def index 2ac8ec42120..e2ed750368f 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/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: |