summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-04-18 16:42:44 +0000
committerKarl Berry <karl@freefriends.org>2009-04-18 16:42:44 +0000
commit9fbcb733dd11b3c8375ec9997391296abbc6d79d (patch)
tree7c139328d5c1b332a5a5311bebd0bf665d18b11c /Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty
parent6e3c22d01092e6a41b9147068d2719a44d5ac16f (diff)
new pgf package circuitikz (17apr09)
git-svn-id: svn://tug.org/texlive/trunk@12745 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty')
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty49
1 files changed, 49 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty
new file mode 100644
index 00000000000..7fa55c85998
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty
@@ -0,0 +1,49 @@
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% 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/LICENSE for more details.
+
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+% \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ }{
+ \pgf@circ@siunitx@resfalse
+ }
+ \fi
+}
+
+\def\pgf@circ@finallabel#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1label/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1label/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1label/name}}{\ctikzvalof{bipole/#1label/unit}}$%
+ \fi%
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+}
+
+
+\endinput