summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-06-22 03:02:09 +0000
committerNorbert Preining <norbert@preining.info>2020-06-22 03:02:09 +0000
commitc667de615db3c132e784c84cf43a0e9849ecd7e2 (patch)
tree1d7b5a660cf6b7d7170a49f90a4656c23697f35f /graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
parent9f10616edfed3b801246055ec6d06631ff60f9b1 (diff)
CTAN sync 202006220302
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex25
1 files changed, 17 insertions, 8 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
index 2860ef9a32..58420725ad 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/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