summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-04 20:55:44 +0000
committerKarl Berry <karl@freefriends.org>2019-04-04 20:55:44 +0000
commitacab24042d34dd439e1d074820d1da2fa1d591cd (patch)
tree32881f869e20a69711c5fe86134aa48143d9b1e8 /Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
parent93f5c4643a3d0a596d220ff14756ce68d99afe33 (diff)
pgf (4apr19)
git-svn-id: svn://tug.org/texlive/trunk@50758 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty137
1 files changed, 68 insertions, 69 deletions
diff --git a/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty b/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
index a6aacd5fd7c..4f9d31572f6 100644
--- a/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
+++ b/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
@@ -14,7 +14,7 @@
%
% This file is intended to be distributed or even inlined into a file
% when a document needs to be typeset on a system that does not have
-% pgf/TikZ installed.
+% pgf/TikZ installed.
%
% It replaces \tikzpicture/ \endtikzpicture and \tikz and invokes the
% \includegraphics with the correct file name instead.
@@ -36,14 +36,14 @@
\tikzsetfigurename{\tikzexternal@realjob-figure}%
\long\def\tikzpicture#1\end#2{% collect every thing up to \end{tikzpicture}
- \def\tikzexternal@laTeX@collectpicture@@{#2}%
- \ifx\tikzexternal@laTeX@collectpicture@@\tikzexternal@laTeX@tikzpicturestring
- \tikzexternal@image
- \end{tikzpicture}%
- \else
- \expandafter
- \tikzpicture
- \fi
+ \def\tikzexternal@laTeX@collectpicture@@{#2}%
+ \ifx\tikzexternal@laTeX@collectpicture@@\tikzexternal@laTeX@tikzpicturestring
+ \tikzexternal@image
+ \end{tikzpicture}%
+ \else
+ \expandafter
+ \tikzpicture
+ \fi
}%
\def\endtikzpicture{}
\def\tikzexternal@laTeX@tikzpicturestring{tikzpicture}%
@@ -63,82 +63,81 @@
{
\catcode`\;=\active
\gdef\tikz@collectactivesemicolon#1#2;{%
- \tikz@opt@process{#1}{#2;}%
+ \tikz@opt@process{#1}{#2;}%
}
}
\def\tikz@opt@process#1#2{\tikzexternal@image}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\tikzexternal@image{%
- \leavevmode
- \begingroup
- \t@tikzexternal@tmpa=\expandafter{\tikzexternal@filenameprefix}%
- \ifx\tikzexternal@nextfile\empty
- \expandafter\ifx\csname c@tikzext@no@\tikzexternal@figurename\endcsname\relax
- \expandafter\gdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{0}%
- \fi
- \t@tikzexternal@tmpb=\expandafter{\tikzexternal@figurename}%
- \count0=\csname c@tikzext@no@\tikzexternal@figurename\endcsname
- \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb\the\count0 }%
- \advance\count0 by1\relax
- \expandafter\xdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{\the\count0 }%
- \else
- \t@tikzexternal@tmpb=\expandafter{\tikzexternal@nextfile}%
- \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb}%
- \fi
- \endgroup
- \global\let\tikzexternal@nextfile=\empty
- \pgfincludeexternalgraphics\tikzexternal@curfilename
+ \leavevmode
+ \begingroup
+ \t@tikzexternal@tmpa=\expandafter{\tikzexternal@filenameprefix}%
+ \ifx\tikzexternal@nextfile\empty
+ \expandafter\ifx\csname c@tikzext@no@\tikzexternal@figurename\endcsname\relax
+ \expandafter\gdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{0}%
+ \fi
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@figurename}%
+ \count0=\csname c@tikzext@no@\tikzexternal@figurename\endcsname
+ \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb\the\count0 }%
+ \advance\count0 by1\relax
+ \expandafter\xdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{\the\count0 }%
+ \else
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@nextfile}%
+ \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb}%
+ \fi
+ \endgroup
+ \global\let\tikzexternal@nextfile=\empty
+ \pgfincludeexternalgraphics\tikzexternal@curfilename
}%
\def\tikzset#1{}\def\pgfkeys#1{}\def\pgfqkeys#1#2{}
\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{\pgfincludeexternalgraphics{#1}}
\def\tikzifinpicture#1#2{#2}
\def\pgfincludeexternalgraphics#1{%
- \begingroup
- \pgfexternalreaddpth{#1}%
- \setbox1=\hbox{\includegraphics{#1}}%
- \ifdim\pgfretval=0pt
- \box1
- \else
- \dimen0=\pgfretval\relax
- \hbox{\lower\dimen0 \box1 }%
- \fi
- \endgroup
+ \begingroup
+ \pgfexternalreaddpth{#1}%
+ \setbox1=\hbox{\includegraphics{#1}}%
+ \ifdim\pgfretval=0pt
+ \box1
+ \else
+ \dimen0=\pgfretval\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \endgroup
}
\newread\r@pgf@reada
\def\pgfexternalreaddpth#1{%
- \edef\pgfexternalreaddpth@restore{%
- \noexpand\endlinechar=\the\endlinechar\space
- \noexpand\catcode`\noexpand\@=\the\catcode`\@\space
- }%
- \def\pgfretval{0pt}%
- \endlinechar=-1 % suppress white space at end
- \catcode`\@=11
- \openin\r@pgf@reada=#1.dpth
- \pgfincludeexternalgraphics@read@dpth
- \pgfexternalreaddpth@restore
+ \edef\pgfexternalreaddpth@restore{%
+ \noexpand\endlinechar=\the\endlinechar\space
+ \noexpand\catcode`\noexpand\@=\the\catcode`\@\space
+ }%
+ \def\pgfretval{0pt}%
+ \endlinechar=-1 % suppress white space at end
+ \catcode`\@=11
+ \openin\r@pgf@reada=#1.dpth
+ \pgfincludeexternalgraphics@read@dpth
+ \pgfexternalreaddpth@restore
}%
\def\pgfincludeexternalgraphics@read@dpth{%
- \ifeof\r@pgf@reada
- \closein\r@pgf@reada
- \else
- \read\r@pgf@reada to\pgfincludeexternalgraphics@auxline
- \ifx\pgfincludeexternalgraphics@auxline\empty
- \else
- \expandafter\pgfincludeexternalgraphics@read@dpth@line\pgfincludeexternalgraphics@auxline\pgfincludeexternalgraphics@read@dpth@line@EOI
- \fi
- \expandafter\pgfincludeexternalgraphics@read@dpth
- \fi
+ \ifeof\r@pgf@reada
+ \closein\r@pgf@reada
+ \else
+ \read\r@pgf@reada to\pgfincludeexternalgraphics@auxline
+ \ifx\pgfincludeexternalgraphics@auxline\empty
+ \else
+ \expandafter\pgfincludeexternalgraphics@read@dpth@line\pgfincludeexternalgraphics@auxline\pgfincludeexternalgraphics@read@dpth@line@EOI
+ \fi
+ \expandafter\pgfincludeexternalgraphics@read@dpth
+ \fi
}%
\long\def\pgfincludeexternalgraphics@read@dpth@line#1#2\pgfincludeexternalgraphics@read@dpth@line@EOI{%
- \ifcat\noexpand#1\relax
- \if@filesw
- {\toks0={#1#2}%
- \immediate\write\@auxout{\noexpand\def\noexpand\dpthimport{\the\toks0 }\noexpand\dpthimport }%
- }%
- \fi
- \else%
- \def\pgfretval{#1#2}%
- \fi
+ \ifcat\noexpand#1\relax
+ \if@filesw
+ {\toks0={#1#2}%
+ \immediate\write\@auxout{\noexpand\def\noexpand\dpthimport{\the\toks0 }\noexpand\dpthimport }%
+ }%
+ \fi
+ \else%
+ \def\pgfretval{#1#2}%
+ \fi
}%
-