summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-01-16 03:03:27 +0000
committerNorbert Preining <norbert@preining.info>2023-01-16 03:03:27 +0000
commit6f9e1680085e7bb4d258f6f8116369d122e196e1 (patch)
tree9ac0ecb239240d1d672b188f29c1479de215074b /graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits
parentb8345f39630408bb198e7636381ce4240154ca9b (diff)
CTAN sync 202301160303
Diffstat (limited to 'graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits')
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex264
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex442
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex148
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex28
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex75
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex64
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex45
7 files changed, 1066 insertions, 0 deletions
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex
new file mode 100644
index 0000000000..1a9173fddc
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex
@@ -0,0 +1,264 @@
+% Copyright 2019 by Till Tantau and others Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{calc,decorations.markings}%
+
+
+%
+% Indicate that the picture contains a circuit
+%
+\tikzset{
+ circuit/.style={
+ every circuit/.try,
+ /utils/exec=\tikz@lib@circ@on@tofalse,
+ execute at begin to={
+ \tikz@lib@circ@on@totrue
+ \let\tikz@lib@circ@start@node\pgfutil@empty
+ \def\tikz@lib@circ@end{-- (\tikztotarget) \tikztonodes}
+ }
+ }
+}%
+
+\newif\iftikz@lib@circ@on@to
+
+
+%
+% General management
+%
+
+\tikzset{
+ circuit handle symbol/.code={%
+ \global\advance\tikz@lib@circ@count by1\relax%
+ \iftikz@lib@circ@on@to
+ {%
+ % Compute the tikz@time...
+ \pgfkeys{
+ /pgf/key filters/active families or no family/.install key filter={/pgf/key filters/false}{/pgf/key filters/false},
+ /tikz/circuits/pos grabber/.activate family}
+ \pgfqkeysfiltered{/tikz}{pos=.5,#1}%
+ \expandafter%
+ }%
+ \expandafter\def\expandafter\tikz@lib@circ@pos\expandafter{\tikz@time}%
+ \pgfkeysalso{to path={
+ \pgfextra{\tikz@lib@circ@on@tofalse}
+ decorate [decoration={markings,mark connection node=mark node}]
+ {
+ \tikz@lib@circ@start@node
+ \tikz@lib@circ@end
+ }
+ }}
+ \ifdim\tikz@lib@circ@pos pt=0pt\relax%
+ \def\tikz@lib@circ@start@node{%
+ {\pgfextra{\tikz@lib@circ@compute@direction{\tikz@lib@circ@start}}%
+ node[alias=tikz@lib@circ@node@start,at={(0,0)},#1,pos=]{}}(tikz@lib@circ@node@start)}%
+ \else%
+ \ifdim\tikz@lib@circ@pos pt=1pt\relax%
+ \def\tikz@lib@circ@end{
+ {\pgfextra{\tikz@lib@circ@compute@direction{\tikz@lib@circ@target}}%
+ node[alias=tikz@lib@circ@node\the\tikz@lib@circ@count,at={(0,0)},#1,pos=]{}}
+ --(tikz@lib@circ@node\the\tikz@lib@circ@count)\tikztonodes
+ }%
+ \else%
+ \edef\tikz@marshal{mark=at position \tikz@lib@circ@pos\space with}%
+ \def\tikz@marshala{decoration=}%
+ \expandafter\expandafter\expandafter\tikzset%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@marshala\expandafter{\tikz@marshal{\node[alias=mark node,#1,pos=]{};}}}
+ \fi%
+ \fi%
+ \else
+ \pgfkeysalso{#1}
+ \fi
+ }
+}%
+\newcount\tikz@lib@circ@count
+
+\def\tikz@lib@circ@compute@direction#1{%
+ \tikz@scan@one@point\tikz@lib@circ@save@start(\tikztostart)%
+ \tikz@scan@one@point\tikz@lib@circ@save@target(\tikztotarget)%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\tikz@lib@circ@start}{\tikz@lib@circ@target}}}%
+ \pgf@ya=-\pgf@y%
+ \pgftransformcm{\the\pgf@x}{\the\pgf@y}{\the\pgf@ya}{\the\pgf@x}{#1}%
+}%
+\def\tikz@lib@circ@save@start#1{\def\tikz@lib@circ@start{#1}}%
+\def\tikz@lib@circ@save@target#1{\def\tikz@lib@circ@target{#1}}%
+
+\tikzset{
+ circuits/pos grabber/.is family,
+ pos/.belongs to family=/tikz/circuits/pos grabber,
+ at start/.belongs to family=/tikz/circuits/pos grabber,
+ very near start/.belongs to family=/tikz/circuits/pos grabber,
+ near start/.belongs to family=/tikz/circuits/pos grabber,
+ midway/.belongs to family=/tikz/circuits/pos grabber,
+ near end/.belongs to family=/tikz/circuits/pos grabber,
+ very near end/.belongs to family=/tikz/circuits/pos grabber,
+ at end/.belongs to family=/tikz/circuits/pos grabber
+}%
+
+
+%
+% Declaring a new symbol
+%
+\tikzset{
+ circuit declare symbol/.style args={#1}{
+ % Declares a new circuit symbol.
+ %
+ % #1 = name
+ % #2 = factor for default minimum width
+ % #3 = factor for default minimum height
+ %
+ % The following styles are defined:
+ %
+ % #1
+ % Can be given as an option to a "node" command or to a "to"
+ % command. It takes a set of options as parameter that will be
+ % passed to the option.
+ %
+ % set #1 graphic
+ % This keys can be set to the necessary options to make a normal
+ % node look like the symbol. For instance, for a resistor that is
+ % rendered as a rectangle, this keys can be set, basically, to
+ % "rectangle,draw". Set this key to use a different appearance for
+ % symbols of kind #1.
+ %
+ % every #1
+ % This style will be included with every symbols of this kind and
+ % can be used to configure them further.
+ %
+ % every circuit symbol
+ % This style is also included with every symbol.
+ #1/.style={circuit handle symbol={
+ inner sep=0.5pt,
+ every circuit symbol,
+ #1/graphic,
+ every #1/.try,
+ ##1}
+ },
+ #1/graphic/.style={},
+ set #1 graphic/.style={#1/graphic/.style={##1}}
+ },
+ circuit symbol unit/.code=\pgfmathsetlength\tikzcircuitssizeunit{#1},
+ circuit symbol size/.style args={width #1 height #2}{
+ minimum width={(#1)*\tikzcircuitssizeunit},
+ minimum height={(#2)*\tikzcircuitssizeunit}
+ },
+ huge circuit symbols/.style={circuit symbol unit=10pt},
+ large circuit symbols/.style={circuit symbol unit=8pt},
+ medium circuit symbols/.style={circuit symbol unit=7pt},
+ small circuit symbols/.style={circuit symbol unit=6pt},
+ tiny circuit symbols/.style={circuit symbol unit=5pt},
+}%
+
+\newdimen\tikzcircuitssizeunit
+\tikzcircuitssizeunit=7pt
+
+
+%
+% Annotations
+%
+
+\tikzset{
+ circuit declare annotation/.style args={#1#2#3}{%
+ #1/.style={
+ append after command={%
+ \bgroup
+ [current point is local=true]
+ [every circuit annotation/.try]
+ [every #1/.try]
+ [shift={(\tikzlastnode.north)}]
+ [annotation arrow,->]
+ [label distance=#2,##1]
+ #3
+ \tikz@after@path%
+ \egroup%
+ }
+ },
+ #1'/.style={
+ append after command={%
+ \bgroup
+ [current point is local=true]
+ [every circuit annotation/.try]
+ [every #1/.try]
+ [shift={(\tikzlastnode.south)},yscale=-1]
+ [annotation arrow,->]
+ [label distance=#2,##1]
+ #3
+ \tikz@after@path%
+ \egroup%
+ }
+ }
+ },
+ annotation arrow/.style = {
+ /utils/exec={\pgfsetarrowoptions{direction ee}{.4*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth}},
+ >=direction ee
+ }
+}%
+
+
+
+%
+% Rotating symbols
+%
+\tikzset{
+ point up/.style={rotate=90},
+ point down/.style={rotate=-90},
+ point left/.style={rotate=180},
+ point right/.style={}
+}%
+
+
+
+%
+% Basic theming
+%
+
+\tikzset{
+ every circuit symbol/.style={},
+ circuit symbol open/.style={draw},
+ circuit symbol filled/.style={draw,fill=black},
+ circuit symbol lines/.style={draw},
+ circuit symbol wires/.style={draw},
+}%
+
+
+
+
+
+%
+% Labels
+%
+
+\tikzset{
+ info/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@plain{\tikz@lib@circ@lab@plain[]}#1\pgf@stop},%}
+ info'/.code={\pgfutil@ifnextchar[\tikz@lib@circ@labp@plain{\tikz@lib@circ@labp@plain[]}#1\pgf@stop},%}
+ info sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@sloped@plain{\tikz@lib@circ@lab@sloped@plain[]}#1\pgf@stop},%}
+ info' sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@slopedp@plain{\tikz@lib@circ@lab@slopedp@plain[]}#1\pgf@stop},%}
+ circuit declare unit/.style 2 args={
+ %
+ % Defines four styles that can be used to add labels to a node.
+ %
+ #1/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab{\tikz@lib@circ@lab[]}##1\pgf@stop{#2}{#1}},%}
+ #1 sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@sloped{\tikz@lib@circ@lab@sloped[]}##1\pgf@stop{#2}{#1}},%}
+ #1'/.code={\pgfutil@ifnextchar[\tikz@lib@circ@labp{\tikz@lib@circ@labp[]}##1\pgf@stop{#2}{#1}},%}
+ #1' sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@slopedp{\tikz@lib@circ@lab@slopedp[]}##1\pgf@stop{#2}{#1}}%}
+ }
+}%
+
+\def\tikz@lib@circ@lab[#1]#2\pgf@stop#3#4{\tikzset{label={[every info/.try,every #4/.try,#1]$\mathrm{#2#3}$}}}%
+\def\tikz@lib@circ@lab@sloped[#1]#2\pgf@stop#3#4{\tikzset{label={[every info/.try,every #4/.try,transform shape,#1]$\mathrm{#2#3}$}}}%
+\def\tikz@lib@circ@labp[#1]#2\pgf@stop#3#4{\tikzset{label={[label position=below,every info/.try,every #4/.try,#1]$\mathrm{#2#3}$}}}%
+\def\tikz@lib@circ@lab@slopedp[#1]#2\pgf@stop#3#4{\tikzset{label={[label position=below,every info/.try,every #4/.try,transform shape,#1]$\mathrm{#2#3}$}}}%
+
+\def\tikz@lib@circ@lab@plain[#1]#2\pgf@stop{\tikzset{label={[every info/.try,#1]#2}}}%
+\def\tikz@lib@circ@lab@sloped@plain[#1]#2\pgf@stop{\tikzset{label={[every info/.try,transform shape,#1]#2}}}%
+\def\tikz@lib@circ@labp@plain[#1]#2\pgf@stop{\tikzset{label={[label position=below,every info/.try,#1]#2}}}%
+\def\tikz@lib@circ@lab@slopedp@plain[#1]#2\pgf@stop{\tikzset{label={[label position=below,every info/.try,transform shape,#1]#2}}}%
+
+
+
+\endinput
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex
new file mode 100644
index 0000000000..9d1cfcfcea
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex
@@ -0,0 +1,442 @@
+% Copyright 2019 by Till Tantau and others Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{arrows}%
+\usetikzlibrary{circuits.ee}%
+
+\usepgflibrary{shapes.gates.ee.IEC}%
+
+
+%
+% When this lib is loaded, all symbols default to IEC
+%
+
+\tikzset{
+ circuit ee IEC/.style=
+ {
+ circuit ee,
+ set resistor graphic = resistor IEC graphic,
+ set inductor graphic = inductor IEC graphic,
+ set capacitor graphic = capacitor IEC graphic,
+ set contact graphic = contact IEC graphic,
+ set ground graphic = ground IEC graphic,
+ set battery graphic = battery IEC graphic,
+ set diode graphic = diode IEC graphic,
+ set Zener diode graphic = Zener diode IEC graphic,
+ set tunnel diode graphic = tunnel diode IEC graphic,
+ set backward diode graphic = backward diode IEC graphic,
+ set Schottky diode graphic = Schottky diode IEC graphic,
+ set breakdown diode graphic = breakdown diode IEC graphic,
+ set bulb graphic = bulb IEC graphic,
+ set voltage source graphic = voltage source IEC graphic,
+ set current source graphic = current source IEC graphic,
+ set make contact graphic = make contact IEC graphic,
+ set break contact graphic = break contact IEC graphic,
+ set amperemeter graphic = amperemeter graphic,
+ set voltmeter graphic = voltmeter graphic,
+ set ohmmeter graphic = ohmmeter graphic,
+ set ac source graphic = ac source graphic,
+ set dc source graphic = dc source graphic,
+ },
+}%
+
+
+%
+% Resistors
+%
+
+\tikzset{
+ resistor IEC graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 4 height 1,
+ shape=rectangle ee,
+ transform shape,
+ },
+ var resistor IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 4.8 height 0.8,
+ shape=var resistor IEC,
+ transform shape,
+ outer sep=0pt,
+ cap=round,
+ },
+}%
+
+
+
+%
+% Inductors
+%
+
+\tikzset{
+ inductor IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 4 height .5,
+ transform shape,
+ shape=inductor IEC,
+ outer sep=0pt,
+ cap=round,
+ },
+ var inductor IEC graphic/.style={
+ circuit symbol filled,
+ circuit symbol size=width 4 height 1,
+ transform shape,
+ shape=rectangle ee,
+ },
+}%
+
+
+
+%
+% Capacitors
+%
+
+\tikzset{
+ capacitor IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width .5 height 2,
+ transform shape,
+ shape=capacitor IEC,
+ },
+}%
+
+
+
+%
+% Ground
+%
+
+\tikzset{
+ ground IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width .75 height 2,
+ transform shape,
+ shape=ground IEC,
+ },
+}%
+
+
+
+
+%
+% Battery
+%
+
+\tikzset{
+ battery IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width .5 height 2.5,
+ transform shape,
+ shape=battery IEC,
+ transform shape,
+ },
+}%
+
+
+
+%
+% Diodes
+%
+
+\tikzset{
+ %
+ % normal diode
+ %
+ diode IEC graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 1.25 height 1.25,
+ transform shape,
+ shape=generic diode IEC,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var diode IEC graphic/.style={
+ diode IEC graphic,
+ circuit symbol filled,
+ },
+}%
+
+\tikzset{
+ %
+ % Zener diode
+ %
+ Zener diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var Zener diode IEC graphic/.style={
+ Zener diode IEC graphic,
+ circuit symbol filled,
+ },
+}%
+
+\tikzset{
+ %
+ % Schottky diode
+ %
+ Schottky diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.4pt}{-.6pt}}
+ \pgfpathlineto{\pgfqpoint{-.4pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.4pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.4pt}{.6pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var Schottky diode IEC graphic/.style={
+ Schottky diode IEC graphic,
+ circuit symbol filled,
+ },
+}%
+
+\tikzset{
+ %
+ % tunnel diode
+ %
+ tunnel diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{-.5pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var tunnel diode IEC graphic/.style={
+ tunnel diode IEC graphic,
+ circuit symbol filled,
+ },
+}%
+
+\tikzset{
+ %
+ % backward diode
+ %
+ backward diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{-1pt}}
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var backward diode IEC graphic/.style={
+ backward diode IEC graphic,
+ circuit symbol filled,
+ },
+}%
+
+
+\tikzset{
+ %
+ % breakdown diode
+ %
+ breakdown diode IEC graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2.5 height 1.25,
+ transform shape,
+ shape=breakdown diode IEC,
+ },
+ var breakdown diode IEC graphic/.style={
+ breakdown diode IEC graphic,
+ circuit symbol filled,
+ },
+}%
+
+
+
+%
+% Contacts
+%
+
+\tikzset{
+ contact IEC graphic/.style={
+ circuit symbol filled,
+ circuit symbol size=width .5 height .5,
+ shape=circle ee,
+ outer sep=.25\pgflinewidth,
+ },
+% connection IEC graphic/.style={
+% circuit symbol open,
+% circuit symbol size=width 1 height 1,
+% shape=circle ee,
+% outer sep=.25\pgflinewidth,
+% },
+}%
+
+
+%
+% Bulbs
+%
+
+\tikzset{
+ bulb IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 1.5 height 1.5,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfpointpolar{-135}{1pt}}
+ \pgfpathlineto{\pgfpointpolar{45}{1pt}}
+ \pgfpathmoveto{\pgfpointpolar{-45}{1pt}}
+ \pgfpathlineto{\pgfpointpolar{135}{1pt}}
+ \pgfusepathqstroke
+ },
+ transform shape,
+ },
+}%
+
+
+%
+% Current and voltage sources
+%
+
+\tikzset{
+ current source IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 2 height 2,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ transform shape,
+ },
+ voltage source IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 2 height 2,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-1pt}{0pt}}
+ \pgfpathlineto{\pgfqpoint{1pt}{0pt}}
+ \pgfusepathqstroke
+ },
+ transform shape,
+ },
+}%
+
+
+
+%
+% Contacts
+%
+
+\tikzset{
+ make contact IEC graphic/.style={
+ circuit symbol wires,
+ circuit symbol size=width 2 height 1,
+ transform shape,
+ shape=make contact IEC,
+ outer sep=0pt,
+ cap=round,
+ },
+ var make contact IEC graphic/.style={
+ circuit symbol wires,
+ circuit symbol size=width 2.4 height 1,
+ transform shape,
+ shape=var make contact IEC,
+ outer sep=0pt,
+ cap=round,
+ },
+}%
+
+
+\tikzset{
+ break contact IEC graphic/.style={
+ circuit symbol wires,
+ circuit symbol size=width 2 height 1,
+ transform shape,
+ shape=break contact IEC,
+ outer sep=0pt,
+ cap=round,
+ },
+}%
+
+
+
+%
+% Measurement devices
+%
+
+\tikzset{
+ amperemeter graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2 height 2,
+ transform shape,
+ shape=generic circle IEC,
+ info=center:A,
+ },
+ voltmeter graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2 height 2,
+ transform shape,
+ shape=generic circle IEC,
+ info=center:V,
+ },
+ ohmmeter graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2 height 2,
+ transform shape,
+ shape=generic circle IEC,
+ info=center:$\Omega$,
+ },
+}%
+
+
+
+%
+% AC/DC
+%
+
+\tikzset{
+ ac source graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 2 height 2,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{0.7pt}{0pt}}
+ \pgfpathquadraticcurveto{\pgfqpoint{ 0.35pt}{-0.5pt}}{\pgfqpoint{0pt}{0pt}}
+ \pgfpathquadraticcurveto{\pgfqpoint{-0.35pt}{ 0.5pt}}{\pgfqpoint{-0.7pt}{0pt}}
+ \pgfusepathqstroke
+ },
+ transform shape,
+ },
+ dc source graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 2 height 2,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{ 0.7pt}{ 0.2pt}}
+ \pgfpathlineto{\pgfqpoint{-0.7pt}{ 0.2pt}}
+ \pgfusepathqstroke
+ \pgfpathmoveto{\pgfqpoint{ 0.7pt}{-0.2pt}}
+ \pgfpathlineto{\pgfqpoint{-0.7pt}{-0.2pt}}
+ \pgfusepathqstroke
+ },
+ transform shape,
+ },
+}%
+
+\endinput
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex
new file mode 100644
index 0000000000..2e065d7dda
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex
@@ -0,0 +1,148 @@
+
+% Copyright 2019 by Till Tantau and others Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{circuits}%
+\usepgflibrary{shapes.gates.ee}%
+
+
+%
+% Setting up an ee circuit
+%
+\tikzset{
+ circuit ee/.style={
+ circuit,
+ every circuit ee/.try
+ }
+}%
+
+
+%
+% The default symbols (you need to load a sublib to install the actual rendering).
+%
+
+\tikzset{
+ circuit declare symbol = resistor,
+ circuit declare symbol = inductor,
+ circuit declare symbol = capacitor,
+ circuit declare symbol = contact,
+ circuit declare symbol = ground,
+ circuit declare symbol = battery,
+ circuit declare symbol = diode,
+ circuit declare symbol = Zener diode,
+ circuit declare symbol = Schottky diode,
+ circuit declare symbol = tunnel diode,
+ circuit declare symbol = backward diode,
+ circuit declare symbol = breakdown diode,
+ circuit declare symbol = bulb,
+ circuit declare symbol = current source,
+ circuit declare symbol = voltage source,
+ circuit declare symbol = current direction,
+ circuit declare symbol = current direction',
+ circuit declare symbol = make contact,
+ circuit declare symbol = break contact,
+ circuit declare symbol = amperemeter,
+ circuit declare symbol = voltmeter,
+ circuit declare symbol = ohmmeter,
+ circuit declare symbol = ac source,
+ circuit declare symbol = dc source,
+ %
+ set current direction graphic = current direction ee graphic,
+ set current direction' graphic = current direction' ee graphic,
+}%
+
+
+%
+% The default labels
+%
+
+\tikzset{
+ circuit declare unit={ampere}{A},
+ circuit declare unit={volt}{V},
+ circuit declare unit={ohm}{\Omega},
+ circuit declare unit={siemens}{S},
+ circuit declare unit={henry}{H},
+ circuit declare unit={farad}{F},
+ circuit declare unit={coulomb}{C},
+ circuit declare unit={voltampere}{VA},
+ circuit declare unit={watt}{W},
+ circuit declare unit={hertz}{Hz},
+}%
+
+
+
+%
+% The direction and arrow settings
+%
+
+\tikzset{
+ % These styles should set the end-arrow.
+ %
+ % This arrow will generally be used to indicate current directions in a circuit:
+ current direction arrow/.style = {
+ /utils/exec={\pgfsetarrowoptions{direction ee}{1.3065*.5*\the\tikzcircuitssizeunit+1.3065*.3*\the\pgflinewidth}},
+ >=direction ee,
+ direction ee arrow = direction ee,
+ }
+}%
+
+
+
+
+\tikzset{
+ current direction ee graphic/.style = {
+ shape=direction ee,
+ circuit symbol filled,
+ current direction arrow,
+ minimum width = .5*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth,
+ minimum height = .5*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth,
+ transform shape
+ },
+ current direction' ee graphic/.style = {
+ current direction ee graphic,
+ rotate=180
+ }
+}%
+
+
+
+%
+% Annotations
+%
+
+\tikzset{
+ circuit declare annotation={direction info}{.5\tikzcircuitssizeunit}
+ {
+ (-1.25\tikzcircuitssizeunit,.3333\tikzcircuitssizeunit) edge[line to] (1.25\tikzcircuitssizeunit,.3333\tikzcircuitssizeunit)
+ },
+ circuit declare annotation={light emitting}{1.75\tikzcircuitssizeunit}
+ {
+ (-.2\tikzcircuitssizeunit,.65\tikzcircuitssizeunit) edge[line to] ++(45:1.25\tikzcircuitssizeunit)
+ (.2\tikzcircuitssizeunit,.25\tikzcircuitssizeunit) edge[line to] ++(45:1.25\tikzcircuitssizeunit)
+ },
+ circuit declare annotation={light dependent}{1.75\tikzcircuitssizeunit}
+ {
+ [shift=(135:1.25\tikzcircuitssizeunit)]
+ (.2\tikzcircuitssizeunit,.65\tikzcircuitssizeunit) edge[line to] ++(-45:1.25\tikzcircuitssizeunit)
+ (-.2\tikzcircuitssizeunit,.25\tikzcircuitssizeunit) edge[line to] ++(-45:1.25\tikzcircuitssizeunit)
+ },
+ circuit declare annotation={adjustable}{1.5\tikzcircuitssizeunit}
+ {
+ [shift=(\tikzlastnode.center)]
+ (-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)
+ },
+ circuit declare annotation={adjustable'}{1.5\tikzcircuitssizeunit}
+ {
+ [shift=(\tikzlastnode.center)]
+ (-1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit)
+ }
+}%
+
+
+\endinput
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex
new file mode 100644
index 0000000000..743bc24be8
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex
@@ -0,0 +1,28 @@
+% Copyright 2018 by Till Tantau and others Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{circuits.logic.US}%
+
+\tikzset{
+ circuit logic CDH/.style =
+ {
+ circuit logic US,
+ set and gate graphic = and gate CDH graphic,
+ set nand gate graphic = nand gate CDH graphic,
+ }
+}%
+
+\tikzset{
+ circuit logic US make graphic=and gate CDH,
+ circuit logic US make graphic=nand gate CDH,
+}%
+
+
+
+\endinput
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex
new file mode 100644
index 0000000000..3d74ccd197
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex
@@ -0,0 +1,75 @@
+% Copyright 2018 by Till Tantau and others Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{circuits.logic}%
+\usepgflibrary{shapes.gates.logic.IEC}%
+
+
+%
+% When this lib is loaded, all symbols default to IEC
+%
+
+\tikzset{
+ circuit logic IEC/.style=
+ {
+ circuit logic,
+ set and gate graphic = and gate IEC graphic,
+ set nand gate graphic = nand gate IEC graphic,
+ set or gate graphic = or gate IEC graphic,
+ set nor gate graphic = nor gate IEC graphic,
+ set xor gate graphic = xor gate IEC graphic,
+ set xnor gate graphic = xnor gate IEC graphic,
+ set not gate graphic = not gate IEC graphic,
+ set buffer gate graphic = buffer gate IEC graphic,
+ %
+ and gate IEC symbol = {$\scriptstyle\char`\&$},
+ nand gate IEC symbol = {$\scriptstyle\char`\&$},
+ or gate IEC symbol = {$\scriptstyle\geq1$},
+ nor gate IEC symbol = {$\scriptstyle\geq1$},
+ xor gate IEC symbol = {$\scriptstyle=1$},
+ xnor gate IEC symbol = {$\scriptstyle=1$},
+ not gate IEC symbol = {$\scriptstyle1$},
+ buffer gate IEC symbol = {$\scriptstyle1$},
+ },
+}%
+
+
+%
+% The logical gate graphics are all nearly identical, so we provide a
+% simple style for creating them:
+%
+\tikzset{
+ circuit logic IEC make graphic/.style=
+ {
+ #1 graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2.5 height 4,
+ shape=#1,
+ inner sep=.5ex
+ }
+ }
+}%
+
+
+\tikzset{
+ circuit logic IEC make graphic=and gate IEC,
+ circuit logic IEC make graphic=nand gate IEC,
+ circuit logic IEC make graphic=or gate IEC,
+ circuit logic IEC make graphic=nor gate IEC,
+ circuit logic IEC make graphic=xor gate IEC,
+ circuit logic IEC make graphic=xnor gate IEC,
+ circuit logic IEC make graphic=not gate IEC,
+ circuit logic IEC make graphic=buffer gate IEC,
+ circuit logic IEC make graphic=and gate CDH,
+ circuit logic IEC make graphic=nand gate CDH,
+}%
+
+
+
+\endinput
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex
new file mode 100644
index 0000000000..b20b4d58ba
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex
@@ -0,0 +1,64 @@
+% Copyright 2018 by Till Tantau and others Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{circuits.logic}%
+\usepgflibrary{shapes.gates.logic.US}%
+
+
+%
+% When this lib is loaded, all symbols default to IEC
+%
+
+\tikzset{
+ circuit logic US/.style=
+ {
+ circuit logic,
+ set and gate graphic = and gate US graphic,
+ set nand gate graphic = nand gate US graphic,
+ set or gate graphic = or gate US graphic,
+ set nor gate graphic = nor gate US graphic,
+ set xor gate graphic = xor gate US graphic,
+ set xnor gate graphic = xnor gate US graphic,
+ set not gate graphic = not gate US graphic,
+ set buffer gate graphic = buffer gate US graphic
+ }
+}%
+
+
+%
+% The logical gate graphics are all nearly identical, so we provide a
+% simple style for creating them:
+%
+\tikzset{
+ circuit logic US make graphic/.style=
+ {
+ #1 graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 0 height 2.5,
+ shape=#1,
+ transform shape
+ }
+ }
+}%
+
+
+\tikzset{
+ circuit logic US make graphic=and gate US,
+ circuit logic US make graphic=nand gate US,
+ circuit logic US make graphic=or gate US,
+ circuit logic US make graphic=nor gate US,
+ circuit logic US make graphic=xor gate US,
+ circuit logic US make graphic=xnor gate US,
+ circuit logic US make graphic=not gate US,
+ circuit logic US make graphic=buffer gate US,
+}%
+
+
+
+\endinput
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex
new file mode 100644
index 0000000000..390d022a8a
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex
@@ -0,0 +1,45 @@
+% Copyright 2018 by Till Tantau and Mark Wibrow
+%
+% 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/generic/pgf/licenses/LICENSE for more details.
+
+\usetikzlibrary{circuits}%
+
+
+
+%
+% Provides a shortcut to the "logic gates inputs" key.
+%
+
+\tikzset{
+ circuit logic/.style={
+ circuit,
+ inputs/.style={logic gate inputs={##1}},
+ logic gate inverted radius=.25\tikzcircuitssizeunit,
+ every circuit logic/.try,
+ }
+}%
+
+
+
+%
+% The default symbols (you need to load a sublib to install the actual rendering).
+%
+
+\tikzset{
+ circuit declare symbol = and gate,
+ circuit declare symbol = nand gate,
+ circuit declare symbol = or gate,
+ circuit declare symbol = nor gate,
+ circuit declare symbol = xor gate,
+ circuit declare symbol = xnor gate,
+ circuit declare symbol = not gate,
+ circuit declare symbol = buffer gate
+}%
+
+
+\endinput