diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex index d8eaca5aee7..75789f2d16c 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex @@ -7,7 +7,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.17 2010/09/01 08:56:40 ludewich Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.20 2013/07/15 12:05:31 tantau Exp $ @@ -107,10 +107,32 @@ \ifpgfexternal@aux@in@dpth \csname newwrite\endcsname\w@pgfexternal@auxout \fi + \pgfexternal@geometry@compatibility \fi% \gdef\pgfrealjobname##1{}% avoid multiple calls. } +\def\pgfexternal@geometry@compatibility{% + % check if \usepackage{geometry} is loaded: + \pgfutil@ifundefined{geometry}{% + }{% + % The geometry package hooks into \begin{document}, evaluates + % its driver -- and generates \special instructions to set the + % paper size. + % + % Unfortunately, this confuses dvips utterly - and perhaps + % other drivers as well. + % + % Thus, if we currently about to generate some external + % graphics, we WANT to disable geometry (it has no purpose in + % this context anyway). + % + % This here works well: + \immediate\write16{Package TikZ externalization: calling \string\geometry{driver=none} during externalization.^^J}% + \geometry{driver=none}% + }% +}% + \def\pgfexternal@nofiles{% % replace \relax. The \nofiles macros does % \let\makeglossary=\relax @@ -158,7 +180,7 @@ % This will be overwritten by the tikz external lib if it is loaded. \def\pgfexternal@error@no@shipout{% - \PackageError{pgf}{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}% + \pgferror{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}% }% @@ -238,13 +260,23 @@ \endgroup } -% Defines \pgfexternaldepth to be the depth of the external picture -% '#1' and \pgfexternaltrimleft / \pgfexternaltrimright to be the 'hbaseline' shift. -% +% Reads the .dpth file which contains meta data of the external +% picture. +% +% This command handles the following stuff: +% - it defines \pgfexternaldepth . The macro contains the contents of +% a line which does not start with a control sequence (for example a +% line containing '50pt') +% - it defines \pgfexternaltrimleft and \pgfexternaltrimright +% - it checks if the .dpth file contains content stored by means of +% \pgfexternalstorecommand. If so, the argument of +% \pgfexternalstorecommand will be restored. +% - anything else will be appended to the main .aux file, assuming that +% it contains \label or \ref information (only if the LaTeX switch +% \if@filesw is \iftrue). % -% Furthermore, it handles any auxiliary information stored in the -% .dpth file (it appends it to the main aux file). % +% #1: the image file name (such that #1.dpth exists) \def\pgfexternalreaddpth#1{% % no \begingroup. Handle that manually: \edef\pgfexternalreaddpth@restore{% @@ -291,6 +323,10 @@ % the .aux file. % \expandafter\ifx\pgf@first\pgfexternal@restore + % if the first line in the .dpth file starts with the + % magic string \pgfexternal@restore, the complete line + % will be executed as-is. Example: + % \pgfexternal@restore{\def\somevalue{1}} #1% \else % do NOT execute #1! many LaTeX commands don't support it (\label for example) |