| 1 |
% Copyright 2019 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{arrows}% |
| 11 |
\usetikzlibrary{circuits.ee}% |
| 12 |
|
| 13 |
\usepgflibrary{shapes.gates.ee.IEC}% |
| 14 |
|
| 15 |
|
| 16 |
% |
| 17 |
% When this lib is loaded, all symbols default to IEC |
| 18 |
% |
| 19 |
|
| 20 |
\tikzset{ |
| 21 |
circuit ee IEC/.style= |
| 22 |
{ |
| 23 |
circuit ee, |
| 24 |
set resistor graphic = resistor IEC graphic, |
| 25 |
set inductor graphic = inductor IEC graphic, |
| 26 |
set capacitor graphic = capacitor IEC graphic, |
| 27 |
set contact graphic = contact IEC graphic, |
| 28 |
set ground graphic = ground IEC graphic, |
| 29 |
set battery graphic = battery IEC graphic, |
| 30 |
set diode graphic = diode IEC graphic, |
| 31 |
set Zener diode graphic = Zener diode IEC graphic, |
| 32 |
set tunnel diode graphic = tunnel diode IEC graphic, |
| 33 |
set backward diode graphic = backward diode IEC graphic, |
| 34 |
set Schottky diode graphic = Schottky diode IEC graphic, |
| 35 |
set breakdown diode graphic = breakdown diode IEC graphic, |
| 36 |
set bulb graphic = bulb IEC graphic, |
| 37 |
set voltage source graphic = voltage source IEC graphic, |
| 38 |
set current source graphic = current source IEC graphic, |
| 39 |
set make contact graphic = make contact IEC graphic, |
| 40 |
set break contact graphic = break contact IEC graphic, |
| 41 |
set amperemeter graphic = amperemeter graphic, |
| 42 |
set voltmeter graphic = voltmeter graphic, |
| 43 |
set ohmmeter graphic = ohmmeter graphic, |
| 44 |
set ac source graphic = ac source graphic, |
| 45 |
set dc source graphic = dc source graphic, |
| 46 |
}, |
| 47 |
}% |
| 48 |
|
| 49 |
|
| 50 |
% |
| 51 |
% Resistors |
| 52 |
% |
| 53 |
|
| 54 |
\tikzset{ |
| 55 |
resistor IEC graphic/.style={ |
| 56 |
circuit symbol open, |
| 57 |
circuit symbol size=width 4 height 1, |
| 58 |
shape=rectangle ee, |
| 59 |
transform shape, |
| 60 |
}, |
| 61 |
var resistor IEC graphic/.style={ |
| 62 |
circuit symbol lines, |
| 63 |
circuit symbol size=width 4.8 height 0.8, |
| 64 |
shape=var resistor IEC, |
| 65 |
transform shape, |
| 66 |
outer sep=0pt, |
| 67 |
cap=round, |
| 68 |
}, |
| 69 |
}% |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
% |
| 74 |
% Inductors |
| 75 |
% |
| 76 |
|
| 77 |
\tikzset{ |
| 78 |
inductor IEC graphic/.style={ |
| 79 |
circuit symbol lines, |
| 80 |
circuit symbol size=width 4 height .5, |
| 81 |
transform shape, |
| 82 |
shape=inductor IEC, |
| 83 |
outer sep=0pt, |
| 84 |
cap=round, |
| 85 |
}, |
| 86 |
var inductor IEC graphic/.style={ |
| 87 |
circuit symbol filled, |
| 88 |
circuit symbol size=width 4 height 1, |
| 89 |
transform shape, |
| 90 |
shape=rectangle ee, |
| 91 |
}, |
| 92 |
}% |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
% |
| 97 |
% Capacitors |
| 98 |
% |
| 99 |
|
| 100 |
\tikzset{ |
| 101 |
capacitor IEC graphic/.style={ |
| 102 |
circuit symbol lines, |
| 103 |
circuit symbol size=width .5 height 2, |
| 104 |
transform shape, |
| 105 |
shape=capacitor IEC, |
| 106 |
}, |
| 107 |
}% |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
% |
| 112 |
% Ground |
| 113 |
% |
| 114 |
|
| 115 |
\tikzset{ |
| 116 |
ground IEC graphic/.style={ |
| 117 |
circuit symbol lines, |
| 118 |
circuit symbol size=width .75 height 2, |
| 119 |
transform shape, |
| 120 |
shape=ground IEC, |
| 121 |
}, |
| 122 |
}% |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
% |
| 128 |
% Battery |
| 129 |
% |
| 130 |
|
| 131 |
\tikzset{ |
| 132 |
battery IEC graphic/.style={ |
| 133 |
circuit symbol lines, |
| 134 |
circuit symbol size=width .5 height 2.5, |
| 135 |
transform shape, |
| 136 |
shape=battery IEC, |
| 137 |
transform shape, |
| 138 |
}, |
| 139 |
}% |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
% |
| 144 |
% Diodes |
| 145 |
% |
| 146 |
|
| 147 |
\tikzset{ |
| 148 |
% |
| 149 |
% normal diode |
| 150 |
% |
| 151 |
diode IEC graphic/.style={ |
| 152 |
circuit symbol open, |
| 153 |
circuit symbol size=width 1.25 height 1.25, |
| 154 |
transform shape, |
| 155 |
shape=generic diode IEC, |
| 156 |
/pgf/generic diode IEC/before background={ |
| 157 |
\pgfpathmoveto{\pgfqpoint{0pt}{-1pt}} |
| 158 |
\pgfpathlineto{\pgfqpoint{0pt}{1pt}} |
| 159 |
\pgfusepathqstroke |
| 160 |
}, |
| 161 |
}, |
| 162 |
var diode IEC graphic/.style={ |
| 163 |
diode IEC graphic, |
| 164 |
circuit symbol filled, |
| 165 |
}, |
| 166 |
}% |
| 167 |
|
| 168 |
\tikzset{ |
| 169 |
% |
| 170 |
% Zener diode |
| 171 |
% |
| 172 |
Zener diode IEC graphic/.style={ |
| 173 |
diode IEC graphic, |
| 174 |
/pgf/generic diode IEC/before background={ |
| 175 |
\pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}} |
| 176 |
\pgfpathlineto{\pgfqpoint{0pt}{-1pt}} |
| 177 |
\pgfpathlineto{\pgfqpoint{0pt}{1pt}} |
| 178 |
\pgfusepathqstroke |
| 179 |
}, |
| 180 |
}, |
| 181 |
var Zener diode IEC graphic/.style={ |
| 182 |
Zener diode IEC graphic, |
| 183 |
circuit symbol filled, |
| 184 |
}, |
| 185 |
}% |
| 186 |
|
| 187 |
\tikzset{ |
| 188 |
% |
| 189 |
% Schottky diode |
| 190 |
% |
| 191 |
Schottky diode IEC graphic/.style={ |
| 192 |
diode IEC graphic, |
| 193 |
/pgf/generic diode IEC/before background={ |
| 194 |
\pgfpathmoveto{\pgfqpoint{-.4pt}{-.6pt}} |
| 195 |
\pgfpathlineto{\pgfqpoint{-.4pt}{-1pt}} |
| 196 |
\pgfpathlineto{\pgfqpoint{0pt}{-1pt}} |
| 197 |
\pgfpathlineto{\pgfqpoint{0pt}{1pt}} |
| 198 |
\pgfpathlineto{\pgfqpoint{.4pt}{1pt}} |
| 199 |
\pgfpathlineto{\pgfqpoint{.4pt}{.6pt}} |
| 200 |
\pgfusepathqstroke |
| 201 |
}, |
| 202 |
}, |
| 203 |
var Schottky diode IEC graphic/.style={ |
| 204 |
Schottky diode IEC graphic, |
| 205 |
circuit symbol filled, |
| 206 |
}, |
| 207 |
}% |
| 208 |
|
| 209 |
\tikzset{ |
| 210 |
% |
| 211 |
% tunnel diode |
| 212 |
% |
| 213 |
tunnel diode IEC graphic/.style={ |
| 214 |
diode IEC graphic, |
| 215 |
/pgf/generic diode IEC/before background={ |
| 216 |
\pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}} |
| 217 |
\pgfpathlineto{\pgfqpoint{0pt}{-1pt}} |
| 218 |
\pgfpathlineto{\pgfqpoint{0pt}{1pt}} |
| 219 |
\pgfpathlineto{\pgfqpoint{-.5pt}{1pt}} |
| 220 |
\pgfusepathqstroke |
| 221 |
}, |
| 222 |
}, |
| 223 |
var tunnel diode IEC graphic/.style={ |
| 224 |
tunnel diode IEC graphic, |
| 225 |
circuit symbol filled, |
| 226 |
}, |
| 227 |
}% |
| 228 |
|
| 229 |
\tikzset{ |
| 230 |
% |
| 231 |
% backward diode |
| 232 |
% |
| 233 |
backward diode IEC graphic/.style={ |
| 234 |
diode IEC graphic, |
| 235 |
/pgf/generic diode IEC/before background={ |
| 236 |
\pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}} |
| 237 |
\pgfpathlineto{\pgfqpoint{.5pt}{-1pt}} |
| 238 |
\pgfpathmoveto{\pgfqpoint{0pt}{-1pt}} |
| 239 |
\pgfpathlineto{\pgfqpoint{0pt}{1pt}} |
| 240 |
\pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}} |
| 241 |
\pgfpathlineto{\pgfqpoint{.5pt}{1pt}} |
| 242 |
\pgfusepathqstroke |
| 243 |
}, |
| 244 |
}, |
| 245 |
var backward diode IEC graphic/.style={ |
| 246 |
backward diode IEC graphic, |
| 247 |
circuit symbol filled, |
| 248 |
}, |
| 249 |
}% |
| 250 |
|
| 251 |
|
| 252 |
\tikzset{ |
| 253 |
% |
| 254 |
% breakdown diode |
| 255 |
% |
| 256 |
breakdown diode IEC graphic/.style={ |
| 257 |
circuit symbol open, |
| 258 |
circuit symbol size=width 2.5 height 1.25, |
| 259 |
transform shape, |
| 260 |
shape=breakdown diode IEC, |
| 261 |
}, |
| 262 |
var breakdown diode IEC graphic/.style={ |
| 263 |
breakdown diode IEC graphic, |
| 264 |
circuit symbol filled, |
| 265 |
}, |
| 266 |
}% |
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
% |
| 271 |
% Contacts |
| 272 |
% |
| 273 |
|
| 274 |
\tikzset{ |
| 275 |
contact IEC graphic/.style={ |
| 276 |
circuit symbol filled, |
| 277 |
circuit symbol size=width .5 height .5, |
| 278 |
shape=circle ee, |
| 279 |
outer sep=.25\pgflinewidth, |
| 280 |
}, |
| 281 |
% connection IEC graphic/.style={ |
| 282 |
% circuit symbol open, |
| 283 |
% circuit symbol size=width 1 height 1, |
| 284 |
% shape=circle ee, |
| 285 |
% outer sep=.25\pgflinewidth, |
| 286 |
% }, |
| 287 |
}% |
| 288 |
|
| 289 |
|
| 290 |
% |
| 291 |
% Bulbs |
| 292 |
% |
| 293 |
|
| 294 |
\tikzset{ |
| 295 |
bulb IEC graphic/.style={ |
| 296 |
circuit symbol lines, |
| 297 |
circuit symbol size=width 1.5 height 1.5, |
| 298 |
shape=generic circle IEC, |
| 299 |
/pgf/generic circle IEC/before background={ |
| 300 |
\pgfpathmoveto{\pgfpointpolar{-135}{1pt}} |
| 301 |
\pgfpathlineto{\pgfpointpolar{45}{1pt}} |
| 302 |
\pgfpathmoveto{\pgfpointpolar{-45}{1pt}} |
| 303 |
\pgfpathlineto{\pgfpointpolar{135}{1pt}} |
| 304 |
\pgfusepathqstroke |
| 305 |
}, |
| 306 |
transform shape, |
| 307 |
}, |
| 308 |
}% |
| 309 |
|
| 310 |
|
| 311 |
% |
| 312 |
% Current and voltage sources |
| 313 |
% |
| 314 |
|
| 315 |
\tikzset{ |
| 316 |
current source IEC graphic/.style={ |
| 317 |
circuit symbol lines, |
| 318 |
circuit symbol size=width 2 height 2, |
| 319 |
shape=generic circle IEC, |
| 320 |
/pgf/generic circle IEC/before background={ |
| 321 |
\pgfpathmoveto{\pgfqpoint{0pt}{-1pt}} |
| 322 |
\pgfpathlineto{\pgfqpoint{0pt}{1pt}} |
| 323 |
\pgfusepathqstroke |
| 324 |
}, |
| 325 |
transform shape, |
| 326 |
}, |
| 327 |
voltage source IEC graphic/.style={ |
| 328 |
circuit symbol lines, |
| 329 |
circuit symbol size=width 2 height 2, |
| 330 |
shape=generic circle IEC, |
| 331 |
/pgf/generic circle IEC/before background={ |
| 332 |
\pgfpathmoveto{\pgfqpoint{-1pt}{0pt}} |
| 333 |
\pgfpathlineto{\pgfqpoint{1pt}{0pt}} |
| 334 |
\pgfusepathqstroke |
| 335 |
}, |
| 336 |
transform shape, |
| 337 |
}, |
| 338 |
}% |
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
% |
| 343 |
% Contacts |
| 344 |
% |
| 345 |
|
| 346 |
\tikzset{ |
| 347 |
make contact IEC graphic/.style={ |
| 348 |
circuit symbol wires, |
| 349 |
circuit symbol size=width 2 height 1, |
| 350 |
transform shape, |
| 351 |
shape=make contact IEC, |
| 352 |
outer sep=0pt, |
| 353 |
cap=round, |
| 354 |
}, |
| 355 |
var make contact IEC graphic/.style={ |
| 356 |
circuit symbol wires, |
| 357 |
circuit symbol size=width 2.4 height 1, |
| 358 |
transform shape, |
| 359 |
shape=var make contact IEC, |
| 360 |
outer sep=0pt, |
| 361 |
cap=round, |
| 362 |
}, |
| 363 |
}% |
| 364 |
|
| 365 |
|
| 366 |
\tikzset{ |
| 367 |
break contact IEC graphic/.style={ |
| 368 |
circuit symbol wires, |
| 369 |
circuit symbol size=width 2 height 1, |
| 370 |
transform shape, |
| 371 |
shape=break contact IEC, |
| 372 |
outer sep=0pt, |
| 373 |
cap=round, |
| 374 |
}, |
| 375 |
}% |
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
% |
| 380 |
% Measurement devices |
| 381 |
% |
| 382 |
|
| 383 |
\tikzset{ |
| 384 |
amperemeter graphic/.style={ |
| 385 |
circuit symbol open, |
| 386 |
circuit symbol size=width 2 height 2, |
| 387 |
transform shape, |
| 388 |
shape=generic circle IEC, |
| 389 |
info=center:A, |
| 390 |
}, |
| 391 |
voltmeter graphic/.style={ |
| 392 |
circuit symbol open, |
| 393 |
circuit symbol size=width 2 height 2, |
| 394 |
transform shape, |
| 395 |
shape=generic circle IEC, |
| 396 |
info=center:V, |
| 397 |
}, |
| 398 |
ohmmeter graphic/.style={ |
| 399 |
circuit symbol open, |
| 400 |
circuit symbol size=width 2 height 2, |
| 401 |
transform shape, |
| 402 |
shape=generic circle IEC, |
| 403 |
info=center:$\Omega$, |
| 404 |
}, |
| 405 |
}% |
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
% |
| 410 |
% AC/DC |
| 411 |
% |
| 412 |
|
| 413 |
\tikzset{ |
| 414 |
ac source graphic/.style={ |
| 415 |
circuit symbol lines, |
| 416 |
circuit symbol size=width 2 height 2, |
| 417 |
shape=generic circle IEC, |
| 418 |
/pgf/generic circle IEC/before background={ |
| 419 |
\pgfpathmoveto{\pgfqpoint{0.7pt}{0pt}} |
| 420 |
\pgfpathquadraticcurveto{\pgfqpoint{ 0.35pt}{-0.5pt}}{\pgfqpoint{0pt}{0pt}} |
| 421 |
\pgfpathquadraticcurveto{\pgfqpoint{-0.35pt}{ 0.5pt}}{\pgfqpoint{-0.7pt}{0pt}} |
| 422 |
\pgfusepathqstroke |
| 423 |
}, |
| 424 |
transform shape, |
| 425 |
}, |
| 426 |
dc source graphic/.style={ |
| 427 |
circuit symbol lines, |
| 428 |
circuit symbol size=width 2 height 2, |
| 429 |
shape=generic circle IEC, |
| 430 |
/pgf/generic circle IEC/before background={ |
| 431 |
\pgfpathmoveto{\pgfqpoint{ 0.7pt}{ 0.2pt}} |
| 432 |
\pgfpathlineto{\pgfqpoint{-0.7pt}{ 0.2pt}} |
| 433 |
\pgfusepathqstroke |
| 434 |
\pgfpathmoveto{\pgfqpoint{ 0.7pt}{-0.2pt}} |
| 435 |
\pgfpathlineto{\pgfqpoint{-0.7pt}{-0.2pt}} |
| 436 |
\pgfusepathqstroke |
| 437 |
}, |
| 438 |
transform shape, |
| 439 |
}, |
| 440 |
}% |
| 441 |
|
| 442 |
\endinput |