Debian Codegraph @

texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex

raw
1 % Copyright 2018 by Till Tantau and others Wibrow
2 %
3 % This file may be distributed and/or modified
4 %
5 % 1. under the LaTeX Project Public License and/or
6 % 2. under the GNU Public License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10 \usetikzlibrary{circuits.logic}%
11 \usepgflibrary{shapes.gates.logic.IEC}%
12
13
14 %
15 % When this lib is loaded, all symbols default to IEC
16 %
17
18 \tikzset{
19 circuit logic IEC/.style=
20 {
21 circuit logic,
22 set and gate graphic = and gate IEC graphic,
23 set nand gate graphic = nand gate IEC graphic,
24 set or gate graphic = or gate IEC graphic,
25 set nor gate graphic = nor gate IEC graphic,
26 set xor gate graphic = xor gate IEC graphic,
27 set xnor gate graphic = xnor gate IEC graphic,
28 set not gate graphic = not gate IEC graphic,
29 set buffer gate graphic = buffer gate IEC graphic,
30 %
31 and gate IEC symbol = {$\scriptstyle\char`\&$},
32 nand gate IEC symbol = {$\scriptstyle\char`\&$},
33 or gate IEC symbol = {$\scriptstyle\geq1$},
34 nor gate IEC symbol = {$\scriptstyle\geq1$},
35 xor gate IEC symbol = {$\scriptstyle=1$},
36 xnor gate IEC symbol = {$\scriptstyle=1$},
37 not gate IEC symbol = {$\scriptstyle1$},
38 buffer gate IEC symbol = {$\scriptstyle1$},
39 },
40 }%
41
42
43 %
44 % The logical gate graphics are all nearly identical, so we provide a
45 % simple style for creating them:
46 %
47 \tikzset{
48 circuit logic IEC make graphic/.style=
49 {
50 #1 graphic/.style={
51 circuit symbol open,
52 circuit symbol size=width 2.5 height 4,
53 shape=#1,
54 inner sep=.5ex
55 }
56 }
57 }%
58
59
60 \tikzset{
61 circuit logic IEC make graphic=and gate IEC,
62 circuit logic IEC make graphic=nand gate IEC,
63 circuit logic IEC make graphic=or gate IEC,
64 circuit logic IEC make graphic=nor gate IEC,
65 circuit logic IEC make graphic=xor gate IEC,
66 circuit logic IEC make graphic=xnor gate IEC,
67 circuit logic IEC make graphic=not gate IEC,
68 circuit logic IEC make graphic=buffer gate IEC,
69 circuit logic IEC make graphic=and gate CDH,
70 circuit logic IEC make graphic=nand gate CDH,
71 }%
72
73
74
75 \endinput