diff options
author | Karl Berry <karl@freefriends.org> | 2013-01-03 23:32:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-01-03 23:32:17 +0000 |
commit | c2de5f2979b063faba1573870b6b21419cb8b0fa (patch) | |
tree | 6f841845e55de6bda7de0d7f5ea231d0f6a88dc1 /Master/texmf-dist/tex | |
parent | 2a36de362639f891b12a07cb15896525e42e1465 (diff) |
tikzinclude (3jan13)
git-svn-id: svn://tug.org/texlive/trunk@28715 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzinclude/tikzinclude.sty | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzinclude/tikzinclude.sty b/Master/texmf-dist/tex/latex/tikzinclude/tikzinclude.sty new file mode 100644 index 00000000000..f5fb8c74d89 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzinclude/tikzinclude.sty @@ -0,0 +1,72 @@ +%% +%% This is file `tikzinclude.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tikzinclude.dtx (with options: `package') +%% +%% Copyright (C) 2012 by Ferdinand Schwenk (me@nerdifand.de). +%% Copyright (C) 2012 by Benjamin Berg (benjamin@sipsolutions.net). +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is available at +%% http://www.latex-project.org/lppl/. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{tikzinclude} + [2012/22/02 v1.0 package for including only a specified tikz pictures from a file] +\RequirePackage{tikz} +\RequirePackage{ifthen} +\RequirePackage{etoolbox} +\newif\if@tikzinclude@active\@tikzinclude@activefalse +\let\@tikzinclude@typsetpicturebox\pgfsys@typesetpicturebox +\newcommand{\@tikzinclude@picture@started}{% + \if@tikzinclude@active% + \let\par\@tikzinclude@par% + \fi% +} +\newcommand{\@tikzinclude@picture@ended}{% + \if@tikzinclude@active% + \ifthenelse{% + \equal{\pgfkeysvalueof{/tikzinclude/figure}}{\pgfkeysvalueof{/tikzinclude/select}}% + }% + {}% + {% + \global\def\pgfsys@typesetpicturebox##1{% + \global\let\pgfsys@typesetpicturebox\@tikzinclude@typsetpicturebox% + }% + }% + \fi% +} +\BeforeBeginEnvironment{tikzpicture}{\if@tikzinclude@active% + \whileboolexpr{test{\ifdimgreater{\lastskip}{0pt}}}{\unskip}\fi}% + \AtBeginEnvironment{tikzpicture}{\@tikzinclude@picture@started% +} +\AtEndEnvironment{tikzpicture}{\@tikzinclude@picture@ended} +\AfterEndEnvironment{tikzpicture}{\ignorespaces} +\pgfkeyssetvalue{/tikzinclude/figure}{} +\pgfkeyssetvalue{/tikzinclude/select}{} +\newcommand\includetikzgraphics[2][]{% + \begingroup% + \ifthenelse{\equal{#1}{}}% + {% + \input{#2}% + }% + {% + \let\@tikzinclude@par\par% + \def\par{}% + \pgfkeyssetvalue{/tikzinclude/select}{#1}% + \@tikzinclude@activetrue% + \kern0pt\input{#2}% + \whileboolexpr{test{\ifdimgreater{\lastskip}{0pt}}}{\unskip}% + \@tikzinclude@activefalse% + \let\par\@tikzinclude@par% + }% + \endgroup% +} +\endinput +%% +%% End of file `tikzinclude.sty'. |