summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-06-21 20:42:13 +0000
committerKarl Berry <karl@freefriends.org>2020-06-21 20:42:13 +0000
commit46664e932a29dc32f69fac4c6773c5c3da0ece8e (patch)
tree2ca599bdb2f25c8d3163d62d00cbe1b6a44e3e91 /Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
parent3777b671f537fa94efd5ee9710f921aa79a8fca5 (diff)
circuitikz (21jun20)
git-svn-id: svn://tug.org/texlive/trunk@55620 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex25
1 files changed, 17 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
index 2860ef9a32d..58420725ad9 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
@@ -71,13 +71,22 @@
%% this code has been contributed by Schrödinger's cat
%% https://tex.stackexchange.com/a/529159/38080
%%
-\tikzset{use fpu reciprocal/.code={%
-\def\pgfmathreciprocal@##1{%
- \begingroup
- \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
- \pgfmathparse{1/##1}%
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
-}}}%
+%% Use the official key to use the fpu if installed, see
+%% https://github.com/pgf-tikz/pgf/issues/861
+%%
+%% Thanks to "muzimuzhi Z" https://tex.stackexchange.com/a/547085/38080
+%%
+\pgfkeysifdefined{/pgf/fpu/install only/.@cmd}{%
+ \pgfqkeys{/pgf}{use fpu reciprocal/.code={\pgfkeys{/pgf/fpu/install only={reciprocal}}}}%
+ }{%
+ \pgfqkeys{/pgf}{use fpu reciprocal/.code={%
+ \def\pgfmathreciprocal@##1{%
+ \begingroup
+ \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
+ \pgfmathparse{1/##1}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ }}}%
+}
\endinput