| 1 |
% Copyright 2019 by Till Tantau |
| 2 |
% |
| 3 |
% This file may be distributed and/or modified |
| 4 |
% |
| 5 |
% 1. under the LaTeX Project Public License and/or |
| 6 |
% 2. under the GNU Public License. |
| 7 |
% |
| 8 |
% See the file doc/generic/pgf/licenses/LICENSE for more details. |
| 9 |
% |
| 10 |
% In addition to the above licenses, this particular file may also be |
| 11 |
% directly inlined into other documents and this copyright notice may |
| 12 |
% be removed. Additionally, when you inline this file, you may modify |
| 13 |
% it as needed and you may remove comments. |
| 14 |
% |
| 15 |
% This file is intended to be distributed or even inlined into a file |
| 16 |
% when a document needs to be typeset on a system that does not have |
| 17 |
% pgf/TikZ installed. |
| 18 |
|
| 19 |
% "environment" for reading an external graphic. Note that there are |
| 20 |
% no (!) braces around the "name" of the environment |
| 21 |
% |
| 22 |
% #1 = name of the graphics file |
| 23 |
% |
| 24 |
% Example: |
| 25 |
% |
| 26 |
% \beginpgfgraphicnamed{mygraph} |
| 27 |
% \begin{tikzpicture} |
| 28 |
% ... |
| 29 |
% \end{tikzpicture} |
| 30 |
% \endpgfgraphicnamed |
| 31 |
|
| 32 |
\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{% |
| 33 |
\begingroup |
| 34 |
\setbox1=\hbox{\includegraphics{#1}}% |
| 35 |
\openin1=#1.dpth |
| 36 |
\ifeof1 \box1 |
| 37 |
\else |
| 38 |
\read1 to\pgfincludeexternalgraphicsdp \closein1 |
| 39 |
\dimen0=\pgfincludeexternalgraphicsdp\relax |
| 40 |
\hbox{\lower\dimen0 \box1 }% |
| 41 |
\fi |
| 42 |
\endgroup |
| 43 |
} |