summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-08-08 22:54:29 +0000
committerKarl Berry <karl@freefriends.org>2015-08-08 22:54:29 +0000
commit531d43fafa269c546d587eaca6cd14adcd11914f (patch)
tree1883933af984c60254e6d9d1bd955a76748cb827 /Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
parent877e963d44f039783cb9227d90c911866c780961 (diff)
pgf (8aug15)
git-svn-id: svn://tug.org/texlive/trunk@38079 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.def48
1 files changed, 35 insertions, 13 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 c990a3730a4..6c740514bba 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
@@ -78,13 +78,14 @@
\let\pgfmath@tempcnta\pgfutil@tempcnta
\let\pgfmath@tempcntb\pgfutil@tempcntb
+\def\pgfutil@check@rerun#1#2{\@newl@bel{pgf@lab}{#1}{#2}}
\AtBeginDocument{\AtEndDocument{\par\vfil\penalty-10000\relax\the\pgfutil@everybye}}
\def\pgfutil@insertatbegincurrentpagefrombox#1{%
\edef\pgf@temp{\the\wd\pgfutil@abb}%
\global\setbox\pgfutil@abb\hbox{%
- \unhbox\pgfutil@abb
+ \unhbox\pgfutil@abb%
%
% the order in which \pgfutil@insertatbegincurrentpagefrombox
% matters unless we make the following -shift!
@@ -94,7 +95,7 @@
%
% CF observed problems when placing patterns in XObjects without
% this skip (dvipdfmx driver for pgfplots shader=interp)
- \hskip-\pgf@temp\relax
+ \hskip-\pgf@temp\relax%
#1%
}%
}
@@ -112,11 +113,32 @@
\EveryShipout{%
% Add at begin page stuff
\setbox\@cclv=\vbox{%
- \setbox\z@=\hbox{\pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty}%
+ \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%
@@ -132,18 +154,18 @@
% 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:
- \let\pgf@temp\pr@shipout% This is the original shipout
- \let\pr@shipout\@EveryShipout@Shipout% This is what preview.sty should call
- \let\@EveryShipout@Org@Shipout\pgf@temp% Everyshi should now use the original one
- }{}%
+ \@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:
\def\pgfutil@guessdriver{