summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-01-28 22:52:25 +0000
committerKarl Berry <karl@freefriends.org>2013-01-28 22:52:25 +0000
commit61da1767c34606cb616ac7f4d5b3ae9636142d08 (patch)
tree75c12695cc787a14fe609225de6fea2ea09bfec2 /Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty
parent6eb4e4fd92e16d8e86fe34efa288c39269e91269 (diff)
tikzscale 0.2.3 (27jan13)
git-svn-id: svn://tug.org/texlive/trunk@28967 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty46
1 files changed, 31 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty b/Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty
index 38b78365249..f3b881ec1f6 100644
--- a/Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty
+++ b/Master/texmf-dist/tex/latex/tikzscale/tikzscale.sty
@@ -13,7 +13,7 @@
%% ----------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tikzscale}[2013/01/13 v0.2.2 tikzscale LaTeX package]
+\ProvidesPackage{tikzscale}[2013/01/23 v0.2.3 tikzscale LaTeX package]
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\RequirePackage{pgfkeys}
@@ -100,15 +100,6 @@
\AtEndPreamble{%
\def\tikzscale@tikzFileExtensions{.tikz,.TIKZ,.TikZ,.pgf,.PGF}%
\DeclareGraphicsExtensions{\tikzscale@tikzFileExtensions,\Gin@extensions}%
-\ifdef{\currfiledir}{%
-\ifdef{\Ginput@path}{%
-\def\tikzscale@graphicspath{\Ginput@path,\currfiledir,{}}%
-}{%
-\def\tikzscale@graphicspath{\currfiledir,{}}%
-}%
-}{%
-\def\tikzscale@graphicspath{{}}%
-}%
\LetLtxMacro{\tikzscale@oldincludegraphics}{\includegraphics}%
\tikzscale@useEnhancedIncludegraphics
\tikzscale@patchTikzpictureIncludegraphics
@@ -167,13 +158,16 @@
\def\tikzscale@FixEndLine{%
\edef\tikzscale@restoreEndLineChar{\endlinechar=\the\endlinechar\relax}%
\endlinechar=-1%
-\pretocmd{\tikzpicture}{%
-\tikzscale@restoreEndLineChar
-}{}{\PackageError{tikzscale}{Patching tikzpicture failed}}%
+\tikzscale@addRestoreEndLineCharToTikzpicture
\apptocmd{\endtikzpicture}{%
\endlinechar=-1%
}{}{\PackageError{tikzscale}{Patching endtikzpicture failed}}%
}%
+\def\tikzscale@addRestoreEndLineCharToTikzpicture{%
+\pretocmd{\tikzpicture}{%
+\tikzscale@restoreEndLineChar
+}{}{\PackageError{tikzscale}{Patching tikzpicture failed}}%
+}
\def\tikzscale@patchTikzpictureIncludegraphics{%
\pretocmd{\tikzpicture}{%
\LetLtxMacro{\includegraphics}{\tikzscale@oldincludegraphics}%
@@ -189,17 +183,33 @@
\def\tikzscale@checkDirectory##1{%
\def\tikzscale@checkExtension####1{%
\IfFileExists{##1#2####1}{%
-\csdef{#1}{##1#2####1}%
+\csedef{#1}{##1#2####1}%
\listbreak
}{}%
}%
\eforcsvlist{\tikzscale@checkExtension}{{},\Gin@extensions}%
}%
+\tikzscale@setGraphicsPath
\eforcsvlist{\tikzscale@checkDirectory}{\tikzscale@graphicspath}%
\ifcsundef{#1}{%
\csdef{#1}{#2}%
}{}%
}
+\NewDocumentCommand{\tikzscale@setGraphicsPath}{}{%
+\ifdef{\currfiledir}{%
+\ifdef{\Ginput@path}{%
+\def\tikzscale@graphicspath{\currfiledir,\Ginput@path,{}}%
+}{%
+\def\tikzscale@graphicspath{\currfiledir,{}}%
+}%
+}{%
+\ifdef{\Ginput@path}{%
+\def\tikzscale@graphicspath{\Ginput@path,{}}%
+}{%
+\def\tikzscale@graphicspath{{}}%
+}%
+}%
+}%
\NewDocumentCommand{\tikzscale@isTikzFile}{mm}{%
\def\do##1{%
\IfEndWith{#2}{##1}{%
@@ -219,7 +229,7 @@ height/.value required,
axisratio/.code = {\pgfmathsetmacro{\requestedAxisRatio}{#1}},
axisratio/.value required
}
-\NewDocumentCommand{\tikzscale@includetikz}{O{}m}{%
+\newcommand{\tikzscale@includetikz}[2][]{%
\pgfkeys{/tikzscale, #1}%
\tikzscale@ifExternalizationActive{%
\tikzifexternalizingnext{%
@@ -442,9 +452,15 @@ axisratio/.value required
}
\NewDocumentCommand{\tikzscale@conditionalDisableExternalization}{}{%
\tikzexternaldisable
+\ifExternalizationLoaded{%
+\tikzscale@addRestoreEndLineCharToTikzpicture
+}{}%
}
\NewDocumentCommand{\tikzscale@conditionalEnableExternalization}{m}{%
\tikzexternalenable
+\ifExternalizationLoaded{%
+\tikzscale@addRestoreEndLineCharToTikzpicture
+}{}%
}
%%
%% Copyright (C) 2012 by Patrick Häcker <pat_h@web.de>