summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex43
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
new file mode 100644
index 00000000000..38eeb306855
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
@@ -0,0 +1,43 @@
+% Copyright 2007 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+%
+% In addition to the above licenses, this particular file may also be
+% directly inlined into other documents and this copyright notice may
+% be removed. Additionally, when you inline this file, you may modify
+% it as needed and you may remove comments.
+%
+% 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.
+
+% "environment" for reading an external graphic. Note that there are
+% no (!) braces around the "name" of the environment
+%
+% #1 = name of the graphics file
+%
+% Example:
+%
+% \beginpgfgraphicnamed{mygraph}
+% \begin{tikzpicture}
+% ...
+% \end{tikzpicture}
+% \endpgfgraphicnamed
+
+\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{%
+ \begingroup
+ \setbox1=\hbox{\includegraphics{#1}}%
+ \openin1=#1.dpth
+ \ifeof1 \box1
+ \else
+ \read1 to\pgfincludeexternalgraphicsdp \closein1
+ \dimen0=\pgfincludeexternalgraphicsdp\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \endgroup
+}