summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FILES.byname1104
-rw-r--r--FILES.byname.gzbin2180753 -> 2181013 bytes
-rw-r--r--FILES.last07days1203
-rw-r--r--fonts/libertinus-otf/Changes1
-rw-r--r--fonts/libertinus-otf/doc/libertinus-otf-doc.pdfbin557712 -> 683645 bytes
-rw-r--r--fonts/libertinus-otf/doc/libertinus-otf-doc.tex1092
-rw-r--r--fonts/libertinus-otf/latex/libertinus-otf.sty67
-rw-r--r--graphics/pgf/contrib/circuitikz/README.md2
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex22
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin17617 -> 17749 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin897426 -> 908573 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex64
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz-1.0.sty20155
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty5
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex19
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex130
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex8
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex14
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz-1.0.tex19914
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex5
-rw-r--r--indexing/upmendex/COPYRIGHT2
-rw-r--r--indexing/upmendex/README.md13
-rw-r--r--indexing/upmendex/doc/samples/Makefile2
-rw-r--r--indexing/upmendex/doc/samples/alphabet/Makefile3
-rw-r--r--indexing/upmendex/doc/samples/korean.idx4
-rw-r--r--indexing/upmendex/doc/samples/option/Makefile3
-rw-r--r--indexing/upmendex/source/ChangeLog43
-rw-r--r--indexing/upmendex/source/Makefile.am13
-rw-r--r--indexing/upmendex/source/Makefile.in9
-rw-r--r--indexing/upmendex/source/aclocal.m41
-rwxr-xr-xindexing/upmendex/source/configure92
-rw-r--r--indexing/upmendex/source/configure.ac20
-rw-r--r--indexing/upmendex/source/convert.c3
-rw-r--r--indexing/upmendex/source/fwrite.c19
-rw-r--r--indexing/upmendex/source/main.c4
-rw-r--r--indexing/upmendex/source/sort.c14
-rwxr-xr-xindexing/upmendex/source/tests/upmendex.test2
-rw-r--r--macros/generic/expkv/README.md2
-rw-r--r--macros/generic/expkv/expkv.dtx316
-rw-r--r--macros/generic/expkv/expkv.pdfbin333595 -> 340584 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx119
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdfbin221711 -> 221784 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdfbin65594 -> 65642 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex6
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx2
-rw-r--r--macros/latex/contrib/fontsize/README55
-rw-r--r--macros/latex/contrib/fontsize/fontsize.dtx489
-rw-r--r--macros/latex/contrib/fontsize/fontsize.pdfbin0 -> 617406 bytes
-rw-r--r--macros/latex/contrib/ntgclass/CATALOG (renamed from macros/latex/contrib/ntgclass/catalog.txt)10
-rw-r--r--macros/latex/contrib/ntgclass/ChangeLog348
-rw-r--r--macros/latex/contrib/ntgclass/MANIFEST (renamed from macros/latex/contrib/ntgclass/manifest.txt)13
-rw-r--r--macros/latex/contrib/ntgclass/README (renamed from macros/latex/contrib/ntgclass/00readme.txt)16
-rw-r--r--macros/latex/contrib/ntgclass/a4.dtx62
-rw-r--r--macros/latex/contrib/ntgclass/a4.ins62
-rw-r--r--macros/latex/contrib/ntgclass/a4.pdfbin149067 -> 256462 bytes
-rw-r--r--macros/latex/contrib/ntgclass/artdoc.pdfbin146448 -> 223019 bytes
-rw-r--r--macros/latex/contrib/ntgclass/artdoc.tex30
-rw-r--r--macros/latex/contrib/ntgclass/brief-sample.pdfbin0 -> 63097 bytes
-rw-r--r--macros/latex/contrib/ntgclass/brief-sample.tex (renamed from macros/latex/contrib/ntgclass/brief.tex)30
-rw-r--r--macros/latex/contrib/ntgclass/brief.dtx291
-rw-r--r--macros/latex/contrib/ntgclass/brief.pdfbin198831 -> 348927 bytes
-rw-r--r--macros/latex/contrib/ntgclass/briefdoc.pdfbin81879 -> 129699 bytes
-rw-r--r--macros/latex/contrib/ntgclass/briefdoc.tex30
-rw-r--r--macros/latex/contrib/ntgclass/changes.txt5
-rw-r--r--macros/latex/contrib/ntgclass/classdoc.pdfbin69777 -> 131160 bytes
-rw-r--r--macros/latex/contrib/ntgclass/classdoc.tex30
-rw-r--r--macros/latex/contrib/ntgclass/ntgclass.dtx349
-rw-r--r--macros/latex/contrib/ntgclass/ntgclass.ins66
-rw-r--r--macros/latex/contrib/ntgclass/ntgclass.pdfbin376559 -> 485753 bytes
-rw-r--r--macros/latex/contrib/ntgclass/ntgstyle.pdfbin0 -> 79755 bytes
-rw-r--r--macros/latex/contrib/ntgclass/ntgstyle.tex128
-rw-r--r--macros/latex/contrib/ntgclass/rapdoc.pdfbin138589 -> 202501 bytes
-rw-r--r--macros/latex/contrib/ntgclass/rapdoc.tex30
-rw-r--r--macros/latex/contrib/ntgclass/rapport.dtx3560
-rw-r--r--macros/latex/contrib/ntgclass/wijzer.dtx3560
-rw-r--r--macros/latex/contrib/overpic/overpic.dtx25
-rw-r--r--macros/latex/contrib/overpic/overpic.ins2
-rw-r--r--macros/latex/contrib/overpic/overpic.pdfbin347489 -> 371275 bytes
-rw-r--r--macros/latex/contrib/suftesi/suftesi.dtx581
-rw-r--r--macros/latex/contrib/suftesi/suftesi.pdfbin1111704 -> 761080 bytes
-rw-r--r--macros/latex/contrib/xsim/README4
-rw-r--r--macros/latex/contrib/xsim/code/xsim.auxfile.code.tex15
-rw-r--r--macros/latex/contrib/xsim/code/xsim.base.code.tex16
-rw-r--r--macros/latex/contrib/xsim/code/xsim.blanks.code.tex5
-rw-r--r--macros/latex/contrib/xsim/code/xsim.collections.code.tex8
-rw-r--r--macros/latex/contrib/xsim/code/xsim.definitions.code.tex32
-rw-r--r--macros/latex/contrib/xsim/code/xsim.environments.code.tex80
-rw-r--r--macros/latex/contrib/xsim/code/xsim.exercises.code.tex72
-rw-r--r--macros/latex/contrib/xsim/code/xsim.goals.code.tex92
-rw-r--r--macros/latex/contrib/xsim/code/xsim.properties.code.tex40
-rw-r--r--macros/latex/contrib/xsim/code/xsim.random.code.tex32
-rw-r--r--macros/latex/contrib/xsim/code/xsim.solutions.code.tex4
-rw-r--r--macros/latex/contrib/xsim/code/xsim.sty40
-rw-r--r--macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex4
-rw-r--r--macros/latex/contrib/xsim/code/xsimverb.sty8
-rw-r--r--macros/latex/contrib/xsim/doc/xsim-manual.cls15
-rw-r--r--macros/latex/contrib/xsim/doc/xsim.history12
-rw-r--r--macros/latex/contrib/xsim/doc/xsim.ideas1
-rw-r--r--macros/latex/contrib/xsim/doc/xsim_manual.pdfbin1231162 -> 1231179 bytes
-rw-r--r--macros/latex/contrib/xsim/doc/xsim_manual.tex86
-rw-r--r--macros/luatex/latex/emoji/README.md35
-rw-r--r--macros/luatex/latex/emoji/emoji-doc.pdfbin0 -> 629877 bytes
-rw-r--r--macros/luatex/latex/emoji/emoji-doc.tex1791
-rw-r--r--macros/luatex/latex/emoji/emoji.sty1592
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm7
-rw-r--r--systems/texlive/tlnet/tlpkg/texlive.tlpdb200
-rw-r--r--systems/texlive/tlnet/tlpkg/texlive.tlpdb.md52
-rw-r--r--systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha5122
-rw-r--r--systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc14
-rw-r--r--systems/texlive/tlnet/tlpkg/texlive.tlpdb.xzbin2173744 -> 2171508 bytes
-rw-r--r--systems/win32/miktex/tm/packages/files.csv.lzmabin528527 -> 528480 bytes
-rw-r--r--systems/win32/miktex/tm/packages/next/pr.ini6
-rw-r--r--systems/win32/miktex/tm/packages/pr.ini8
-rw-r--r--systems/win32/w32tex/ChangeLog24
-rw-r--r--timestamp2
140 files changed, 56003 insertions, 2565 deletions
diff --git a/FILES.byname b/FILES.byname
index 44d21360e6..aafab135b3 100644
--- a/FILES.byname
+++ b/FILES.byname
@@ -4993,7 +4993,7 @@
1990/10/02 | 812 | dviware/vutex/vaxvms.ins
1990/10/02 | 127576 | dviware/vutex/vutex.web
2014/04/13 | 4600576 | dviware/xdvi/22.87/xdvik-22.87.tar.gz
-2020/02/21 | 224402 | FILES.last07days
+2020/02/22 | 207511 | FILES.last07days
2018/06/27 | 99883 | fonts/academicons/academicons.pdf
2018/06/27 | 10779 | fonts/academicons/academicons.sty
2018/06/27 | 5774 | fonts/academicons/academicons.tex
@@ -60100,12 +60100,12 @@
2019/07/11 | 2529 | fonts/libertinus-fonts/README.txt
2019/07/11 | 7198913 | fonts/libertinus-fonts.zip
2018/09/03 | 1016 | fonts/libertinus/latex/libertinus.sty
-2020/02/08 | 1543 | fonts/libertinus-otf/Changes
-2020/02/08 | 557712 | fonts/libertinus-otf/doc/libertinus-otf-doc.pdf
-2020/02/08 | 38870 | fonts/libertinus-otf/doc/libertinus-otf-doc.tex
-2020/02/08 | 22525 | fonts/libertinus-otf/latex/libertinus-otf.sty
+2020/02/22 | 1616 | fonts/libertinus-otf/Changes
+2020/02/22 | 683645 | fonts/libertinus-otf/doc/libertinus-otf-doc.pdf
+2020/02/22 | 58135 | fonts/libertinus-otf/doc/libertinus-otf-doc.tex
+2020/02/22 | 24872 | fonts/libertinus-otf/latex/libertinus-otf.sty
2020/02/08 | 408 | fonts/libertinus-otf/README.md
-2020/02/08 | 541754 | fonts/libertinus-otf.zip
+2020/02/22 | 658510 | fonts/libertinus-otf.zip
2018/09/04 | 488 | fonts/libertinus/README.md
2017/08/17 | 5490 | fonts/libertinust1math/afm/BDXsfmi-bol.afm
2017/08/12 | 5698 | fonts/libertinust1math/afm/BDXsfmi-reg.afm
@@ -133719,42 +133719,44 @@
2019/04/14 | 24014 | graphics/pgf/contrib/chordbox/chordbox.tex
2019/04/14 | 1125 | graphics/pgf/contrib/chordbox/README.md
2019/04/15 | 567774 | graphics/pgf/contrib/chordbox.zip
-2020/02/04 | 21465 | graphics/pgf/contrib/circuitikz/doc/changelog.tex
-2020/02/04 | 17617 | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
-2020/02/04 | 938 | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.tex
-2020/02/04 | 897426 | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
-2020/02/04 | 292428 | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
-2020/02/04 | 418 | graphics/pgf/contrib/circuitikz/doc/compatibility.tex
-2020/02/04 | 5687 | graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty
-2020/02/04 | 3276 | graphics/pgf/contrib/circuitikz/README.md
-2020/02/04 | 364086 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.4.sty
-2020/02/04 | 393856 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.6.sty
-2020/02/04 | 403539 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.7.sty
-2020/02/04 | 422268 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.8.3.sty
-2020/02/04 | 690730 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.3.sty
-2020/02/04 | 758990 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.6.sty
-2020/02/04 | 10839 | graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
-2020/02/04 | 280 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-example.tex
-2020/02/04 | 3098 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-legacy.tex
-2020/02/04 | 1875 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex
-2020/02/04 | 191511 | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
-2020/02/04 | 7749 | graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex
-2020/02/04 | 91397 | graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
-2020/02/04 | 7477 | graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex
-2020/02/04 | 14053 | graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
-2020/02/04 | 46195 | graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex
-2020/02/04 | 95276 | graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex
-2020/02/04 | 58658 | graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
-2020/02/04 | 34841 | graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
-2020/02/04 | 30851 | graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
-2020/02/04 | 226045 | graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
-2020/02/04 | 1887 | graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
-2020/02/04 | 23460 | graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex
-2020/02/04 | 416850 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.8.3.tex
-2020/02/04 | 683433 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.9.3.tex
-2020/02/04 | 751663 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.9.6.tex
-2020/02/04 | 3519 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
-2020/02/04 | 1562149 | graphics/pgf/contrib/circuitikz.zip
+2020/02/22 | 22183 | graphics/pgf/contrib/circuitikz/doc/changelog.tex
+2020/02/22 | 17749 | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+2020/02/22 | 938 | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.tex
+2020/02/22 | 908573 | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+2020/02/22 | 295279 | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+2020/02/22 | 418 | graphics/pgf/contrib/circuitikz/doc/compatibility.tex
+2020/02/22 | 5687 | graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty
+2020/02/22 | 3156 | graphics/pgf/contrib/circuitikz/README.md
+2020/02/22 | 364086 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.4.sty
+2020/02/22 | 393856 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.6.sty
+2020/02/22 | 403539 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.7.sty
+2020/02/22 | 422268 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.8.3.sty
+2020/02/22 | 690730 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.3.sty
+2020/02/22 | 758990 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.6.sty
+2020/02/22 | 841461 | graphics/pgf/contrib/circuitikz/tex/circuitikz-1.0.sty
+2020/02/22 | 10910 | graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+2020/02/22 | 280 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-example.tex
+2020/02/22 | 3098 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-legacy.tex
+2020/02/22 | 1875 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex
+2020/02/22 | 193586 | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+2020/02/22 | 7749 | graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex
+2020/02/22 | 91976 | graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
+2020/02/22 | 7477 | graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex
+2020/02/22 | 14053 | graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
+2020/02/22 | 46195 | graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex
+2020/02/22 | 95276 | graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex
+2020/02/22 | 59121 | graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
+2020/02/22 | 34841 | graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
+2020/02/22 | 30851 | graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
+2020/02/22 | 226045 | graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+2020/02/22 | 2305 | graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
+2020/02/22 | 23460 | graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex
+2020/02/22 | 416850 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.8.3.tex
+2020/02/22 | 683433 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.9.3.tex
+2020/02/22 | 751663 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.9.6.tex
+2020/02/22 | 834142 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-1.0.tex
+2020/02/22 | 3590 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+2020/02/22 | 1748109 | graphics/pgf/contrib/circuitikz.zip
2019/07/12 | 14811 | graphics/pgf/contrib/codeanatomy/codeanatomy.dtx
2019/07/12 | 1475 | graphics/pgf/contrib/codeanatomy/codeanatomy.ins
2019/07/12 | 123921 | graphics/pgf/contrib/codeanatomy/codeanatomy.lstlisting.pdf
@@ -137729,88 +137731,88 @@
2006/07/18 | 22933 | indexing/texindex/texindex.pdf
1991/07/08 | 1930 | indexing/texindex/texindex.tex
2006/07/18 | 21351 | indexing/texindex.zip
-2019/03/16 | 1464 | indexing/upmendex/COPYRIGHT
-2019/03/16 | 1992 | indexing/upmendex/doc/samples/alphabet/alpha_es.idx
-2019/03/16 | 4039 | indexing/upmendex/doc/samples/alphabet/alpha_zh.idx
-2019/03/16 | 1891 | indexing/upmendex/doc/samples/alphabet/alpha_zhp.idx
-2019/03/16 | 4485 | indexing/upmendex/doc/samples/alphabet/alpha_zhr.idx
-2019/03/16 | 1200 | indexing/upmendex/doc/samples/alphabet/alpha_zhs.idx
-2019/03/16 | 2144 | indexing/upmendex/doc/samples/alphabet/alpha_zhz.idx
-2019/03/16 | 959 | indexing/upmendex/doc/samples/alphabet/Makefile
-2019/03/16 | 300 | indexing/upmendex/doc/samples/alphabet/mdxsty_es11.ist
-2019/03/16 | 301 | indexing/upmendex/doc/samples/alphabet/mdxsty_es12.ist
-2019/03/16 | 300 | indexing/upmendex/doc/samples/alphabet/mdxsty_es13.ist
-2019/03/16 | 278 | indexing/upmendex/doc/samples/alphabet/mdxsty_es1.ist
-2019/03/16 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_es21.ist
-2019/03/16 | 296 | indexing/upmendex/doc/samples/alphabet/mdxsty_es22.ist
-2019/03/16 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_es23.ist
-2019/03/16 | 279 | indexing/upmendex/doc/samples/alphabet/mdxsty_es2.ist
-2019/03/16 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh11.ist
-2019/03/16 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh12.ist
-2019/03/16 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh13.ist
-2019/03/16 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh14.ist
-2019/03/16 | 278 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh1.ist
-2019/03/16 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh21.ist
-2019/03/16 | 521 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh22.ist
-2019/03/16 | 279 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh2.ist
-2019/03/16 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh31.ist
-2019/03/16 | 435 | indexing/upmendex/doc/samples/french.idx
-2019/03/16 | 463 | indexing/upmendex/doc/samples/german.idx
-2019/03/16 | 340 | indexing/upmendex/doc/samples/greek.idx
-2019/03/16 | 1474 | indexing/upmendex/doc/samples/korean.idx
-2019/03/16 | 345 | indexing/upmendex/doc/samples/Makefile
-2019/03/16 | 260 | indexing/upmendex/doc/samples/mdxsty00.ist
-2019/03/16 | 289 | indexing/upmendex/doc/samples/mdxsty01.ist
-2019/03/16 | 552 | indexing/upmendex/doc/samples/mdxsty02.ist
-2019/03/16 | 326 | indexing/upmendex/doc/samples/multi.idx
-2019/03/16 | 1095 | indexing/upmendex/doc/samples/option/attri1.idx
-2019/03/16 | 872 | indexing/upmendex/doc/samples/option/japanese.idx
-2019/03/16 | 722 | indexing/upmendex/doc/samples/option/Makefile
-2019/03/16 | 271 | indexing/upmendex/doc/samples/option/mdxsty_j00.ist
-2019/03/16 | 271 | indexing/upmendex/doc/samples/option/mdxsty_j01.ist
-2019/03/16 | 285 | indexing/upmendex/doc/samples/option/mdxsty_j02.ist
-2019/03/16 | 334 | indexing/upmendex/doc/samples/option/mdxsty_rule0.ist
-2019/03/16 | 614 | indexing/upmendex/doc/samples/russian.idx
-2019/03/16 | 16668 | indexing/upmendex/doc/upmendex.ja.txt
-2019/03/16 | 16358 | indexing/upmendex/man/upmendex.1
-2019/03/16 | 311434 | indexing/upmendex/man/upmendex.man1.pdf
-2019/03/16 | 2884 | indexing/upmendex/README.md
-2019/03/16 | 43928 | indexing/upmendex/source/aclocal.m4
-2019/03/16 | 337 | indexing/upmendex/source/ac/withenable.ac
-2019/03/16 | 4908 | indexing/upmendex/source/c-auto.in
-2019/03/16 | 2951 | indexing/upmendex/source/ChangeLog
-2019/03/16 | 698430 | indexing/upmendex/source/configure
-2019/03/16 | 1595 | indexing/upmendex/source/configure.ac
-2019/03/16 | 9244 | indexing/upmendex/source/convert.c
-2019/03/16 | 412 | indexing/upmendex/source/exhanzi.h
-2019/03/16 | 729 | indexing/upmendex/source/exkana.h
-2019/03/16 | 1291 | indexing/upmendex/source/exvar.h
-2019/03/16 | 12966 | indexing/upmendex/source/fread.c
-2019/03/16 | 27539 | indexing/upmendex/source/fwrite.c
-2019/03/16 | 19515 | indexing/upmendex/source/hanzi.h
-2019/03/16 | 333 | indexing/upmendex/source/indexsty
-2019/03/16 | 3891 | indexing/upmendex/source/kana.h
-2019/03/16 | 1190 | indexing/upmendex/source/kp.c
-2019/03/16 | 406 | indexing/upmendex/source/kp.h
-2019/03/16 | 1842 | indexing/upmendex/source/ktable.h
-2019/03/16 | 7492 | indexing/upmendex/source/main.c
-2019/03/16 | 1199 | indexing/upmendex/source/Makefile.am
-2019/03/16 | 46213 | indexing/upmendex/source/Makefile.in
-2019/03/16 | 2329 | indexing/upmendex/source/mendex.h
-2019/03/16 | 1052 | indexing/upmendex/source/pageread.c
-2019/03/16 | 5842 | indexing/upmendex/source/qsort.c
-2019/03/16 | 400 | indexing/upmendex/source/qsort.h
-2019/03/16 | 12667 | indexing/upmendex/source/sort.c
-2019/03/16 | 10083 | indexing/upmendex/source/styfile.c
-2019/03/16 | 68 | indexing/upmendex/source/tests/foo.idx
-2019/03/16 | 58 | indexing/upmendex/source/tests/foo.ind
-2019/03/16 | 64 | indexing/upmendex/source/tests/uni.dict
-2019/03/16 | 435 | indexing/upmendex/source/tests/uni.idx
-2019/03/16 | 766 | indexing/upmendex/source/tests/uni.ind
-2019/03/16 | 272 | indexing/upmendex/source/tests/uni.ist
-2019/03/16 | 848 | indexing/upmendex/source/tests/upmendex.test
-2019/03/16 | 2105 | indexing/upmendex/source/var.h
-2019/03/16 | 507523 | indexing/upmendex.zip
+2020/02/22 | 1464 | indexing/upmendex/COPYRIGHT
+2020/02/22 | 1992 | indexing/upmendex/doc/samples/alphabet/alpha_es.idx
+2020/02/22 | 4039 | indexing/upmendex/doc/samples/alphabet/alpha_zh.idx
+2020/02/22 | 1891 | indexing/upmendex/doc/samples/alphabet/alpha_zhp.idx
+2020/02/22 | 4485 | indexing/upmendex/doc/samples/alphabet/alpha_zhr.idx
+2020/02/22 | 1200 | indexing/upmendex/doc/samples/alphabet/alpha_zhs.idx
+2020/02/22 | 2144 | indexing/upmendex/doc/samples/alphabet/alpha_zhz.idx
+2020/02/22 | 986 | indexing/upmendex/doc/samples/alphabet/Makefile
+2020/02/22 | 300 | indexing/upmendex/doc/samples/alphabet/mdxsty_es11.ist
+2020/02/22 | 301 | indexing/upmendex/doc/samples/alphabet/mdxsty_es12.ist
+2020/02/22 | 300 | indexing/upmendex/doc/samples/alphabet/mdxsty_es13.ist
+2020/02/22 | 278 | indexing/upmendex/doc/samples/alphabet/mdxsty_es1.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_es21.ist
+2020/02/22 | 296 | indexing/upmendex/doc/samples/alphabet/mdxsty_es22.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_es23.ist
+2020/02/22 | 279 | indexing/upmendex/doc/samples/alphabet/mdxsty_es2.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh11.ist
+2020/02/22 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh12.ist
+2020/02/22 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh13.ist
+2020/02/22 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh14.ist
+2020/02/22 | 278 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh1.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh21.ist
+2020/02/22 | 521 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh22.ist
+2020/02/22 | 279 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh2.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh31.ist
+2020/02/22 | 435 | indexing/upmendex/doc/samples/french.idx
+2020/02/22 | 463 | indexing/upmendex/doc/samples/german.idx
+2020/02/22 | 340 | indexing/upmendex/doc/samples/greek.idx
+2020/02/22 | 1477 | indexing/upmendex/doc/samples/korean.idx
+2020/02/22 | 371 | indexing/upmendex/doc/samples/Makefile
+2020/02/22 | 260 | indexing/upmendex/doc/samples/mdxsty00.ist
+2020/02/22 | 289 | indexing/upmendex/doc/samples/mdxsty01.ist
+2020/02/22 | 552 | indexing/upmendex/doc/samples/mdxsty02.ist
+2020/02/22 | 326 | indexing/upmendex/doc/samples/multi.idx
+2020/02/22 | 1095 | indexing/upmendex/doc/samples/option/attri1.idx
+2020/02/22 | 872 | indexing/upmendex/doc/samples/option/japanese.idx
+2020/02/22 | 749 | indexing/upmendex/doc/samples/option/Makefile
+2020/02/22 | 271 | indexing/upmendex/doc/samples/option/mdxsty_j00.ist
+2020/02/22 | 271 | indexing/upmendex/doc/samples/option/mdxsty_j01.ist
+2020/02/22 | 285 | indexing/upmendex/doc/samples/option/mdxsty_j02.ist
+2020/02/22 | 334 | indexing/upmendex/doc/samples/option/mdxsty_rule0.ist
+2020/02/22 | 614 | indexing/upmendex/doc/samples/russian.idx
+2020/02/22 | 16668 | indexing/upmendex/doc/upmendex.ja.txt
+2020/02/22 | 16358 | indexing/upmendex/man/upmendex.1
+2020/02/22 | 311434 | indexing/upmendex/man/upmendex.man1.pdf
+2020/02/22 | 2977 | indexing/upmendex/README.md
+2020/02/22 | 43971 | indexing/upmendex/source/aclocal.m4
+2020/02/22 | 337 | indexing/upmendex/source/ac/withenable.ac
+2020/02/22 | 4908 | indexing/upmendex/source/c-auto.in
+2020/02/22 | 4393 | indexing/upmendex/source/ChangeLog
+2020/02/22 | 700167 | indexing/upmendex/source/configure
+2020/02/22 | 2318 | indexing/upmendex/source/configure.ac
+2020/02/22 | 9288 | indexing/upmendex/source/convert.c
+2020/02/22 | 412 | indexing/upmendex/source/exhanzi.h
+2020/02/22 | 729 | indexing/upmendex/source/exkana.h
+2020/02/22 | 1291 | indexing/upmendex/source/exvar.h
+2020/02/22 | 12966 | indexing/upmendex/source/fread.c
+2020/02/22 | 27948 | indexing/upmendex/source/fwrite.c
+2020/02/22 | 19515 | indexing/upmendex/source/hanzi.h
+2020/02/22 | 333 | indexing/upmendex/source/indexsty
+2020/02/22 | 3891 | indexing/upmendex/source/kana.h
+2020/02/22 | 1190 | indexing/upmendex/source/kp.c
+2020/02/22 | 406 | indexing/upmendex/source/kp.h
+2020/02/22 | 1842 | indexing/upmendex/source/ktable.h
+2020/02/22 | 7492 | indexing/upmendex/source/main.c
+2020/02/22 | 1173 | indexing/upmendex/source/Makefile.am
+2020/02/22 | 46330 | indexing/upmendex/source/Makefile.in
+2020/02/22 | 2329 | indexing/upmendex/source/mendex.h
+2020/02/22 | 1052 | indexing/upmendex/source/pageread.c
+2020/02/22 | 5842 | indexing/upmendex/source/qsort.c
+2020/02/22 | 400 | indexing/upmendex/source/qsort.h
+2020/02/22 | 13004 | indexing/upmendex/source/sort.c
+2020/02/22 | 10083 | indexing/upmendex/source/styfile.c
+2020/02/22 | 68 | indexing/upmendex/source/tests/foo.idx
+2020/02/22 | 58 | indexing/upmendex/source/tests/foo.ind
+2020/02/22 | 64 | indexing/upmendex/source/tests/uni.dict
+2020/02/22 | 435 | indexing/upmendex/source/tests/uni.idx
+2020/02/22 | 766 | indexing/upmendex/source/tests/uni.ind
+2020/02/22 | 272 | indexing/upmendex/source/tests/uni.ist
+2020/02/22 | 800 | indexing/upmendex/source/tests/upmendex.test
+2020/02/22 | 2105 | indexing/upmendex/source/var.h
+2020/02/22 | 509316 | indexing/upmendex.zip
2019/11/22 | 1116 | indexing/xindex/CHANGELOG
2019/10/31 | 1232 | indexing/xindex/doc/Makefile
2018/10/09 | 32092 | indexing/xindex/doc/tests/buch.idx
@@ -161568,7 +161570,7 @@
2020/01/08 | 13014086 | install/graphics/pgf/base/pgf.tds.zip
2013/02/23 | 92056 | install/graphics/pgf/contrib/battleship.tds.zip
2016/02/19 | 701759 | install/graphics/pgf/contrib/celtic.tds.zip
-2020/02/04 | 1574019 | install/graphics/pgf/contrib/circuitikz.tds.zip
+2020/02/22 | 1760394 | install/graphics/pgf/contrib/circuitikz.tds.zip
2017/06/01 | 1005947 | install/graphics/pgf/contrib/hobby.tds.zip
2014/06/15 | 843875 | install/graphics/pgf/contrib/logicpuzzle.tds.zip
2018/07/11 | 969430 | install/graphics/pgf/contrib/penrose.tds.zip
@@ -161599,7 +161601,7 @@
2015/11/14 | 558928 | install/macros/generic/catcodes.tds.zip
2015/11/16 | 603358 | install/macros/generic/commado.tds.zip
2015/11/14 | 1248858 | install/macros/generic/dowith.tds.zip
-2020/01/22 | 346352 | install/macros/generic/expkv.tds.zip
+2020/02/22 | 354609 | install/macros/generic/expkv.tds.zip
2012/09/20 | 321508 | install/macros/generic/langcode.tds.zip
2019/04/30 | 596514 | install/macros/generic/markdown.tds.zip
2014/06/11 | 428488 | install/macros/generic/mathdots.tds.zip
@@ -161894,7 +161896,7 @@
2019/03/20 | 7942984 | install/macros/latex/contrib/stex.tds.zip
2011/12/21 | 204538 | install/macros/latex/contrib/storebox.tds.zip
2019/11/30 | 800764 | install/macros/latex/contrib/stringenc.tds.zip
-2020/02/11 | 1841412 | install/macros/latex/contrib/suftesi.tds.zip
+2020/02/22 | 1495487 | install/macros/latex/contrib/suftesi.tds.zip
2012/05/06 | 463336 | install/macros/latex/contrib/svn-multi.tds.zip
2010/04/24 | 261363 | install/macros/latex/contrib/svn-prov.tds.zip
2014/05/20 | 721827 | install/macros/latex/contrib/sympytexpackage.tds.zip
@@ -174808,10 +174810,10 @@
2017/05/25 | 50653 | macros/generic/expex/expex.tex
2017/05/25 | 1673 | macros/generic/expex/README
2017/05/26 | 498764 | macros/generic/expex.zip
-2020/01/22 | 53076 | macros/generic/expkv/expkv.dtx
-2020/01/22 | 333595 | macros/generic/expkv/expkv.pdf
-2020/01/22 | 1264 | macros/generic/expkv/README.md
-2020/01/22 | 342257 | macros/generic/expkv.zip
+2020/02/22 | 56974 | macros/generic/expkv/expkv.dtx
+2020/02/22 | 340584 | macros/generic/expkv/expkv.pdf
+2020/02/22 | 1264 | macros/generic/expkv/README.md
+2020/02/22 | 350477 | macros/generic/expkv.zip
2007/04/19 | 1285 | macros/generic/fenixpar/fenixpar.sty
2011/11/18 | 8382 | macros/generic/fenixpar/fenixtok.sty
2011/11/18 | 312 | macros/generic/fenixpar/README
@@ -179926,41 +179928,41 @@
2019/12/02 | 4874 | macros/latex/contrib/biblatex-contrib/biblatex-apa6/swedish-apa6.lbx
2019/12/02 | 8239 | macros/latex/contrib/biblatex-contrib/biblatex-apa6/swissgerman-apa6.lbx
2019/12/02 | 283026 | macros/latex/contrib/biblatex-contrib/biblatex-apa6.zip
-2020/02/01 | 14523 | macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
-2020/02/01 | 63832 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
-2020/02/01 | 18831 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
-2020/02/01 | 2048 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
-2020/02/01 | 12280 | macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
-2020/02/01 | 65594 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
-2020/02/01 | 12785 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-citations.bib
-2020/02/01 | 221711 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
-2020/02/01 | 91854 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib
-2020/02/01 | 32559 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.tex
-2020/02/01 | 18770 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
-2020/02/01 | 9142 | macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
-2020/02/01 | 8988 | macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
-2020/02/01 | 9459 | macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
-2020/02/01 | 9093 | macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
-2020/02/01 | 9114 | macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
-2020/02/01 | 9356 | macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
-2020/02/01 | 10017 | macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
-2020/02/01 | 12253 | macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
-2020/02/01 | 10457 | macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
-2020/02/01 | 9414 | macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
-2020/02/01 | 12296 | macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
-2020/02/01 | 12394 | macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
-2020/02/01 | 9136 | macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
-2020/02/01 | 9136 | macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
-2020/02/01 | 12304 | macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
-2020/02/01 | 9152 | macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
-2020/02/01 | 9108 | macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
-2020/02/01 | 1744 | macros/latex/contrib/biblatex-contrib/biblatex-apa/README
-2020/02/01 | 9776 | macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
-2020/02/01 | 9768 | macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
-2020/02/01 | 10015 | macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
-2020/02/01 | 8956 | macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
-2020/02/01 | 12386 | macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
-2020/02/01 | 394191 | macros/latex/contrib/biblatex-contrib/biblatex-apa.zip
+2020/02/22 | 14523 | macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
+2020/02/22 | 64239 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
+2020/02/22 | 18831 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
+2020/02/22 | 2048 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
+2020/02/22 | 12280 | macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
+2020/02/22 | 65642 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
+2020/02/22 | 12785 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-citations.bib
+2020/02/22 | 221784 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
+2020/02/22 | 91854 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib
+2020/02/22 | 32559 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.tex
+2020/02/22 | 18833 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
+2020/02/22 | 9142 | macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
+2020/02/22 | 8988 | macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
+2020/02/22 | 9459 | macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
+2020/02/22 | 9093 | macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
+2020/02/22 | 9114 | macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
+2020/02/22 | 9356 | macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
+2020/02/22 | 10017 | macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
+2020/02/22 | 12253 | macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
+2020/02/22 | 10457 | macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
+2020/02/22 | 9414 | macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
+2020/02/22 | 12296 | macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
+2020/02/22 | 12394 | macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
+2020/02/22 | 9136 | macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
+2020/02/22 | 9136 | macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
+2020/02/22 | 12304 | macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
+2020/02/22 | 9152 | macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
+2020/02/22 | 9108 | macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
+2020/02/22 | 1744 | macros/latex/contrib/biblatex-contrib/biblatex-apa/README
+2020/02/22 | 9776 | macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
+2020/02/22 | 9768 | macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
+2020/02/22 | 10015 | macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
+2020/02/22 | 8956 | macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
+2020/02/22 | 12386 | macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
+2020/02/22 | 394431 | macros/latex/contrib/biblatex-contrib/biblatex-apa.zip
2019/12/30 | 57853 | macros/latex/contrib/biblatex-contrib/biblatex-archaeology/biblatex-archaeology.conf
2019/12/30 | 1289045 | macros/latex/contrib/biblatex-contrib/biblatex-archaeology/biblatex-archaeology.dtx
2019/12/30 | 41339 | macros/latex/contrib/biblatex-contrib/biblatex-archaeology/biblatex-archaeology.ins
@@ -187651,6 +187653,10 @@
2019/12/20 | 20472 | macros/latex/contrib/fontsetup/system-install-fonts/fsplpscel.otf
2019/12/20 | 17944 | macros/latex/contrib/fontsetup/system-install-fonts/fspmnscel.otf
2019/12/20 | 1479016 | macros/latex/contrib/fontsetup.zip
+2020/02/22 | 17143 | macros/latex/contrib/fontsize/fontsize.dtx
+2020/02/22 | 617406 | macros/latex/contrib/fontsize/fontsize.pdf
+2020/02/22 | 1521 | macros/latex/contrib/fontsize/README
+2020/02/22 | 619720 | macros/latex/contrib/fontsize.zip
2020/02/21 | 21927 | macros/latex/contrib/fontspec/CHANGES.md
2020/02/21 | 549 | macros/latex/contrib/fontspec/fontspec.cfg
2020/02/21 | 12465 | macros/latex/contrib/fontspec/fontspec-code-api.dtx
@@ -194553,28 +194559,33 @@
2000/07/24 | 1906 | macros/latex/contrib/ntabbing/ntabbing.sty
2000/07/24 | 2850 | macros/latex/contrib/ntabbing/ntabbing.tex
2005/06/02 | 74502 | macros/latex/contrib/ntabbing.zip
-2004/02/20 | 1020 | macros/latex/contrib/ntgclass/00readme.txt
-2004/04/15 | 22127 | macros/latex/contrib/ntgclass/a4.dtx
-2004/06/08 | 3008 | macros/latex/contrib/ntgclass/a4.ins
-2004/04/15 | 149067 | macros/latex/contrib/ntgclass/a4.pdf
-2004/04/15 | 146448 | macros/latex/contrib/ntgclass/artdoc.pdf
-2004/02/20 | 27335 | macros/latex/contrib/ntgclass/artdoc.tex
-2004/04/15 | 81879 | macros/latex/contrib/ntgclass/briefdoc.pdf
-2004/02/20 | 12564 | macros/latex/contrib/ntgclass/briefdoc.tex
-2004/02/20 | 88012 | macros/latex/contrib/ntgclass/brief.dtx
-2004/04/16 | 198831 | macros/latex/contrib/ntgclass/brief.pdf
-2004/02/20 | 8750 | macros/latex/contrib/ntgclass/brief.tex
-2004/02/20 | 661 | macros/latex/contrib/ntgclass/catalog.txt
-2004/02/20 | 149 | macros/latex/contrib/ntgclass/changes.txt
-2004/04/16 | 69777 | macros/latex/contrib/ntgclass/classdoc.pdf
-2004/02/20 | 6880 | macros/latex/contrib/ntgclass/classdoc.tex
-2004/04/16 | 1291 | macros/latex/contrib/ntgclass/manifest.txt
-2004/06/08 | 177592 | macros/latex/contrib/ntgclass/ntgclass.dtx
-2004/06/08 | 3878 | macros/latex/contrib/ntgclass/ntgclass.ins
-2004/06/08 | 376559 | macros/latex/contrib/ntgclass/ntgclass.pdf
-2004/04/15 | 138589 | macros/latex/contrib/ntgclass/rapdoc.pdf
-2004/02/20 | 27780 | macros/latex/contrib/ntgclass/rapdoc.tex
-2005/04/30 | 1126923 | macros/latex/contrib/ntgclass.zip
+2020/02/22 | 21044 | macros/latex/contrib/ntgclass/a4.dtx
+2020/02/22 | 3224 | macros/latex/contrib/ntgclass/a4.ins
+2020/02/22 | 256462 | macros/latex/contrib/ntgclass/a4.pdf
+2020/02/22 | 223019 | macros/latex/contrib/ntgclass/artdoc.pdf
+2020/01/25 | 26217 | macros/latex/contrib/ntgclass/artdoc.tex
+2020/02/22 | 129699 | macros/latex/contrib/ntgclass/briefdoc.pdf
+2020/01/25 | 11446 | macros/latex/contrib/ntgclass/briefdoc.tex
+2020/02/22 | 88479 | macros/latex/contrib/ntgclass/brief.dtx
+2020/02/22 | 348927 | macros/latex/contrib/ntgclass/brief.pdf
+2020/02/22 | 63097 | macros/latex/contrib/ntgclass/brief-sample.pdf
+2020/02/22 | 7632 | macros/latex/contrib/ntgclass/brief-sample.tex
+2020/02/22 | 663 | macros/latex/contrib/ntgclass/CATALOG
+2020/02/22 | 13792 | macros/latex/contrib/ntgclass/ChangeLog
+2020/02/22 | 131160 | macros/latex/contrib/ntgclass/classdoc.pdf
+2020/01/25 | 5762 | macros/latex/contrib/ntgclass/classdoc.tex
+2020/02/22 | 1357 | macros/latex/contrib/ntgclass/MANIFEST
+2020/02/22 | 183210 | macros/latex/contrib/ntgclass/ntgclass.dtx
+2020/02/22 | 4213 | macros/latex/contrib/ntgclass/ntgclass.ins
+2020/02/22 | 485753 | macros/latex/contrib/ntgclass/ntgclass.pdf
+2020/02/22 | 79755 | macros/latex/contrib/ntgclass/ntgstyle.pdf
+2020/01/25 | 5009 | macros/latex/contrib/ntgclass/ntgstyle.tex
+2020/02/22 | 202501 | macros/latex/contrib/ntgclass/rapdoc.pdf
+2020/01/25 | 26662 | macros/latex/contrib/ntgclass/rapdoc.tex
+2020/01/25 | 116608 | macros/latex/contrib/ntgclass/rapport.dtx
+2020/02/22 | 943 | macros/latex/contrib/ntgclass/README
+2020/01/25 | 116608 | macros/latex/contrib/ntgclass/wijzer.dtx
+2020/02/22 | 2069620 | macros/latex/contrib/ntgclass.zip
2012/09/05 | 201753 | macros/latex/contrib/ntheorem/ntheorem.dtx
2012/09/05 | 696 | macros/latex/contrib/ntheorem/ntheorem.ins
2012/09/05 | 475991 | macros/latex/contrib/ntheorem/ntheorem.pdf
@@ -195074,12 +195085,12 @@
2017/12/21 | 64888 | macros/latex/contrib/overlays/sample.pdf
2017/12/21 | 7702 | macros/latex/contrib/overlays/sample.tex
2017/12/22 | 109185 | macros/latex/contrib/overlays.zip
-2018/09/02 | 12678 | macros/latex/contrib/overpic/overpic.dtx
-2017/10/07 | 2352 | macros/latex/contrib/overpic/overpic.ins
-2018/09/02 | 347489 | macros/latex/contrib/overpic/overpic.pdf
+2020/02/22 | 12833 | macros/latex/contrib/overpic/overpic.dtx
+2018/09/02 | 2351 | macros/latex/contrib/overpic/overpic.ins
+2020/02/22 | 371275 | macros/latex/contrib/overpic/overpic.pdf
2017/10/08 | 786 | macros/latex/contrib/overpic/README.de.md
2017/10/08 | 965 | macros/latex/contrib/overpic/README.md
-2018/09/02 | 352433 | macros/latex/contrib/overpic.zip
+2020/02/22 | 376208 | macros/latex/contrib/overpic.zip
2018/05/05 | 43 | macros/latex/contrib/padcount/CHANGES
2018/05/05 | 19106 | macros/latex/contrib/padcount/lppl.txt
2018/05/05 | 5821 | macros/latex/contrib/padcount/padcount.dtx
@@ -201938,11 +201949,11 @@
2006/03/25 | 2275 | macros/latex/contrib/sudoku/sudoku.ins
2006/03/25 | 67384 | macros/latex/contrib/sudoku/sudoku.pdf
2006/03/25 | 60808 | macros/latex/contrib/sudoku.zip
-2020/02/11 | 1680 | macros/latex/contrib/suftesi/README
-2020/02/11 | 188423 | macros/latex/contrib/suftesi/suftesi.dtx
-2020/02/11 | 1111704 | macros/latex/contrib/suftesi/suftesi.pdf
-2020/02/11 | 684245 | macros/latex/contrib/suftesi/templates.zip
-2020/02/11 | 1825707 | macros/latex/contrib/suftesi.zip
+2020/02/22 | 1680 | macros/latex/contrib/suftesi/README
+2020/02/22 | 192220 | macros/latex/contrib/suftesi/suftesi.dtx
+2020/02/22 | 761080 | macros/latex/contrib/suftesi/suftesi.pdf
+2020/02/22 | 684078 | macros/latex/contrib/suftesi/templates.zip
+2020/02/22 | 1479754 | macros/latex/contrib/suftesi.zip
2020/02/02 | 856 | macros/latex/contrib/supertabular/CATALOG
2020/02/02 | 13567 | macros/latex/contrib/supertabular/ChangeLog
2020/01/24 | 502 | macros/latex/contrib/supertabular/MANIFEST
@@ -206504,108 +206515,108 @@
2019/11/12 | 11940 | macros/latex/contrib/xsavebox/xsavebox.sty
2019/06/24 | 10243 | macros/latex/contrib/xsavebox/xsavebox.tex
2019/11/12 | 376084 | macros/latex/contrib/xsavebox.zip
-2020/01/16 | 7208 | macros/latex/contrib/xsim/code/xsim.auxfile.code.tex
-2020/01/16 | 6611 | macros/latex/contrib/xsim/code/xsim.base.code.tex
-2020/01/16 | 5827 | macros/latex/contrib/xsim/code/xsim.blanks.code.tex
-2020/01/16 | 12954 | macros/latex/contrib/xsim/code/xsim.collections.code.tex
-2020/01/16 | 14983 | macros/latex/contrib/xsim/code/xsim.definitions.code.tex
-2020/01/16 | 15380 | macros/latex/contrib/xsim/code/xsim.environments.code.tex
-2020/01/16 | 19541 | macros/latex/contrib/xsim/code/xsim.exercises.code.tex
-2020/01/16 | 9504 | macros/latex/contrib/xsim/code/xsim.goals.code.tex
-2020/01/16 | 4706 | macros/latex/contrib/xsim/code/xsim.grades.code.tex
-2020/01/16 | 21901 | macros/latex/contrib/xsim/code/xsim.interface.code.tex
-2020/01/16 | 6843 | macros/latex/contrib/xsim/code/xsim.modules.code.tex
-2020/01/16 | 15670 | macros/latex/contrib/xsim/code/xsim.properties.code.tex
-2020/01/16 | 10591 | macros/latex/contrib/xsim/code/xsim.random.code.tex
-2020/01/16 | 13146 | macros/latex/contrib/xsim/code/xsim.solutions.code.tex
-2020/01/16 | 3452 | macros/latex/contrib/xsim/code/xsim.sty
-2020/01/16 | 3022 | macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex
-2020/01/16 | 6642 | macros/latex/contrib/xsim/code/xsim.tags.code.tex
-2020/01/16 | 5317 | macros/latex/contrib/xsim/code/xsim.templates.code.tex
-2020/01/16 | 4826 | macros/latex/contrib/xsim/code/xsim.translations.code.tex
-2020/01/16 | 3415 | macros/latex/contrib/xsim/code/xsimverb.sty
-2020/01/16 | 7266 | macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex
-2020/01/16 | 29952 | macros/latex/contrib/xsim/doc/examples/xsim.blanks.pdf
-2020/01/16 | 469 | macros/latex/contrib/xsim/doc/examples/xsim.blanks.tex
-2020/01/16 | 38376 | macros/latex/contrib/xsim/doc/examples/xsim.boxed-headings.pdf
-2020/01/16 | 570 | macros/latex/contrib/xsim/doc/examples/xsim.boxed-headings.tex
-2020/01/16 | 30938 | macros/latex/contrib/xsim/doc/examples/xsim.code-and-output.pdf
-2020/01/16 | 1069 | macros/latex/contrib/xsim/doc/examples/xsim.code-and-output.tex
-2020/01/16 | 33206 | macros/latex/contrib/xsim/doc/examples/xsim.collections.pdf
-2020/01/16 | 1394 | macros/latex/contrib/xsim/doc/examples/xsim.collections.tex
-2020/01/16 | 38749 | macros/latex/contrib/xsim/doc/examples/xsim.crossref.pdf
-2020/01/16 | 1351 | macros/latex/contrib/xsim/doc/examples/xsim.crossref.tex
-2020/01/16 | 41167 | macros/latex/contrib/xsim/doc/examples/xsim.description-list.pdf
-2020/01/16 | 776 | macros/latex/contrib/xsim/doc/examples/xsim.description-list.tex
-2020/01/16 | 42153 | macros/latex/contrib/xsim/doc/examples/xsim.different-point-types.pdf
-2020/01/16 | 1337 | macros/latex/contrib/xsim/doc/examples/xsim.different-point-types.tex
-2020/01/16 | 31555 | macros/latex/contrib/xsim/doc/examples/xsim.difficulties.pdf
-2020/01/16 | 1345 | macros/latex/contrib/xsim/doc/examples/xsim.difficulties.tex
-2020/01/16 | 37708 | macros/latex/contrib/xsim/doc/examples/xsim.floating.pdf
-2020/01/16 | 1013 | macros/latex/contrib/xsim/doc/examples/xsim.floating.tex
-2020/01/16 | 46308 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-80640.pdf
-2020/01/16 | 3442 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-80640.tex
-2020/01/16 | 65379 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-91339.pdf
-2020/01/16 | 2259 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-91339.tex
-2020/01/16 | 23204 | macros/latex/contrib/xsim/doc/examples/xsim.grade-distribution.pdf
-2020/01/16 | 894 | macros/latex/contrib/xsim/doc/examples/xsim.grade-distribution.tex
-2020/01/16 | 45719 | macros/latex/contrib/xsim/doc/examples/xsim.hints.pdf
-2020/01/16 | 1313 | macros/latex/contrib/xsim/doc/examples/xsim.hints.tex
-2020/01/16 | 45738 | macros/latex/contrib/xsim/doc/examples/xsim.listings.pdf
-2020/01/16 | 821 | macros/latex/contrib/xsim/doc/examples/xsim.listings.tex
-2020/01/16 | 57220 | macros/latex/contrib/xsim/doc/examples/xsim.listofexercises.pdf
-2020/01/16 | 1792 | macros/latex/contrib/xsim/doc/examples/xsim.listofexercises.tex
-2020/01/16 | 31016 | macros/latex/contrib/xsim/doc/examples/xsim.multiplechoice.pdf
-2020/01/16 | 1425 | macros/latex/contrib/xsim/doc/examples/xsim.multiplechoice.tex
-2020/01/16 | 28127 | macros/latex/contrib/xsim/doc/examples/xsim.pointsums.pdf
-2020/01/16 | 653 | macros/latex/contrib/xsim/doc/examples/xsim.pointsums.tex
-2020/01/16 | 23102 | macros/latex/contrib/xsim/doc/examples/xsim.randomexercises.pdf
-2020/01/16 | 948 | macros/latex/contrib/xsim/doc/examples/xsim.randomexercises.tex
-2020/01/16 | 86047 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-13635.pdf
-2020/01/16 | 1913 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-13635.tex
-2020/01/16 | 20045 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-155630.pdf
-2020/01/16 | 443 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-155630.tex
-2020/01/16 | 56153 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.pdf
-2020/01/16 | 1183 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.tex
-2020/01/16 | 48094 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.pdf
-2020/01/16 | 613 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.tex
-2020/01/16 | 36968 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-305110.pdf
-2020/01/16 | 1072 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-305110.tex
-2020/01/16 | 27155 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-308883.pdf
-2020/01/16 | 247 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-308883.tex
-2020/01/16 | 57235 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-338165.pdf
-2020/01/16 | 1828 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-338165.tex
-2020/01/16 | 95065 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-350028.pdf
-2020/01/16 | 3547 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-350028.tex
-2020/01/16 | 65721 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369065.pdf
-2020/01/16 | 1862 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369065.tex
-2020/01/16 | 46504 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369636.pdf
-2020/01/16 | 927 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369636.tex
-2020/01/16 | 55079 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369803.pdf
-2020/01/16 | 1404 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369803.tex
-2020/01/16 | 28426 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-370642.pdf
-2020/01/16 | 542 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-370642.tex
-2020/01/16 | 25040 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-391530.pdf
-2020/01/16 | 1385 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-391530.tex
-2020/01/16 | 50580 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-395273.pdf
-2020/01/16 | 1923 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-395273.tex
-2020/01/16 | 42513 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-498299.pdf
-2020/01/16 | 1496 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-498299.tex
-2020/01/16 | 36256 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-15093.pdf
-2020/01/16 | 3142 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-15093.tex
-2020/01/16 | 46008 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdf
-2020/01/16 | 1518 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex
-2020/01/16 | 43899 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.pdf
-2020/01/16 | 1777 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.tex
-2020/01/16 | 86646 | macros/latex/contrib/xsim/doc/examples/xsim.various.pdf
-2020/01/16 | 5844 | macros/latex/contrib/xsim/doc/examples/xsim.various.tex
-2020/01/16 | 7552 | macros/latex/contrib/xsim/doc/xsim.history
-2020/01/16 | 1086 | macros/latex/contrib/xsim/doc/xsim.ideas
-2020/01/16 | 26452 | macros/latex/contrib/xsim/doc/xsim-manual.cls
-2020/01/16 | 1231162 | macros/latex/contrib/xsim/doc/xsim_manual.pdf
-2020/01/16 | 104224 | macros/latex/contrib/xsim/doc/xsim_manual.tex
-2020/01/16 | 3932 | macros/latex/contrib/xsim/README
-2020/01/16 | 2924519 | macros/latex/contrib/xsim.zip
+2020/02/21 | 7301 | macros/latex/contrib/xsim/code/xsim.auxfile.code.tex
+2020/02/21 | 6791 | macros/latex/contrib/xsim/code/xsim.base.code.tex
+2020/02/21 | 5840 | macros/latex/contrib/xsim/code/xsim.blanks.code.tex
+2020/02/21 | 12938 | macros/latex/contrib/xsim/code/xsim.collections.code.tex
+2020/02/21 | 15212 | macros/latex/contrib/xsim/code/xsim.definitions.code.tex
+2020/02/21 | 16620 | macros/latex/contrib/xsim/code/xsim.environments.code.tex
+2020/02/21 | 21402 | macros/latex/contrib/xsim/code/xsim.exercises.code.tex
+2020/02/21 | 11749 | macros/latex/contrib/xsim/code/xsim.goals.code.tex
+2020/02/21 | 4706 | macros/latex/contrib/xsim/code/xsim.grades.code.tex
+2020/02/21 | 21901 | macros/latex/contrib/xsim/code/xsim.interface.code.tex
+2020/02/21 | 6843 | macros/latex/contrib/xsim/code/xsim.modules.code.tex
+2020/02/21 | 16114 | macros/latex/contrib/xsim/code/xsim.properties.code.tex
+2020/02/21 | 10608 | macros/latex/contrib/xsim/code/xsim.random.code.tex
+2020/02/21 | 13261 | macros/latex/contrib/xsim/code/xsim.solutions.code.tex
+2020/02/21 | 4508 | macros/latex/contrib/xsim/code/xsim.sty
+2020/02/21 | 3022 | macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex
+2020/02/21 | 6642 | macros/latex/contrib/xsim/code/xsim.tags.code.tex
+2020/02/21 | 5317 | macros/latex/contrib/xsim/code/xsim.templates.code.tex
+2020/02/21 | 4826 | macros/latex/contrib/xsim/code/xsim.translations.code.tex
+2020/02/21 | 3419 | macros/latex/contrib/xsim/code/xsimverb.sty
+2020/02/21 | 7268 | macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex
+2020/02/21 | 29952 | macros/latex/contrib/xsim/doc/examples/xsim.blanks.pdf
+2020/02/21 | 469 | macros/latex/contrib/xsim/doc/examples/xsim.blanks.tex
+2020/02/21 | 38376 | macros/latex/contrib/xsim/doc/examples/xsim.boxed-headings.pdf
+2020/02/21 | 570 | macros/latex/contrib/xsim/doc/examples/xsim.boxed-headings.tex
+2020/02/21 | 30938 | macros/latex/contrib/xsim/doc/examples/xsim.code-and-output.pdf
+2020/02/21 | 1069 | macros/latex/contrib/xsim/doc/examples/xsim.code-and-output.tex
+2020/02/21 | 33206 | macros/latex/contrib/xsim/doc/examples/xsim.collections.pdf
+2020/02/21 | 1394 | macros/latex/contrib/xsim/doc/examples/xsim.collections.tex
+2020/02/21 | 38749 | macros/latex/contrib/xsim/doc/examples/xsim.crossref.pdf
+2020/02/21 | 1351 | macros/latex/contrib/xsim/doc/examples/xsim.crossref.tex
+2020/02/21 | 41167 | macros/latex/contrib/xsim/doc/examples/xsim.description-list.pdf
+2020/02/21 | 776 | macros/latex/contrib/xsim/doc/examples/xsim.description-list.tex
+2020/02/21 | 42153 | macros/latex/contrib/xsim/doc/examples/xsim.different-point-types.pdf
+2020/02/21 | 1337 | macros/latex/contrib/xsim/doc/examples/xsim.different-point-types.tex
+2020/02/21 | 31555 | macros/latex/contrib/xsim/doc/examples/xsim.difficulties.pdf
+2020/02/21 | 1345 | macros/latex/contrib/xsim/doc/examples/xsim.difficulties.tex
+2020/02/21 | 37708 | macros/latex/contrib/xsim/doc/examples/xsim.floating.pdf
+2020/02/21 | 1013 | macros/latex/contrib/xsim/doc/examples/xsim.floating.tex
+2020/02/21 | 46308 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-80640.pdf
+2020/02/21 | 3442 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-80640.tex
+2020/02/21 | 65379 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-91339.pdf
+2020/02/21 | 2259 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-91339.tex
+2020/02/21 | 23204 | macros/latex/contrib/xsim/doc/examples/xsim.grade-distribution.pdf
+2020/02/21 | 894 | macros/latex/contrib/xsim/doc/examples/xsim.grade-distribution.tex
+2020/02/21 | 45719 | macros/latex/contrib/xsim/doc/examples/xsim.hints.pdf
+2020/02/21 | 1313 | macros/latex/contrib/xsim/doc/examples/xsim.hints.tex
+2020/02/21 | 45738 | macros/latex/contrib/xsim/doc/examples/xsim.listings.pdf
+2020/02/21 | 821 | macros/latex/contrib/xsim/doc/examples/xsim.listings.tex
+2020/02/21 | 57220 | macros/latex/contrib/xsim/doc/examples/xsim.listofexercises.pdf
+2020/02/21 | 1792 | macros/latex/contrib/xsim/doc/examples/xsim.listofexercises.tex
+2020/02/21 | 31016 | macros/latex/contrib/xsim/doc/examples/xsim.multiplechoice.pdf
+2020/02/21 | 1425 | macros/latex/contrib/xsim/doc/examples/xsim.multiplechoice.tex
+2020/02/21 | 28127 | macros/latex/contrib/xsim/doc/examples/xsim.pointsums.pdf
+2020/02/21 | 653 | macros/latex/contrib/xsim/doc/examples/xsim.pointsums.tex
+2020/02/21 | 23102 | macros/latex/contrib/xsim/doc/examples/xsim.randomexercises.pdf
+2020/02/21 | 948 | macros/latex/contrib/xsim/doc/examples/xsim.randomexercises.tex
+2020/02/21 | 86047 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-13635.pdf
+2020/02/21 | 1913 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-13635.tex
+2020/02/21 | 20045 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-155630.pdf
+2020/02/21 | 443 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-155630.tex
+2020/02/21 | 56153 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.pdf
+2020/02/21 | 1183 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.tex
+2020/02/21 | 48094 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.pdf
+2020/02/21 | 613 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.tex
+2020/02/21 | 36968 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-305110.pdf
+2020/02/21 | 1072 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-305110.tex
+2020/02/21 | 27155 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-308883.pdf
+2020/02/21 | 247 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-308883.tex
+2020/02/21 | 57235 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-338165.pdf
+2020/02/21 | 1828 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-338165.tex
+2020/02/21 | 95065 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-350028.pdf
+2020/02/21 | 3547 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-350028.tex
+2020/02/21 | 65721 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369065.pdf
+2020/02/21 | 1862 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369065.tex
+2020/02/21 | 46504 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369636.pdf
+2020/02/21 | 927 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369636.tex
+2020/02/21 | 55079 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369803.pdf
+2020/02/21 | 1404 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369803.tex
+2020/02/21 | 28426 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-370642.pdf
+2020/02/21 | 542 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-370642.tex
+2020/02/21 | 25040 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-391530.pdf
+2020/02/21 | 1385 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-391530.tex
+2020/02/21 | 50580 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-395273.pdf
+2020/02/21 | 1923 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-395273.tex
+2020/02/21 | 42513 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-498299.pdf
+2020/02/21 | 1496 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-498299.tex
+2020/02/21 | 36256 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-15093.pdf
+2020/02/21 | 3142 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-15093.tex
+2020/02/21 | 46008 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdf
+2020/02/21 | 1518 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex
+2020/02/21 | 43899 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.pdf
+2020/02/21 | 1777 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.tex
+2020/02/21 | 86646 | macros/latex/contrib/xsim/doc/examples/xsim.various.pdf
+2020/02/21 | 5844 | macros/latex/contrib/xsim/doc/examples/xsim.various.tex
+2020/02/21 | 8024 | macros/latex/contrib/xsim/doc/xsim.history
+2020/02/21 | 1047 | macros/latex/contrib/xsim/doc/xsim.ideas
+2020/02/21 | 26967 | macros/latex/contrib/xsim/doc/xsim-manual.cls
+2020/02/21 | 1231179 | macros/latex/contrib/xsim/doc/xsim_manual.pdf
+2020/02/21 | 104686 | macros/latex/contrib/xsim/doc/xsim_manual.tex
+2020/02/21 | 3931 | macros/latex/contrib/xsim/README
+2020/02/22 | 2926189 | macros/latex/contrib/xsim.zip
2019/06/23 | 1140 | macros/latex/contrib/xskak/README.md
2019/06/23 | 21142 | macros/latex/contrib/xskak/skak-comment-test.pdf
2019/06/23 | 195 | macros/latex/contrib/xskak/skak-comment-test.tex
@@ -208288,6 +208299,11 @@
2019/06/08 | 10433 | macros/luatex/latex/combofont/combofont.tex
2019/06/08 | 445 | macros/luatex/latex/combofont/README.md
2019/06/08 | 94990 | macros/luatex/latex/combofont.zip
+2020/02/22 | 629877 | macros/luatex/latex/emoji/emoji-doc.pdf
+2020/02/22 | 96354 | macros/luatex/latex/emoji/emoji-doc.tex
+2020/02/22 | 111305 | macros/luatex/latex/emoji/emoji.sty
+2020/02/22 | 767 | macros/luatex/latex/emoji/README.md
+2020/02/22 | 650318 | macros/luatex/latex/emoji.zip
2018/02/14 | 12749 | macros/luatex/latex/gurps/gurps.dtx
2018/02/14 | 8204 | macros/luatex/latex/gurps/gurps.lua
2018/02/14 | 239743 | macros/luatex/latex/gurps/gurps.pdf
@@ -255381,7 +255397,7 @@
2019/02/28 | 364 | systems/texlive/tlnet/archive/epspdf.i386-netbsd.tar.xz
2019/02/28 | 364 | systems/texlive/tlnet/archive/epspdf.i386-solaris.tar.xz
2020/01/21 | 31912 | systems/texlive/tlnet/archive/epspdf.r53472.tar.xz
-2019/02/28 | 5252 | systems/texlive/tlnet/archive/epspdf.win32.tar.xz
+2020/02/22 | 8348 | systems/texlive/tlnet/archive/epspdf.win32.r53854.tar.xz
2019/02/28 | 364 | systems/texlive/tlnet/archive/epspdf.x86_64-cygwin.tar.xz
2019/02/28 | 372 | systems/texlive/tlnet/archive/epspdf.x86_64-darwinlegacy.tar.xz
2019/02/28 | 364 | systems/texlive/tlnet/archive/epspdf.x86_64-darwin.tar.xz
@@ -255987,9 +256003,9 @@
2019/02/28 | 1497740 | systems/texlive/tlnet/archive/fonts-churchslavonic.tar.xz
2019/12/21 | 798648 | systems/texlive/tlnet/archive/fontsetup.doc.r53195.tar.xz
2019/12/21 | 4324 | systems/texlive/tlnet/archive/fontsetup.r53195.tar.xz
-2020/02/04 | 1196228 | systems/texlive/tlnet/archive/fontspec.doc.r53656.tar.xz
-2020/02/04 | 26640 | systems/texlive/tlnet/archive/fontspec.r53656.tar.xz
-2020/02/04 | 82840 | systems/texlive/tlnet/archive/fontspec.source.r53656.tar.xz
+2020/02/22 | 1189088 | systems/texlive/tlnet/archive/fontspec.doc.r53860.tar.xz
+2020/02/22 | 26792 | systems/texlive/tlnet/archive/fontspec.r53860.tar.xz
+2020/02/22 | 83044 | systems/texlive/tlnet/archive/fontspec.source.r53860.tar.xz
2019/02/28 | 4604 | systems/texlive/tlnet/archive/fonts-tlwg.doc.tar.xz
2019/02/28 | 7672648 | systems/texlive/tlnet/archive/fonts-tlwg.source.tar.xz
2019/02/28 | 5008320 | systems/texlive/tlnet/archive/fonts-tlwg.tar.xz
@@ -257207,9 +257223,9 @@
2019/02/28 | 6820 | systems/texlive/tlnet/archive/keystroke.tar.xz
2019/02/28 | 314328 | systems/texlive/tlnet/archive/keyval2e.doc.tar.xz
2019/02/28 | 3228 | systems/texlive/tlnet/archive/keyval2e.tar.xz
-2019/06/02 | 402220 | systems/texlive/tlnet/archive/keyvaltable.doc.tar.xz
-2019/06/02 | 31816 | systems/texlive/tlnet/archive/keyvaltable.source.tar.xz
-2019/06/02 | 6988 | systems/texlive/tlnet/archive/keyvaltable.tar.xz
+2020/02/22 | 425960 | systems/texlive/tlnet/archive/keyvaltable.doc.r53861.tar.xz
+2020/02/22 | 7624 | systems/texlive/tlnet/archive/keyvaltable.r53861.tar.xz
+2020/02/22 | 34428 | systems/texlive/tlnet/archive/keyvaltable.source.r53861.tar.xz
2019/02/28 | 123796 | systems/texlive/tlnet/archive/kix.doc.tar.xz
2019/02/28 | 15960 | systems/texlive/tlnet/archive/kixfont.doc.tar.xz
2019/02/28 | 1828 | systems/texlive/tlnet/archive/kixfont.tar.xz
@@ -257330,14 +257346,14 @@
2019/02/28 | 344 | systems/texlive/tlnet/archive/l3build.amd64-freebsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.amd64-netbsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.armhf-linux.tar.xz
-2020/02/19 | 722200 | systems/texlive/tlnet/archive/l3build.doc.r53834.tar.xz
+2020/02/22 | 722904 | systems/texlive/tlnet/archive/l3build.doc.r53862.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.i386-cygwin.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.i386-freebsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.i386-linux.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.i386-netbsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/l3build.i386-solaris.tar.xz
-2020/02/19 | 31944 | systems/texlive/tlnet/archive/l3build.r53834.tar.xz
-2020/02/19 | 29224 | systems/texlive/tlnet/archive/l3build.source.r53834.tar.xz
+2020/02/22 | 31844 | systems/texlive/tlnet/archive/l3build.r53862.tar.xz
+2020/02/22 | 29304 | systems/texlive/tlnet/archive/l3build.source.r53862.tar.xz
2019/02/28 | 684 | systems/texlive/tlnet/archive/l3build.win32.tar.xz
2019/02/28 | 344 | systems/texlive/tlnet/archive/l3build.x86_64-cygwin.tar.xz
2019/02/28 | 348 | systems/texlive/tlnet/archive/l3build.x86_64-darwinlegacy.tar.xz
@@ -257348,9 +257364,9 @@
2020/01/14 | 3870792 | systems/texlive/tlnet/archive/l3experimental.doc.r53394.tar.xz
2020/01/14 | 25084 | systems/texlive/tlnet/archive/l3experimental.r53394.tar.xz
2020/01/14 | 84892 | systems/texlive/tlnet/archive/l3experimental.source.r53394.tar.xz
-2020/02/15 | 9937192 | systems/texlive/tlnet/archive/l3kernel.doc.r53781.tar.xz
-2020/02/15 | 148736 | systems/texlive/tlnet/archive/l3kernel.r53781.tar.xz
-2020/02/15 | 529452 | systems/texlive/tlnet/archive/l3kernel.source.r53781.tar.xz
+2020/02/22 | 9955180 | systems/texlive/tlnet/archive/l3kernel.doc.r53862.tar.xz
+2020/02/22 | 148716 | systems/texlive/tlnet/archive/l3kernel.r53862.tar.xz
+2020/02/22 | 530100 | systems/texlive/tlnet/archive/l3kernel.source.r53862.tar.xz
2020/02/15 | 1739536 | systems/texlive/tlnet/archive/l3packages.doc.r53781.tar.xz
2020/02/15 | 19880 | systems/texlive/tlnet/archive/l3packages.r53781.tar.xz
2020/02/15 | 64900 | systems/texlive/tlnet/archive/l3packages.source.r53781.tar.xz
@@ -257543,7 +257559,7 @@
2019/02/28 | 384 | systems/texlive/tlnet/archive/latexdiff.x86_64-solaris.tar.xz
2019/02/28 | 130636 | systems/texlive/tlnet/archive/latex-doc-ptr.doc.tar.xz
2019/02/28 | 500 | systems/texlive/tlnet/archive/latex-doc-ptr.tar.xz
-2020/02/14 | 18424840 | systems/texlive/tlnet/archive/latex.doc.r53771.tar.xz
+2020/02/22 | 18428188 | systems/texlive/tlnet/archive/latex.doc.r53857.tar.xz
2019/02/28 | 8008 | systems/texlive/tlnet/archive/latexfileinfo-pkgs.doc.tar.xz
2019/02/28 | 8120 | systems/texlive/tlnet/archive/latexfileinfo-pkgs.source.tar.xz
2019/02/28 | 856 | systems/texlive/tlnet/archive/latexfileinfo-pkgs.tar.xz
@@ -257674,12 +257690,12 @@
2019/02/28 | 348 | systems/texlive/tlnet/archive/latex-papersize.x86_64-linuxmusl.tar.xz
2019/02/28 | 344 | systems/texlive/tlnet/archive/latex-papersize.x86_64-linux.tar.xz
2019/02/28 | 348 | systems/texlive/tlnet/archive/latex-papersize.x86_64-solaris.tar.xz
-2020/02/14 | 168600 | systems/texlive/tlnet/archive/latex.r53771.tar.xz
+2020/02/22 | 168616 | systems/texlive/tlnet/archive/latex.r53857.tar.xz
2019/02/28 | 98676 | systems/texlive/tlnet/archive/latex-referenz.doc.tar.xz
2019/02/28 | 520 | systems/texlive/tlnet/archive/latex-referenz.tar.xz
2019/02/28 | 5020492 | systems/texlive/tlnet/archive/latex-refsheet.doc.tar.xz
2019/02/28 | 480 | systems/texlive/tlnet/archive/latex-refsheet.tar.xz
-2020/02/14 | 523452 | systems/texlive/tlnet/archive/latex.source.r53771.tar.xz
+2020/02/22 | 524152 | systems/texlive/tlnet/archive/latex.source.r53857.tar.xz
2019/02/28 | 45788 | systems/texlive/tlnet/archive/latex-tabellen.doc.tar.xz
2019/02/28 | 384 | systems/texlive/tlnet/archive/latex-tabellen.tar.xz
2019/02/28 | 84088 | systems/texlive/tlnet/archive/latex-tds.doc.tar.xz
@@ -259228,9 +259244,9 @@
2019/02/28 | 438652 | systems/texlive/tlnet/archive/nag.doc.tar.xz
2019/02/28 | 17648 | systems/texlive/tlnet/archive/nag.source.tar.xz
2019/02/28 | 7800 | systems/texlive/tlnet/archive/nag.tar.xz
-2019/02/28 | 976704 | systems/texlive/tlnet/archive/nameauth.doc.tar.xz
-2019/02/28 | 63968 | systems/texlive/tlnet/archive/nameauth.source.tar.xz
-2019/02/28 | 6128 | systems/texlive/tlnet/archive/nameauth.tar.xz
+2020/02/22 | 1052036 | systems/texlive/tlnet/archive/nameauth.doc.r53863.tar.xz
+2020/02/22 | 6632 | systems/texlive/tlnet/archive/nameauth.r53863.tar.xz
+2020/02/22 | 72504 | systems/texlive/tlnet/archive/nameauth.source.r53863.tar.xz
2019/02/28 | 82880 | systems/texlive/tlnet/archive/namespc.doc.tar.xz
2019/02/28 | 3492 | systems/texlive/tlnet/archive/namespc.source.tar.xz
2019/02/28 | 976 | systems/texlive/tlnet/archive/namespc.tar.xz
@@ -261090,9 +261106,9 @@
2019/02/28 | 3976584 | systems/texlive/tlnet/archive/revtex.doc.tar.xz
2019/02/28 | 186980 | systems/texlive/tlnet/archive/revtex.source.tar.xz
2019/02/28 | 75996 | systems/texlive/tlnet/archive/revtex.tar.xz
-2019/05/20 | 160052 | systems/texlive/tlnet/archive/rgltxdoc.doc.tar.xz
-2019/05/20 | 9400 | systems/texlive/tlnet/archive/rgltxdoc.source.tar.xz
-2019/05/20 | 3356 | systems/texlive/tlnet/archive/rgltxdoc.tar.xz
+2020/02/22 | 161168 | systems/texlive/tlnet/archive/rgltxdoc.doc.r53858.tar.xz
+2020/02/22 | 3340 | systems/texlive/tlnet/archive/rgltxdoc.r53858.tar.xz
+2020/02/22 | 9516 | systems/texlive/tlnet/archive/rgltxdoc.source.r53858.tar.xz
2019/02/28 | 335072 | systems/texlive/tlnet/archive/ribbonproofs.doc.tar.xz
2019/02/28 | 11420 | systems/texlive/tlnet/archive/ribbonproofs.tar.xz
2019/02/28 | 110516 | systems/texlive/tlnet/archive/rjlparshap.doc.tar.xz
@@ -261509,9 +261525,9 @@
2019/02/28 | 250180 | systems/texlive/tlnet/archive/SIunits.doc.tar.xz
2019/02/28 | 34544 | systems/texlive/tlnet/archive/SIunits.source.tar.xz
2019/02/28 | 6064 | systems/texlive/tlnet/archive/SIunits.tar.xz
-2020/01/16 | 1759948 | systems/texlive/tlnet/archive/siunitx.doc.r53414.tar.xz
-2020/01/16 | 35144 | systems/texlive/tlnet/archive/siunitx.r53414.tar.xz
-2020/01/16 | 104184 | systems/texlive/tlnet/archive/siunitx.source.r53414.tar.xz
+2020/02/22 | 629712 | systems/texlive/tlnet/archive/siunitx.doc.r53856.tar.xz
+2020/02/22 | 34640 | systems/texlive/tlnet/archive/siunitx.r53856.tar.xz
+2020/02/22 | 103308 | systems/texlive/tlnet/archive/siunitx.source.r53856.tar.xz
2019/02/28 | 200108 | systems/texlive/tlnet/archive/skak.doc.tar.xz
2019/02/28 | 316212 | systems/texlive/tlnet/archive/skaknew.doc.tar.xz
2019/02/28 | 160064 | systems/texlive/tlnet/archive/skaknew.tar.xz
@@ -262191,13 +262207,13 @@
2019/02/28 | 344 | systems/texlive/tlnet/archive/texdoc.amd64-freebsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/texdoc.amd64-netbsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/texdoc.armhf-linux.tar.xz
-2020/02/03 | 132400 | systems/texlive/tlnet/archive/texdoc.doc.r53643.tar.xz
+2020/02/22 | 132412 | systems/texlive/tlnet/archive/texdoc.doc.r53859.tar.xz
2019/02/28 | 336 | systems/texlive/tlnet/archive/texdoc.i386-cygwin.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/texdoc.i386-freebsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/texdoc.i386-linux.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/texdoc.i386-netbsd.tar.xz
2019/02/28 | 340 | systems/texlive/tlnet/archive/texdoc.i386-solaris.tar.xz
-2020/02/03 | 26672 | systems/texlive/tlnet/archive/texdoc.r53643.tar.xz
+2020/02/22 | 26728 | systems/texlive/tlnet/archive/texdoc.r53859.tar.xz
2019/11/19 | 63868 | systems/texlive/tlnet/archive/tex.doc.tar.xz
2019/02/28 | 344 | systems/texlive/tlnet/archive/texdoctk.aarch64-linux.tar.xz
2019/02/28 | 344 | systems/texlive/tlnet/archive/texdoctk.amd64-freebsd.tar.xz
@@ -262803,7 +262819,7 @@
2019/07/06 | 340 | systems/texlive/tlnet/archive/tlshell.i386-netbsd.tar.xz
2019/07/06 | 340 | systems/texlive/tlnet/archive/tlshell.i386-solaris.tar.xz
2020/02/16 | 25508 | systems/texlive/tlnet/archive/tlshell.r53801.tar.xz
-2019/10/07 | 3934704 | systems/texlive/tlnet/archive/tlshell.win32.tar.xz
+2020/02/22 | 3941456 | systems/texlive/tlnet/archive/tlshell.win32.r53854.tar.xz
2019/07/06 | 340 | systems/texlive/tlnet/archive/tlshell.x86_64-cygwin.tar.xz
2019/07/06 | 348 | systems/texlive/tlnet/archive/tlshell.x86_64-darwinlegacy.tar.xz
2019/07/06 | 344 | systems/texlive/tlnet/archive/tlshell.x86_64-darwin.tar.xz
@@ -263513,8 +263529,8 @@
2019/02/28 | 2472 | systems/texlive/tlnet/archive/williams.tar.xz
2019/07/20 | 449128 | systems/texlive/tlnet/archive/windycity.doc.tar.xz
2019/07/20 | 17136 | systems/texlive/tlnet/archive/windycity.tar.xz
-2019/11/17 | 973264 | systems/texlive/tlnet/archive/wintools.win32.doc.tar.xz
-2019/11/17 | 4788948 | systems/texlive/tlnet/archive/wintools.win32.tar.xz
+2020/02/22 | 973264 | systems/texlive/tlnet/archive/wintools.win32.doc.r53854.tar.xz
+2020/02/22 | 4796672 | systems/texlive/tlnet/archive/wintools.win32.r53854.tar.xz
2019/11/05 | 475336 | systems/texlive/tlnet/archive/withargs.doc.tar.xz
2019/11/05 | 6100 | systems/texlive/tlnet/archive/withargs.tar.xz
2019/12/29 | 877396 | systems/texlive/tlnet/archive/witharrows.doc.r53246.tar.xz
@@ -263961,16 +263977,16 @@
2020/01/24 | 138180 | systems/texlive/tlnet/archive/zxjatype.doc.r53500.tar.xz
2020/01/24 | 8760 | systems/texlive/tlnet/archive/zxjatype.r53500.tar.xz
2020/01/17 | 107147 | systems/texlive/tlnet/install-tl
-2020/02/21 | 3949279 | systems/texlive/tlnet/install-tl-unx.tar.gz
-2020/02/21 | 152 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512
-2020/02/21 | 455 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512.asc
+2020/02/22 | 3949331 | systems/texlive/tlnet/install-tl-unx.tar.gz
+2020/02/22 | 152 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512
+2020/02/22 | 455 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512.asc
2019/05/09 | 4543 | systems/texlive/tlnet/install-tl-windows.bat
-2020/02/21 | 18696897 | systems/texlive/tlnet/install-tl-windows.exe
-2020/02/21 | 153 | systems/texlive/tlnet/install-tl-windows.exe.sha512
-2020/02/21 | 455 | systems/texlive/tlnet/install-tl-windows.exe.sha512.asc
-2020/02/21 | 22541662 | systems/texlive/tlnet/install-tl.zip
-2020/02/21 | 145 | systems/texlive/tlnet/install-tl.zip.sha512
-2020/02/21 | 455 | systems/texlive/tlnet/install-tl.zip.sha512.asc
+2020/02/22 | 18700754 | systems/texlive/tlnet/install-tl-windows.exe
+2020/02/22 | 153 | systems/texlive/tlnet/install-tl-windows.exe.sha512
+2020/02/22 | 455 | systems/texlive/tlnet/install-tl-windows.exe.sha512.asc
+2020/02/22 | 22541695 | systems/texlive/tlnet/install-tl.zip
+2020/02/22 | 145 | systems/texlive/tlnet/install-tl.zip.sha512
+2020/02/22 | 455 | systems/texlive/tlnet/install-tl.zip.sha512.asc
2019/04/29 | 1221 | systems/texlive/tlnet/README.md
2019/03/13 | 5351 | systems/texlive/tlnet/tlpkg/gpg/pubring.gpg
2016/04/12 | 600 | systems/texlive/tlnet/tlpkg/gpg/random_seed
@@ -264022,15 +264038,15 @@
2019/12/22 | 9915 | systems/texlive/tlnet/tlpkg/TeXLive/TeXCatalogue.pm
2017/06/04 | 21326 | systems/texlive/tlnet/tlpkg/TeXLive/TLConfFile.pm
2020/02/16 | 11112 | systems/texlive/tlnet/tlpkg/TeXLive/TLConfig.pm
-2020/02/17 | 20152 | systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
+2020/02/21 | 20239 | systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
2016/10/11 | 4618 | systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm
2017/11/14 | 27560 | systems/texlive/tlnet/tlpkg/TeXLive/TLPaper.pm
-2020/02/21 | 16168000 | systems/texlive/tlnet/tlpkg/texlive.tlpdb
-2020/02/21 | 48 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
+2020/02/22 | 16167905 | systems/texlive/tlnet/tlpkg/texlive.tlpdb
+2020/02/22 | 48 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
2020/02/17 | 85521 | systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm
-2020/02/21 | 144 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
-2020/02/21 | 455 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
-2020/02/21 | 2173744 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
+2020/02/22 | 144 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
+2020/02/22 | 455 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
+2020/02/22 | 2171508 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
2019/12/22 | 58727 | systems/texlive/tlnet/tlpkg/TeXLive/TLPOBJ.pm
2020/01/17 | 40906 | systems/texlive/tlnet/tlpkg/TeXLive/TLPSRC.pm
2018/08/31 | 14972 | systems/texlive/tlnet/tlpkg/TeXLive/TLTREE.pm
@@ -267456,7 +267472,7 @@
2020/02/04 | 281488 | systems/win32/miktex/tm/packages/filehook.tar.lzma
2012/12/04 | 924573 | systems/win32/miktex/tm/packages/fileinfo.tar.lzma
2011/09/21 | 281409 | systems/win32/miktex/tm/packages/filemod.tar.lzma
-2020/02/21 | 528527 | systems/win32/miktex/tm/packages/files.csv.lzma
+2020/02/22 | 528480 | systems/win32/miktex/tm/packages/files.csv.lzma
2001/05/14 | 5617 | systems/win32/miktex/tm/packages/finbib.tar.lzma
2015/10/20 | 44379 | systems/win32/miktex/tm/packages/findhyph.tar.lzma
2011/10/21 | 89323 | systems/win32/miktex/tm/packages/fink.tar.lzma
@@ -267525,7 +267541,7 @@
2020/02/13 | 2425284 | systems/win32/miktex/tm/packages/fonts-arundina.tar.lzma
2017/02/03 | 2021910 | systems/win32/miktex/tm/packages/fonts-churchslavonic.tar.lzma
2019/12/21 | 818734 | systems/win32/miktex/tm/packages/fontsetup.tar.lzma
-2020/02/04 | 1306635 | systems/win32/miktex/tm/packages/fontspec.tar.lzma
+2020/02/22 | 1299441 | systems/win32/miktex/tm/packages/fontspec.tar.lzma
2018/11/11 | 12792540 | systems/win32/miktex/tm/packages/fonts-tlwg.tar.lzma
2017/07/16 | 330987 | systems/win32/miktex/tm/packages/fonttable.tar.lzma
2008/06/10 | 283950 | systems/win32/miktex/tm/packages/fontwrap.tar.lzma
@@ -267960,7 +267976,7 @@
2012/11/08 | 249186 | systems/win32/miktex/tm/packages/keyreader.tar.lzma
2010/05/10 | 38167 | systems/win32/miktex/tm/packages/keystroke.tar.lzma
2011/08/28 | 317766 | systems/win32/miktex/tm/packages/keyval2e.tar.lzma
-2019/06/03 | 441296 | systems/win32/miktex/tm/packages/keyvaltable.tar.lzma
+2020/02/22 | 468114 | systems/win32/miktex/tm/packages/keyvaltable.tar.lzma
2004/07/13 | 3289 | systems/win32/miktex/tm/packages/kixfont.cab
2011/03/07 | 125293 | systems/win32/miktex/tm/packages/kix.tar.lzma
2016/07/16 | 113930 | systems/win32/miktex/tm/packages/kluwer.tar.lzma
@@ -267995,11 +268011,11 @@
2013/08/19 | 270728 | systems/win32/miktex/tm/packages/l2tabu-french.tar.lzma
2012/02/01 | 258354 | systems/win32/miktex/tm/packages/l2tabu-italian.tar.lzma
2016/02/07 | 246670 | systems/win32/miktex/tm/packages/l2tabu.tar.lzma
-2020/02/05 | 767329 | systems/win32/miktex/tm/packages/l3backend.tar.lzma
-2020/02/18 | 773817 | systems/win32/miktex/tm/packages/l3build.tar.lzma
+2020/02/22 | 766910 | systems/win32/miktex/tm/packages/l3backend.tar.lzma
+2020/02/22 | 774844 | systems/win32/miktex/tm/packages/l3build.tar.lzma
2013/05/29 | 156214 | systems/win32/miktex/tm/packages/l3ctr2e.tar.lzma
2020/01/14 | 3982611 | systems/win32/miktex/tm/packages/l3experimental.tar.lzma
-2020/02/15 | 10525355 | systems/win32/miktex/tm/packages/l3kernel.tar.lzma
+2020/02/22 | 10543110 | systems/win32/miktex/tm/packages/l3kernel.tar.lzma
2020/02/15 | 1826219 | systems/win32/miktex/tm/packages/l3packages.tar.lzma
2008/04/02 | 115132 | systems/win32/miktex/tm/packages/labbook.tar.lzma
2006/11/14 | 45130 | systems/win32/miktex/tm/packages/labelcas.cab
@@ -268589,9 +268605,9 @@
2018/01/12 | 157226 | systems/win32/miktex/tm/packages/miktex-zip-bin-x64.tar.lzma
2020/02/14 | 38792 | systems/win32/miktex/tm/packages/miktex-zlib-bin-2.9.tar.lzma
2020/02/14 | 42900 | systems/win32/miktex/tm/packages/miktex-zlib-bin-x64-2.9.tar.lzma
-2020/02/21 | 196974 | systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma
-2020/02/21 | 1177685 | systems/win32/miktex/tm/packages/miktex-zzdb2-2.9.tar.lzma
-2020/02/21 | 1098247 | systems/win32/miktex/tm/packages/miktex-zzdb3-2.9.tar.lzma
+2020/02/22 | 196878 | systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma
+2020/02/22 | 1178199 | systems/win32/miktex/tm/packages/miktex-zzdb2-2.9.tar.lzma
+2020/02/22 | 1097620 | systems/win32/miktex/tm/packages/miktex-zzdb3-2.9.tar.lzma
2020/02/14 | 13041 | systems/win32/miktex/tm/packages/miktex-zzip-bin-2.9.tar.lzma
2020/02/14 | 14036 | systems/win32/miktex/tm/packages/miktex-zzip-bin-x64-2.9.tar.lzma
2016/07/15 | 35914 | systems/win32/miktex/tm/packages/mil3.tar.lzma
@@ -268705,7 +268721,7 @@
2018/06/19 | 439567 | systems/win32/miktex/tm/packages/na-border.tar.lzma
2017/08/27 | 981496 | systems/win32/miktex/tm/packages/na-box.tar.lzma
2011/12/07 | 464357 | systems/win32/miktex/tm/packages/nag.tar.lzma
-2017/03/28 | 1049696 | systems/win32/miktex/tm/packages/nameauth.tar.lzma
+2020/02/22 | 1130956 | systems/win32/miktex/tm/packages/nameauth.tar.lzma
2005/06/25 | 8785 | systems/win32/miktex/tm/packages/namespc.cab
2019/09/29 | 433369 | systems/win32/miktex/tm/packages/nanicolle.tar.lzma
2013/03/28 | 28195703 | systems/win32/miktex/tm/packages/nanumtype1.tar.lzma
@@ -268742,183 +268758,183 @@
2018/04/09 | 400132 | systems/win32/miktex/tm/packages/newunicodechar.tar.lzma
2011/09/19 | 101312 | systems/win32/miktex/tm/packages/newvbtm.tar.lzma
2019/09/11 | 231430 | systems/win32/miktex/tm/packages/newverbs.tar.lzma
-2020/02/21 | 528740 | systems/win32/miktex/tm/packages/next/files.csv.lzma
-2020/02/21 | 29255 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-2.9.tar.lzma
-2020/02/21 | 33423 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-x64-2.9.tar.lzma
-2020/02/21 | 937769 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-2.9.tar.lzma
-2020/02/21 | 1041977 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-x64-2.9.tar.lzma
-2020/02/21 | 28530 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-2.9.tar.lzma
-2020/02/21 | 30767 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-x64-2.9.tar.lzma
-2020/02/21 | 29317 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-2.9.tar.lzma
-2020/02/21 | 34840 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-x64-2.9.tar.lzma
-2020/02/21 | 49693 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-2.9.tar.lzma
-2020/02/21 | 57187 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-x64-2.9.tar.lzma
-2020/02/21 | 84567 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-2.9.tar.lzma
-2020/02/21 | 94300 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-x64-2.9.tar.lzma
-2020/02/21 | 60323 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-2.9.tar.lzma
-2020/02/21 | 67274 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-x64-2.9.tar.lzma
-2020/02/21 | 26663 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-2.9.tar.lzma
-2020/02/21 | 30230 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-x64-2.9.tar.lzma
-2020/02/21 | 328797 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-2.9.tar.lzma
-2020/02/21 | 391674 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-x64-2.9.tar.lzma
-2020/02/21 | 32241 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-2.9.tar.lzma
-2020/02/21 | 36328 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-x64-2.9.tar.lzma
-2020/02/21 | 49316 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-2.9.tar.lzma
-2020/02/21 | 53990 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-x64-2.9.tar.lzma
-2020/02/21 | 199195 | systems/win32/miktex/tm/packages/next/miktex-console-bin-2.9.tar.lzma
-2020/02/21 | 215429 | systems/win32/miktex/tm/packages/next/miktex-console-bin-x64-2.9.tar.lzma
-2020/02/21 | 169210 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-2.9.tar.lzma
-2020/02/21 | 184256 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-x64-2.9.tar.lzma
-2020/02/21 | 52045 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-2.9.tar.lzma
-2020/02/21 | 58859 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-x64-2.9.tar.lzma
-2020/02/21 | 20668 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-2.9.tar.lzma
-2020/02/21 | 22935 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-x64-2.9.tar.lzma
-2020/02/21 | 450322 | systems/win32/miktex/tm/packages/next/miktex-doc-2.9.tar.lzma
-2020/02/21 | 41033 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-2.9.tar.lzma
-2020/02/21 | 45772 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-x64-2.9.tar.lzma
-2020/02/21 | 272523 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-2.9.tar.lzma
-2020/02/21 | 309614 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-x64-2.9.tar.lzma
-2020/02/21 | 40600 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-2.9.tar.lzma
-2020/02/21 | 44941 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-x64-2.9.tar.lzma
-2020/02/21 | 115594 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-2.9.tar.lzma
-2020/02/21 | 130308 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-x64-2.9.tar.lzma
-2020/02/21 | 1249275 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-2.9.tar.lzma
-2020/02/21 | 1382985 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-x64-2.9.tar.lzma
-2020/02/21 | 33551 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-2.9.tar.lzma
-2020/02/21 | 38892 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-x64-2.9.tar.lzma
-2020/02/21 | 43425 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-2.9.tar.lzma
-2020/02/21 | 47986 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-x64-2.9.tar.lzma
-2020/02/21 | 45468 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-2.9.tar.lzma
-2020/02/21 | 50502 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-x64-2.9.tar.lzma
-2020/02/21 | 56696 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-2.9.tar.lzma
-2020/02/21 | 61700 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-x64-2.9.tar.lzma
-2020/02/21 | 133251 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-2.9.tar.lzma
-2020/02/21 | 152100 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-x64-2.9.tar.lzma
-2020/02/21 | 69855 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-2.9.tar.lzma
-2020/02/21 | 72710 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-x64-2.9.tar.lzma
-2020/02/21 | 68740 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-2.9.tar.lzma
-2020/02/21 | 77341 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-x64-2.9.tar.lzma
-2020/02/21 | 246426 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-2.9.tar.lzma
-2020/02/21 | 281512 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-x64-2.9.tar.lzma
-2020/02/21 | 25305 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-2.9.tar.lzma
-2020/02/21 | 28721 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-x64-2.9.tar.lzma
-2020/02/21 | 100709 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-2.9.tar.lzma
-2020/02/21 | 116662 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-x64-2.9.tar.lzma
-2020/02/21 | 63291 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-2.9.tar.lzma
-2020/02/21 | 72567 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-x64-2.9.tar.lzma
-2020/02/21 | 94105 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-2.9.tar.lzma
-2020/02/21 | 111160 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-x64-2.9.tar.lzma
-2020/02/21 | 57751 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-2.9.tar.lzma
-2020/02/21 | 64382 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-x64-2.9.tar.lzma
-2020/02/21 | 456871 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-2.9.tar.lzma
-2020/02/21 | 544810 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-x64-2.9.tar.lzma
-2020/02/21 | 137120 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-2.9.tar.lzma
-2020/02/21 | 149788 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-x64-2.9.tar.lzma
-2020/02/21 | 92933 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-2.9.tar.lzma
-2020/02/21 | 108872 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-x64-2.9.tar.lzma
-2020/02/21 | 15882 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-2.9.tar.lzma
-2020/02/21 | 17674 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-x64-2.9.tar.lzma
-2020/02/21 | 27784 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-2.9.tar.lzma
-2020/02/21 | 29704 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-x64-2.9.tar.lzma
-2020/02/21 | 615495 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-2.9.tar.lzma
-2020/02/21 | 669501 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-x64-2.9.tar.lzma
-2020/02/21 | 499163 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-2.9.tar.lzma
-2020/02/21 | 561256 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-x64-2.9.tar.lzma
-2020/02/21 | 540298 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-2.9.tar.lzma
-2020/02/21 | 576147 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-x64-2.9.tar.lzma
-2020/02/21 | 93442 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-2.9.tar.lzma
-2020/02/21 | 102517 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-x64-2.9.tar.lzma
-2020/02/21 | 1711482 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-2.9.tar.lzma
-2020/02/21 | 1946013 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-x64-2.9.tar.lzma
-2020/02/21 | 67255 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-2.9.tar.lzma
-2020/02/21 | 73636 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-x64-2.9.tar.lzma
-2020/02/21 | 26876 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-2.9.tar.lzma
-2020/02/21 | 31191 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-x64-2.9.tar.lzma
-2020/02/21 | 7497 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-2.9.tar.lzma
-2020/02/21 | 8472 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-x64-2.9.tar.lzma
-2020/02/21 | 167815 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-2.9.tar.lzma
-2020/02/21 | 182803 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-x64-2.9.tar.lzma
-2020/02/21 | 247553 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-2.9.tar.lzma
-2020/02/21 | 281322 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-x64-2.9.tar.lzma
-2020/02/21 | 87327 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-2.9.tar.lzma
-2020/02/21 | 92095 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-x64-2.9.tar.lzma
-2020/02/21 | 77832 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-2.9.tar.lzma
-2020/02/21 | 86614 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-x64-2.9.tar.lzma
-2020/02/21 | 164888 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-2.9.tar.lzma
-2020/02/21 | 185326 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-x64-2.9.tar.lzma
-2020/02/21 | 148482 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-2.9.tar.lzma
-2020/02/21 | 167253 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-x64-2.9.tar.lzma
-2020/02/21 | 195007 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-2.9.tar.lzma
-2020/02/21 | 177509 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-x64-2.9.tar.lzma
-2020/02/21 | 80461 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-2.9.tar.lzma
-2020/02/21 | 91384 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-x64-2.9.tar.lzma
-2020/02/21 | 30988 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-2.9.tar.lzma
-2020/02/21 | 34833 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-x64-2.9.tar.lzma
-2020/02/21 | 56415 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-2.9.tar.lzma
-2020/02/21 | 62839 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-x64-2.9.tar.lzma
-2020/02/21 | 41874 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-2.9.tar.lzma
-2020/02/21 | 45691 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-x64-2.9.tar.lzma
-2020/02/21 | 45601 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-2.9.tar.lzma
-2020/02/21 | 52017 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-x64-2.9.tar.lzma
-2020/02/21 | 354437 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-2.9.tar.lzma
-2020/02/21 | 387425 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-x64-2.9.tar.lzma
-2020/02/21 | 321907 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-2.9.tar.lzma
-2020/02/21 | 356275 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-x64-2.9.tar.lzma
-2020/02/21 | 186884 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-2.9.tar.lzma
-2020/02/21 | 193653 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-x64-2.9.tar.lzma
-2020/02/21 | 207775 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-2.9.tar.lzma
-2020/02/21 | 243361 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-x64-2.9.tar.lzma
-2020/02/21 | 78019 | systems/win32/miktex/tm/packages/next/miktex-png-bin-2.9.tar.lzma
-2020/02/21 | 87198 | systems/win32/miktex/tm/packages/next/miktex-png-bin-x64-2.9.tar.lzma
-2020/02/21 | 932994 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-2.9.tar.lzma
-2020/02/21 | 1042556 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-x64-2.9.tar.lzma
-2020/02/21 | 19892 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-2.9.tar.lzma
-2020/02/21 | 23519 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-x64-2.9.tar.lzma
-2020/02/21 | 31152 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-2.9.tar.lzma
-2020/02/21 | 36617 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-x64-2.9.tar.lzma
-2020/02/21 | 63283 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-2.9.tar.lzma
-2020/02/21 | 71709 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-x64-2.9.tar.lzma
-2020/02/21 | 42574 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-2.9.tar.lzma
-2020/02/21 | 50882 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-x64-2.9.tar.lzma
-2020/02/21 | 1104158 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-2.9.tar.lzma
-2020/02/21 | 1231281 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-x64-2.9.tar.lzma
-2020/02/21 | 41872 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-2.9.tar.lzma
-2020/02/21 | 50855 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-x64-2.9.tar.lzma
-2020/02/21 | 53463 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-2.9.tar.lzma
-2020/02/21 | 59420 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-x64-2.9.tar.lzma
-2020/02/21 | 26772 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-2.9.tar.lzma
-2020/02/21 | 29170 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-x64-2.9.tar.lzma
-2020/02/21 | 16046 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-2.9.tar.lzma
-2020/02/21 | 17754 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-x64-2.9.tar.lzma
-2020/02/21 | 63105 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-2.9.tar.lzma
-2020/02/21 | 69213 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-x64-2.9.tar.lzma
-2020/02/21 | 147333 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-2.9.tar.lzma
-2020/02/21 | 160716 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-x64-2.9.tar.lzma
-2020/02/21 | 74351 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-2.9.tar.lzma
-2020/02/21 | 84332 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-x64-2.9.tar.lzma
-2020/02/21 | 91343 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-2.9.tar.lzma
-2020/02/21 | 96320 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-x64-2.9.tar.lzma
-2020/02/21 | 2457971 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-2.9.tar.lzma
-2020/02/21 | 2579567 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-x64-2.9.tar.lzma
-2020/02/21 | 54898 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-2.9.tar.lzma
-2020/02/21 | 61079 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-x64-2.9.tar.lzma
-2020/02/21 | 26503 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-2.9.tar.lzma
-2020/02/21 | 32338 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-x64-2.9.tar.lzma
-2020/02/21 | 61608 | systems/win32/miktex/tm/packages/next/miktex-web-bin-2.9.tar.lzma
-2020/02/21 | 65092 | systems/win32/miktex/tm/packages/next/miktex-web-bin-x64-2.9.tar.lzma
-2020/02/21 | 247179 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-2.9.tar.lzma
-2020/02/21 | 276689 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-x64-2.9.tar.lzma
-2020/02/21 | 532964 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-2.9.tar.lzma
-2020/02/21 | 563461 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-x64-2.9.tar.lzma
-2020/02/21 | 39186 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-2.9.tar.lzma
-2020/02/21 | 42926 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-x64-2.9.tar.lzma
-2020/02/21 | 196822 | systems/win32/miktex/tm/packages/next/miktex-zzdb1-2.9.tar.lzma
-2020/02/21 | 1178069 | systems/win32/miktex/tm/packages/next/miktex-zzdb2-2.9.tar.lzma
-2020/02/21 | 1098464 | systems/win32/miktex/tm/packages/next/miktex-zzdb3-2.9.tar.lzma
-2020/02/21 | 13061 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-2.9.tar.lzma
-2020/02/21 | 14047 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-x64-2.9.tar.lzma
+2020/02/22 | 528740 | systems/win32/miktex/tm/packages/next/files.csv.lzma
+2020/02/22 | 29254 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-2.9.tar.lzma
+2020/02/22 | 33423 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-x64-2.9.tar.lzma
+2020/02/22 | 937766 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-2.9.tar.lzma
+2020/02/22 | 1041977 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-x64-2.9.tar.lzma
+2020/02/22 | 28530 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-2.9.tar.lzma
+2020/02/22 | 30767 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-x64-2.9.tar.lzma
+2020/02/22 | 29316 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-2.9.tar.lzma
+2020/02/22 | 34841 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-x64-2.9.tar.lzma
+2020/02/22 | 49695 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-2.9.tar.lzma
+2020/02/22 | 57187 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-x64-2.9.tar.lzma
+2020/02/22 | 84566 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-2.9.tar.lzma
+2020/02/22 | 94299 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-x64-2.9.tar.lzma
+2020/02/22 | 60325 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-2.9.tar.lzma
+2020/02/22 | 67274 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-x64-2.9.tar.lzma
+2020/02/22 | 26662 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-2.9.tar.lzma
+2020/02/22 | 30230 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-x64-2.9.tar.lzma
+2020/02/22 | 328795 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-2.9.tar.lzma
+2020/02/22 | 391673 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-x64-2.9.tar.lzma
+2020/02/22 | 32241 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-2.9.tar.lzma
+2020/02/22 | 36327 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-x64-2.9.tar.lzma
+2020/02/22 | 49314 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-2.9.tar.lzma
+2020/02/22 | 53989 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-x64-2.9.tar.lzma
+2020/02/22 | 199193 | systems/win32/miktex/tm/packages/next/miktex-console-bin-2.9.tar.lzma
+2020/02/22 | 215429 | systems/win32/miktex/tm/packages/next/miktex-console-bin-x64-2.9.tar.lzma
+2020/02/22 | 169210 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-2.9.tar.lzma
+2020/02/22 | 184257 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-x64-2.9.tar.lzma
+2020/02/22 | 52045 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-2.9.tar.lzma
+2020/02/22 | 58859 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-x64-2.9.tar.lzma
+2020/02/22 | 20667 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-2.9.tar.lzma
+2020/02/22 | 22935 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-x64-2.9.tar.lzma
+2020/02/22 | 450322 | systems/win32/miktex/tm/packages/next/miktex-doc-2.9.tar.lzma
+2020/02/22 | 41032 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-2.9.tar.lzma
+2020/02/22 | 45771 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-x64-2.9.tar.lzma
+2020/02/22 | 272523 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-2.9.tar.lzma
+2020/02/22 | 309612 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-x64-2.9.tar.lzma
+2020/02/22 | 40600 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-2.9.tar.lzma
+2020/02/22 | 44940 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-x64-2.9.tar.lzma
+2020/02/22 | 115594 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-2.9.tar.lzma
+2020/02/22 | 130308 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-x64-2.9.tar.lzma
+2020/02/22 | 1249271 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-2.9.tar.lzma
+2020/02/22 | 1382985 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-x64-2.9.tar.lzma
+2020/02/22 | 33552 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-2.9.tar.lzma
+2020/02/22 | 38892 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-x64-2.9.tar.lzma
+2020/02/22 | 43425 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-2.9.tar.lzma
+2020/02/22 | 47985 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-x64-2.9.tar.lzma
+2020/02/22 | 45467 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-2.9.tar.lzma
+2020/02/22 | 50502 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-x64-2.9.tar.lzma
+2020/02/22 | 56695 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-2.9.tar.lzma
+2020/02/22 | 61699 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-x64-2.9.tar.lzma
+2020/02/22 | 133252 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-2.9.tar.lzma
+2020/02/22 | 152099 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-x64-2.9.tar.lzma
+2020/02/22 | 69856 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-2.9.tar.lzma
+2020/02/22 | 72708 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-x64-2.9.tar.lzma
+2020/02/22 | 68739 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-2.9.tar.lzma
+2020/02/22 | 77342 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-x64-2.9.tar.lzma
+2020/02/22 | 246426 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-2.9.tar.lzma
+2020/02/22 | 281511 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-x64-2.9.tar.lzma
+2020/02/22 | 25304 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-2.9.tar.lzma
+2020/02/22 | 28720 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-x64-2.9.tar.lzma
+2020/02/22 | 100709 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-2.9.tar.lzma
+2020/02/22 | 116661 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-x64-2.9.tar.lzma
+2020/02/22 | 63293 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-2.9.tar.lzma
+2020/02/22 | 72568 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-x64-2.9.tar.lzma
+2020/02/22 | 94109 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-2.9.tar.lzma
+2020/02/22 | 111161 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-x64-2.9.tar.lzma
+2020/02/22 | 57751 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-2.9.tar.lzma
+2020/02/22 | 64381 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-x64-2.9.tar.lzma
+2020/02/22 | 456869 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-2.9.tar.lzma
+2020/02/22 | 544811 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-x64-2.9.tar.lzma
+2020/02/22 | 137120 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-2.9.tar.lzma
+2020/02/22 | 149788 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-x64-2.9.tar.lzma
+2020/02/22 | 92933 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-2.9.tar.lzma
+2020/02/22 | 108873 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-x64-2.9.tar.lzma
+2020/02/22 | 15881 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-2.9.tar.lzma
+2020/02/22 | 17672 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-x64-2.9.tar.lzma
+2020/02/22 | 27782 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-2.9.tar.lzma
+2020/02/22 | 29703 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-x64-2.9.tar.lzma
+2020/02/22 | 615497 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-2.9.tar.lzma
+2020/02/22 | 669501 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-x64-2.9.tar.lzma
+2020/02/22 | 499162 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-2.9.tar.lzma
+2020/02/22 | 561256 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-x64-2.9.tar.lzma
+2020/02/22 | 540298 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-2.9.tar.lzma
+2020/02/22 | 576144 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-x64-2.9.tar.lzma
+2020/02/22 | 93442 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-2.9.tar.lzma
+2020/02/22 | 102516 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-x64-2.9.tar.lzma
+2020/02/22 | 1711484 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-2.9.tar.lzma
+2020/02/22 | 1946009 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-x64-2.9.tar.lzma
+2020/02/22 | 67255 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-2.9.tar.lzma
+2020/02/22 | 73636 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-x64-2.9.tar.lzma
+2020/02/22 | 26875 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-2.9.tar.lzma
+2020/02/22 | 31191 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-x64-2.9.tar.lzma
+2020/02/22 | 7498 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-2.9.tar.lzma
+2020/02/22 | 8471 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-x64-2.9.tar.lzma
+2020/02/22 | 167814 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-2.9.tar.lzma
+2020/02/22 | 182805 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-x64-2.9.tar.lzma
+2020/02/22 | 247553 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-2.9.tar.lzma
+2020/02/22 | 281322 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-x64-2.9.tar.lzma
+2020/02/22 | 87327 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-2.9.tar.lzma
+2020/02/22 | 92094 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-x64-2.9.tar.lzma
+2020/02/22 | 77830 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-2.9.tar.lzma
+2020/02/22 | 86614 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-x64-2.9.tar.lzma
+2020/02/22 | 164889 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-2.9.tar.lzma
+2020/02/22 | 185325 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-x64-2.9.tar.lzma
+2020/02/22 | 148482 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-2.9.tar.lzma
+2020/02/22 | 167253 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-x64-2.9.tar.lzma
+2020/02/22 | 195007 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-2.9.tar.lzma
+2020/02/22 | 177510 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-x64-2.9.tar.lzma
+2020/02/22 | 80461 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-2.9.tar.lzma
+2020/02/22 | 91384 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-x64-2.9.tar.lzma
+2020/02/22 | 30988 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-2.9.tar.lzma
+2020/02/22 | 34833 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-x64-2.9.tar.lzma
+2020/02/22 | 56417 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-2.9.tar.lzma
+2020/02/22 | 62839 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-x64-2.9.tar.lzma
+2020/02/22 | 41872 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-2.9.tar.lzma
+2020/02/22 | 45691 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-x64-2.9.tar.lzma
+2020/02/22 | 45601 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-2.9.tar.lzma
+2020/02/22 | 52017 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-x64-2.9.tar.lzma
+2020/02/22 | 354437 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-2.9.tar.lzma
+2020/02/22 | 387424 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-x64-2.9.tar.lzma
+2020/02/22 | 321906 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-2.9.tar.lzma
+2020/02/22 | 356274 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-x64-2.9.tar.lzma
+2020/02/22 | 186883 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-2.9.tar.lzma
+2020/02/22 | 193652 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-x64-2.9.tar.lzma
+2020/02/22 | 207773 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-2.9.tar.lzma
+2020/02/22 | 243360 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-x64-2.9.tar.lzma
+2020/02/22 | 78018 | systems/win32/miktex/tm/packages/next/miktex-png-bin-2.9.tar.lzma
+2020/02/22 | 87198 | systems/win32/miktex/tm/packages/next/miktex-png-bin-x64-2.9.tar.lzma
+2020/02/22 | 932998 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-2.9.tar.lzma
+2020/02/22 | 1042551 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-x64-2.9.tar.lzma
+2020/02/22 | 19892 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-2.9.tar.lzma
+2020/02/22 | 23518 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-x64-2.9.tar.lzma
+2020/02/22 | 31155 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-2.9.tar.lzma
+2020/02/22 | 36618 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-x64-2.9.tar.lzma
+2020/02/22 | 63281 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-2.9.tar.lzma
+2020/02/22 | 71708 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-x64-2.9.tar.lzma
+2020/02/22 | 42574 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-2.9.tar.lzma
+2020/02/22 | 50881 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-x64-2.9.tar.lzma
+2020/02/22 | 1104159 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-2.9.tar.lzma
+2020/02/22 | 1231280 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-x64-2.9.tar.lzma
+2020/02/22 | 41872 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-2.9.tar.lzma
+2020/02/22 | 50855 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-x64-2.9.tar.lzma
+2020/02/22 | 53464 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-2.9.tar.lzma
+2020/02/22 | 59420 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-x64-2.9.tar.lzma
+2020/02/22 | 26773 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-2.9.tar.lzma
+2020/02/22 | 29169 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-x64-2.9.tar.lzma
+2020/02/22 | 16046 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-2.9.tar.lzma
+2020/02/22 | 17754 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-x64-2.9.tar.lzma
+2020/02/22 | 63104 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-2.9.tar.lzma
+2020/02/22 | 69213 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-x64-2.9.tar.lzma
+2020/02/22 | 147334 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-2.9.tar.lzma
+2020/02/22 | 160715 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-x64-2.9.tar.lzma
+2020/02/22 | 74350 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-2.9.tar.lzma
+2020/02/22 | 84332 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-x64-2.9.tar.lzma
+2020/02/22 | 91342 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-2.9.tar.lzma
+2020/02/22 | 96320 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-x64-2.9.tar.lzma
+2020/02/22 | 2457968 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-2.9.tar.lzma
+2020/02/22 | 2579567 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-x64-2.9.tar.lzma
+2020/02/22 | 54898 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-2.9.tar.lzma
+2020/02/22 | 61078 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-x64-2.9.tar.lzma
+2020/02/22 | 26501 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-2.9.tar.lzma
+2020/02/22 | 32337 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-x64-2.9.tar.lzma
+2020/02/22 | 61607 | systems/win32/miktex/tm/packages/next/miktex-web-bin-2.9.tar.lzma
+2020/02/22 | 65092 | systems/win32/miktex/tm/packages/next/miktex-web-bin-x64-2.9.tar.lzma
+2020/02/22 | 247179 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-2.9.tar.lzma
+2020/02/22 | 276690 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-x64-2.9.tar.lzma
+2020/02/22 | 532963 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-2.9.tar.lzma
+2020/02/22 | 563461 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-x64-2.9.tar.lzma
+2020/02/22 | 39186 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-2.9.tar.lzma
+2020/02/22 | 42927 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-x64-2.9.tar.lzma
+2020/02/22 | 196878 | systems/win32/miktex/tm/packages/next/miktex-zzdb1-2.9.tar.lzma
+2020/02/22 | 1177960 | systems/win32/miktex/tm/packages/next/miktex-zzdb2-2.9.tar.lzma
+2020/02/22 | 1097647 | systems/win32/miktex/tm/packages/next/miktex-zzdb3-2.9.tar.lzma
+2020/02/22 | 13062 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-2.9.tar.lzma
+2020/02/22 | 14047 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-x64-2.9.tar.lzma
2019/03/12 | 1412 | systems/win32/miktex/tm/packages/nextpage.tar.lzma
-2020/02/21 | 652 | systems/win32/miktex/tm/packages/next/pr.ini
+2020/02/22 | 652 | systems/win32/miktex/tm/packages/next/pr.ini
2018/07/06 | 145915 | systems/win32/miktex/tm/packages/nexus-otf.tar.lzma
2017/03/30 | 191149 | systems/win32/miktex/tm/packages/nfssext-cfr.tar.lzma
2012/12/20 | 612251 | systems/win32/miktex/tm/packages/nicefilelist.tar.lzma
@@ -269231,7 +269247,7 @@
2008/11/07 | 35981 | systems/win32/miktex/tm/packages/prettyref.tar.lzma
2017/07/26 | 201385 | systems/win32/miktex/tm/packages/preview.tar.lzma
2019/06/20 | 375963 | systems/win32/miktex/tm/packages/prftree.tar.lzma
-2020/02/21 | 343 | systems/win32/miktex/tm/packages/pr.ini
+2020/02/22 | 332 | systems/win32/miktex/tm/packages/pr.ini
2010/09/27 | 248469 | systems/win32/miktex/tm/packages/printlen.tar.lzma
2008/06/17 | 77313 | systems/win32/miktex/tm/packages/proba.tar.lzma
2017/07/12 | 988486 | systems/win32/miktex/tm/packages/probsoln.tar.lzma
@@ -270354,10 +270370,10 @@
2010/01/14 | 955365 | systems/win32/visualtex/vx-setup-399.exe
2019/08/12 | 14654 | systems/win32/w32tex/00FILES.euc
2019/08/12 | 14654 | systems/win32/w32tex/00FILES.sjis
-2020/02/14 | 4947632 | systems/win32/w32tex/aleph-w32.tar.xz
+2020/02/21 | 4934684 | systems/win32/w32tex/aleph-w32.tar.xz
2020/02/17 | 64187260 | systems/win32/w32tex/biblatex-biber.tar.xz
2016/12/13 | 65971452 | systems/win32/w32tex/cbfonts.tar.xz
-2020/02/20 | 593501 | systems/win32/w32tex/ChangeLog
+2020/02/21 | 594044 | systems/win32/w32tex/ChangeLog
2009/08/03 | 141221 | systems/win32/w32tex/ChangeLog.0
2009/08/03 | 221890 | systems/win32/w32tex/ChangeLog.1
2009/08/03 | 116462 | systems/win32/w32tex/ChangeLog.2
@@ -270378,17 +270394,17 @@
2009/08/03 | 1072620 | systems/win32/w32tex/gtftex.zip
2020/02/14 | 1810100 | systems/win32/w32tex/jtex-w32.tar.xz
2020/02/16 | 40901888 | systems/win32/w32tex/latex-dev.tar.xz
-2020/02/13 | 30271176 | systems/win32/w32tex/latex.tar.xz
+2020/02/21 | 30276388 | systems/win32/w32tex/latex.tar.xz
2020/01/20 | 996420 | systems/win32/w32tex/lcdf-typetools-w32.tar.xz
2020/02/20 | 392920244 | systems/win32/w32tex/ltxpkgdocs.tar.xz
2020/02/19 | 34336976 | systems/win32/w32tex/ltxpkgs.tar.xz
2020/02/18 | 3871452 | systems/win32/w32tex/luajittex-dev-w32.tar.xz
2020/02/20 | 3858232 | systems/win32/w32tex/luajittex-exp-w32.tar.xz
2020/02/18 | 3872752 | systems/win32/w32tex/luajittex-w32.tar.xz
-2020/02/18 | 17872044 | systems/win32/w32tex/luatex-dev-w32.tar.xz
-2020/02/20 | 17880108 | systems/win32/w32tex/luatex-exp-w32.tar.xz
+2020/02/21 | 17870028 | systems/win32/w32tex/luatex-dev-w32.tar.xz
+2020/02/21 | 17878640 | systems/win32/w32tex/luatex-exp-w32.tar.xz
2020/02/10 | 17310192 | systems/win32/w32tex/luatexja.tar.xz
-2020/02/18 | 16902596 | systems/win32/w32tex/luatex-w32.tar.xz
+2020/02/21 | 16902540 | systems/win32/w32tex/luatex-w32.tar.xz
2020/01/20 | 1598940 | systems/win32/w32tex/makeindex-w32.tar.xz
2015/05/26 | 1542676 | systems/win32/w32tex/manual.tar.xz
2020/01/31 | 438820 | systems/win32/w32tex/mftools.tar.xz
@@ -270398,7 +270414,7 @@
2020/02/17 | 8193972 | systems/win32/w32tex/newtxpx-boondoxfonts.tar.xz
2020/02/13 | 1233524 | systems/win32/w32tex/omegaj-w32.tar.xz
2019/09/08 | 357888 | systems/win32/w32tex/otfbeta.tar.xz
-2020/02/14 | 20436288 | systems/win32/w32tex/pdftex-w32.tar.xz
+2020/02/21 | 20439236 | systems/win32/w32tex/pdftex-w32.tar.xz
2020/02/19 | 83020132 | systems/win32/w32tex/pgfcontrib.tar.xz
2015/01/26 | 189072 | systems/win32/w32tex/plain2-2.54-w32.tar.xz
2020/02/10 | 2966552 | systems/win32/w32tex/platex.tar.xz
@@ -270406,8 +270422,8 @@
2020/01/20 | 1168532 | systems/win32/w32tex/pstoedit-w32.tar.xz
2020/02/12 | 284720720 | systems/win32/w32tex/pstricks.tar.xz
2020/01/20 | 517548 | systems/win32/w32tex/psutils-w32.tar.xz
-2020/02/14 | 6347964 | systems/win32/w32tex/ptex-ng-w32.tar.xz
-2020/02/16 | 10297168 | systems/win32/w32tex/ptex-w32.tar.xz
+2020/02/21 | 6348788 | systems/win32/w32tex/ptex-ng-w32.tar.xz
+2020/02/21 | 10315064 | systems/win32/w32tex/ptex-w32.tar.xz
2020/01/27 | 1760916 | systems/win32/w32tex/qpdf-w32.tar.xz
2019/04/15 | 499188 | systems/win32/w32tex/sam2p-w32.tar.xz
2020/01/24 | 24929772 | systems/win32/w32tex/t1fonts.tar.xz
@@ -270427,12 +270443,12 @@
2020/01/19 | 5856 | systems/win32/w32tex/txtutil.tar.xz
2013/04/08 | 71588 | systems/win32/w32tex/ums.tar.xz
2012/05/28 | 233472 | systems/win32/w32tex/unzip.exe
-2020/02/15 | 8385100 | systems/win32/w32tex/uptex-w32.tar.xz
+2020/02/21 | 8384768 | systems/win32/w32tex/uptex-w32.tar.xz
2013/04/08 | 722652 | systems/win32/w32tex/utf.tar.xz
2013/04/08 | 13748 | systems/win32/w32tex/vf-n2bk.tar.xz
2019/04/08 | 35478888 | systems/win32/w32tex/w32tex-src.tar.xz
2020/02/15 | 99063264 | systems/win32/w32tex/web2c-lib.tar.xz
-2020/02/16 | 43134236 | systems/win32/w32tex/web2c-w32.tar.xz
+2020/02/21 | 43132780 | systems/win32/w32tex/web2c-w32.tar.xz
2020/02/10 | 810988 | systems/win32/w32tex/win64/aleph-w64.tar.xz
2019/12/09 | 22317480 | systems/win32/w32tex/win64/biblatex-biber-w64.tar.xz
2020/02/18 | 1943236 | systems/win32/w32tex/win64/context-w64.tar.xz
@@ -270474,7 +270490,7 @@
2020/02/10 | 1799760 | systems/win32/w32tex/win64/uptex-w64.tar.xz
2020/02/16 | 3379960 | systems/win32/w32tex/win64/web2c-w64.tar.xz
2020/02/12 | 11107132 | systems/win32/w32tex/win64/xetex-w64.tar.xz
-2020/02/19 | 49614932 | systems/win32/w32tex/xetex-w32.tar.xz
+2020/02/21 | 49615904 | systems/win32/w32tex/xetex-w32.tar.xz
2019/10/03 | 2936880 | systems/win32/w32tex/xindy-w32.tar.xz
2013/11/19 | 11356248 | systems/win32/w32tex/xymtex.tar.xz
2016/09/09 | 4334636 | systems/win32/w32tex/xypic.tar.xz
@@ -270571,7 +270587,7 @@
2004/06/04 | 404 | tds/tds.sed
2004/06/23 | 65418 | tds/tds.tex
2019/05/29 | 304264 | tds.zip
-2020/02/22 | 186 | timestamp
+2020/02/23 | 186 | timestamp
2002/08/26 | 61898 | usergrps/dante/antrag.pdf
2002/08/26 | 118217 | usergrps/dante/antrag.ps
2017/06/30 | 917 | usergrps/dante/dtk/doc/beispiel.bib
diff --git a/FILES.byname.gz b/FILES.byname.gz
index 40cdea7f53..dbe5df65c9 100644
--- a/FILES.byname.gz
+++ b/FILES.byname.gz
Binary files differ
diff --git a/FILES.last07days b/FILES.last07days
index 311109782f..de679d9355 100644
--- a/FILES.last07days
+++ b/FILES.last07days
@@ -1,392 +1,747 @@
+2020/02/22 | 9955180 | systems/texlive/tlnet/archive/l3kernel.doc.r53862.tar.xz
+2020/02/22 | 986 | indexing/upmendex/doc/samples/alphabet/Makefile
+2020/02/22 | 9776 | macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
+2020/02/22 | 9768 | macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
+2020/02/22 | 973264 | systems/texlive/tlnet/archive/wintools.win32.doc.r53854.tar.xz
+2020/02/22 | 96354 | macros/luatex/latex/emoji/emoji-doc.tex
+2020/02/22 | 96320 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-x64-2.9.tar.lzma
+2020/02/22 | 95276 | graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex
+2020/02/22 | 9516 | systems/texlive/tlnet/archive/rgltxdoc.source.r53858.tar.xz
+2020/02/22 | 9459 | macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
+2020/02/22 | 943 | macros/latex/contrib/ntgclass/README
+2020/02/22 | 94299 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-x64-2.9.tar.lzma
+2020/02/22 | 9414 | macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
+2020/02/22 | 94109 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-2.9.tar.lzma
+2020/02/22 | 938 | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.tex
+2020/02/22 | 937766 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-2.9.tar.lzma
+2020/02/22 | 9356 | macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
+2020/02/22 | 93442 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-2.9.tar.lzma
+2020/02/22 | 932998 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-2.9.tar.lzma
+2020/02/22 | 92933 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-2.9.tar.lzma
+2020/02/22 | 9288 | indexing/upmendex/source/convert.c
+2020/02/22 | 92094 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-x64-2.9.tar.lzma
+2020/02/22 | 91976 | graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
+2020/02/22 | 91854 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib
+2020/02/22 | 9152 | macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
+2020/02/22 | 9142 | macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
+2020/02/22 | 91384 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-x64-2.9.tar.lzma
+2020/02/22 | 9136 | macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
+2020/02/22 | 9136 | macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
+2020/02/22 | 91342 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-2.9.tar.lzma
+2020/02/22 | 9114 | macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
+2020/02/22 | 9108 | macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
+2020/02/22 | 9093 | macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
+2020/02/22 | 908573 | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+2020/02/22 | 8988 | macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
+2020/02/22 | 8956 | macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
+2020/02/22 | 88479 | macros/latex/contrib/ntgclass/brief.dtx
+2020/02/22 | 87327 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-2.9.tar.lzma
+2020/02/22 | 872 | indexing/upmendex/doc/samples/option/japanese.idx
+2020/02/22 | 87198 | systems/win32/miktex/tm/packages/next/miktex-png-bin-x64-2.9.tar.lzma
+2020/02/22 | 86614 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-x64-2.9.tar.lzma
+2020/02/22 | 8471 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-x64-2.9.tar.lzma
+2020/02/22 | 84566 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-2.9.tar.lzma
+2020/02/22 | 84332 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-x64-2.9.tar.lzma
+2020/02/22 | 841461 | graphics/pgf/contrib/circuitikz/tex/circuitikz-1.0.sty
+2020/02/22 | 8348 | systems/texlive/tlnet/archive/epspdf.win32.r53854.tar.xz
+2020/02/22 | 834142 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-1.0.tex
+2020/02/22 | 83044 | systems/texlive/tlnet/archive/fontspec.source.r53860.tar.xz
+2020/02/22 | 80461 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-2.9.tar.lzma
+2020/02/22 | 800 | indexing/upmendex/source/tests/upmendex.test
+2020/02/22 | 79755 | macros/latex/contrib/ntgclass/ntgstyle.pdf
+2020/02/22 | 78018 | systems/win32/miktex/tm/packages/next/miktex-png-bin-2.9.tar.lzma
+2020/02/22 | 77830 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-2.9.tar.lzma
+2020/02/22 | 7749 | graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex
+2020/02/22 | 774844 | systems/win32/miktex/tm/packages/l3build.tar.lzma
+2020/02/22 | 77342 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-x64-2.9.tar.lzma
+2020/02/22 | 767 | macros/luatex/latex/emoji/README.md
+2020/02/22 | 766 | indexing/upmendex/source/tests/uni.ind
+2020/02/22 | 766910 | systems/win32/miktex/tm/packages/l3backend.tar.lzma
+2020/02/22 | 7632 | macros/latex/contrib/ntgclass/brief-sample.tex
+2020/02/22 | 7624 | systems/texlive/tlnet/archive/keyvaltable.r53861.tar.xz
+2020/02/22 | 761080 | macros/latex/contrib/suftesi/suftesi.pdf
+2020/02/22 | 758990 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.6.sty
+2020/02/22 | 751663 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.9.6.tex
+2020/02/22 | 749 | indexing/upmendex/doc/samples/option/Makefile
+2020/02/22 | 7498 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-2.9.tar.lzma
+2020/02/22 | 7492 | indexing/upmendex/source/main.c
+2020/02/22 | 7477 | graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex
+2020/02/22 | 74350 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-2.9.tar.lzma
+2020/02/22 | 73636 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-x64-2.9.tar.lzma
+2020/02/22 | 729 | indexing/upmendex/source/exkana.h
+2020/02/22 | 72708 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-x64-2.9.tar.lzma
+2020/02/22 | 72568 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-x64-2.9.tar.lzma
+2020/02/22 | 72504 | systems/texlive/tlnet/archive/nameauth.source.r53863.tar.xz
+2020/02/22 | 722904 | systems/texlive/tlnet/archive/l3build.doc.r53862.tar.xz
+2020/02/22 | 71708 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-x64-2.9.tar.lzma
+2020/02/22 | 700167 | indexing/upmendex/source/configure
+2020/02/22 | 69856 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-2.9.tar.lzma
+2020/02/22 | 69213 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-x64-2.9.tar.lzma
+2020/02/22 | 690730 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.3.sty
+2020/02/22 | 68 | indexing/upmendex/source/tests/foo.idx
+2020/02/22 | 68739 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-2.9.tar.lzma
+2020/02/22 | 684078 | macros/latex/contrib/suftesi/templates.zip
+2020/02/22 | 683645 | fonts/libertinus-otf/doc/libertinus-otf-doc.pdf
+2020/02/22 | 683433 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.9.3.tex
+2020/02/22 | 67274 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-x64-2.9.tar.lzma
+2020/02/22 | 67255 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-2.9.tar.lzma
+2020/02/22 | 669501 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-x64-2.9.tar.lzma
+2020/02/22 | 663 | macros/latex/contrib/ntgclass/CATALOG
+2020/02/22 | 6632 | systems/texlive/tlnet/archive/nameauth.r53863.tar.xz
+2020/02/22 | 658510 | fonts/libertinus-otf.zip
+2020/02/22 | 65642 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
+2020/02/22 | 652 | systems/win32/miktex/tm/packages/next/pr.ini
+2020/02/22 | 65092 | systems/win32/miktex/tm/packages/next/miktex-web-bin-x64-2.9.tar.lzma
+2020/02/22 | 650318 | macros/luatex/latex/emoji.zip
+2020/02/22 | 64 | indexing/upmendex/source/tests/uni.dict
+2020/02/22 | 64381 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-x64-2.9.tar.lzma
+2020/02/22 | 64239 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
+2020/02/22 | 63293 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-2.9.tar.lzma
+2020/02/22 | 63281 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-2.9.tar.lzma
+2020/02/22 | 63104 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-2.9.tar.lzma
+2020/02/22 | 63097 | macros/latex/contrib/ntgclass/brief-sample.pdf
+2020/02/22 | 629877 | macros/luatex/latex/emoji/emoji-doc.pdf
+2020/02/22 | 629712 | systems/texlive/tlnet/archive/siunitx.doc.r53856.tar.xz
+2020/02/22 | 62839 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-x64-2.9.tar.lzma
+2020/02/22 | 619720 | macros/latex/contrib/fontsize.zip
+2020/02/22 | 617406 | macros/latex/contrib/fontsize/fontsize.pdf
+2020/02/22 | 61699 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-x64-2.9.tar.lzma
+2020/02/22 | 61607 | systems/win32/miktex/tm/packages/next/miktex-web-bin-2.9.tar.lzma
+2020/02/22 | 615497 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-2.9.tar.lzma
+2020/02/22 | 614 | indexing/upmendex/doc/samples/russian.idx
+2020/02/22 | 61078 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-x64-2.9.tar.lzma
+2020/02/22 | 60325 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-2.9.tar.lzma
+2020/02/22 | 59420 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-x64-2.9.tar.lzma
+2020/02/22 | 59121 | graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
+2020/02/22 | 58 | indexing/upmendex/source/tests/foo.ind
+2020/02/22 | 58859 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-x64-2.9.tar.lzma
+2020/02/22 | 5842 | indexing/upmendex/source/qsort.c
+2020/02/22 | 58135 | fonts/libertinus-otf/doc/libertinus-otf-doc.tex
+2020/02/22 | 57751 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-2.9.tar.lzma
+2020/02/22 | 576144 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-x64-2.9.tar.lzma
+2020/02/22 | 57187 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-x64-2.9.tar.lzma
+2020/02/22 | 56974 | macros/generic/expkv/expkv.dtx
+2020/02/22 | 5687 | graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty
+2020/02/22 | 56695 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-2.9.tar.lzma
+2020/02/22 | 56417 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-2.9.tar.lzma
+2020/02/22 | 563461 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-x64-2.9.tar.lzma
+2020/02/22 | 561256 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-x64-2.9.tar.lzma
+2020/02/22 | 552 | indexing/upmendex/doc/samples/mdxsty02.ist
+2020/02/22 | 54898 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-2.9.tar.lzma
+2020/02/22 | 544811 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-x64-2.9.tar.lzma
+2020/02/22 | 540298 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-2.9.tar.lzma
+2020/02/22 | 53989 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-x64-2.9.tar.lzma
+2020/02/22 | 53464 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-2.9.tar.lzma
+2020/02/22 | 532963 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-2.9.tar.lzma
+2020/02/22 | 530100 | systems/texlive/tlnet/archive/l3kernel.source.r53862.tar.xz
+2020/02/22 | 528740 | systems/win32/miktex/tm/packages/next/files.csv.lzma
+2020/02/22 | 528480 | systems/win32/miktex/tm/packages/files.csv.lzma
+2020/02/22 | 524152 | systems/texlive/tlnet/archive/latex.source.r53857.tar.xz
+2020/02/22 | 521 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh22.ist
+2020/02/22 | 52045 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-2.9.tar.lzma
+2020/02/22 | 52017 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-x64-2.9.tar.lzma
+2020/02/22 | 509316 | indexing/upmendex.zip
+2020/02/22 | 50881 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-x64-2.9.tar.lzma
+2020/02/22 | 50855 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-x64-2.9.tar.lzma
+2020/02/22 | 50502 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-x64-2.9.tar.lzma
+2020/02/22 | 499162 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-2.9.tar.lzma
+2020/02/22 | 49695 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-2.9.tar.lzma
+2020/02/22 | 49314 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-2.9.tar.lzma
+2020/02/22 | 4908 | indexing/upmendex/source/c-auto.in
+2020/02/22 | 48 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
+2020/02/22 | 485753 | macros/latex/contrib/ntgclass/ntgclass.pdf
+2020/02/22 | 47985 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-x64-2.9.tar.lzma
+2020/02/22 | 4796672 | systems/texlive/tlnet/archive/wintools.win32.r53854.tar.xz
+2020/02/22 | 468114 | systems/win32/miktex/tm/packages/keyvaltable.tar.lzma
+2020/02/22 | 463 | indexing/upmendex/doc/samples/german.idx
+2020/02/22 | 46330 | indexing/upmendex/source/Makefile.in
+2020/02/22 | 46195 | graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex
+2020/02/22 | 45771 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-x64-2.9.tar.lzma
+2020/02/22 | 45691 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-x64-2.9.tar.lzma
+2020/02/22 | 456869 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-2.9.tar.lzma
+2020/02/22 | 45601 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-2.9.tar.lzma
+2020/02/22 | 455 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
+2020/02/22 | 455 | systems/texlive/tlnet/install-tl.zip.sha512.asc
+2020/02/22 | 455 | systems/texlive/tlnet/install-tl-windows.exe.sha512.asc
+2020/02/22 | 455 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512.asc
+2020/02/22 | 45467 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-2.9.tar.lzma
+2020/02/22 | 450322 | systems/win32/miktex/tm/packages/next/miktex-doc-2.9.tar.lzma
+2020/02/22 | 44940 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-x64-2.9.tar.lzma
+2020/02/22 | 4485 | indexing/upmendex/doc/samples/alphabet/alpha_zhr.idx
+2020/02/22 | 43971 | indexing/upmendex/source/aclocal.m4
+2020/02/22 | 4393 | indexing/upmendex/source/ChangeLog
+2020/02/22 | 435 | indexing/upmendex/source/tests/uni.idx
+2020/02/22 | 435 | indexing/upmendex/doc/samples/french.idx
+2020/02/22 | 43425 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-2.9.tar.lzma
+2020/02/22 | 42927 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-x64-2.9.tar.lzma
+2020/02/22 | 425960 | systems/texlive/tlnet/archive/keyvaltable.doc.r53861.tar.xz
+2020/02/22 | 42574 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-2.9.tar.lzma
+2020/02/22 | 422268 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.8.3.sty
+2020/02/22 | 4213 | macros/latex/contrib/ntgclass/ntgclass.ins
+2020/02/22 | 418 | graphics/pgf/contrib/circuitikz/doc/compatibility.tex
+2020/02/22 | 41872 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-2.9.tar.lzma
+2020/02/22 | 41872 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-2.9.tar.lzma
+2020/02/22 | 416850 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz-0.8.3.tex
+2020/02/22 | 412 | indexing/upmendex/source/exhanzi.h
+2020/02/22 | 41032 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-2.9.tar.lzma
+2020/02/22 | 406 | indexing/upmendex/source/kp.h
+2020/02/22 | 40600 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-2.9.tar.lzma
+2020/02/22 | 4039 | indexing/upmendex/doc/samples/alphabet/alpha_zh.idx
+2020/02/22 | 403539 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.7.sty
+2020/02/22 | 400 | indexing/upmendex/source/qsort.h
+2020/02/22 | 3949331 | systems/texlive/tlnet/install-tl-unx.tar.gz
+2020/02/22 | 394431 | macros/latex/contrib/biblatex-contrib/biblatex-apa.zip
+2020/02/22 | 3941456 | systems/texlive/tlnet/archive/tlshell.win32.r53854.tar.xz
+2020/02/22 | 393856 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.6.sty
+2020/02/22 | 39186 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-2.9.tar.lzma
+2020/02/22 | 391673 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-x64-2.9.tar.lzma
+2020/02/22 | 3891 | indexing/upmendex/source/kana.h
+2020/02/22 | 38892 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-x64-2.9.tar.lzma
+2020/02/22 | 387424 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-x64-2.9.tar.lzma
+2020/02/22 | 376208 | macros/latex/contrib/overpic.zip
+2020/02/22 | 371 | indexing/upmendex/doc/samples/Makefile
+2020/02/22 | 371275 | macros/latex/contrib/overpic/overpic.pdf
+2020/02/22 | 36618 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-x64-2.9.tar.lzma
+2020/02/22 | 364086 | graphics/pgf/contrib/circuitikz/tex/circuitikz-0.4.sty
+2020/02/22 | 36327 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-x64-2.9.tar.lzma
+2020/02/22 | 3590 | graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+2020/02/22 | 356274 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-x64-2.9.tar.lzma
+2020/02/22 | 354609 | install/macros/generic/expkv.tds.zip
+2020/02/22 | 354437 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-2.9.tar.lzma
+2020/02/22 | 350477 | macros/generic/expkv.zip
+2020/02/22 | 348927 | macros/latex/contrib/ntgclass/brief.pdf
+2020/02/22 | 34841 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-x64-2.9.tar.lzma
+2020/02/22 | 34841 | graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
+2020/02/22 | 34833 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-x64-2.9.tar.lzma
+2020/02/22 | 34640 | systems/texlive/tlnet/archive/siunitx.r53856.tar.xz
+2020/02/22 | 34428 | systems/texlive/tlnet/archive/keyvaltable.source.r53861.tar.xz
+2020/02/22 | 340 | indexing/upmendex/doc/samples/greek.idx
+2020/02/22 | 340584 | macros/generic/expkv/expkv.pdf
+2020/02/22 | 337 | indexing/upmendex/source/ac/withenable.ac
+2020/02/22 | 33552 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-2.9.tar.lzma
+2020/02/22 | 334 | indexing/upmendex/doc/samples/option/mdxsty_rule0.ist
+2020/02/22 | 33423 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-x64-2.9.tar.lzma
+2020/02/22 | 3340 | systems/texlive/tlnet/archive/rgltxdoc.r53858.tar.xz
+2020/02/22 | 333 | indexing/upmendex/source/indexsty
+2020/02/22 | 332 | systems/win32/miktex/tm/packages/pr.ini
+2020/02/22 | 328795 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-2.9.tar.lzma
+2020/02/22 | 326 | indexing/upmendex/doc/samples/multi.idx
+2020/02/22 | 32559 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.tex
+2020/02/22 | 32337 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-x64-2.9.tar.lzma
+2020/02/22 | 3224 | macros/latex/contrib/ntgclass/a4.ins
+2020/02/22 | 32241 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-2.9.tar.lzma
+2020/02/22 | 321906 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-2.9.tar.lzma
+2020/02/22 | 31844 | systems/texlive/tlnet/archive/l3build.r53862.tar.xz
+2020/02/22 | 3156 | graphics/pgf/contrib/circuitikz/README.md
+2020/02/22 | 31191 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-x64-2.9.tar.lzma
+2020/02/22 | 31155 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-2.9.tar.lzma
+2020/02/22 | 311434 | indexing/upmendex/man/upmendex.man1.pdf
+2020/02/22 | 3098 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-legacy.tex
+2020/02/22 | 30988 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-2.9.tar.lzma
+2020/02/22 | 309612 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-x64-2.9.tar.lzma
+2020/02/22 | 30851 | graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
+2020/02/22 | 30767 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-x64-2.9.tar.lzma
+2020/02/22 | 30230 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-x64-2.9.tar.lzma
+2020/02/22 | 301 | indexing/upmendex/doc/samples/alphabet/mdxsty_es12.ist
+2020/02/22 | 300 | indexing/upmendex/doc/samples/alphabet/mdxsty_es13.ist
+2020/02/22 | 300 | indexing/upmendex/doc/samples/alphabet/mdxsty_es11.ist
+2020/02/22 | 2977 | indexing/upmendex/README.md
+2020/02/22 | 29703 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-x64-2.9.tar.lzma
+2020/02/22 | 296 | indexing/upmendex/doc/samples/alphabet/mdxsty_es22.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh31.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh21.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh11.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_es23.ist
+2020/02/22 | 295 | indexing/upmendex/doc/samples/alphabet/mdxsty_es21.ist
+2020/02/22 | 295279 | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+2020/02/22 | 29316 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-2.9.tar.lzma
+2020/02/22 | 29304 | systems/texlive/tlnet/archive/l3build.source.r53862.tar.xz
+2020/02/22 | 2926189 | macros/latex/contrib/xsim.zip
+2020/02/22 | 29254 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-2.9.tar.lzma
+2020/02/22 | 29169 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-x64-2.9.tar.lzma
+2020/02/22 | 289 | indexing/upmendex/doc/samples/mdxsty01.ist
+2020/02/22 | 28720 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-x64-2.9.tar.lzma
+2020/02/22 | 285 | indexing/upmendex/doc/samples/option/mdxsty_j02.ist
+2020/02/22 | 28530 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-2.9.tar.lzma
+2020/02/22 | 281511 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-x64-2.9.tar.lzma
+2020/02/22 | 281322 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-x64-2.9.tar.lzma
+2020/02/22 | 280 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-example.tex
+2020/02/22 | 279 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh2.ist
+2020/02/22 | 279 | indexing/upmendex/doc/samples/alphabet/mdxsty_es2.ist
+2020/02/22 | 27948 | indexing/upmendex/source/fwrite.c
+2020/02/22 | 278 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh1.ist
+2020/02/22 | 278 | indexing/upmendex/doc/samples/alphabet/mdxsty_es1.ist
+2020/02/22 | 27782 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-2.9.tar.lzma
+2020/02/22 | 276690 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-x64-2.9.tar.lzma
+2020/02/22 | 272 | indexing/upmendex/source/tests/uni.ist
+2020/02/22 | 272523 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-2.9.tar.lzma
+2020/02/22 | 271 | indexing/upmendex/doc/samples/option/mdxsty_j01.ist
+2020/02/22 | 271 | indexing/upmendex/doc/samples/option/mdxsty_j00.ist
+2020/02/22 | 26875 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-2.9.tar.lzma
+2020/02/22 | 26792 | systems/texlive/tlnet/archive/fontspec.r53860.tar.xz
+2020/02/22 | 26773 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-2.9.tar.lzma
+2020/02/22 | 26728 | systems/texlive/tlnet/archive/texdoc.r53859.tar.xz
+2020/02/22 | 26662 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-2.9.tar.lzma
+2020/02/22 | 26501 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-2.9.tar.lzma
+2020/02/22 | 260 | indexing/upmendex/doc/samples/mdxsty00.ist
+2020/02/22 | 2579567 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-x64-2.9.tar.lzma
+2020/02/22 | 256462 | macros/latex/contrib/ntgclass/a4.pdf
+2020/02/22 | 25304 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-2.9.tar.lzma
+2020/02/22 | 24872 | fonts/libertinus-otf/latex/libertinus-otf.sty
+2020/02/22 | 247553 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-2.9.tar.lzma
+2020/02/22 | 247179 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-2.9.tar.lzma
+2020/02/22 | 246426 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-2.9.tar.lzma
+2020/02/22 | 2457968 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-2.9.tar.lzma
+2020/02/22 | 243360 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-x64-2.9.tar.lzma
+2020/02/22 | 23518 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-x64-2.9.tar.lzma
+2020/02/22 | 23460 | graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex
+2020/02/22 | 2329 | indexing/upmendex/source/mendex.h
+2020/02/22 | 2318 | indexing/upmendex/source/configure.ac
+2020/02/22 | 2305 | graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
+2020/02/22 | 22935 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-x64-2.9.tar.lzma
+2020/02/22 | 226045 | graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+2020/02/22 | 22541695 | systems/texlive/tlnet/install-tl.zip
+2020/02/22 | 223019 | macros/latex/contrib/ntgclass/artdoc.pdf
+2020/02/22 | 22183 | graphics/pgf/contrib/circuitikz/doc/changelog.tex
+2020/02/22 | 221784 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
+2020/02/22 | 2171508 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
+2020/02/22 | 215429 | systems/win32/miktex/tm/packages/next/miktex-console-bin-x64-2.9.tar.lzma
+2020/02/22 | 2144 | indexing/upmendex/doc/samples/alphabet/alpha_zhz.idx
+2020/02/22 | 2105 | indexing/upmendex/source/var.h
+2020/02/22 | 21044 | macros/latex/contrib/ntgclass/a4.dtx
+2020/02/22 | 207773 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-2.9.tar.lzma
+2020/02/22 | 2069620 | macros/latex/contrib/ntgclass.zip
+2020/02/22 | 20667 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-2.9.tar.lzma
+2020/02/22 | 2048 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
+2020/02/22 | 202501 | macros/latex/contrib/ntgclass/rapdoc.pdf
+2020/02/22 | 1992 | indexing/upmendex/doc/samples/alphabet/alpha_es.idx
+2020/02/22 | 199193 | systems/win32/miktex/tm/packages/next/miktex-console-bin-2.9.tar.lzma
+2020/02/22 | 19892 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-2.9.tar.lzma
+2020/02/22 | 196878 | systems/win32/miktex/tm/packages/next/miktex-zzdb1-2.9.tar.lzma
+2020/02/22 | 196878 | systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma
+2020/02/22 | 19515 | indexing/upmendex/source/hanzi.h
+2020/02/22 | 195007 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-2.9.tar.lzma
+2020/02/22 | 1946009 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-x64-2.9.tar.lzma
+2020/02/22 | 193652 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-x64-2.9.tar.lzma
+2020/02/22 | 193586 | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+2020/02/22 | 192220 | macros/latex/contrib/suftesi/suftesi.dtx
+2020/02/22 | 1891 | indexing/upmendex/doc/samples/alphabet/alpha_zhp.idx
+2020/02/22 | 18833 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
+2020/02/22 | 18831 | macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
+2020/02/22 | 1875 | graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex
+2020/02/22 | 18700754 | systems/texlive/tlnet/install-tl-windows.exe
+2020/02/22 | 186883 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-2.9.tar.lzma
+2020/02/22 | 185325 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-x64-2.9.tar.lzma
+2020/02/22 | 1842 | indexing/upmendex/source/ktable.h
+2020/02/22 | 18428188 | systems/texlive/tlnet/archive/latex.doc.r53857.tar.xz
+2020/02/22 | 184257 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-x64-2.9.tar.lzma
+2020/02/22 | 183210 | macros/latex/contrib/ntgclass/ntgclass.dtx
+2020/02/22 | 182805 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-x64-2.9.tar.lzma
+2020/02/22 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh14.ist
+2020/02/22 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh13.ist
+2020/02/22 | 1807 | indexing/upmendex/doc/samples/alphabet/mdxsty_zh12.ist
+2020/02/22 | 17754 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-x64-2.9.tar.lzma
+2020/02/22 | 177510 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-x64-2.9.tar.lzma
+2020/02/22 | 17749 | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+2020/02/22 | 17672 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-x64-2.9.tar.lzma
+2020/02/22 | 1760394 | install/graphics/pgf/contrib/circuitikz.tds.zip
+2020/02/22 | 1748109 | graphics/pgf/contrib/circuitikz.zip
+2020/02/22 | 1744 | macros/latex/contrib/biblatex-contrib/biblatex-apa/README
+2020/02/22 | 17143 | macros/latex/contrib/fontsize/fontsize.dtx
+2020/02/22 | 1711484 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-2.9.tar.lzma
+2020/02/22 | 169210 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-2.9.tar.lzma
+2020/02/22 | 168616 | systems/texlive/tlnet/archive/latex.r53857.tar.xz
+2020/02/22 | 1680 | macros/latex/contrib/suftesi/README
+2020/02/22 | 167814 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-2.9.tar.lzma
+2020/02/22 | 167253 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-x64-2.9.tar.lzma
+2020/02/22 | 16668 | indexing/upmendex/doc/upmendex.ja.txt
+2020/02/22 | 164889 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-2.9.tar.lzma
+2020/02/22 | 16358 | indexing/upmendex/man/upmendex.1
+2020/02/22 | 1616 | fonts/libertinus-otf/Changes
+2020/02/22 | 16167905 | systems/texlive/tlnet/tlpkg/texlive.tlpdb
+2020/02/22 | 161168 | systems/texlive/tlnet/archive/rgltxdoc.doc.r53858.tar.xz
+2020/02/22 | 160715 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-x64-2.9.tar.lzma
+2020/02/22 | 16046 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-2.9.tar.lzma
+2020/02/22 | 15881 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-2.9.tar.lzma
+2020/02/22 | 153 | systems/texlive/tlnet/install-tl-windows.exe.sha512
+2020/02/22 | 152 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512
+2020/02/22 | 1521 | macros/latex/contrib/fontsize/README
+2020/02/22 | 152099 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-x64-2.9.tar.lzma
+2020/02/22 | 149788 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-x64-2.9.tar.lzma
+2020/02/22 | 1495487 | install/macros/latex/contrib/suftesi.tds.zip
+2020/02/22 | 148716 | systems/texlive/tlnet/archive/l3kernel.r53862.tar.xz
+2020/02/22 | 148482 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-2.9.tar.lzma
+2020/02/22 | 1479754 | macros/latex/contrib/suftesi.zip
+2020/02/22 | 1477 | indexing/upmendex/doc/samples/korean.idx
+2020/02/22 | 147334 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-2.9.tar.lzma
+2020/02/22 | 1464 | indexing/upmendex/COPYRIGHT
+2020/02/22 | 145 | systems/texlive/tlnet/install-tl.zip.sha512
+2020/02/22 | 14523 | macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
+2020/02/22 | 144 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
+2020/02/22 | 14053 | graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
+2020/02/22 | 14047 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-x64-2.9.tar.lzma
+2020/02/22 | 1382985 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-x64-2.9.tar.lzma
+2020/02/22 | 13792 | macros/latex/contrib/ntgclass/ChangeLog
+2020/02/22 | 137120 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-2.9.tar.lzma
+2020/02/22 | 1357 | macros/latex/contrib/ntgclass/MANIFEST
+2020/02/22 | 133252 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-2.9.tar.lzma
+2020/02/22 | 132412 | systems/texlive/tlnet/archive/texdoc.doc.r53859.tar.xz
+2020/02/22 | 131160 | macros/latex/contrib/ntgclass/classdoc.pdf
+2020/02/22 | 13062 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-2.9.tar.lzma
+2020/02/22 | 130308 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-x64-2.9.tar.lzma
+2020/02/22 | 13004 | indexing/upmendex/source/sort.c
+2020/02/22 | 1299441 | systems/win32/miktex/tm/packages/fontspec.tar.lzma
+2020/02/22 | 129699 | macros/latex/contrib/ntgclass/briefdoc.pdf
+2020/02/22 | 12966 | indexing/upmendex/source/fread.c
+2020/02/22 | 1291 | indexing/upmendex/source/exvar.h
+2020/02/22 | 12833 | macros/latex/contrib/overpic/overpic.dtx
+2020/02/22 | 12785 | macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-citations.bib
+2020/02/22 | 1264 | macros/generic/expkv/README.md
+2020/02/22 | 1249271 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-2.9.tar.lzma
+2020/02/22 | 12394 | macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
+2020/02/22 | 12386 | macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
+2020/02/22 | 1231280 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-x64-2.9.tar.lzma
+2020/02/22 | 12304 | macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
+2020/02/22 | 12296 | macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
+2020/02/22 | 12280 | macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
+2020/02/22 | 12253 | macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
+2020/02/22 | 1200 | indexing/upmendex/doc/samples/alphabet/alpha_zhs.idx
+2020/02/22 | 1190 | indexing/upmendex/source/kp.c
+2020/02/22 | 1189088 | systems/texlive/tlnet/archive/fontspec.doc.r53860.tar.xz
+2020/02/22 | 1178199 | systems/win32/miktex/tm/packages/miktex-zzdb2-2.9.tar.lzma
+2020/02/22 | 1177960 | systems/win32/miktex/tm/packages/next/miktex-zzdb2-2.9.tar.lzma
+2020/02/22 | 1173 | indexing/upmendex/source/Makefile.am
+2020/02/22 | 116661 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-x64-2.9.tar.lzma
+2020/02/22 | 115594 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-2.9.tar.lzma
+2020/02/22 | 1130956 | systems/win32/miktex/tm/packages/nameauth.tar.lzma
+2020/02/22 | 111305 | macros/luatex/latex/emoji/emoji.sty
+2020/02/22 | 111161 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-x64-2.9.tar.lzma
+2020/02/22 | 1104159 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-2.9.tar.lzma
+2020/02/22 | 1097647 | systems/win32/miktex/tm/packages/next/miktex-zzdb3-2.9.tar.lzma
+2020/02/22 | 1097620 | systems/win32/miktex/tm/packages/miktex-zzdb3-2.9.tar.lzma
+2020/02/22 | 1095 | indexing/upmendex/doc/samples/option/attri1.idx
+2020/02/22 | 10910 | graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+2020/02/22 | 108873 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-x64-2.9.tar.lzma
+2020/02/22 | 10543110 | systems/win32/miktex/tm/packages/l3kernel.tar.lzma
+2020/02/22 | 1052 | indexing/upmendex/source/pageread.c
+2020/02/22 | 1052036 | systems/texlive/tlnet/archive/nameauth.doc.r53863.tar.xz
+2020/02/22 | 10457 | macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
+2020/02/22 | 1042551 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-x64-2.9.tar.lzma
+2020/02/22 | 1041977 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-x64-2.9.tar.lzma
+2020/02/22 | 103308 | systems/texlive/tlnet/archive/siunitx.source.r53856.tar.xz
+2020/02/22 | 102516 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-x64-2.9.tar.lzma
+2020/02/22 | 10083 | indexing/upmendex/source/styfile.c
+2020/02/22 | 100709 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-2.9.tar.lzma
+2020/02/22 | 10017 | macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
+2020/02/22 | 10015 | macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
2020/02/21 | 9999 | macros/latex/contrib/l3kernel/l3news10.tex
2020/02/21 | 9772 | macros/latex/contrib/l3kernel/l3docstrip.dtx
2020/02/21 | 9656 | macros/latex/contrib/l3kernel/l3unicode.dtx
-2020/02/21 | 96320 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-x64-2.9.tar.lzma
+2020/02/21 | 95065 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-350028.pdf
+2020/02/21 | 948 | macros/latex/contrib/xsim/doc/examples/xsim.randomexercises.tex
2020/02/21 | 9465 | macros/latex/contrib/l3kernel/l3news08.tex
2020/02/21 | 9450 | macros/latex/contrib/l3kernel/l3flag.dtx
-2020/02/21 | 94300 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-x64-2.9.tar.lzma
-2020/02/21 | 94105 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-2.9.tar.lzma
-2020/02/21 | 937769 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-2.9.tar.lzma
2020/02/21 | 9356 | macros/latex/contrib/fontspec/fontspec-code-feat-aat.dtx
-2020/02/21 | 93442 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-2.9.tar.lzma
-2020/02/21 | 932994 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-2.9.tar.lzma
2020/02/21 | 9309 | macros/latex/contrib/fontspec/fontspec-doc-enc.tex
-2020/02/21 | 92933 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-2.9.tar.lzma
-2020/02/21 | 92095 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-x64-2.9.tar.lzma
-2020/02/21 | 91384 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-x64-2.9.tar.lzma
-2020/02/21 | 91343 | systems/win32/miktex/tm/packages/next/miktex-texware-bin-2.9.tar.lzma
+2020/02/21 | 927 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369636.tex
2020/02/21 | 9101 | macros/latex/contrib/fontspec/fontspec-code-vars.dtx
+2020/02/21 | 894 | macros/latex/contrib/xsim/doc/examples/xsim.grade-distribution.tex
2020/02/21 | 8943 | macros/latex/contrib/l3backend/l3backend-color.dtx
2020/02/21 | 8915 | macros/latex/contrib/l3build/l3build-install.lua
2020/02/21 | 88271 | macros/latex/contrib/l3kernel/l3int.dtx
-2020/02/21 | 87327 | systems/win32/miktex/tm/packages/next/miktex-mfware-bin-2.9.tar.lzma
-2020/02/21 | 87198 | systems/win32/miktex/tm/packages/next/miktex-png-bin-x64-2.9.tar.lzma
2020/02/21 | 8694 | macros/latex/contrib/fontspec/fontspec-code-xfss.dtx
2020/02/21 | 8673 | macros/latex/contrib/fontspec/fontspec-doc-intro.tex
-2020/02/21 | 86614 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-x64-2.9.tar.lzma
+2020/02/21 | 86646 | macros/latex/contrib/xsim/doc/examples/xsim.various.pdf
+2020/02/21 | 86047 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-13635.pdf
2020/02/21 | 85507 | macros/latex/contrib/l3kernel/l3coffins.dtx
2020/02/21 | 84830 | macros/latex/contrib/l3kernel/l3fp-basics.dtx
2020/02/21 | 8481 | macros/latex/contrib/l3kernel/l3news11.tex
-2020/02/21 | 8472 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-x64-2.9.tar.lzma
-2020/02/21 | 84567 | systems/win32/miktex/tm/packages/next/miktex-bibtex8bit-bin-2.9.tar.lzma
-2020/02/21 | 84332 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-x64-2.9.tar.lzma
+2020/02/21 | 8384768 | systems/win32/w32tex/uptex-w32.tar.xz
2020/02/21 | 8351 | macros/latex/contrib/fontspec/fontspec-code-msg.dtx
2020/02/21 | 82562 | macros/latex/contrib/l3kernel/l3seq.dtx
-2020/02/21 | 80461 | systems/win32/miktex/tm/packages/next/miktex-mpmcli-bin-2.9.tar.lzma
+2020/02/21 | 821 | macros/latex/contrib/xsim/doc/examples/xsim.listings.tex
+2020/02/21 | 8024 | macros/latex/contrib/xsim/doc/xsim.history
2020/02/21 | 789044 | install/macros/latex/contrib/l3build.tds.zip
2020/02/21 | 785096 | macros/latex/contrib/l3build.zip
2020/02/21 | 784873 | install/macros/latex/contrib/l3backend.tds.zip
-2020/02/21 | 78019 | systems/win32/miktex/tm/packages/next/miktex-png-bin-2.9.tar.lzma
-2020/02/21 | 77832 | systems/win32/miktex/tm/packages/next/miktex-mkfntmap-bin-2.9.tar.lzma
-2020/02/21 | 77341 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-x64-2.9.tar.lzma
+2020/02/21 | 776 | macros/latex/contrib/xsim/doc/examples/xsim.description-list.tex
2020/02/21 | 77128 | macros/latex/contrib/l3kernel/l3box.dtx
2020/02/21 | 769891 | systems/win32/miktex/tm/packages/siunitx.tar.lzma
2020/02/21 | 760637 | macros/latex/contrib/l3backend.zip
2020/02/21 | 7599 | macros/latex/contrib/l3build/l3build-arguments.lua
2020/02/21 | 75907 | macros/latex/contrib/l3kernel/l3skip.dtx
2020/02/21 | 7529 | macros/latex/contrib/fontspec/fontspec-doc-style.sty
-2020/02/21 | 7497 | systems/win32/miktex/tm/packages/next/miktex-md5-bin-2.9.tar.lzma
-2020/02/21 | 74351 | systems/win32/miktex/tm/packages/next/miktex-texify-bin-2.9.tar.lzma
2020/02/21 | 74349 | macros/latex/contrib/l3kernel/l3clist.dtx
2020/02/21 | 74225 | macros/latex/contrib/l3kernel/l3prefixes.pdf
2020/02/21 | 742217 | macros/latex/contrib/l3backend/l3backend-code.pdf
2020/02/21 | 73859 | macros/latex/contrib/l3kernel/l3fp-trig.dtx
-2020/02/21 | 73636 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-x64-2.9.tar.lzma
+2020/02/21 | 7301 | macros/latex/contrib/xsim/code/xsim.auxfile.code.tex
2020/02/21 | 72855 | macros/latex/contrib/l3kernel/l3str.dtx
-2020/02/21 | 72710 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-x64-2.9.tar.lzma
-2020/02/21 | 72567 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-x64-2.9.tar.lzma
+2020/02/21 | 7268 | macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex
2020/02/21 | 7205 | macros/latex/contrib/l3build/l3build-manifest.lua
2020/02/21 | 7191 | macros/latex/contrib/fontspec/fontspec-code-interfaces.dtx
-2020/02/21 | 71709 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-x64-2.9.tar.lzma
2020/02/21 | 71688 | macros/latex/contrib/l3kernel/l3msg.dtx
2020/02/21 | 706664 | macros/latex/contrib/l3build/l3build.pdf
2020/02/21 | 7045 | macros/latex/contrib/l3build/l3build-typesetting.lua
2020/02/21 | 70305 | macros/latex/contrib/l3kernel/l3fp.dtx
-2020/02/21 | 69855 | systems/win32/miktex/tm/packages/next/miktex-fonts-bin-2.9.tar.lzma
2020/02/21 | 6970 | macros/latex/contrib/l3kernel/l3fp-assign.dtx
-2020/02/21 | 69213 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-x64-2.9.tar.lzma
2020/02/21 | 6881 | macros/latex/contrib/l3build/l3build-variables.lua
-2020/02/21 | 68740 | systems/win32/miktex/tm/packages/next/miktex-freeglut-bin-2.9.tar.lzma
+2020/02/21 | 6843 | macros/latex/contrib/xsim/code/xsim.modules.code.tex
2020/02/21 | 68329 | macros/latex/contrib/l3kernel/l3candidates.dtx
-2020/02/21 | 67274 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-x64-2.9.tar.lzma
-2020/02/21 | 67255 | systems/win32/miktex/tm/packages/next/miktex-lzma-bin-2.9.tar.lzma
-2020/02/21 | 669501 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-x64-2.9.tar.lzma
+2020/02/21 | 6791 | macros/latex/contrib/xsim/code/xsim.base.code.tex
2020/02/21 | 6677 | macros/latex/contrib/l3kernel/l3news02.tex
-2020/02/21 | 652 | systems/win32/miktex/tm/packages/next/pr.ini
-2020/02/21 | 65092 | systems/win32/miktex/tm/packages/next/miktex-web-bin-x64-2.9.tar.lzma
+2020/02/21 | 6642 | macros/latex/contrib/xsim/code/xsim.tags.code.tex
+2020/02/21 | 65721 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369065.pdf
+2020/02/21 | 653 | macros/latex/contrib/xsim/doc/examples/xsim.pointsums.tex
+2020/02/21 | 65379 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-91339.pdf
2020/02/21 | 6482 | macros/latex/contrib/l3kernel/l3news03.tex
-2020/02/21 | 64382 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-x64-2.9.tar.lzma
2020/02/21 | 6431 | macros/latex/contrib/l3kernel/l3news06.tex
2020/02/21 | 64264 | macros/latex/contrib/l3kernel/l3prg.dtx
2020/02/21 | 6385 | macros/latex/contrib/fontspec/fontspec-code-opening.dtx
-2020/02/21 | 63291 | systems/win32/miktex/tm/packages/next/miktex-graphite2-bin-2.9.tar.lzma
-2020/02/21 | 63283 | systems/win32/miktex/tm/packages/next/miktex-ps2pk-bin-2.9.tar.lzma
-2020/02/21 | 63105 | systems/win32/miktex/tm/packages/next/miktex-tex4ht-bin-2.9.tar.lzma
+2020/02/21 | 6348788 | systems/win32/w32tex/ptex-ng-w32.tar.xz
2020/02/21 | 629912 | macros/latex/contrib/fontspec/fontspec-code.pdf
-2020/02/21 | 62839 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-x64-2.9.tar.lzma
2020/02/21 | 6236 | macros/latex/contrib/l3kernel/l3alloc.dtx
2020/02/21 | 6203 | macros/latex/contrib/l3kernel/l3color-base.dtx
-2020/02/21 | 61700 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-x64-2.9.tar.lzma
2020/02/21 | 61697 | macros/latex/contrib/l3kernel/expl3.dtx
-2020/02/21 | 61608 | systems/win32/miktex/tm/packages/next/miktex-web-bin-2.9.tar.lzma
-2020/02/21 | 615495 | systems/win32/miktex/tm/packages/next/miktex-lcdf-typetools-bin-2.9.tar.lzma
-2020/02/21 | 61079 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-x64-2.9.tar.lzma
+2020/02/21 | 613 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.tex
2020/02/21 | 6104 | macros/latex/contrib/l3kernel/l3syntax-changes.tex
2020/02/21 | 6074 | macros/latex/contrib/l3kernel/l3.ins
2020/02/21 | 6038 | macros/latex/contrib/fontspec/fontspec-code-scripts.dtx
-2020/02/21 | 60323 | systems/win32/miktex/tm/packages/next/miktex-bibtex-bin-2.9.tar.lzma
2020/02/21 | 600048 | macros/latex/contrib/fontspec/fontspec.pdf
-2020/02/21 | 59420 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-x64-2.9.tar.lzma
-2020/02/21 | 58859 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-x64-2.9.tar.lzma
+2020/02/21 | 594044 | systems/win32/w32tex/ChangeLog
+2020/02/21 | 5844 | macros/latex/contrib/xsim/doc/examples/xsim.various.tex
2020/02/21 | 584457 | macros/latex/contrib/l3kernel/expl3.pdf
-2020/02/21 | 57751 | systems/win32/miktex/tm/packages/next/miktex-gsf2pk-bin-2.9.tar.lzma
+2020/02/21 | 5840 | macros/latex/contrib/xsim/code/xsim.blanks.code.tex
2020/02/21 | 5772085 | macros/latex/contrib/l3kernel/source3.pdf
-2020/02/21 | 576147 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-x64-2.9.tar.lzma
-2020/02/21 | 57187 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-x64-2.9.tar.lzma
+2020/02/21 | 57235 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-338165.pdf
+2020/02/21 | 57220 | macros/latex/contrib/xsim/doc/examples/xsim.listofexercises.pdf
+2020/02/21 | 570 | macros/latex/contrib/xsim/doc/examples/xsim.boxed-headings.tex
2020/02/21 | 5701 | macros/latex/contrib/l3kernel/l3format.ins
-2020/02/21 | 56696 | systems/win32/miktex/tm/packages/next/miktex-fmt-bin-2.9.tar.lzma
-2020/02/21 | 56415 | systems/win32/miktex/tm/packages/next/miktex-mthelp-bin-2.9.tar.lzma
-2020/02/21 | 563461 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-x64-2.9.tar.lzma
-2020/02/21 | 561256 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-x64-2.9.tar.lzma
+2020/02/21 | 56153 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.pdf
2020/02/21 | 550 | macros/latex/contrib/l3backend/README.md
+2020/02/21 | 55079 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369803.pdf
2020/02/21 | 549 | macros/latex/contrib/fontspec/fontspec.cfg
-2020/02/21 | 54898 | systems/win32/miktex/tm/packages/next/miktex-ttf2pk2-bin-2.9.tar.lzma
-2020/02/21 | 544810 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-x64-2.9.tar.lzma
+2020/02/21 | 542 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-370642.tex
2020/02/21 | 5429 | macros/latex/contrib/l3kernel/l3news04.tex
-2020/02/21 | 540298 | systems/win32/miktex/tm/packages/next/miktex-log4cxx-bin-2.9.tar.lzma
-2020/02/21 | 53990 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-x64-2.9.tar.lzma
2020/02/21 | 5392 | macros/latex/contrib/l3build/l3build.lua
-2020/02/21 | 53463 | systems/win32/miktex/tm/packages/next/miktex-tdsutil-bin-2.9.tar.lzma
-2020/02/21 | 532964 | systems/win32/miktex/tm/packages/next/miktex-yap-bin-2.9.tar.lzma
-2020/02/21 | 528740 | systems/win32/miktex/tm/packages/next/files.csv.lzma
-2020/02/21 | 528527 | systems/win32/miktex/tm/packages/files.csv.lzma
-2020/02/21 | 52045 | systems/win32/miktex/tm/packages/next/miktex-cweb-bin-2.9.tar.lzma
-2020/02/21 | 52017 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-x64-2.9.tar.lzma
+2020/02/21 | 5317 | macros/latex/contrib/xsim/code/xsim.templates.code.tex
2020/02/21 | 51073 | macros/latex/contrib/l3kernel/l3fp-extended.dtx
-2020/02/21 | 50882 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-x64-2.9.tar.lzma
-2020/02/21 | 50855 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-x64-2.9.tar.lzma
-2020/02/21 | 50502 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-x64-2.9.tar.lzma
-2020/02/21 | 499163 | systems/win32/miktex/tm/packages/next/miktex-libressl-bin-2.9.tar.lzma
+2020/02/21 | 50580 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-395273.pdf
2020/02/21 | 4977 | macros/latex/contrib/l3kernel/l3news07.tex
-2020/02/21 | 49693 | systems/win32/miktex/tm/packages/next/miktex-bibarts-bin-2.9.tar.lzma
2020/02/21 | 49619 | macros/latex/contrib/l3kernel/l3prop.dtx
+2020/02/21 | 49615904 | systems/win32/w32tex/xetex-w32.tar.xz
2020/02/21 | 49394 | macros/latex/contrib/l3kernel/l3fp-expo.dtx
2020/02/21 | 4935 | macros/latex/contrib/l3kernel/l3news01.tex
-2020/02/21 | 49316 | systems/win32/miktex/tm/packages/next/miktex-cjkutils-bin-2.9.tar.lzma
+2020/02/21 | 4934684 | systems/win32/w32tex/aleph-w32.tar.xz
2020/02/21 | 4929 | macros/latex/contrib/fontspec/fontspec-code-enc.dtx
2020/02/21 | 49096 | macros/latex/contrib/l3kernel/l3text-case.dtx
-2020/02/21 | 48 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
-2020/02/21 | 47986 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-x64-2.9.tar.lzma
+2020/02/21 | 4826 | macros/latex/contrib/xsim/code/xsim.translations.code.tex
+2020/02/21 | 48094 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-299534.pdf
2020/02/21 | 47981 | macros/latex/contrib/l3backend/l3backend-pdf.dtx
2020/02/21 | 47215 | macros/latex/contrib/l3kernel/l3fp-aux.dtx
2020/02/21 | 4716 | macros/latex/contrib/l3kernel/l3news05.tex
+2020/02/21 | 4706 | macros/latex/contrib/xsim/code/xsim.grades.code.tex
+2020/02/21 | 469 | macros/latex/contrib/xsim/doc/examples/xsim.blanks.tex
+2020/02/21 | 46504 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369636.pdf
+2020/02/21 | 46308 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-80640.pdf
2020/02/21 | 462340 | macros/latex/contrib/keyvaltable.zip
-2020/02/21 | 45772 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-x64-2.9.tar.lzma
-2020/02/21 | 45691 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-x64-2.9.tar.lzma
-2020/02/21 | 456871 | systems/win32/miktex/tm/packages/next/miktex-harfbuzz-bin-2.9.tar.lzma
-2020/02/21 | 45601 | systems/win32/miktex/tm/packages/next/miktex-m-tx-bin-2.9.tar.lzma
-2020/02/21 | 455 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
-2020/02/21 | 455 | systems/texlive/tlnet/install-tl.zip.sha512.asc
-2020/02/21 | 455 | systems/texlive/tlnet/install-tl-windows.exe.sha512.asc
-2020/02/21 | 455 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512.asc
-2020/02/21 | 45468 | systems/win32/miktex/tm/packages/next/miktex-findtexmf-bin-2.9.tar.lzma
+2020/02/21 | 46008 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdf
+2020/02/21 | 45738 | macros/latex/contrib/xsim/doc/examples/xsim.listings.pdf
+2020/02/21 | 45719 | macros/latex/contrib/xsim/doc/examples/xsim.hints.pdf
2020/02/21 | 4525 | macros/latex/contrib/l3kernel/l3news.tex
-2020/02/21 | 450322 | systems/win32/miktex/tm/packages/next/miktex-doc-2.9.tar.lzma
-2020/02/21 | 44941 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-x64-2.9.tar.lzma
+2020/02/21 | 4508 | macros/latex/contrib/xsim/code/xsim.sty
2020/02/21 | 4479 | macros/latex/contrib/l3build/l3build-ctan.lua
2020/02/21 | 44588 | macros/latex/contrib/fontspec/fontspec-doc-opentype.tex
-2020/02/21 | 43425 | systems/win32/miktex/tm/packages/next/miktex-expat-bin-2.9.tar.lzma
+2020/02/21 | 443 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-155630.tex
+2020/02/21 | 43899 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.pdf
+2020/02/21 | 43132780 | systems/win32/w32tex/web2c-w32.tar.xz
2020/02/21 | 4308 | macros/latex/contrib/l3build/l3build-stdmain.lua
-2020/02/21 | 42926 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-x64-2.9.tar.lzma
2020/02/21 | 42710 | macros/latex/contrib/l3backend/l3backend-draw.dtx
-2020/02/21 | 42574 | systems/win32/miktex/tm/packages/next/miktex-psutils-bin-2.9.tar.lzma
+2020/02/21 | 42513 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-498299.pdf
+2020/02/21 | 42153 | macros/latex/contrib/xsim/doc/examples/xsim.different-point-types.pdf
2020/02/21 | 42147 | macros/latex/contrib/l3kernel/l3debug.dtx
-2020/02/21 | 41874 | systems/win32/miktex/tm/packages/next/miktex-mtprint-bin-2.9.tar.lzma
-2020/02/21 | 41872 | systems/win32/miktex/tm/packages/next/miktex-synctex-bin-2.9.tar.lzma
-2020/02/21 | 41033 | systems/win32/miktex/tm/packages/next/miktex-dvicopy-bin-2.9.tar.lzma
+2020/02/21 | 41167 | macros/latex/contrib/xsim/doc/examples/xsim.description-list.pdf
2020/02/21 | 40930 | macros/latex/contrib/l3kernel/l3sort.dtx
2020/02/21 | 4071 | macros/latex/contrib/fontspec/fontspec-doc-luatex.tex
2020/02/21 | 40709 | macros/latex/contrib/l3kernel/l3tl-analysis.dtx
2020/02/21 | 40682 | macros/latex/contrib/fontspec/fontspec-code-internal.dtx
-2020/02/21 | 40600 | systems/win32/miktex/tm/packages/next/miktex-dvipng-bin-2.9.tar.lzma
2020/02/21 | 4037 | macros/latex/contrib/fontspec/fontspec-code-fontload.dtx
2020/02/21 | 4025 | macros/latex/contrib/nameauth/README
2020/02/21 | 3968 | macros/latex/contrib/fontspec/fontspec-code-graphite.dtx
-2020/02/21 | 3949279 | systems/texlive/tlnet/install-tl-unx.tar.gz
-2020/02/21 | 39186 | systems/win32/miktex/tm/packages/next/miktex-zlib-bin-2.9.tar.lzma
-2020/02/21 | 391674 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-x64-2.9.tar.lzma
+2020/02/21 | 3931 | macros/latex/contrib/xsim/README
2020/02/21 | 388 | systems/texlive/tlnet/archive/texlive-docindex.r53851.tar.xz
-2020/02/21 | 38892 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-x64-2.9.tar.lzma
2020/02/21 | 38840 | macros/latex/contrib/l3kernel/l3deprecation.dtx
-2020/02/21 | 387425 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-x64-2.9.tar.lzma
+2020/02/21 | 38749 | macros/latex/contrib/xsim/doc/examples/xsim.crossref.pdf
+2020/02/21 | 38376 | macros/latex/contrib/xsim/doc/examples/xsim.boxed-headings.pdf
2020/02/21 | 379209 | macros/latex/contrib/l3kernel/l3news.pdf
-2020/02/21 | 36617 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-x64-2.9.tar.lzma
-2020/02/21 | 36328 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-x64-2.9.tar.lzma
+2020/02/21 | 37708 | macros/latex/contrib/xsim/doc/examples/xsim.floating.pdf
+2020/02/21 | 36968 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-305110.pdf
+2020/02/21 | 36256 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-15093.pdf
2020/02/21 | 3622 | macros/latex/contrib/fontspec/fontspec.dtx
2020/02/21 | 3591 | macros/latex/contrib/l3backend/l3backend.ins
-2020/02/21 | 356275 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-x64-2.9.tar.lzma
-2020/02/21 | 354437 | systems/win32/miktex/tm/packages/next/miktex-omega-bin-2.9.tar.lzma
-2020/02/21 | 34840 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-x64-2.9.tar.lzma
-2020/02/21 | 34833 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-x64-2.9.tar.lzma
-2020/02/21 | 343 | systems/win32/miktex/tm/packages/pr.ini
+2020/02/21 | 3547 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-350028.tex
+2020/02/21 | 3442 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-80640.tex
+2020/02/21 | 3419 | macros/latex/contrib/xsim/code/xsimverb.sty
2020/02/21 | 33832 | macros/latex/contrib/l3build/l3build-check.lua
-2020/02/21 | 33551 | systems/win32/miktex/tm/packages/next/miktex-epstopdf-bin-2.9.tar.lzma
-2020/02/21 | 33423 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-x64-2.9.tar.lzma
-2020/02/21 | 328797 | systems/win32/miktex/tm/packages/next/miktex-cairo-bin-2.9.tar.lzma
+2020/02/21 | 33206 | macros/latex/contrib/xsim/doc/examples/xsim.collections.pdf
2020/02/21 | 3244 | macros/latex/contrib/l3build/l3build-aux.lua
-2020/02/21 | 32338 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-x64-2.9.tar.lzma
-2020/02/21 | 32241 | systems/win32/miktex/tm/packages/next/miktex-chktex-bin-2.9.tar.lzma
-2020/02/21 | 321907 | systems/win32/miktex/tm/packages/next/miktex-pdftex-bin-2.9.tar.lzma
+2020/02/21 | 31555 | macros/latex/contrib/xsim/doc/examples/xsim.difficulties.pdf
2020/02/21 | 31444 | macros/latex/contrib/l3kernel/l3prefixes.csv
-2020/02/21 | 31191 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-x64-2.9.tar.lzma
-2020/02/21 | 31152 | systems/win32/miktex/tm/packages/next/miktex-posix-bin-2.9.tar.lzma
+2020/02/21 | 3142 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-15093.tex
+2020/02/21 | 31016 | macros/latex/contrib/xsim/doc/examples/xsim.multiplechoice.pdf
2020/02/21 | 31015 | macros/latex/contrib/l3kernel/l3text.dtx
-2020/02/21 | 30988 | systems/win32/miktex/tm/packages/next/miktex-mspack-bin-2.9.tar.lzma
-2020/02/21 | 309614 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-x64-2.9.tar.lzma
-2020/02/21 | 30767 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-x64-2.9.tar.lzma
+2020/02/21 | 30938 | macros/latex/contrib/xsim/doc/examples/xsim.code-and-output.pdf
2020/02/21 | 3057 | macros/latex/contrib/fontspec/fontspec-lua.dtx
-2020/02/21 | 30230 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-x64-2.9.tar.lzma
+2020/02/21 | 30276388 | systems/win32/w32tex/latex.tar.xz
+2020/02/21 | 3022 | macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex
2020/02/21 | 2997 | macros/latex/contrib/l3kernel/README.md
+2020/02/21 | 29952 | macros/latex/contrib/xsim/doc/examples/xsim.blanks.pdf
2020/02/21 | 29795 | macros/latex/contrib/fontspec/fontspec-doc-fontsel.tex
-2020/02/21 | 29704 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-x64-2.9.tar.lzma
-2020/02/21 | 29317 | systems/win32/miktex/tm/packages/next/miktex-axohelp-bin-2.9.tar.lzma
-2020/02/21 | 29255 | systems/win32/miktex/tm/packages/next/miktex-arctrl-bin-2.9.tar.lzma
-2020/02/21 | 29170 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-x64-2.9.tar.lzma
-2020/02/21 | 28721 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-x64-2.9.tar.lzma
-2020/02/21 | 28530 | systems/win32/miktex/tm/packages/next/miktex-autosp-bin-2.9.tar.lzma
2020/02/21 | 2846 | macros/latex/contrib/fontspec/README.md
+2020/02/21 | 28426 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-370642.pdf
2020/02/21 | 2817 | macros/latex/contrib/l3kernel/l3prefixes.tex
-2020/02/21 | 281512 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-x64-2.9.tar.lzma
-2020/02/21 | 281322 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-x64-2.9.tar.lzma
+2020/02/21 | 28127 | macros/latex/contrib/xsim/doc/examples/xsim.pointsums.pdf
2020/02/21 | 279770 | macros/latex/contrib/l3kernel/l3styleguide.pdf
2020/02/21 | 2795 | macros/latex/contrib/l3build/l3build-unpack.lua
-2020/02/21 | 27784 | systems/win32/miktex/tm/packages/next/miktex-lacheck-bin-2.9.tar.lzma
-2020/02/21 | 276689 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-x64-2.9.tar.lzma
-2020/02/21 | 272523 | systems/win32/miktex/tm/packages/next/miktex-dvipdfmx-bin-2.9.tar.lzma
-2020/02/21 | 26876 | systems/win32/miktex/tm/packages/next/miktex-makeindex-bin-2.9.tar.lzma
-2020/02/21 | 26772 | systems/win32/miktex/tm/packages/next/miktex-teckit-bin-2.9.tar.lzma
-2020/02/21 | 26663 | systems/win32/miktex/tm/packages/next/miktex-bzip2-bin-2.9.tar.lzma
+2020/02/21 | 27155 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-308883.pdf
+2020/02/21 | 26967 | macros/latex/contrib/xsim/doc/xsim-manual.cls
2020/02/21 | 26601 | macros/latex/contrib/l3kernel/l3sys.dtx
-2020/02/21 | 26503 | systems/win32/miktex/tm/packages/next/miktex-uriparser-bin-2.9.tar.lzma
2020/02/21 | 26400 | macros/latex/contrib/fontspec/fontspec-code-keyval.dtx
2020/02/21 | 263041 | macros/latex/contrib/l3kernel/l3docstrip.pdf
2020/02/21 | 25867 | macros/latex/contrib/fontspec/fontspec-doc-featset.tex
-2020/02/21 | 2579567 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-x64-2.9.tar.lzma
2020/02/21 | 25753 | macros/latex/contrib/l3kernel/l3fp-random.dtx
-2020/02/21 | 25305 | systems/win32/miktex/tm/packages/next/miktex-fribidixetex-bin-2.9.tar.lzma
2020/02/21 | 250949 | macros/latex/contrib/l3kernel/l3regex.dtx
+2020/02/21 | 25040 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-391530.pdf
2020/02/21 | 2484 | macros/latex/contrib/l3kernel/l3legacy.dtx
2020/02/21 | 2480 | macros/latex/contrib/l3build/l3build-help.lua
-2020/02/21 | 247553 | systems/win32/miktex/tm/packages/next/miktex-metapost-bin-2.9.tar.lzma
-2020/02/21 | 247179 | systems/win32/miktex/tm/packages/next/miktex-xetex-bin-2.9.tar.lzma
-2020/02/21 | 246426 | systems/win32/miktex/tm/packages/next/miktex-freetype2-bin-2.9.tar.lzma
-2020/02/21 | 2457971 | systems/win32/miktex/tm/packages/next/miktex-texworks-bin-2.9.tar.lzma
-2020/02/21 | 243361 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-x64-2.9.tar.lzma
+2020/02/21 | 247 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-308883.tex
2020/02/21 | 235516 | macros/latex/contrib/l3kernel/l3news09.pdf
-2020/02/21 | 23519 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-x64-2.9.tar.lzma
2020/02/21 | 2339 | macros/latex/contrib/l3build/CONTRIBUTING.md
+2020/02/21 | 23204 | macros/latex/contrib/xsim/doc/examples/xsim.grade-distribution.pdf
2020/02/21 | 2310 | macros/latex/contrib/l3build/l3build-tagging.lua
+2020/02/21 | 23102 | macros/latex/contrib/xsim/doc/examples/xsim.randomexercises.pdf
2020/02/21 | 23068 | macros/latex/contrib/l3kernel/l3fp-logic.dtx
-2020/02/21 | 22935 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-x64-2.9.tar.lzma
2020/02/21 | 227510 | macros/latex/contrib/l3kernel/l3syntax-changes.pdf
-2020/02/21 | 22541662 | systems/texlive/tlnet/install-tl.zip
+2020/02/21 | 2259 | macros/latex/contrib/xsim/doc/examples/xsim.golatex-91339.tex
2020/02/21 | 21927 | macros/latex/contrib/fontspec/CHANGES.md
+2020/02/21 | 21901 | macros/latex/contrib/xsim/code/xsim.interface.code.tex
2020/02/21 | 21817 | macros/latex/contrib/l3kernel/l3quark.dtx
-2020/02/21 | 2173744 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
2020/02/21 | 2155 | macros/latex/contrib/fontspec/fontspec-code-load.dtx
-2020/02/21 | 215429 | systems/win32/miktex/tm/packages/next/miktex-console-bin-x64-2.9.tar.lzma
2020/02/21 | 2153 | macros/latex/contrib/l3kernel/source3.tex
+2020/02/21 | 21402 | macros/latex/contrib/xsim/code/xsim.exercises.code.tex
2020/02/21 | 21211 | macros/latex/contrib/l3backend/l3backend-graphics.dtx
2020/02/21 | 21165 | macros/latex/contrib/l3kernel/source3body.tex
2020/02/21 | 21159 | macros/latex/contrib/fontspec/fontspec-code-opentype.dtx
-2020/02/21 | 207775 | systems/win32/miktex/tm/packages/next/miktex-pmx-bin-2.9.tar.lzma
2020/02/21 | 20768 | macros/latex/contrib/fontspec/fontspec-code-feat-opentype.dtx
-2020/02/21 | 20668 | systems/win32/miktex/tm/packages/next/miktex-devnag-bin-2.9.tar.lzma
2020/02/21 | 20546 | macros/latex/contrib/l3kernel/CHANGELOG.md
-2020/02/21 | 199195 | systems/win32/miktex/tm/packages/next/miktex-console-bin-2.9.tar.lzma
-2020/02/21 | 19892 | systems/win32/miktex/tm/packages/next/miktex-popt-bin-2.9.tar.lzma
+2020/02/21 | 20439236 | systems/win32/w32tex/pdftex-w32.tar.xz
+2020/02/21 | 20239 | systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
+2020/02/21 | 20045 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-155630.pdf
2020/02/21 | 1980 | macros/latex/contrib/fontspec/fontspec.ins
-2020/02/21 | 196974 | systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma
2020/02/21 | 19693 | macros/latex/contrib/l3kernel/l3intarray.dtx
-2020/02/21 | 196822 | systems/win32/miktex/tm/packages/next/miktex-zzdb1-2.9.tar.lzma
2020/02/21 | 19661 | macros/latex/contrib/l3kernel/l3fp-convert.dtx
-2020/02/21 | 195007 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-2.9.tar.lzma
-2020/02/21 | 1946013 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-x64-2.9.tar.lzma
-2020/02/21 | 193653 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-x64-2.9.tar.lzma
2020/02/21 | 19309 | macros/latex/contrib/l3kernel/l3bootstrap.dtx
+2020/02/21 | 1923 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-395273.tex
2020/02/21 | 192383 | macros/latex/contrib/l3kernel/l3news12.pdf
+2020/02/21 | 1913 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-13635.tex
2020/02/21 | 19110 | macros/latex/contrib/l3kernel/l3kernel-functions.dtx
2020/02/21 | 19106 | macros/latex/contrib/fontspec/LICENSE
2020/02/21 | 1909 | macros/latex/contrib/l3kernel/interface3.tex
2020/02/21 | 18895242 | systems/win32/miktex/tm/packages/ltxbase.tar.lzma
-2020/02/21 | 18696897 | systems/texlive/tlnet/install-tl-windows.exe
-2020/02/21 | 186884 | systems/win32/miktex/tm/packages/next/miktex-pixman-bin-2.9.tar.lzma
+2020/02/21 | 1862 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369065.tex
2020/02/21 | 186295 | macros/latex/contrib/l3kernel/l3term-glossary.pdf
2020/02/21 | 18605 | macros/latex/contrib/l3kernel/l3fp-round.dtx
-2020/02/21 | 185326 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-x64-2.9.tar.lzma
-2020/02/21 | 184256 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-x64-2.9.tar.lzma
-2020/02/21 | 182803 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-x64-2.9.tar.lzma
+2020/02/21 | 1828 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-338165.tex
2020/02/21 | 1817 | macros/latex/contrib/l3build/l3build.1
2020/02/21 | 18012 | macros/latex/contrib/l3kernel/l3luatex.dtx
-2020/02/21 | 17754 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-x64-2.9.tar.lzma
-2020/02/21 | 177509 | systems/win32/miktex/tm/packages/next/miktex-mpfr-bin-x64-2.9.tar.lzma
-2020/02/21 | 17674 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-x64-2.9.tar.lzma
+2020/02/21 | 1792 | macros/latex/contrib/xsim/doc/examples/xsim.listofexercises.tex
+2020/02/21 | 17878640 | systems/win32/w32tex/luatex-exp-w32.tar.xz
+2020/02/21 | 17870028 | systems/win32/w32tex/luatex-dev-w32.tar.xz
+2020/02/21 | 1777 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-6698.tex
2020/02/21 | 17570 | macros/latex/contrib/fontspec/fontspec-code-user.dtx
-2020/02/21 | 1711482 | systems/win32/miktex/tm/packages/next/miktex-luatex-bin-2.9.tar.lzma
-2020/02/21 | 169210 | systems/win32/miktex/tm/packages/next/miktex-curl-bin-2.9.tar.lzma
+2020/02/21 | 16902540 | systems/win32/w32tex/luatex-w32.tar.xz
2020/02/21 | 1687 | macros/latex/contrib/fontspec/fontspec-example.tex
2020/02/21 | 1681 | macros/latex/contrib/l3backend/CHANGELOG.md
-2020/02/21 | 167815 | systems/win32/miktex/tm/packages/next/miktex-metafont-bin-2.9.tar.lzma
-2020/02/21 | 167253 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-x64-2.9.tar.lzma
-2020/02/21 | 164888 | systems/win32/miktex/tm/packages/next/miktex-mktex-bin-2.9.tar.lzma
+2020/02/21 | 16620 | macros/latex/contrib/xsim/code/xsim.environments.code.tex
2020/02/21 | 1642 | macros/latex/contrib/l3kernel/l3term-glossary.tex
-2020/02/21 | 16168000 | systems/texlive/tlnet/tlpkg/texlive.tlpdb
-2020/02/21 | 160716 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-x64-2.9.tar.lzma
-2020/02/21 | 16046 | systems/win32/miktex/tm/packages/next/miktex-tex2xindy-bin-2.9.tar.lzma
+2020/02/21 | 16114 | macros/latex/contrib/xsim/code/xsim.properties.code.tex
2020/02/21 | 159154 | macros/latex/contrib/l3kernel/l3news11.pdf
2020/02/21 | 158956 | systems/texlive/tlnet/archive/texlive-docindex.doc.r53851.tar.xz
-2020/02/21 | 15882 | systems/win32/miktex/tm/packages/next/miktex-kpathsea-bin-2.9.tar.lzma
2020/02/21 | 15708 | macros/latex/contrib/l3kernel/l3final.dtx
2020/02/21 | 1540245 | macros/latex/contrib/l3kernel/interface3.pdf
-2020/02/21 | 153 | systems/texlive/tlnet/install-tl-windows.exe.sha512
2020/02/21 | 1537 | macros/latex/contrib/l3build/l3build.ins
-2020/02/21 | 152 | systems/texlive/tlnet/install-tl-unx.tar.gz.sha512
2020/02/21 | 152413 | macros/latex/contrib/l3kernel/l3news08.pdf
-2020/02/21 | 152100 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-x64-2.9.tar.lzma
-2020/02/21 | 149788 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-x64-2.9.tar.lzma
+2020/02/21 | 15212 | macros/latex/contrib/xsim/code/xsim.definitions.code.tex
+2020/02/21 | 1518 | macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex
+2020/02/21 | 1496 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-498299.tex
2020/02/21 | 1495 | macros/latex/contrib/l3build/l3build-clean.lua
2020/02/21 | 14913 | macros/latex/contrib/l3kernel/l3news12.tex
2020/02/21 | 149136 | macros/latex/contrib/l3kernel/l3doc.dtx
-2020/02/21 | 148482 | systems/win32/miktex/tm/packages/next/miktex-mo-bin-2.9.tar.lzma
-2020/02/21 | 147333 | systems/win32/miktex/tm/packages/next/miktex-tex-bin-2.9.tar.lzma
-2020/02/21 | 145 | systems/texlive/tlnet/install-tl.zip.sha512
2020/02/21 | 14509 | macros/latex/contrib/l3backend/l3backend-box.dtx
-2020/02/21 | 144 | systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
+2020/02/21 | 1425 | macros/latex/contrib/xsim/doc/examples/xsim.multiplechoice.tex
2020/02/21 | 14249 | macros/latex/contrib/l3backend/l3backend-header.dtx
2020/02/21 | 140797 | macros/latex/contrib/l3kernel/l3news06.pdf
2020/02/21 | 140777 | macros/latex/contrib/l3kernel/l3news02.pdf
-2020/02/21 | 14047 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-x64-2.9.tar.lzma
+2020/02/21 | 1404 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-369803.tex
2020/02/21 | 140297 | macros/latex/contrib/l3kernel/l3news10.pdf
-2020/02/21 | 1382985 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-x64-2.9.tar.lzma
+2020/02/21 | 1394 | macros/latex/contrib/xsim/doc/examples/xsim.collections.tex
+2020/02/21 | 1385 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-391530.tex
2020/02/21 | 137983 | macros/latex/contrib/l3kernel/l3news03.pdf
-2020/02/21 | 137120 | systems/win32/miktex/tm/packages/next/miktex-hunspell-bin-2.9.tar.lzma
2020/02/21 | 1370731 | install/macros/latex/contrib/fontspec.tds.zip
2020/02/21 | 13674 | macros/latex/contrib/fontspec/fontspec-doc-api.tex
+2020/02/21 | 1351 | macros/latex/contrib/xsim/doc/examples/xsim.crossref.tex
+2020/02/21 | 1345 | macros/latex/contrib/xsim/doc/examples/xsim.difficulties.tex
2020/02/21 | 13400 | macros/latex/contrib/l3backend/l3backend-basics.dtx
-2020/02/21 | 133251 | systems/win32/miktex/tm/packages/next/miktex-fontconfig-bin-2.9.tar.lzma
+2020/02/21 | 1337 | macros/latex/contrib/xsim/doc/examples/xsim.different-point-types.tex
+2020/02/21 | 13261 | macros/latex/contrib/xsim/code/xsim.solutions.code.tex
2020/02/21 | 132279 | macros/latex/contrib/l3kernel/l3tl.dtx
+2020/02/21 | 1313 | macros/latex/contrib/xsim/doc/examples/xsim.hints.tex
2020/02/21 | 1309620 | macros/latex/contrib/fontspec.zip
-2020/02/21 | 13061 | systems/win32/miktex/tm/packages/next/miktex-zzip-bin-2.9.tar.lzma
-2020/02/21 | 130308 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-x64-2.9.tar.lzma
2020/02/21 | 1298 | macros/latex/contrib/l3backend/l3backend-code.tex
2020/02/21 | 12979 | macros/latex/contrib/l3kernel/l3fp-traps.dtx
+2020/02/21 | 12938 | macros/latex/contrib/xsim/code/xsim.collections.code.tex
2020/02/21 | 12895 | macros/latex/contrib/fontspec/fontspec-code-lang.dtx
2020/02/21 | 12795 | macros/latex/contrib/fontspec/fontspec-doc-xetex.tex
2020/02/21 | 127036 | macros/latex/contrib/l3kernel/l3basics.dtx
2020/02/21 | 126798 | macros/latex/contrib/l3kernel/l3file.dtx
-2020/02/21 | 1249275 | systems/win32/miktex/tm/packages/next/miktex-dvisvgm-bin-2.9.tar.lzma
2020/02/21 | 1246 | macros/latex/contrib/fontspec/fontspec.ltx
2020/02/21 | 12465 | macros/latex/contrib/fontspec/fontspec-code-api.dtx
-2020/02/21 | 1231281 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-x64-2.9.tar.lzma
+2020/02/21 | 1231179 | macros/latex/contrib/xsim/doc/xsim_manual.pdf
2020/02/21 | 12279 | macros/latex/contrib/fontspec/fontspec-code-math.dtx
2020/02/21 | 1217 | macros/latex/contrib/fontspec/fontspec-code-closing.dtx
2020/02/21 | 12151 | macros/latex/contrib/l3build/CHANGELOG.md
2020/02/21 | 119092 | macros/latex/contrib/l3kernel/l3news07.pdf
2020/02/21 | 11884 | macros/latex/contrib/l3kernel/l3styleguide.tex
+2020/02/21 | 1183 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-199360.tex
2020/02/21 | 11826 | macros/latex/contrib/l3kernel/l3fparray.dtx
2020/02/21 | 1181 | macros/latex/contrib/fontspec/fontspec-code.ltx
-2020/02/21 | 1178069 | systems/win32/miktex/tm/packages/next/miktex-zzdb2-2.9.tar.lzma
-2020/02/21 | 1177685 | systems/win32/miktex/tm/packages/miktex-zzdb2-2.9.tar.lzma
+2020/02/21 | 11749 | macros/latex/contrib/xsim/code/xsim.goals.code.tex
2020/02/21 | 11748 | macros/latex/contrib/l3build/l3build-file-functions.lua
2020/02/21 | 11714486 | install/macros/latex/contrib/l3kernel.tds.zip
2020/02/21 | 11712 | macros/latex/contrib/l3build/l3build-upload.lua
-2020/02/21 | 116662 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-x64-2.9.tar.lzma
-2020/02/21 | 115594 | systems/win32/miktex/tm/packages/next/miktex-dvips-bin-2.9.tar.lzma
2020/02/21 | 11497479 | macros/latex/contrib/l3kernel.zip
2020/02/21 | 1135311 | macros/latex/contrib/nameauth.zip
2020/02/21 | 113529 | macros/latex/contrib/l3kernel/l3news01.pdf
2020/02/21 | 112871 | macros/latex/contrib/l3kernel/l3names.dtx
-2020/02/21 | 111160 | systems/win32/miktex/tm/packages/next/miktex-gregorio-bin-x64-2.9.tar.lzma
-2020/02/21 | 1104158 | systems/win32/miktex/tm/packages/next/miktex-runtime-bin-2.9.tar.lzma
2020/02/21 | 11024 | macros/latex/contrib/l3build/l3build-manifest-setup.lua
-2020/02/21 | 1098464 | systems/win32/miktex/tm/packages/next/miktex-zzdb3-2.9.tar.lzma
-2020/02/21 | 1098247 | systems/win32/miktex/tm/packages/miktex-zzdb3-2.9.tar.lzma
2020/02/21 | 109736 | macros/latex/contrib/l3kernel/l3str-convert.dtx
-2020/02/21 | 108872 | systems/win32/miktex/tm/packages/next/miktex-jpeg-bin-x64-2.9.tar.lzma
2020/02/21 | 108823 | macros/latex/contrib/l3kernel/l3token.dtx
2020/02/21 | 107379 | macros/latex/contrib/l3kernel/l3news09.tex
+2020/02/21 | 1072 | macros/latex/contrib/xsim/doc/examples/xsim.texsx-305110.tex
2020/02/21 | 107122 | macros/latex/contrib/l3kernel/l3news04.pdf
+2020/02/21 | 1069 | macros/latex/contrib/xsim/doc/examples/xsim.code-and-output.tex
2020/02/21 | 106742 | macros/latex/contrib/l3kernel/l3expan.dtx
2020/02/21 | 106186 | macros/latex/contrib/l3build/l3build.dtx
+2020/02/21 | 10608 | macros/latex/contrib/xsim/code/xsim.random.code.tex
2020/02/21 | 105629 | macros/latex/contrib/l3kernel/l3fp-parse.dtx
2020/02/21 | 105090 | macros/latex/contrib/l3kernel/l3news05.pdf
2020/02/21 | 1048607 | macros/latex/contrib/nameauth/nameauth.pdf
-2020/02/21 | 1042556 | systems/win32/miktex/tm/packages/next/miktex-poppler-bin-x64-2.9.tar.lzma
-2020/02/21 | 1041977 | systems/win32/miktex/tm/packages/next/miktex-asymptote-bin-x64-2.9.tar.lzma
-2020/02/21 | 102517 | systems/win32/miktex/tm/packages/next/miktex-lua53-bin-x64-2.9.tar.lzma
+2020/02/21 | 1047 | macros/latex/contrib/xsim/doc/xsim.ideas
+2020/02/21 | 104686 | macros/latex/contrib/xsim/doc/xsim_manual.tex
+2020/02/21 | 10315064 | systems/win32/w32tex/ptex-w32.tar.xz
2020/02/21 | 1024 | macros/latex/contrib/l3build/README.md
2020/02/21 | 101588 | macros/latex/contrib/l3kernel/l3keys.dtx
-2020/02/21 | 100709 | systems/win32/miktex/tm/packages/next/miktex-gd-bin-2.9.tar.lzma
+2020/02/21 | 1013 | macros/latex/contrib/xsim/doc/examples/xsim.floating.tex
2020/02/20 | 9875 | support/texdoc/script/texdoclib-score.tlu
2020/02/20 | 9871 | macros/latex/base/ltvers.dtx
2020/02/20 | 9565 | support/texdoc/script/texdoclib-view.tlu
@@ -407,7 +762,6 @@
2020/02/20 | 640541 | macros/latex/contrib/siunitx/siunitx.pdf
2020/02/20 | 614116 | macros/latex/contrib/siunitx/siunitx.dtx
2020/02/20 | 61188 | systems/texlive/tlnet/archive/tex4ht.doc.r53849.tar.xz
-2020/02/20 | 593501 | systems/win32/w32tex/ChangeLog
2020/02/20 | 56760 | macros/latex/base/ltfssini.dtx
2020/02/20 | 526206 | macros/latex/base/classes.pdf
2020/02/20 | 5064 | systems/texlive/tlnet/archive/stackengine.r53843.tar.xz
@@ -493,7 +847,6 @@
2020/02/20 | 1918180 | systems/texlive/tlnet/archive/xint.doc.r53846.tar.xz
2020/02/20 | 186868 | systems/texlive/tlnet/archive/lexend.r53845.tar.xz
2020/02/20 | 181390 | macros/latex/base/syntonly.pdf
-2020/02/20 | 17880108 | systems/win32/w32tex/luatex-exp-w32.tar.xz
2020/02/20 | 178219 | macros/latex/base/alltt.pdf
2020/02/20 | 173783 | systems/win32/miktex/tm/packages/rgltxdoc.tar.lzma
2020/02/20 | 16790 | support/texdoc/texdoc.cnf
@@ -551,7 +904,6 @@
2020/02/19 | 758 | systems/win32/miktex/setup/deb/dists/buster/universe/binary-amd64/Packages.gz
2020/02/19 | 7452 | systems/texlive/tlnet/archive/hitszthesis.r53831.tar.xz
2020/02/19 | 7320 | systems/texlive/tlnet/archive/rerunfilecheck.source.r53837.tar.xz
-2020/02/19 | 722200 | systems/texlive/tlnet/archive/l3build.doc.r53834.tar.xz
2020/02/19 | 719 | macros/latex/contrib/lwarp/lwarp_baseline_marker.eps
2020/02/19 | 706 | systems/win32/miktex/setup/rpm/fedora/28/repodata/70e3be0cd5f73c07f3273b0c319f6020d9f8b1e36c5b28f68f3192d107953ced-other.xml.gz
2020/02/19 | 6749 | systems/win32/miktex/setup/rpm/opensuse/15/repodata/6d12f6e641883230f36fd7a547e735f8dcd7e863a5c8adbd74e01a2e956a2560-filelists.sqlite.bz2
@@ -559,7 +911,6 @@
2020/02/19 | 630205 | fonts/lexend.zip
2020/02/19 | 616520 | systems/texlive/tlnet/archive/bitset.doc.r53837.tar.xz
2020/02/19 | 5712 | systems/texlive/tlnet/archive/bitset.r53837.tar.xz
-2020/02/19 | 49614932 | systems/win32/w32tex/xetex-w32.tar.xz
2020/02/19 | 488 | systems/win32/miktex/setup/rpm/opensuse/15/repodata/repomd.xml.asc
2020/02/19 | 488 | systems/win32/miktex/setup/rpm/fedora/30/repodata/repomd.xml.asc
2020/02/19 | 488 | systems/win32/miktex/setup/rpm/fedora/28/repodata/repomd.xml.asc
@@ -576,7 +927,6 @@
2020/02/19 | 3471183 | install/macros/latex/contrib/lwarp.tds.zip
2020/02/19 | 34336976 | systems/win32/w32tex/ltxpkgs.tar.xz
2020/02/19 | 32646 | systems/win32/miktex/setup/rpm/fedora/28/repodata/d34771b4b58bb1dfe6af2c2e770a3d2b892366c882899dedc33f8b34efa346d0-primary.sqlite.bz2
-2020/02/19 | 31944 | systems/texlive/tlnet/archive/l3build.r53834.tar.xz
2020/02/19 | 313676 | systems/texlive/tlnet/archive/rerunfilecheck.doc.r53837.tar.xz
2020/02/19 | 3120 | systems/texlive/tlnet/archive/rerunfilecheck.r53837.tar.xz
2020/02/19 | 3066148 | systems/texlive/tlnet/archive/hyperref.doc.r53837.tar.xz
@@ -589,7 +939,6 @@
2020/02/19 | 29640 | macros/latex/contrib/rgltxdoc/rgltxdoc.dtx
2020/02/19 | 2947 | macros/latex/contrib/lwarp/lwarp_tutorial.txt
2020/02/19 | 29241366 | systems/win32/miktex/setup/deb/pool/universe/m/miktex/miktex_2.9.7300-stretch1_amd64.deb
-2020/02/19 | 29224 | systems/texlive/tlnet/archive/l3build.source.r53834.tar.xz
2020/02/19 | 29159 | systems/win32/miktex/setup/rpm/opensuse/15/repodata/2dde9c815d39a96401a96d6ca00f3015f0195ca93ab277b7b243889e0dd833fb-primary.sqlite.bz2
2020/02/19 | 29118726 | systems/win32/miktex/setup/deb/pool/universe/m/miktex/miktex_2.9.7300-buster1_amd64.deb
2020/02/19 | 28684830 | systems/win32/miktex/setup/deb/pool/universe/m/miktex/miktex_2.9.7300-xenial1_amd64.deb
@@ -694,7 +1043,6 @@
2020/02/18 | 776 | fonts/etbb/vf/ETbb-Italic-tlf-sc-ot1.vf
2020/02/18 | 776 | fonts/etbb/vf/ETbb-Italic-osf-sc-ot1.vf
2020/02/18 | 776 | fonts/etbb/vf/ETbb-Italic-lf-sc-ot1.vf
-2020/02/18 | 773817 | systems/win32/miktex/tm/packages/l3build.tar.lzma
2020/02/18 | 772 | fonts/etbb/vf/ETbb-Bold-tosf-sc-ot1.vf
2020/02/18 | 772 | fonts/etbb/vf/ETbb-Bold-tlf-sc-ot1.vf
2020/02/18 | 772 | fonts/etbb/vf/ETbb-Bold-osf-sc-ot1.vf
@@ -1165,7 +1513,6 @@
2020/02/18 | 1800 | fonts/etbb/vf/Etbb1-Bold-lf-t1.vf
2020/02/18 | 1796 | fonts/etbb/tfm/ETbb-Bold-lf-ly1--base.tfm
2020/02/18 | 1788 | fonts/etbb/tfm/ETbb-Bold-osf-ly1--base.tfm
-2020/02/18 | 17872044 | systems/win32/w32tex/luatex-dev-w32.tar.xz
2020/02/18 | 1784 | fonts/etbb/tfm/ETbb-Bold-inf-ly1.tfm
2020/02/18 | 1780 | fonts/etbb/tfm/ETbb-Bold-inf-ly1--base.tfm
2020/02/18 | 1768 | fonts/etbb/tfm/ETbb-Bold-tosf-ly1--base.tfm
@@ -1257,7 +1604,6 @@
2020/02/18 | 1692 | fonts/etbb/vf/ETbb-BoldItalic-osf-ly1.vf
2020/02/18 | 1692 | fonts/etbb/vf/ETbb-BoldItalic-lf-ly1.vf
2020/02/18 | 1692 | fonts/etbb/vf/ETbb-BoldItalic-inf-ly1.vf
-2020/02/18 | 16902596 | systems/win32/w32tex/luatex-w32.tar.xz
2020/02/18 | 1688 | fonts/etbb/vf/ETbb-Italic-tlf-ly1.vf
2020/02/18 | 1688 | fonts/etbb/vf/ETbb-Italic-sup-ly1.vf
2020/02/18 | 1688 | fonts/etbb/vf/ETbb-Italic-osf-ly1.vf
@@ -1633,7 +1979,6 @@
2020/02/17 | 202 | fonts/ptex-fontmaps/maps/moga-mobo-ex/ptex-moga-mobo-ex-04.map
2020/02/17 | 202 | fonts/ptex-fontmaps/maps/cjkunifonts-ttf/uptex-tc-cjkunifonts-ttf.map
2020/02/17 | 202 | fonts/ptex-fontmaps/maps/cjkunifonts-ttf/uptex-sc-cjkunifonts-ttf.map
-2020/02/17 | 20152 | systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
2020/02/17 | 199619 | systems/win32/miktex/tm/packages/schulmathematik.tar.lzma
2020/02/17 | 1990264 | graphics/circuit_macros.zip
2020/02/17 | 198 | fonts/ptex-fontmaps/maps/adobe/uptex-ko-adobe.map
@@ -1978,7 +2323,6 @@
2020/02/16 | 4403 | macros/luatex/optex/alloc.opm
2020/02/16 | 4354 | graphics/circuit_macros/doc/Makefile
2020/02/16 | 4337 | graphics/circuit_macros/examples/svg/AlogixSVG.m4
-2020/02/16 | 43134236 | systems/win32/w32tex/web2c-w32.tar.xz
2020/02/16 | 4312 | graphics/circuit_macros/examples/ex09.m4
2020/02/16 | 4305 | graphics/circuit_macros/examples/Euro.m4
2020/02/16 | 4301 | fonts/haranoaji/LICENSE
@@ -2328,7 +2672,6 @@
2020/02/16 | 1039 | graphics/circuit_macros/examples/chaos.m4
2020/02/16 | 1034 | graphics/circuit_macros/examples/svg/OpampSVG.m4
2020/02/16 | 1029 | graphics/circuit_macros/xfig.m4
-2020/02/16 | 10297168 | systems/win32/w32tex/ptex-w32.tar.xz
2020/02/16 | 1024 | graphics/circuit_macros/examples/Btree.m4
2020/02/16 | 1022 | graphics/circuit_macros/examples/Tgate.m4
2020/02/16 | 1022 | graphics/circuit_macros/doc/Tgate.m4
@@ -2336,449 +2679,3 @@
2020/02/16 | 1020 | graphics/circuit_macros/doc/Headers.m4
2020/02/16 | 1019 | graphics/circuit_macros/gpic.m4
2020/02/16 | 1003 | graphics/circuit_macros/examples/ex15.m4
-2020/02/15 | 9937192 | systems/texlive/tlnet/archive/l3kernel.doc.r53781.tar.xz
-2020/02/15 | 9900 | fonts/newpx/tfm/zpl-BoldItalic-lf-sc-t1.tfm
-2020/02/15 | 9897 | macros/latex/contrib/biblatex-contrib/archaeologie/README.md
-2020/02/15 | 9880 | fonts/newpx/tfm/zpl-BoldItalic-osf-sc-t1.tfm
-2020/02/15 | 9844 | fonts/newpx/tfm/zpl-BoldItalic-tlf-sc-t1.tfm
-2020/02/15 | 9840 | fonts/newpx/tfm/zpl-BoldItalic-tosf-sc-t1.tfm
-2020/02/15 | 982524 | systems/texlive/tlnet/archive/eplain.doc.r53786.tar.xz
-2020/02/15 | 97988 | systems/texlive/tlnet/archive/texinfo.r53776.tar.xz
-2020/02/15 | 97848 | support/texlive/texlive-dummy/EnterpriseLinux-8.zip
-2020/02/15 | 9704 | fonts/newpx/tfm/zpl-BoldItalic-lf-t1.tfm
-2020/02/15 | 9692 | fonts/newpx/tfm/zpl-BoldItalic-osf-t1.tfm
-2020/02/15 | 9648 | fonts/newpx/tfm/zpl-BoldItalic-tlf-t1.tfm
-2020/02/15 | 9644 | fonts/newpx/tfm/zpl-BoldItalic-tosf-t1.tfm
-2020/02/15 | 96323 | systems/win32/miktex/tm/packages/miktex-texware-bin-x64-2.9.tar.lzma
-2020/02/15 | 94262 | systems/win32/miktex/tm/packages/miktex-bibtex8bit-bin-x64-2.9.tar.lzma
-2020/02/15 | 94103 | systems/win32/miktex/tm/packages/miktex-gregorio-bin-2.9.tar.lzma
-2020/02/15 | 936016 | systems/win32/miktex/tm/packages/miktex-asymptote-bin-2.9.tar.lzma
-2020/02/15 | 932479 | systems/win32/miktex/tm/packages/miktex-poppler-bin-2.9.tar.lzma
-2020/02/15 | 924 | fonts/newpx/vf/zpl-BoldItalic-tosf-scl-ot1.vf
-2020/02/15 | 92114 | systems/win32/miktex/tm/packages/miktex-mfware-bin-x64-2.9.tar.lzma
-2020/02/15 | 920 | fonts/newpx/vf/zpl-BoldItalic-tlf-scl-ot1.vf
-2020/02/15 | 920 | fonts/newpx/vf/zpl-BoldItalic-osf-scl-ot1.vf
-2020/02/15 | 920 | fonts/newpx/vf/zpl-BoldItalic-lf-scl-ot1.vf
-2020/02/15 | 916 | fonts/newpx/vf/zpl-Regular-tosf-scl-ot1.vf
-2020/02/15 | 916 | fonts/newpx/vf/zpl-Regular-tlf-scl-ot1.vf
-2020/02/15 | 916 | fonts/newpx/vf/zpl-Regular-osf-scl-ot1.vf
-2020/02/15 | 916 | fonts/newpx/vf/zpl-Italic-tosf-scl-ot1.vf
-2020/02/15 | 914775 | systems/win32/miktex/tm/packages/fewerfloatpages.tar.lzma
-2020/02/15 | 912 | fonts/newpx/vf/zpl-Regular-lf-scl-ot1.vf
-2020/02/15 | 912 | fonts/newpx/vf/zpl-Italic-tlf-scl-ot1.vf
-2020/02/15 | 912 | fonts/newpx/vf/zpl-Italic-osf-scl-ot1.vf
-2020/02/15 | 912 | fonts/newpx/vf/zpl-Italic-lf-scl-ot1.vf
-2020/02/15 | 912 | fonts/newpx/vf/zpl-Bold-tosf-scl-ot1.vf
-2020/02/15 | 91259 | systems/win32/miktex/tm/packages/miktex-mpmcli-bin-x64-2.9.tar.lzma
-2020/02/15 | 91093 | systems/win32/miktex/tm/packages/miktex-texware-bin-2.9.tar.lzma
-2020/02/15 | 908 | fonts/newpx/vf/zpl-Bold-tlf-scl-ot1.vf
-2020/02/15 | 908 | fonts/newpx/vf/zpl-Bold-osf-scl-ot1.vf
-2020/02/15 | 908 | fonts/newpx/vf/zpl-Bold-lf-scl-ot1.vf
-2020/02/15 | 893144 | systems/texlive/tlnet/archive/fewerfloatpages.doc.r53779.tar.xz
-2020/02/15 | 877940 | systems/texlive/tlnet/archive/uplatex.doc.r53786.tar.xz
-2020/02/15 | 87305 | systems/win32/miktex/tm/packages/miktex-mfware-bin-2.9.tar.lzma
-2020/02/15 | 8676 | systems/texlive/tlnet/archive/mltex.doc.r53786.tar.xz
-2020/02/15 | 86587 | systems/win32/miktex/tm/packages/miktex-mkfntmap-bin-x64-2.9.tar.lzma
-2020/02/15 | 8532 | fonts/newtxtt/doc/newtxtt-doc.tex
-2020/02/15 | 84565 | systems/win32/miktex/tm/packages/miktex-bibtex8bit-bin-2.9.tar.lzma
-2020/02/15 | 84374 | systems/win32/miktex/tm/packages/miktex-texify-bin-x64-2.9.tar.lzma
-2020/02/15 | 8096 | fonts/newpx/tfm/zpl-Italic-lf-sc-ly1.tfm
-2020/02/15 | 8080 | fonts/newpx/tfm/zpl-Italic-osf-sc-ly1.tfm
-2020/02/15 | 8068 | fonts/newpx/tfm/zpl-Regular-lf-sc-ly1.tfm
-2020/02/15 | 8064 | fonts/newpx/tfm/zpl-Regular-osf-sc-ly1.tfm
-2020/02/15 | 80590 | systems/win32/miktex/tm/packages/miktex-mpmcli-bin-2.9.tar.lzma
-2020/02/15 | 80403 | macros/latex/contrib/euclideangeometry/euclideangeometry-man.tex
-2020/02/15 | 8036 | fonts/newpx/tfm/zpl-Italic-tlf-sc-ly1.tfm
-2020/02/15 | 8032 | fonts/newpx/tfm/zpl-Italic-tosf-sc-ly1.tfm
-2020/02/15 | 8024 | fonts/newpx/tfm/zpl-Regular-tosf-sc-ly1.tfm
-2020/02/15 | 8024 | fonts/newpx/tfm/zpl-Regular-tlf-sc-ly1.tfm
-2020/02/15 | 8008 | fonts/newpx/tfm/zpl-Bold-lf-sc-ly1.tfm
-2020/02/15 | 7996 | fonts/newpx/tfm/zpl-Bold-osf-sc-ly1.tfm
-2020/02/15 | 7964 | fonts/newpx/tfm/zpl-Bold-tosf-sc-ly1.tfm
-2020/02/15 | 7964 | fonts/newpx/tfm/zpl-Bold-tlf-sc-ly1.tfm
-2020/02/15 | 790829 | fonts/newpx/doc/newpxdoc.pdf
-2020/02/15 | 7832 | systems/texlive/tlnet/archive/subfiles.source.r53782.tar.xz
-2020/02/15 | 78031 | systems/win32/miktex/tm/packages/miktex-mkfntmap-bin-2.9.tar.lzma
-2020/02/15 | 77904 | systems/texlive/tlnet/archive/glossaries.r53777.tar.xz
-2020/02/15 | 7736 | fonts/newpx/tfm/zpl-Regular-lf-ly1.tfm
-2020/02/15 | 7732 | fonts/newpx/tfm/zpl-Regular-osf-ly1.tfm
-2020/02/15 | 77017 | language/japanese/BX/bxjscls/bxjscls-manual.tex
-2020/02/15 | 7696 | fonts/newpx/tfm/zpl-Regular-tosf-ly1.tfm
-2020/02/15 | 7696 | fonts/newpx/tfm/zpl-Regular-tlf-ly1.tfm
-2020/02/15 | 763723 | macros/latex/contrib/biblatex-contrib/archaeologie/archaeologie.dtx
-2020/02/15 | 7548 | fonts/newpx/tfm/zpl-Italic-lf-ly1.tfm
-2020/02/15 | 7536 | fonts/newpx/tfm/zpl-Italic-osf-ly1.tfm
-2020/02/15 | 7488 | fonts/newpx/tfm/zpl-Italic-tlf-ly1.tfm
-2020/02/15 | 7484 | fonts/newpx/tfm/zpl-Italic-tosf-ly1.tfm
-2020/02/15 | 746152 | systems/texlive/tlnet/archive/babel.doc.r53783.tar.xz
-2020/02/15 | 7460 | fonts/newpx/tfm/zpl-Italic-osf-th-ly1.tfm
-2020/02/15 | 74368 | systems/win32/miktex/tm/packages/miktex-texify-bin-2.9.tar.lzma
-2020/02/15 | 7420 | fonts/newpx/tfm/zpl-Italic-tlf-th-ly1.tfm
-2020/02/15 | 7340 | fonts/newpx/tfm/zpl-Bold-lf-ly1.tfm
-2020/02/15 | 7328 | fonts/newpx/tfm/zpl-Bold-osf-ly1.tfm
-2020/02/15 | 7296 | fonts/newpx/tfm/zpl-Bold-tosf-ly1.tfm
-2020/02/15 | 7296 | fonts/newpx/tfm/zpl-Bold-tlf-ly1.tfm
-2020/02/15 | 729132 | language/japanese/BX/bxjscls/bxjscls-manual.pdf
-2020/02/15 | 72712 | systems/win32/miktex/tm/packages/miktex-fonts-bin-x64-2.9.tar.lzma
-2020/02/15 | 71577 | systems/win32/miktex/tm/packages/miktex-ps2pk-bin-x64-2.9.tar.lzma
-2020/02/15 | 69485 | systems/win32/miktex/tm/packages/miktex-fonts-bin-2.9.tar.lzma
-2020/02/15 | 6928 | systems/texlive/tlnet/archive/xetex.r53786.tar.xz
-2020/02/15 | 69166 | systems/win32/miktex/tm/packages/miktex-tex4ht-bin-x64-2.9.tar.lzma
-2020/02/15 | 6712 | fonts/newpx/tfm/zpl-BoldItalic-lf-sc-ly1.tfm
-2020/02/15 | 669528 | systems/win32/miktex/tm/packages/miktex-lcdf-typetools-bin-x64-2.9.tar.lzma
-2020/02/15 | 6688 | fonts/newpx/tfm/zpl-BoldItalic-osf-sc-ly1.tfm
-2020/02/15 | 6652 | fonts/newpx/tfm/zpl-BoldItalic-tlf-sc-ly1.tfm
-2020/02/15 | 6648 | fonts/newpx/tfm/zpl-BoldItalic-tosf-sc-ly1.tfm
-2020/02/15 | 65031 | systems/win32/miktex/tm/packages/miktex-web-bin-x64-2.9.tar.lzma
-2020/02/15 | 64900 | systems/texlive/tlnet/archive/l3packages.source.r53781.tar.xz
-2020/02/15 | 64349 | systems/win32/miktex/tm/packages/miktex-gsf2pk-bin-x64-2.9.tar.lzma
-2020/02/15 | 6376 | systems/texlive/tlnet/archive/mltex.r53786.tar.xz
-2020/02/15 | 63296 | systems/win32/miktex/tm/packages/miktex-ps2pk-bin-2.9.tar.lzma
-2020/02/15 | 6320 | fonts/newpx/tfm/zpl-BoldItalic-lf-ly1.tfm
-2020/02/15 | 6308 | fonts/newpx/tfm/zpl-BoldItalic-osf-ly1.tfm
-2020/02/15 | 63039 | systems/win32/miktex/tm/packages/miktex-tex4ht-bin-2.9.tar.lzma
-2020/02/15 | 62804 | systems/win32/miktex/tm/packages/miktex-mthelp-bin-x64-2.9.tar.lzma
-2020/02/15 | 62776 | systems/texlive/tlnet/archive/glossaries-extra.r53780.tar.xz
-2020/02/15 | 6264 | fonts/newpx/tfm/zpl-BoldItalic-tlf-ly1.tfm
-2020/02/15 | 6260 | fonts/newpx/tfm/zpl-BoldItalic-tosf-ly1.tfm
-2020/02/15 | 625188 | systems/texlive/tlnet/archive/babel.source.r53783.tar.xz
-2020/02/15 | 616888 | systems/texlive/tlnet/archive/xetex.doc.r53786.tar.xz
-2020/02/15 | 61665 | macros/latex/contrib/sdaps/sdapsbase.dtx
-2020/02/15 | 61540 | systems/win32/miktex/tm/packages/miktex-web-bin-2.9.tar.lzma
-2020/02/15 | 615229 | systems/win32/miktex/tm/packages/miktex-lcdf-typetools-bin-2.9.tar.lzma
-2020/02/15 | 6148770 | systems/win32/miktex/tm/packages/glossaries.tar.lzma
-2020/02/15 | 612 | systems/texlive/tlnet/archive/aleph.r53786.tar.xz
-2020/02/15 | 60922 | systems/win32/miktex/tm/packages/miktex-ttf2pk2-bin-x64-2.9.tar.lzma
-2020/02/15 | 608 | systems/texlive/tlnet/archive/latex-bin-dev.r53786.tar.xz
-2020/02/15 | 6052 | systems/texlive/tlnet/archive/collection-latexextra.r53779.tar.xz
-2020/02/15 | 5982332 | systems/texlive/tlnet/archive/glossaries.doc.r53777.tar.xz
-2020/02/15 | 59440 | systems/win32/miktex/tm/packages/miktex-tdsutil-bin-x64-2.9.tar.lzma
-2020/02/15 | 58793 | systems/win32/miktex/tm/packages/miktex-cweb-bin-x64-2.9.tar.lzma
-2020/02/15 | 57718 | systems/win32/miktex/tm/packages/miktex-gsf2pk-bin-2.9.tar.lzma
-2020/02/15 | 57623 | support/texlive/texlive-dummy/EnterpriseLinux-8/texlive-dummy-2020-4.el8.src.rpm
-2020/02/15 | 57135 | systems/win32/miktex/tm/packages/miktex-bibarts-bin-x64-2.9.tar.lzma
-2020/02/15 | 56443 | systems/win32/miktex/tm/packages/miktex-mthelp-bin-2.9.tar.lzma
-2020/02/15 | 556684 | macros/latex/contrib/euclideangeometry/euclideangeometry-man.pdf
-2020/02/15 | 54787 | systems/win32/miktex/tm/packages/miktex-ttf2pk2-bin-2.9.tar.lzma
-2020/02/15 | 540 | systems/texlive/tlnet/archive/latex-bin.r53786.tar.xz
-2020/02/15 | 5409364 | systems/win32/miktex/tm/packages/glossaries-extra.tar.lzma
-2020/02/15 | 54026 | systems/win32/miktex/tm/packages/miktex-cjkutils-bin-x64-2.9.tar.lzma
-2020/02/15 | 53447 | systems/win32/miktex/tm/packages/miktex-tdsutil-bin-2.9.tar.lzma
-2020/02/15 | 53292 | systems/texlive/tlnet/archive/latex-bin.doc.r53786.tar.xz
-2020/02/15 | 529452 | systems/texlive/tlnet/archive/l3kernel.source.r53781.tar.xz
-2020/02/15 | 5237012 | systems/texlive/tlnet/archive/glossaries-extra.doc.r53780.tar.xz
-2020/02/15 | 523592 | systems/texlive/tlnet/archive/latex-base-dev.source.r53778.tar.xz
-2020/02/15 | 51809 | systems/win32/miktex/tm/packages/miktex-cweb-bin-2.9.tar.lzma
-2020/02/15 | 5171 | macros/latex/contrib/sdaps/sdapspdf.dtx
-2020/02/15 | 5108 | fonts/newpx/tfm/zplsups-Regular-t1.tfm
-2020/02/15 | 50890 | systems/win32/miktex/tm/packages/miktex-psutils-bin-x64-2.9.tar.lzma
-2020/02/15 | 50834 | systems/win32/miktex/tm/packages/miktex-synctex-bin-x64-2.9.tar.lzma
-2020/02/15 | 5080 | fonts/newpx/tfm/zplsups-Italic-t1.tfm
-2020/02/15 | 50481 | systems/win32/miktex/tm/packages/miktex-findtexmf-bin-x64-2.9.tar.lzma
-2020/02/15 | 5022 | language/japanese/BX/bxjscls/README.md
-2020/02/15 | 502258 | systems/win32/miktex/doc/2.9/miktex.pdf
-2020/02/15 | 50204 | systems/texlive/tlnet/archive/uplatex.source.r53786.tar.xz
-2020/02/15 | 49716 | systems/win32/miktex/tm/packages/miktex-bibarts-bin-2.9.tar.lzma
-2020/02/15 | 4936 | fonts/newpx/tfm/zplsups-Bold-t1.tfm
-2020/02/15 | 49305 | systems/win32/miktex/tm/packages/miktex-cjkutils-bin-2.9.tar.lzma
-2020/02/15 | 48328 | systems/texlive/tlnet/archive/aleph.doc.r53786.tar.xz
-2020/02/15 | 45676 | systems/win32/miktex/tm/packages/miktex-mtprint-bin-x64-2.9.tar.lzma
-2020/02/15 | 45484 | systems/win32/miktex/tm/packages/miktex-findtexmf-bin-2.9.tar.lzma
-2020/02/15 | 450129 | systems/win32/miktex/tm/packages/miktex-doc-2.9.tar.lzma
-2020/02/15 | 44902 | systems/win32/miktex/tm/packages/miktex-dvipng-bin-x64-2.9.tar.lzma
-2020/02/15 | 441366 | install/fonts/newtxtt.tds.zip
-2020/02/15 | 4384 | fonts/newpx/tfm/zplsups-BoldItalic-t1.tfm
-2020/02/15 | 42546 | systems/win32/miktex/tm/packages/miktex-psutils-bin-2.9.tar.lzma
-2020/02/15 | 42148 | systems/texlive/tlnet/archive/eplain.r53786.tar.xz
-2020/02/15 | 41853 | systems/win32/miktex/tm/packages/miktex-mtprint-bin-2.9.tar.lzma
-2020/02/15 | 41823 | systems/win32/miktex/tm/packages/miktex-synctex-bin-2.9.tar.lzma
-2020/02/15 | 40896 | macros/latex/contrib/sdaps/sdapsarray.dtx
-2020/02/15 | 40516 | systems/win32/miktex/tm/packages/miktex-dvipng-bin-2.9.tar.lzma
-2020/02/15 | 3992 | fonts/newpx/tfm/zpl-Italic-lf-scl-ot1.tfm
-2020/02/15 | 3976 | fonts/newpx/tfm/zpl-Italic-osf-scl-ot1.tfm
-2020/02/15 | 396216 | systems/texlive/tlnet/archive/eplain.source.r53786.tar.xz
-2020/02/15 | 3932 | fonts/newpx/tfm/zpl-Italic-tlf-scl-ot1.tfm
-2020/02/15 | 3928 | fonts/newpx/tfm/zpl-Italic-tosf-scl-ot1.tfm
-2020/02/15 | 38872 | systems/win32/miktex/tm/packages/miktex-epstopdf-bin-x64-2.9.tar.lzma
-2020/02/15 | 3884 | fonts/newpx/tfm/zpl-Regular-osf-scl-ot1.tfm
-2020/02/15 | 3884 | fonts/newpx/tfm/zpl-Regular-lf-scl-ot1.tfm
-2020/02/15 | 387958 | systems/win32/miktex/tm/packages/miktex-omega-bin-x64-2.9.tar.lzma
-2020/02/15 | 3864 | fonts/newpx/tfm/zpl-Bold-lf-scl-ot1.tfm
-2020/02/15 | 385768 | language/japanese/BX/bxjscls/bxjscls.dtx
-2020/02/15 | 3848 | fonts/newpx/tfm/zpl-Bold-osf-scl-ot1.tfm
-2020/02/15 | 3844 | fonts/newpx/tfm/zpl-Regular-tosf-scl-ot1.tfm
-2020/02/15 | 3844 | fonts/newpx/tfm/zpl-Regular-tlf-scl-ot1.tfm
-2020/02/15 | 3820 | fonts/newpx/tfm/zpl-Bold-tosf-scl-ot1.tfm
-2020/02/15 | 3820 | fonts/newpx/tfm/zpl-Bold-tlf-scl-ot1.tfm
-2020/02/15 | 38188 | systems/texlive/tlnet/archive/platex.r53786.tar.xz
-2020/02/15 | 37875 | macros/latex/contrib/sdaps/sdapsclassic.dtx
-2020/02/15 | 363688 | support/texlive/texlive-dummy/EnterpriseLinux-8/texlive-dummy-2020-4.el8.noarch.rpm
-2020/02/15 | 36320 | systems/win32/miktex/tm/packages/miktex-chktex-bin-x64-2.9.tar.lzma
-2020/02/15 | 356322 | systems/win32/miktex/tm/packages/miktex-pdftex-bin-x64-2.9.tar.lzma
-2020/02/15 | 355377 | systems/win32/miktex/tm/packages/miktex-omega-bin-2.9.tar.lzma
-2020/02/15 | 3544 | fonts/newpx/tfm/zpl-BoldItalic-osf-scl-ot1.tfm
-2020/02/15 | 3544 | fonts/newpx/tfm/zpl-BoldItalic-lf-scl-ot1.tfm
-2020/02/15 | 3527 | info/biblio/tugboat.ltx
-2020/02/15 | 3500 | fonts/newpx/tfm/zpl-BoldItalic-tlf-scl-ot1.tfm
-2020/02/15 | 3496 | fonts/newpx/tfm/zpl-BoldItalic-tosf-scl-ot1.tfm
-2020/02/15 | 3484 | fonts/newpx/tfm/zpl-Italic-lf-sc-ot1.tfm
-2020/02/15 | 34835 | systems/win32/miktex/tm/packages/miktex-axohelp-bin-x64-2.9.tar.lzma
-2020/02/15 | 3464 | fonts/newpx/tfm/zpl-Italic-osf-sc-ot1.tfm
-2020/02/15 | 3420 | fonts/newpx/tfm/zpl-Italic-tlf-sc-ot1.tfm
-2020/02/15 | 3416 | fonts/newpx/tfm/zpl-Italic-tosf-sc-ot1.tfm
-2020/02/15 | 33515 | systems/win32/miktex/tm/packages/miktex-epstopdf-bin-2.9.tar.lzma
-2020/02/15 | 3344 | fonts/newpx/tfm/zpl-Regular-lf-sc-ot1.tfm
-2020/02/15 | 33417 | systems/win32/miktex/tm/packages/miktex-arctrl-bin-x64-2.9.tar.lzma
-2020/02/15 | 3340 | fonts/newpx/tfm/zpl-Regular-osf-sc-ot1.tfm
-2020/02/15 | 3340 | fonts/newpx/tfm/zpl-Bold-lf-sc-ot1.tfm
-2020/02/15 | 3324 | fonts/newpx/tfm/zpl-Regular-lf-ot1.tfm
-2020/02/15 | 3324 | fonts/newpx/tfm/zpl-Bold-osf-sc-ot1.tfm
-2020/02/15 | 3320 | fonts/newpx/tfm/zpl-Regular-osf-ot1.tfm
-2020/02/15 | 3300 | fonts/newpx/tfm/zpl-Regular-tosf-sc-ot1.tfm
-2020/02/15 | 3300 | fonts/newpx/tfm/zpl-Regular-tlf-sc-ot1.tfm
-2020/02/15 | 3292 | fonts/newpx/tfm/zpl-Bold-tosf-sc-ot1.tfm
-2020/02/15 | 3292 | fonts/newpx/tfm/zpl-Bold-tlf-sc-ot1.tfm
-2020/02/15 | 3284 | fonts/newpx/tfm/zpl-Regular-tosf-ot1.tfm
-2020/02/15 | 3284 | fonts/newpx/tfm/zpl-Regular-tlf-ot1.tfm
-2020/02/15 | 3268 | fonts/newpx/tfm/zpl-Italic-lf-ot1.tfm
-2020/02/15 | 3256 | fonts/newpx/tfm/zpl-Italic-osf-ot1.tfm
-2020/02/15 | 32267 | systems/win32/miktex/tm/packages/miktex-chktex-bin-2.9.tar.lzma
-2020/02/15 | 321825 | systems/win32/miktex/tm/packages/miktex-pdftex-bin-2.9.tar.lzma
-2020/02/15 | 3208 | fonts/newpx/tfm/zpl-Italic-tlf-ot1.tfm
-2020/02/15 | 3204 | fonts/newpx/tfm/zpl-Italic-tosf-ot1.tfm
-2020/02/15 | 3196 | fonts/newpx/tfm/zpl-Italic-osf-th-ot1.tfm
-2020/02/15 | 31788 | systems/texlive/tlnet/archive/jadetex.doc.r53786.tar.xz
-2020/02/15 | 3156 | fonts/newpx/tfm/zpl-Italic-tlf-th-ot1.tfm
-2020/02/15 | 3128896 | info/biblio/tugboat.bib
-2020/02/15 | 31259 | systems/win32/miktex/tm/packages/miktex-makeindex-bin-x64-2.9.tar.lzma
-2020/02/15 | 309858 | systems/win32/miktex/tm/packages/miktex-dvipdfmx-bin-x64-2.9.tar.lzma
-2020/02/15 | 3096 | fonts/newpx/tfm/zpl-BoldItalic-lf-sc-ot1.tfm
-2020/02/15 | 3088 | fonts/newpx/tfm/zpl-Bold-lf-ot1.tfm
-2020/02/15 | 3076 | fonts/newpx/tfm/zpl-Bold-osf-ot1.tfm
-2020/02/15 | 3076 | fonts/newpx/tfm/zpl-BoldItalic-osf-sc-ot1.tfm
-2020/02/15 | 3050 | fonts/newtxtt/README
-2020/02/15 | 3044 | fonts/newpx/tfm/zpl-Bold-tosf-ot1.tfm
-2020/02/15 | 3044 | fonts/newpx/tfm/zpl-Bold-tlf-ot1.tfm
-2020/02/15 | 3040 | fonts/newpx/tfm/zpl-BoldItalic-tlf-sc-ot1.tfm
-2020/02/15 | 3036 | fonts/newpx/tfm/zpl-BoldItalic-tosf-sc-ot1.tfm
-2020/02/15 | 29820 | systems/texlive/tlnet/archive/jadetex.r53786.tar.xz
-2020/02/15 | 29693 | systems/win32/miktex/tm/packages/miktex-lacheck-bin-x64-2.9.tar.lzma
-2020/02/15 | 29284 | systems/win32/miktex/tm/packages/miktex-axohelp-bin-2.9.tar.lzma
-2020/02/15 | 29189 | systems/win32/miktex/tm/packages/miktex-arctrl-bin-2.9.tar.lzma
-2020/02/15 | 2908202 | install/fonts/newpx.tds.zip
-2020/02/15 | 2877870 | fonts/newpx.zip
-2020/02/15 | 286999 | macros/latex/contrib/sdaps/sdapslayout.pdf
-2020/02/15 | 2864 | fonts/newpx/tfm/zpl-BoldItalic-lf-ot1.tfm
-2020/02/15 | 2852 | fonts/newpx/tfm/zpl-BoldItalic-osf-ot1.tfm
-2020/02/15 | 281291 | systems/win32/miktex/tm/packages/miktex-metapost-bin-x64-2.9.tar.lzma
-2020/02/15 | 2808 | fonts/newpx/tfm/zpl-BoldItalic-tlf-ot1.tfm
-2020/02/15 | 2804 | fonts/newpx/tfm/zpl-BoldItalic-tosf-ot1.tfm
-2020/02/15 | 276866 | systems/win32/miktex/tm/packages/miktex-xetex-bin-x64-2.9.tar.lzma
-2020/02/15 | 27644 | systems/win32/miktex/tm/packages/miktex-lacheck-bin-2.9.tar.lzma
-2020/02/15 | 2760 | fonts/newpx/tfm/zplsups-Italic-ly1.tfm
-2020/02/15 | 272275 | systems/win32/miktex/tm/packages/miktex-dvipdfmx-bin-2.9.tar.lzma
-2020/02/15 | 2696 | fonts/newpx/tfm/zplsups-Regular-ly1.tfm
-2020/02/15 | 26926 | systems/win32/miktex/tm/packages/miktex-makeindex-bin-2.9.tar.lzma
-2020/02/15 | 2680 | language/japanese/zxjafont/README-ja.md
-2020/02/15 | 2660 | systems/texlive/tlnet/archive/fewerfloatpages.r53779.tar.xz
-2020/02/15 | 2624 | fonts/newpx/tfm/zplsups-BoldItalic-ly1.tfm
-2020/02/15 | 2568 | fonts/newpx/tfm/zplsups-Bold-ly1.tfm
-2020/02/15 | 251776 | systems/win32/miktex/tm/packages/subfiles.tar.lzma
-2020/02/15 | 247614 | systems/win32/miktex/tm/packages/miktex-metapost-bin-2.9.tar.lzma
-2020/02/15 | 246891 | systems/win32/miktex/tm/packages/miktex-xetex-bin-2.9.tar.lzma
-2020/02/15 | 241896 | systems/texlive/tlnet/archive/subfiles.doc.r53782.tar.xz
-2020/02/15 | 24036 | systems/texlive/tlnet/archive/cslatex.source.r53786.tar.xz
-2020/02/15 | 22904 | systems/win32/miktex/tm/packages/miktex-devnag-bin-x64-2.9.tar.lzma
-2020/02/15 | 2275 | language/japanese/zxjafont/README.md
-2020/02/15 | 2251 | fonts/newtxtt/tex/t1newtxttz.fd
-2020/02/15 | 2232 | macros/latex/contrib/sdaps/README
-2020/02/15 | 2222 | fonts/newtxtt/tex/t1newtxtt.fd
-2020/02/15 | 2204 | macros/latex/contrib/biblatex-contrib/archaeologie/Makefile
-2020/02/15 | 21963 | macros/latex/contrib/sdaps/sdapslayout.dtx
-2020/02/15 | 219018 | systems/win32/miktex/tm/packages/miktex-console-bin-x64-2.9.tar.lzma
-2020/02/15 | 21344 | fonts/newpx/tfm/zpl-Regular-lf-scl-t1.tfm
-2020/02/15 | 21340 | fonts/newpx/tfm/zpl-Regular-osf-scl-t1.tfm
-2020/02/15 | 21300 | fonts/newpx/tfm/zpl-Regular-tosf-scl-t1.tfm
-2020/02/15 | 21300 | fonts/newpx/tfm/zpl-Regular-tlf-scl-t1.tfm
-2020/02/15 | 20924 | fonts/newpx/tfm/zpl-Bold-lf-scl-t1.tfm
-2020/02/15 | 20904 | fonts/newpx/tfm/zpl-Bold-osf-scl-t1.tfm
-2020/02/15 | 20876 | fonts/newpx/tfm/zpl-Bold-tosf-scl-t1.tfm
-2020/02/15 | 20876 | fonts/newpx/tfm/zpl-Bold-tlf-scl-t1.tfm
-2020/02/15 | 20809 | language/japanese/zxjafont/zxjafont.sty
-2020/02/15 | 20744 | fonts/newpx/tfm/zpl-Italic-lf-scl-t1.tfm
-2020/02/15 | 20724 | fonts/newpx/tfm/zpl-Italic-osf-scl-t1.tfm
-2020/02/15 | 20684 | fonts/newpx/tfm/zpl-Italic-tlf-scl-t1.tfm
-2020/02/15 | 20680 | fonts/newpx/tfm/zpl-Italic-tosf-scl-t1.tfm
-2020/02/15 | 20638 | systems/win32/miktex/tm/packages/miktex-devnag-bin-2.9.tar.lzma
-2020/02/15 | 202996 | macros/latex/contrib/sdaps/sdapsbase.pdf
-2020/02/15 | 199146 | systems/win32/miktex/tm/packages/miktex-console-bin-2.9.tar.lzma
-2020/02/15 | 19880 | systems/texlive/tlnet/archive/l3packages.r53781.tar.xz
-2020/02/15 | 19312 | systems/texlive/tlnet/archive/jadetex.source.r53786.tar.xz
-2020/02/15 | 192001 | macros/latex/contrib/sdaps/sdapsarray.pdf
-2020/02/15 | 1895 | macros/latex/contrib/sdaps/sdapslayout.ins
-2020/02/15 | 1895 | macros/latex/contrib/sdaps/sdapsclassic.ins
-2020/02/15 | 18948 | systems/texlive/tlnet/archive/cslatex.doc.r53786.tar.xz
-2020/02/15 | 1893 | macros/latex/contrib/sdaps/sdapsarray.ins
-2020/02/15 | 1891 | macros/latex/contrib/sdaps/sdapsbase.ins
-2020/02/15 | 1889 | macros/latex/contrib/sdaps/sdapspdf.ins
-2020/02/15 | 185933 | fonts/newpx/type1/zplbi.pfb
-2020/02/15 | 1856 | fonts/newpx/vf/zpl-BoldItalic-tosf-scl-t1.vf
-2020/02/15 | 1856 | fonts/newpx/vf/zpl-BoldItalic-tlf-scl-t1.vf
-2020/02/15 | 1856 | fonts/newpx/vf/zpl-BoldItalic-osf-scl-t1.vf
-2020/02/15 | 185385 | systems/win32/miktex/tm/packages/miktex-mktex-bin-x64-2.9.tar.lzma
-2020/02/15 | 185382 | fonts/newpx/type1/zplri.pfb
-2020/02/15 | 1852 | fonts/newpx/vf/zpl-Regular-tosf-scl-t1.vf
-2020/02/15 | 1852 | fonts/newpx/vf/zpl-BoldItalic-lf-scl-t1.vf
-2020/02/15 | 1848 | fonts/newpx/vf/zpl-Regular-tlf-scl-t1.vf
-2020/02/15 | 1848 | fonts/newpx/vf/zpl-Regular-osf-scl-t1.vf
-2020/02/15 | 1848 | fonts/newpx/vf/zpl-Regular-lf-scl-t1.vf
-2020/02/15 | 1848 | fonts/newpx/vf/zpl-Italic-tosf-scl-t1.vf
-2020/02/15 | 1848 | fonts/newpx/vf/zpl-Italic-tlf-scl-t1.vf
-2020/02/15 | 1848 | fonts/newpx/vf/zpl-Italic-osf-scl-t1.vf
-2020/02/15 | 1844 | fonts/newpx/vf/zpl-Italic-lf-scl-t1.vf
-2020/02/15 | 1844 | fonts/newpx/vf/zpl-Bold-tosf-scl-t1.vf
-2020/02/15 | 1844 | fonts/newpx/vf/zpl-Bold-tlf-scl-t1.vf
-2020/02/15 | 1844 | fonts/newpx/vf/zpl-Bold-osf-scl-t1.vf
-2020/02/15 | 1840 | fonts/newpx/vf/zpl-Bold-lf-scl-t1.vf
-2020/02/15 | 182688 | systems/win32/miktex/tm/packages/miktex-metafont-bin-x64-2.9.tar.lzma
-2020/02/15 | 1826219 | systems/win32/miktex/tm/packages/l3packages.tar.lzma
-2020/02/15 | 1816 | systems/texlive/tlnet/archive/subfiles.r53782.tar.xz
-2020/02/15 | 17843064 | systems/texlive/tlnet/archive/latex-base-dev.doc.r53778.tar.xz
-2020/02/15 | 17770 | macros/latex/contrib/sdaps/sdapscode128.tex
-2020/02/15 | 1776 | fonts/newpx/vf/zpl-BoldItalic-tosf-scl-ly1.vf
-2020/02/15 | 1776 | fonts/newpx/vf/zpl-BoldItalic-tlf-scl-ly1.vf
-2020/02/15 | 1776 | fonts/newpx/vf/zpl-BoldItalic-osf-scl-ly1.vf
-2020/02/15 | 17738 | systems/win32/miktex/tm/packages/miktex-tex2xindy-bin-x64-2.9.tar.lzma
-2020/02/15 | 1772 | fonts/newpx/vf/zpl-Regular-tosf-scl-ly1.vf
-2020/02/15 | 1772 | fonts/newpx/vf/zpl-BoldItalic-lf-scl-ly1.vf
-2020/02/15 | 1768 | fonts/newpx/vf/zpl-Regular-tlf-scl-ly1.vf
-2020/02/15 | 1768 | fonts/newpx/vf/zpl-Regular-osf-scl-ly1.vf
-2020/02/15 | 1768 | fonts/newpx/vf/zpl-Regular-lf-scl-ly1.vf
-2020/02/15 | 1768 | fonts/newpx/vf/zpl-Italic-tosf-scl-ly1.vf
-2020/02/15 | 1768 | fonts/newpx/vf/zpl-Italic-tlf-scl-ly1.vf
-2020/02/15 | 1768 | fonts/newpx/vf/zpl-Italic-osf-scl-ly1.vf
-2020/02/15 | 17651 | systems/win32/miktex/tm/packages/miktex-kpathsea-bin-x64-2.9.tar.lzma
-2020/02/15 | 1764 | fonts/newpx/vf/zpl-Italic-lf-scl-ly1.vf
-2020/02/15 | 1764 | fonts/newpx/vf/zpl-Bold-tosf-scl-ly1.vf
-2020/02/15 | 1764 | fonts/newpx/vf/zpl-Bold-tlf-scl-ly1.vf
-2020/02/15 | 1764 | fonts/newpx/vf/zpl-Bold-osf-scl-ly1.vf
-2020/02/15 | 1760 | fonts/newpx/vf/zpl-Bold-lf-scl-ly1.vf
-2020/02/15 | 175910 | fonts/newpx/type1/zplr.pfb
-2020/02/15 | 175490 | fonts/newpx/type1/zplb.pfb
-2020/02/15 | 174774 | macros/latex/contrib/sdaps/sdapsclassic.pdf
-2020/02/15 | 1739536 | systems/texlive/tlnet/archive/l3packages.doc.r53781.tar.xz
-2020/02/15 | 171596 | systems/win32/miktex/tm/packages/zxjafont.tar.lzma
-2020/02/15 | 167984 | systems/texlive/tlnet/archive/latex-base-dev.r53778.tar.xz
-2020/02/15 | 167700 | systems/win32/miktex/tm/packages/miktex-metafont-bin-2.9.tar.lzma
-2020/02/15 | 167045 | systems/win32/miktex/tm/packages/miktex-mo-bin-x64-2.9.tar.lzma
-2020/02/15 | 165916 | fonts/newtxtt/doc/newtxtt-doc.pdf
-2020/02/15 | 16589 | fonts/newpx/README
-2020/02/15 | 165008 | systems/win32/miktex/tm/packages/miktex-mktex-bin-2.9.tar.lzma
-2020/02/15 | 16360 | CTAN.sites
-2020/02/15 | 1617796 | systems/texlive/tlnet/archive/platex.doc.r53786.tar.xz
-2020/02/15 | 16112 | systems/texlive/tlnet/archive/fewerfloatpages.source.r53779.tar.xz
-2020/02/15 | 160796 | systems/win32/miktex/tm/packages/miktex-tex-bin-x64-2.9.tar.lzma
-2020/02/15 | 160688 | language/japanese/zxjafont/zxjafont.pdf
-2020/02/15 | 16048 | fonts/newpx/tfm/zpl-BoldItalic-lf-scl-t1.tfm
-2020/02/15 | 16044 | fonts/newpx/tfm/zpl-BoldItalic-osf-scl-t1.tfm
-2020/02/15 | 16015 | systems/win32/miktex/tm/packages/miktex-tex2xindy-bin-2.9.tar.lzma
-2020/02/15 | 16000 | fonts/newpx/tfm/zpl-BoldItalic-tlf-scl-t1.tfm
-2020/02/15 | 15996 | fonts/newpx/tfm/zpl-BoldItalic-tosf-scl-t1.tfm
-2020/02/15 | 1587 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Ukrainian.dict
-2020/02/15 | 15876 | systems/win32/miktex/tm/packages/miktex-kpathsea-bin-2.9.tar.lzma
-2020/02/15 | 15843 | language/japanese/zxjafont/zxjafont.tex
-2020/02/15 | 157980 | fonts/newpx/opentype/TeXGyrePagellaX-Italic.otf
-2020/02/15 | 155868 | systems/texlive/tlnet/archive/babel.r53783.tar.xz
-2020/02/15 | 1551 | support/texlive/texlive-dummy/EnterpriseLinux-8/README
-2020/02/15 | 1535417 | systems/win32/miktex/tm/packages/babel.tar.lzma
-2020/02/15 | 152208 | fonts/newpx/opentype/TeXGyrePagellaX-Bold.otf
-2020/02/15 | 152085 | systems/win32/miktex/tm/packages/miktex-fontconfig-bin-x64-2.9.tar.lzma
-2020/02/15 | 151260 | fonts/newpx/opentype/TeXGyrePagellaX-Regular.otf
-2020/02/15 | 149780 | fonts/newpx/opentype/TeXGyrePagellaX-BoldItalic.otf
-2020/02/15 | 148736 | systems/texlive/tlnet/archive/l3kernel.r53781.tar.xz
-2020/02/15 | 148335 | systems/win32/miktex/tm/packages/miktex-mo-bin-2.9.tar.lzma
-2020/02/15 | 147381 | systems/win32/miktex/tm/packages/miktex-tex-bin-2.9.tar.lzma
-2020/02/15 | 14688 | systems/texlive/tlnet/archive/uplatex.r53786.tar.xz
-2020/02/15 | 144993 | macros/latex/contrib/sdaps/sdapspdf.pdf
-2020/02/15 | 1442 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Portuguese.dict
-2020/02/15 | 1432 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-French.dict
-2020/02/15 | 13964 | systems/texlive/tlnet/archive/latex-bin-dev.doc.r53786.tar.xz
-2020/02/15 | 1389 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Dutch.dict
-2020/02/15 | 1380557 | systems/win32/miktex/tm/packages/miktex-dvisvgm-bin-x64-2.9.tar.lzma
-2020/02/15 | 1367 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-German.dict
-2020/02/15 | 13399 | language/japanese/BX/bxjscls/README-ja.md
-2020/02/15 | 1337 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Spanish.dict
-2020/02/15 | 13376 | fonts/newpx/tfm/zpl-Regular-lf-scl-ly1.tfm
-2020/02/15 | 13372 | fonts/newpx/tfm/zpl-Regular-osf-scl-ly1.tfm
-2020/02/15 | 1335 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Brazilian.dict
-2020/02/15 | 13332 | fonts/newpx/tfm/zpl-Regular-tosf-scl-ly1.tfm
-2020/02/15 | 13332 | fonts/newpx/tfm/zpl-Regular-tlf-scl-ly1.tfm
-2020/02/15 | 1332 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Norsk.dict
-2020/02/15 | 133206 | systems/win32/miktex/tm/packages/miktex-fontconfig-bin-2.9.tar.lzma
-2020/02/15 | 1329 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Finnish.dict
-2020/02/15 | 1327 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Italian.dict
-2020/02/15 | 1321 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Polish.dict
-2020/02/15 | 1318 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Romanian.dict
-2020/02/15 | 1314 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Swedish.dict
-2020/02/15 | 1314 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-Sinhala.dict
-2020/02/15 | 1314 | macros/latex/contrib/sdaps/translator-sdaps-dictionary-English.dict
-2020/02/15 | 13144 | fonts/newpx/tfm/zpl-Bold-lf-scl-ly1.tfm
-2020/02/15 | 13124 | fonts/newpx/tfm/zpl-Bold-osf-scl-ly1.tfm
-2020/02/15 | 13116 | fonts/newpx/tfm/zpl-Regular-lf-sc-t1.tfm
-2020/02/15 | 13112 | fonts/newpx/tfm/zpl-Regular-osf-sc-t1.tfm
-2020/02/15 | 13108 | fonts/newpx/tfm/zpl-Italic-lf-scl-ly1.tfm
-2020/02/15 | 13096 | fonts/newpx/tfm/zpl-Bold-tosf-scl-ly1.tfm
-2020/02/15 | 13096 | fonts/newpx/tfm/zpl-Bold-tlf-scl-ly1.tfm
-2020/02/15 | 13092 | fonts/newpx/tfm/zpl-Italic-osf-scl-ly1.tfm
-2020/02/15 | 13072 | fonts/newpx/tfm/zpl-Regular-tosf-sc-t1.tfm
-2020/02/15 | 13072 | fonts/newpx/tfm/zpl-Regular-tlf-sc-t1.tfm
-2020/02/15 | 130543 | systems/win32/miktex/tm/packages/miktex-dvips-bin-x64-2.9.tar.lzma
-2020/02/15 | 13048 | fonts/newpx/tfm/zpl-Italic-tlf-scl-ly1.tfm
-2020/02/15 | 13044 | fonts/newpx/tfm/zpl-Italic-tosf-scl-ly1.tfm
-2020/02/15 | 12952 | fonts/newpx/tfm/zpl-Bold-lf-sc-t1.tfm
-2020/02/15 | 12940 | fonts/newpx/tfm/zpl-Bold-osf-sc-t1.tfm
-2020/02/15 | 12908 | fonts/newpx/tfm/zpl-Bold-tosf-sc-t1.tfm
-2020/02/15 | 12908 | fonts/newpx/tfm/zpl-Bold-tlf-sc-t1.tfm
-2020/02/15 | 1288 | fonts/newpx/tfm/zplsups-BoldItalic-ot1.tfm
-2020/02/15 | 12888 | fonts/newpx/tfm/zpl-Italic-lf-sc-t1.tfm
-2020/02/15 | 12868 | fonts/newpx/tfm/zpl-Italic-osf-sc-t1.tfm
-2020/02/15 | 12828 | fonts/newpx/tfm/zpl-Italic-tlf-sc-t1.tfm
-2020/02/15 | 12824 | fonts/newpx/tfm/zpl-Italic-tosf-sc-t1.tfm
-2020/02/15 | 1276 | fonts/newpx/tfm/zplsups-Italic-ot1.tfm
-2020/02/15 | 12696 | systems/texlive/tlnet/archive/cslatex.r53786.tar.xz
-2020/02/15 | 125544 | systems/texlive/tlnet/archive/glossaries.source.r53777.tar.xz
-2020/02/15 | 1249679 | systems/win32/miktex/tm/packages/miktex-dvisvgm-bin-2.9.tar.lzma
-2020/02/15 | 1238030 | systems/win32/miktex/tm/packages/miktex-runtime-bin-x64-2.9.tar.lzma
-2020/02/15 | 123296 | systems/texlive/tlnet/archive/platex.source.r53786.tar.xz
-2020/02/15 | 12280 | fonts/newpx/tfm/zpl-Regular-lf-t1.tfm
-2020/02/15 | 12272 | fonts/newpx/tfm/zpl-Regular-osf-t1.tfm
-2020/02/15 | 12236 | fonts/newpx/tfm/zpl-Regular-tosf-t1.tfm
-2020/02/15 | 12236 | fonts/newpx/tfm/zpl-Regular-tlf-t1.tfm
-2020/02/15 | 11996 | fonts/newpx/tfm/zpl-Italic-lf-t1.tfm
-2020/02/15 | 11980 | fonts/newpx/tfm/zpl-Italic-osf-t1.tfm
-2020/02/15 | 11932 | fonts/newpx/tfm/zpl-Italic-tlf-t1.tfm
-2020/02/15 | 11928 | fonts/newpx/tfm/zpl-Italic-tosf-t1.tfm
-2020/02/15 | 11868 | fonts/newpx/tfm/zpl-Italic-osf-th-t1.tfm
-2020/02/15 | 11828 | fonts/newpx/tfm/zpl-Italic-tlf-th-t1.tfm
-2020/02/15 | 11708 | fonts/newpx/tfm/zpl-Bold-lf-t1.tfm
-2020/02/15 | 11692 | fonts/newpx/tfm/zpl-Bold-osf-t1.tfm
-2020/02/15 | 11660 | fonts/newpx/tfm/zpl-Bold-tosf-t1.tfm
-2020/02/15 | 11660 | fonts/newpx/tfm/zpl-Bold-tlf-t1.tfm
-2020/02/15 | 115590 | systems/win32/miktex/tm/packages/miktex-dvips-bin-2.9.tar.lzma
-2020/02/15 | 1152893 | language/japanese/BX/bxjscls/bxjscls.pdf
-2020/02/15 | 114644 | systems/texlive/tlnet/archive/glossaries-extra.source.r53780.tar.xz
-2020/02/15 | 1140 | fonts/newpx/tfm/zplsups-Regular-ot1.tfm
-2020/02/15 | 111348 | systems/win32/miktex/tm/packages/miktex-gregorio-bin-x64-2.9.tar.lzma
-2020/02/15 | 1108 | fonts/newpx/tfm/zplsups-Bold-ot1.tfm
-2020/02/15 | 1107812 | systems/win32/miktex/tm/packages/miktex-runtime-bin-2.9.tar.lzma
-2020/02/15 | 11072 | fonts/newpx/tfm/zpl-BoldItalic-osf-scl-ly1.tfm
-2020/02/15 | 11072 | fonts/newpx/tfm/zpl-BoldItalic-lf-scl-ly1.tfm
-2020/02/15 | 11028 | fonts/newpx/tfm/zpl-BoldItalic-tlf-scl-ly1.tfm
-2020/02/15 | 11024 | fonts/newpx/tfm/zpl-BoldItalic-tosf-scl-ly1.tfm
-2020/02/15 | 1097592 | install/macros/latex/contrib/sdaps.tds.zip
-2020/02/15 | 10525355 | systems/win32/miktex/tm/packages/l3kernel.tar.lzma
-2020/02/15 | 1051848 | macros/latex/contrib/sdaps.zip
-2020/02/15 | 1042593 | systems/win32/miktex/tm/packages/miktex-poppler-bin-x64-2.9.tar.lzma
-2020/02/15 | 1041318 | systems/win32/miktex/tm/packages/miktex-asymptote-bin-x64-2.9.tar.lzma
-2020/02/15 | 1012609 | macros/latex/contrib/biblatex-contrib/archaeologie/archaeologie.pdf
-2020/02/15 | 1006808 | macros/latex/contrib/euclideangeometry.zip
diff --git a/fonts/libertinus-otf/Changes b/fonts/libertinus-otf/Changes
index 505f223d53..f6b33892ad 100644
--- a/fonts/libertinus-otf/Changes
+++ b/fonts/libertinus-otf/Changes
@@ -1,3 +1,4 @@
+0.24 2020-02-22 - added some more macros to controll the font features
0.23 2020-02-08 - do not load unicode-math if option nomath is used
0.22 2019-10-23 - added SmallCaps for slanted fonts
- several fixes for symbolic names
diff --git a/fonts/libertinus-otf/doc/libertinus-otf-doc.pdf b/fonts/libertinus-otf/doc/libertinus-otf-doc.pdf
index f7b6a94204..0236d89fa7 100644
--- a/fonts/libertinus-otf/doc/libertinus-otf-doc.pdf
+++ b/fonts/libertinus-otf/doc/libertinus-otf-doc.pdf
Binary files differ
diff --git a/fonts/libertinus-otf/doc/libertinus-otf-doc.tex b/fonts/libertinus-otf/doc/libertinus-otf-doc.tex
index de6034ff2c..dd2186d275 100644
--- a/fonts/libertinus-otf/doc/libertinus-otf-doc.tex
+++ b/fonts/libertinus-otf/doc/libertinus-otf-doc.tex
@@ -1,7 +1,8 @@
-%% $Id: libertinus-otf-doc.tex 1100 2019-10-23 19:07:26Z herbert $
+%% $Id: libertinus-otf-doc.tex 1146 2020-02-22 15:47:27Z herbert $
\listfiles
-\documentclass[polish,english,a4paper]{article}
+\documentclass[ngerman,spanish,polish,english,a4paper]{article}
\usepackage{libertinus-otf}
+\newfontfamily\DejaVu{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
\usepackage{babel}
\usepackage{geometry}
\usepackage{booktabs}
@@ -9,12 +10,18 @@
\usepackage{listings}
\usepackage{xspace}
\usepackage{setspace}
+\usepackage{xltabular}
\usepackage{marginnote}
\usepackage{xcolor}
\usepackage{varioref,multido}
\newcommand\Macro[1]{\texttt{\textbackslash#1}}
+\newcommand\textstyleVariable[1]{\texttt{#1}}
+\newcommand\textgerman[1]{\foreignlanguage{ngerman}{\texttt{#1}}}
\usepackage{dtk-extern}
+\usepackage[imakeidx]{xindex}
+\makeindex[title=Index]
+
\newenvironment{demoquote}
{\begingroup
\setlength{\topsep}{0pt}
@@ -23,9 +30,11 @@
\item\relax}
{\endlist\endgroup}
-\def\Lcs#1{\texttt{\textbackslash#1}\index{#1@\\texttt{\textbackslash#1}}}
+\def\Lcs#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}}
+\def\Largb#1{\texttt{\{}\textit{#1}\texttt{\}}}
\def\Lpack#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Package!#1@\texttt{#1}}}
\def\testfeature#1#2#3{{\fontspec[RawFeature={+#2}]{#1}#3\relax}}
+\def\SUP{\addfontfeatures{RawFeature={+sups}}}
\usepackage{multicol,luacode}
\setlength{\columnsep}{0.3cm}
@@ -571,17 +580,15 @@ Taka Albo tace Usta pęk ucha.
\clearpage
\section{Features}
-
-
-\begin{lstlisting}[basicstyle=\ttfamily\small]
- otfinfo --features libertinusserif-regular.otf
+\subsection{Serif fonts}
+\begin{lstlisting}[basicstyle=\DejaVu\small]
+otfinfo --features LibertinusSerif-Regular.otf
c2sc Small Capitals From Capitals
calt Contextual Alternates
case Case-Sensitive Forms
ccmp Glyph Composition/Decomposition
cpsp Capital Spacing
dlig Discretionary Ligatures
-fina Terminal Forms
frac Fractions
hlig Historical Ligatures
kern Kerning
@@ -589,7 +596,6 @@ liga Standard Ligatures
lnum Lining Figures
mark Mark Positioning
mkmk Mark to Mark Positioning
-nalt Alternate Annotation Forms
onum Oldstyle Figures
pnum Proportional Figures
salt Stylistic Alternates
@@ -601,6 +607,39 @@ ss03 Stylistic Set 3
ss04 Stylistic Set 4
ss05 Stylistic Set 5
ss06 Stylistic Set 6
+ss07 Stylistic Set 7
+subs Subscript
+sups Superscript
+tnum Tabular Figures
+zero Slashed Zero
+\end{lstlisting}
+
+\subsection{Sans Serif fonts}
+\begin{lstlisting}[basicstyle=\DejaVu\small]
+otfinfo --features LibertinusSans-Regular.otf
+c2sc Small Capitals From Capitals
+calt Contextual Alternates
+case Case-Sensitive Forms
+ccmp Glyph Composition/Decomposition
+cpsp Capital Spacing
+dlig Discretionary Ligatures
+frac Fractions
+hlig Historical Ligatures
+kern Kerning
+liga Standard Ligatures
+lnum Lining Figures
+mark Mark Positioning
+onum Oldstyle Figures
+pnum Proportional Figures
+salt Stylistic Alternates
+sinf Scientific Inferiors
+smcp Small Capitals
+ss01 Stylistic Set 1
+ss03 Stylistic Set 3
+ss04 Stylistic Set 4
+ss06 Stylistic Set 6
+ss07 Stylistic Set 7
+subs Subscript
sups Superscript
tnum Tabular Figures
zero Slashed Zero
@@ -629,14 +668,14 @@ defaultfeatures & valid for all fonts\\
\end{tabular}
-\lstset{basicstyle=\ttfamily\small,backgroundcolor=white}
+\lstset{basicstyle=\DejaVu\small,backgroundcolor=white,extendedchars}
\begin{externalDocument}[
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -657,7 +696,7 @@ defaultfeatures & valid for all fonts\\
% grfOptions={width=0.5\linewidth},
compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -681,7 +720,7 @@ defaultfeatures & valid for all fonts\\
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -704,7 +743,7 @@ defaultfeatures & valid for all fonts\\
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -722,15 +761,271 @@ defaultfeatures & valid for all fonts\\
\end{document}
\end{externalDocument}
+\section{Features}
+
+\subsection{Capitals to Small Caps}
+
+The macro \Lcs{Lctosc}\Largb{arg} is for a local change of \emph{arg} and \Lcs{LCtoSC+} and \Lcs{LCtoSC-} for
+a global change of capitals to small caps.
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+\usepackage{xcolor}
+%StopVisiblePreamble
+\begin{document}
+Libertinus Font ŐŰÉÁÄ Кириллица \Lctosc{Libertinus Font ŐŰÉÁÄ Кириллица}\\
+\LCtoSC+ Libertinus Font ŐŰÉÁÄ Кириллица
+
+\sffamily\LCtoSC-
+Libertinus Font ŐŰÉÁÄ Кириллица \Lctosc{Libertinus Font ŐŰÉÁÄ Кириллица}\\
+\LCtoSC+ Libertinus Font ŐŰÉÁÄ Кириллица
+\end{document}
+\end{externalDocument}
+
+
+
+\subsection{Capitals to Small Caps and small captitals}
+
+The macro \Lcs{Lctosmcp}\Largb{arg} is for a local change of \emph{arg} and \Lcs{LCtoSMCP+} and \Lcs{LCtoSMCP-} for
+a global change of capitals to small caps.
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+\usepackage{xcolor}
+%StopVisiblePreamble
+\begin{document}
+Libertinus Font ŐŰÉÁÄ Кириллица \Lctosmcp{Libertinus Font ŐŰÉÁÄ Кириллица}\\
+\LCtoSMCP+ Libertinus Font ŐŰÉÁÄ Кириллица
+
+\sffamily\LCtoSMCP-
+Libertinus Font ŐŰÉÁÄ Кириллица \Lctosmcp{Libertinus Font ŐŰÉÁÄ Кириллица}\\
+\LCtoSMCP+ Libertinus Font ŐŰÉÁÄ Кириллица
+\end{document}
+\end{externalDocument}
+
+\subsection{Ligatures}
+
+The macros \Lcs{Lliga}\Largb{arg} (standard ligatures), \Lcs{Lhlig}\Largb{arg} (historical ligatures),
+\Lcs{Ldlig}\Largb{arg} (discretionary ligatures)
+are for a local change of \emph{arg} and \Lcs{LLIGA+}/\Lcs{LLIGA-}, \Lcs{LHLIG+}/\Lcs{LHLIG-}, and \Lcs{LDLIG+}/\Lcs{LDIG-} for
+a global change of capitals to small caps relative to the current group.
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+\usepackage{xcolor}
+%StopVisiblePreamble
+\begin{document}%\LLIGA+ % Default
+fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, ſs, ſſ, ſt
+
+\LLIGA-
+fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, ſs, ſſ, ſt
+
+ct, st \qquad \LHLIG+ ct, st \LHLIG-
+
+Th, tt, tz, ck, ch \qquad\LDLIG+ Th, tt, tz, ck, ch\LDLIG-
+
+\sffamily\LLIGA+ % Default
+fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, ſs, ſſ, ſt
+
+\LLIGA-
+fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, ſs, ſſ, ſt
+
+ct, st \qquad \LHLIG+ ct, st \LHLIG-
+
+Th, tt, tz, ck, ch \qquad\LDLIG+ Th, tt, tz, ck, ch\LDLIG-
+\end{document}
+\end{externalDocument}
+
+
+
+\subsection{Case sensitive Forms}
+
+The macro \Lcs{Lcase}\Largb{arg} is for a local change of \emph{arg} and \Lcs{LCASE+} and \Lcs{LCASE-} for
+a global change of case sensitive forms.
+
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+\usepackage{xcolor}
+%StopVisiblePreamble
+\begin{document}
+¡CANTÁ! ¿CUÁNTOS? L1234567890L-\\
+\textcolor{red}{\Lcase{¡CANTÁ! ¿CUÁNTOS? L1234567890L-}}
+
+\makebox[0pt][l]{¡CANTÁ! ¿CUÁNTOS? L1234567890L-}%
+\textcolor{red}{\Lcase{¡CANTÁ! ¿CUÁNTOS? L1234567890L-}}
+
+\sffamily
+¡CANTÁ! ¿CUÁNTOS? L1234567890L-\\
+\textcolor{red}{\Lcase{¡CANTÁ! ¿CUÁNTOS? L1234567890L-}}
+
+\makebox[0pt][l]{¡CANTÁ! ¿CUÁNTOS? L1234567890L-}%
+\textcolor{red}{\Lcase{¡CANTÁ! ¿CUÁNTOS? L1234567890L-}}
+\end{document}
+\end{externalDocument}
+
+
+\subsection{Capital spacing, uppercase kerning}
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+\usepackage{xcolor}
+%StopVisiblePreamble
+\begin{document}
+IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.\\
+\textcolor{red}{\Lcpsp{IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.}}
+
+\makebox[0pt][l]{IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.}%
+\textcolor{red}{\LCPSP IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.}
+
+\sffamily
+IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.\\
+\textcolor{red}{\Lcpsp{IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.}}
+
+\makebox[0pt][l]{IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.}%
+\textcolor{red}{\LCPSP IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.}
+\end{document}
+\end{externalDocument}
+
+
+\subsection{Stylistic Alternates}
+
+The macro \Lcs{Lsalt}\Largb{arg} is for a local change of \emph{arg} and \Lcs{LSALT+} and \Lcs{LSALT-} for
+the alternate characters.
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+%StopVisiblePreamble
+\begin{document}
+\&Jβθκφha \quad \&Jβ\Lsalt{θκφ}ha \quad\LSALT+ \&Jβθκφha \quad\LSALT- \&Jβθκφha
+
+\sffamily
+\&Jβθκφha \quad \&Jβ\Lsalt{θκφ}ha \quad\LSALT+ \&Jβθκφha \quad\LSALT- \&Jβθκφha
+\end{document}
+\end{externalDocument}
+
+
+
\subsection{Stylistic Sets}
+There is a short command \Lcs{Lssxx}\Largb{text} for the seven stylistic sets, where xx is the number of the set (two digits)
+and \textit{text} the local argument:
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+%StopVisiblePreamble
+\begin{document}
+Ä,Ë,Ö$\rightarrow$\Lss01{Ä,Ë,Ö}\quad J,K,R$\rightarrow$\Lss02{J,K,R}\quad
+ß,ẞ,\textsc{ß}$\rightarrow$\Lss03{ß,ẞ,\textsc{ß}} \quad ẞ$\rightarrow$\Lss04{ẞ} \quad
+W$\rightarrow$\Lss05{W} \quad \&$\rightarrow$\Lss06{\&} \quad Ŋ$\rightarrow$\Lss07{Ŋ}
+
+\sffamily
+Ä,Ë,Ö$\rightarrow$\Lss01{Ä,Ë,Ö}\quad ß,ẞ,\textsc{ß}$\rightarrow$\Lss03{ß,ẞ,\textsc{ß}} \quad
+ẞ$\rightarrow$\Lss04{ẞ} \quad \&$\rightarrow$\Lss06{\&} \quad Ŋ$\rightarrow$\Lss07{Ŋ}
+\end{document}
+\end{externalDocument}
+
+
+For a global change of the stylistic set one can use the command \Lcs{LSSxx}, where xx
+is again the number of the set.
\begin{externalDocument}[
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -742,8 +1037,7 @@ defaultfeatures & valid for all fonts\\
\usepackage{libertinus-otf}
%StopVisiblePreamble
\begin{document}
-ÄËÖ\par\addfontfeatures{RawFeature=+ss01}
-ÄËÖ
+ÄËÖ \LSS01 ÄËÖ
\end{document}
\end{externalDocument}
@@ -752,7 +1046,7 @@ defaultfeatures & valid for all fonts\\
\begin{externalDocument}[
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
lstOptions={columns=fixed}]{Libertinus}
@@ -762,8 +1056,7 @@ defaultfeatures & valid for all fonts\\
\usepackage{libertinus-otf}
%StopVisiblePreamble
\begin{document}
-JKR\par\addfontfeatures{RawFeature=+ss02}
-JKR
+JKR \LSS02 JKR
\end{document}
\end{externalDocument}
@@ -772,7 +1065,7 @@ JKR
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -784,8 +1077,7 @@ JKR
\usepackage{libertinus-otf}
%StopVisiblePreamble
\begin{document}
-{ß\addfontfeatures{RawFeature=+ss03}ß}\par
-ẞ\addfontfeatures{RawFeature=+ss04}ẞ
+{ß \LSS03 ß} ẞ \LSS04 ẞ
\end{document}
\end{externalDocument}
@@ -796,7 +1088,7 @@ JKR
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -809,21 +1101,76 @@ JKR
%StopVisiblePreamble
\begin{document}
\huge
-W
-\addfontfeatures{RawFeature=+ss05}
-W
-\verb=\Wikipedia=%
-$\rightarrow$\Wikipedia
+W {\LSS05 W} \qquad \WikipediaW \qquad \Wikipedia
+\end{document}
+\end{externalDocument}
+
+
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+%StopVisiblePreamble
+\begin{document}
+\huge\& {\LSS06 \&}
+
+\Land\ \textsf{\Land}
+\end{document}
+\end{externalDocument}
+
+\subsection{Fractions}
+
+There are two macros: \Lcs{Lfrac}\Largb{arg} for a local fraction setting and \Lcs{LFRAC+} and \Lcs{LFRAC-} for a global
+setting relative to the current group.
+
+
+\begin{externalDocument}[
+% grfOptions={width=0.5\linewidth},
+ frame,compiler=lualatex,
+ crop,
+ force=true,
+ runs=2,code,docType=latex,
+ frame,
+% showFilename,
+% align=\centering,
+ lstOptions={columns=fixed}]{Libertinus}
+\documentclass{article}
+\pagestyle{empty}
+\parindent=0pt
+%StartVisiblePreamble
+\usepackage{libertinus-otf}
+%StopVisiblePreamble
+\begin{document}
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289 \par
+ L 1/2 \Lfrac{1/3} 1/4 1/5 1/6 1/7 1/8 1/9 1/10 \Lfrac{5/1289}
+
+\LFRAC+
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289
+
+\LFRAC-
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289
\end{document}
\end{externalDocument}
+\subsection{Scientific Inferieurs}
\begin{externalDocument}[
% grfOptions={width=0.5\linewidth},
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
% showFilename,
@@ -835,14 +1182,17 @@ $\rightarrow$\Wikipedia
\usepackage{libertinus-otf}
%StopVisiblePreamble
\begin{document}
-\huge\&
-\addfontfeatures{RawFeature=+ss06}
-\&
+ H2O, YCbCr, L1234567890abcdefgh
+
+\Lsinf{H2O}, \Lsinf{YCbCr}, \Lsinf{L1234567890abcdefgh} \par\sffamily
+\Lsinf{H2O}, \Lsinf{YCbCr}, \Lsinf{L1234567890abcdefgh}
\end{document}
\end{externalDocument}
+
+
%sflining (sflf) or sfoldstyle (sfosf, osfss)
%sftabular (sft) or sfproportional (sfp)
@@ -903,8 +1253,8 @@ e f g h i j k l m n o p q r s t u v w x y z \{ | \} \textasciitilde
\LibKey\LKeyDown;
\LibKey\LKeyLeft;
\LibKey\LKeyRight;
-\LibKey\LKeyBildUp;
-\LibKey\LKeyBildDown;
+%\LibKey\LKeyPageUp;
+%\LibKey\LKeyPageDown;
\LibKey\LKeyAt;
\LibKey\LKeyFn;
\LibKey\LKeyHome;
@@ -1059,7 +1409,7 @@ a Libertinus font, one can use a predefinded command:
\begin{externalDocument}[
frame,compiler=lualatex,
crop,
- force=false,
+ force=true,
runs=2,code,docType=latex,
frame,
lstOptions={columns=fixed}]{Libertinus}
@@ -1078,6 +1428,672 @@ The default 0123456
\end{externalDocument}
+\iffalse
+
+\begin{xltabular}{\linewidth}{|l r X|}\hline
+ Feature & Tag & Input/Output\\\hline
+ Small Capitals & \textstyleVariable{smcp} & Libertinus őűéáäß Кириллица
+
+\addfontfeatures{RawFeature=smcp}Libertinus őűéáäß Кириллица … \\\hline
+ Capitals to Small Caps &\textstyleVariable{c2sc} & Libertinus Font ŐŰÉÁÄ
+
+\addfontfeatures{RawFeature=+c2sc} Libertinus Font ŐŰÉÁÄ … \\\hline
+ Small Capitals \newline
++ Capitals to Small Caps
+
+ &
+\textstyleVariable{smcp}
+\textstyleVariable{c2sc}
+
+ &
+ Libertinus Font
+
+\addfontfeatures{RawFeature={+smcp,+c2sc}}%
+ Libertinus Font …
+
+\\\hline
+ Case Sensitive Forms
+
+ &
+\textstyleVariable{case}
+
+ &
+ \textspanish{¡CANTÁ! ¿CUÁNTOS?} L1234567890L-
+
+\addfontfeatures{RawFeature=+case}%
+ \textspanish{¡CANTÁ! ¿CUÁNTOS?} L1234567890L- …
+
+\\\hline
+ Standard Ligatures (\textit{default})
+
+ &
+{\raggedleft \textstyleVariable{-liga}\par}
+
+ &
+ fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, \newline
+ſs, ſſ, ſt
+
+\addfontfeatures{RawFeature=-liga}%
+ fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, ſs, ſſ, ſt
+
+\\\hline
+ Historical Ligatures
+
+ &
+\textstyleVariable{hlig}
+
+ &
+ ct, st
+
+\addfontfeatures{RawFeature=+hlig}%
+ ct, st
+
+\\\hline
+ Discretionary Ligatures
+
+ &
+\textstyleVariable{dlig}
+
+ &
+ Th, tt, tz, ck, ch
+
+\addfontfeatures{RawFeature=+dlig}%
+ Th, tt, tz, ck, ch
+
+\\\hline
+ Contextual Alternates (\textit{default})
+
+ &
+\textstyleVariable{-calt}
+
+ &
+ Qu, \textgerman{tief? (f) Schulfächer}
+
+\addfontfeatures{RawFeature=-calt}%
+ Qu, \textgerman{tief? (f) Schulfächer} …
+
+\\\hline
+ Fractions
+
+ &
+ \textstyleVariable{frac}
+
+ &
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289
+
+\addfontfeatures{RawFeature=+frac}%
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289 …
+
+\\\hline
+ Kerning (\textit{default})
+
+ &
+\textstyleVariable{-kern}
+ &
+ Telephone. AVATAR. Wait! Typography. WAY. \ V.
+
+\addfontfeatures{RawFeature=-kern}%
+ Telephone. AVATAR. Wait! Typography. WAY. V.
+
+\\\hline
+ Capital Spacing, Uppercase Kerning
+
+ &
+\textstyleVariable{cpsp}
+
+ &
+ IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.
+
+\addfontfeatures{RawFeature=+cpsp}%
+ IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.
+
+\\\hline
+ Slashed Zero
+
+ &
+\textstyleVariable{zero}
+
+ &
+ 0
+
+\addfontfeatures{RawFeature=+zero}%
+ 0
+
+\\\hline
+ Tabular Figures (\textit{default})
+
+ &
+\textstyleVariable{tnum}
+
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature=+tnum}%
+ 1234567890
+
+\\\hline
+ Proportional Numbers
+
+ &
+\textstyleVariable{pnum}
+
+ &
+ 1111111111
+
+\addfontfeatures{RawFeature={-tnum,+pnum}}%
+ 1111111111
+
+\\\hline
+ Lining Figures (\textit{default})
+
+ &
+ \textstyleVariable{lnum}
+
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature={-tnum,+lnum}}%
+ 1234567890
+
+\\\hline
+ Oldstyle Figures
+
+ &
+\textstyleVariable{onum}
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature={-lnum,+onum}}%
+ 1234567890
+
+\\\hline
+ Proportional Oldstyle \ Figures
+
+ &
+\textstyleVariable{pnum}
+\textstyleVariable{onum}
+
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature={-lnum,-tnum,+onum,+pnum}}%
+ 1234567890
+
+\\\hline
+ Stylistic Alternates
+
+ &
+\textstyleVariable{salt}
+
+ &
+ \& J β θ κ φ h a
+
+\addfontfeatures{RawFeature=+salt}%
+ \& J β θ κ φ h a
+
+\\\hline
+ Stylistic Set 1
+
+ &
+\textstyleVariable{ss01}
+
+ &
+ Ä, Ö, Ü
+
+\addfontfeatures{RawFeature=+ss01}%
+ Ä, Ö, Ü
+
+\\\hline
+ Stylistic Set 2
+
+ &
+\textstyleVariable{ss02}
+
+ &
+ J, K, R
+
+\addfontfeatures{RawFeature=+ss02}%
+ J, K, R
+
+\\\hline
+ Stylistic Set 3
+
+ &
+\textstyleVariable{ss03}
+
+ &
+ ß, ẞ, ß
+
+\addfontfeatures{RawFeature=+ss03}%
+ ß, ẞ, ß
+
+\\\hline
+ Stylistic Set 4
+
+ &
+\textstyleVariable{ss04}
+
+ &
+ ẞ
+
+\addfontfeatures{RawFeature=+ss04}%
+ ẞ
+
+\\\hline
+ Stylistic Set 5
+
+ &
+\textstyleVariable{ss05}
+
+ &
+ W
+
+\addfontfeatures{RawFeature=+ss05}%
+ W
+
+\\\hline
+ Stylistic Set 6
+
+ &
+\textstyleVariable{ss06}
+
+ &
+ \&
+
+\addfontfeatures{RawFeature=+ss06}%
+ \&
+
+\\\hline
+ Stylistic Set 7
+
+ &
+\textstyleVariable{ss07}
+
+ &
+ Ŋ
+
+\addfontfeatures{RawFeature=+ss07}%
+ Ŋ
+
+\\\hline
+ Scientific Inferiors
+
+ &
+\textstyleVariable{sinf}
+
+ &
+ H2O, YCbCr, L1234567890abcdefgh
+
+\addfontfeatures{RawFeature=+sinf}%
+ H2O, YCbCr L1234567890abcdefgh …
+
+\\\hline
+ Superscript &\textstyleVariable{sups} & y = an ⋅ ex, L1234567890abcdefgh\ldots
+
+y=a{\Lsup n}⋅e{\Lsup x}, \Lsup{L1234567890abcdefgh\ldots}\\\hline
+ Mark Positioning (\textit{default}) & \textstyleVariable{-mark} &
+ A̍a̎
+
+ \addfontfeatures{RawFeature=-mark}%
+A̍a̎̎ …
+
+\\\hline
+ Mark-to-mark Positioning (\textit{default})
+
+ &
+\textstyleVariable{-mkmk}
+
+ &
+ x̆́
+
+\addfontfeatures{RawFeature=-mkmk}%
+ x̆́ …
+
+\\\hline
+\end{xltabular}
+
+
+\sffamily
+\begin{xltabular}{\linewidth}{|l r X|}\hline
+ Feature & Tag & Input/Output\\\hline
+ Small Capitals & \textstyleVariable{smcp} & Libertinus őűéáäß Кириллица
+
+\addfontfeatures{RawFeature=smcp}Libertinus őűéáäß Кириллица … \\\hline
+ Capitals to Small Caps &\textstyleVariable{c2sc} & Libertinus Font ŐŰÉÁÄ
+
+\addfontfeatures{RawFeature=+c2sc} Libertinus Font ŐŰÉÁÄ … \\\hline
+ Small Capitals \newline
++ Capitals to Small Caps
+
+ &
+\textstyleVariable{smcp}
+\textstyleVariable{c2sc}
+
+ &
+ Libertinus Font
+
+\addfontfeatures{RawFeature={+smcp,+c2sc}}%
+ Libertinus Font …
+
+\\\hline
+ Case Sensitive Forms
+
+ &
+\textstyleVariable{case}
+
+ &
+ \textspanish{¡CANTÁ! ¿CUÁNTOS?} L1234567890L-
+
+\addfontfeatures{RawFeature=+case}%
+ \textspanish{¡CANTÁ! ¿CUÁNTOS?} L1234567890L- …
+
+\\\hline
+ Standard Ligatures (\textit{default})
+
+ &
+{\raggedleft \textstyleVariable{-liga}\par}
+
+ &
+ fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, \newline
+ſs, ſſ, ſt
+
+\addfontfeatures{RawFeature=-liga}%
+ fb, ff, fh, ffh, fi, ffi, fj, ffj, fk, ffk, fl, ffl, ft, fft, ſh, ſl, ſs, ſſ, ſt
+
+\\\hline
+ Historical Ligatures
+
+ &
+\textstyleVariable{hlig}
+
+ &
+ ct, st
+
+\addfontfeatures{RawFeature=+hlig}%
+ ct, st
+
+\\\hline
+ Discretionary Ligatures
+
+ &
+\textstyleVariable{dlig}
+
+ &
+ Th, tt, tz, ck, ch
+
+\addfontfeatures{RawFeature=+dlig}%
+ Th, tt, tz, ck, ch
+
+\\\hline
+ Contextual Alternates (\textit{default})
+
+ &
+\textstyleVariable{-calt}
+
+ &
+ Qu, \textgerman{tief? (f) Schulfächer}
+
+\addfontfeatures{RawFeature=-calt}%
+ Qu, \textgerman{tief? (f) Schulfächer} …
+
+\\\hline
+ Fractions
+
+ &
+ \textstyleVariable{frac}
+
+ &
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289
+
+\addfontfeatures{RawFeature=+frac}%
+ L 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 5/20 9/1289 …
+
+\\\hline
+ Kerning (\textit{default})
+
+ &
+\textstyleVariable{-kern}
+ &
+ Telephone. AVATAR. Wait! Typography. WAY. \ V.
+
+\addfontfeatures{RawFeature=-kern}%
+ Telephone. AVATAR. Wait! Typography. WAY. V.
+
+\\\hline
+ Capital Spacing, Uppercase Kerning
+
+ &
+\textstyleVariable{cpsp}
+
+ &
+ IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.
+
+\addfontfeatures{RawFeature=+cpsp}%
+ IN THE BEGINNING GOD CREATED THE HEAVENS AND THE EARTH.
+
+\\\hline
+ Slashed Zero
+
+ &
+\textstyleVariable{zero}
+
+ &
+ 0
+
+\addfontfeatures{RawFeature=+zero}%
+ 0
+
+\\\hline
+ Tabular Figures (\textit{default})
+
+ &
+\textstyleVariable{tnum}
+
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature=+tnum}%
+ 1234567890
+
+\\\hline
+ Proportional Numbers
+
+ &
+\textstyleVariable{pnum}
+
+ &
+ 1111111111
+
+\addfontfeatures{RawFeature={-tnum,+pnum}}%
+ 1111111111
+
+\\\hline
+ Lining Figures (\textit{default})
+
+ &
+ \textstyleVariable{lnum}
+
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature={-tnum,+lnum}}%
+ 1234567890
+
+\\\hline
+ Oldstyle Figures
+
+ &
+\textstyleVariable{onum}
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature={-lnum,+onum}}%
+ 1234567890
+
+\\\hline
+ Proportional Oldstyle \ Figures
+
+ &
+\textstyleVariable{pnum}
+\textstyleVariable{onum}
+
+ &
+ 1234567890
+
+\addfontfeatures{RawFeature={-lnum,-tnum,+onum,+pnum}}%
+ 1234567890
+
+\\\hline
+ Stylistic Alternates
+
+ &
+\textstyleVariable{salt}
+
+ &
+ \& J β θ κ φ h a
+
+\addfontfeatures{RawFeature=+salt}%
+ \& J β θ κ φ h a
+
+\\\hline
+ Stylistic Set 1
+
+ &
+\textstyleVariable{ss01}
+
+ &
+ Ä, Ö, Ü
+
+\addfontfeatures{RawFeature=+ss01}%
+ Ä, Ö, Ü
+
+\\\hline
+ Stylistic Set 2
+
+ &
+\textstyleVariable{ss02}
+
+ &
+ J, K, R
+
+\addfontfeatures{RawFeature=+ss02}%
+ J, K, R
+
+\\\hline
+ Stylistic Set 3
+
+ &
+\textstyleVariable{ss03}
+
+ &
+ ß, ẞ, ß
+
+\addfontfeatures{RawFeature=+ss03}%
+ ß, ẞ, ß
+
+\\\hline
+ Stylistic Set 4
+
+ &
+\textstyleVariable{ss04}
+
+ &
+ ẞ
+
+\addfontfeatures{RawFeature=+ss04}%
+ ẞ
+
+\\\hline
+ Stylistic Set 5
+
+ &
+\textstyleVariable{ss05}
+
+ &
+ W
+
+\addfontfeatures{RawFeature=+ss05}%
+ W
+
+\\\hline
+ Stylistic Set 6
+
+ &
+\textstyleVariable{ss06}
+
+ &
+ \&
+
+\addfontfeatures{RawFeature=+ss06}%
+ \&
+
+\\\hline
+ Stylistic Set 7
+
+ &
+\textstyleVariable{ss07}
+
+ &
+ Ŋ
+
+\addfontfeatures{RawFeature=+ss07}%
+ Ŋ
+
+\\\hline
+ Scientific Inferiors
+
+ &
+\textstyleVariable{sinf}
+
+ &
+ H2O, YCbCr, L1234567890abcdefgh
+
+\addfontfeatures{RawFeature=+sinf}%
+ H2O, YCbCr L1234567890abcdefgh …
+
+\\\hline
+ Superscript
+
+ &
+\textstyleVariable{sups}
+
+ &
+ y = an ⋅ ex, L1234567890abcdefgh
+
+\addfontfeatures{RawFeature={+sups,-sinf}}%
+ y = an ⋅ ex, L1234567890abcdefgh …
+
+\\\hline
+ Mark Positioning (\textit{default})
+
+ &
+ \textstyleVariable{-mark}
+
+ &
+ A̍a̎
+
+ \addfontfeatures{RawFeature=-mark}%
+A̍a̎̎ …
+
+\\\hline
+ Mark-to-mark Positioning (\textit{default})
+
+ &
+\textstyleVariable{-mkmk}
+
+ &
+ x̆́
+
+\addfontfeatures{RawFeature=-mkmk}%
+ x̆́ …
+
+\\\hline
+\end{xltabular}
+
+
+\fi
+
+
\clearpage
\newgeometry{margin=1cm,bmargin=2cm}
@@ -1111,5 +2127,9 @@ The default 0123456
\end{multicols}
+\printindex
+
+
+
\end{document}
diff --git a/fonts/libertinus-otf/latex/libertinus-otf.sty b/fonts/libertinus-otf/latex/libertinus-otf.sty
index e741af8b00..f0ffebc960 100644
--- a/fonts/libertinus-otf/latex/libertinus-otf.sty
+++ b/fonts/libertinus-otf/latex/libertinus-otf.sty
@@ -1,4 +1,4 @@
-%% $Id: libertinus-otf.sty 1100 2019-10-23 19:07:26Z herbert $
+%% $Id: libertinus-otf.sty 1146 2020-02-22 15:47:27Z herbert $
%%
%% This file is distributed under the terms of the LaTeX Project Public
%% License from CTAN archives in directory macros/latex/base/lppl.txt.
@@ -8,7 +8,7 @@
% Copyright 2020 Herbert Voss hvoss@tug.org
%
\ProvidesPackage{libertinus-otf}[%
- 2020/02/08 v. 0.23 (Herbert Voss) Supports libertinus fonts for lualatex and xelatex.]
+ 2020/02/22 v. 0.24 (Herbert Voss) Supports libertinus fonts for lualatex and xelatex.]
\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}
%\RequirePackage[no-math]{fontspec}
@@ -543,5 +543,64 @@
\fi
%
-\def\Wikipedia{{\fontspec{Libertinus Serif Regular}[RawFeature=+ss05]W}}
-%\def\WikipediaSF{{\addfontfeature{RawFeature=+ss05}\fontspec{Libertinus Sans Regular}W}}
+\def\WikipediaW{{\fontspec{LibertinusSerif-Regular.otf}[RawFeature=+ss05]W}}
+\def\Wikipedia{{\fontspec{LibertinusSerif-Regular.otf}[RawFeature={+ss05,+smcp}]W\kern-1pt ikipediA}}
+
+%\def\WikipediaWSF{{\sffamily\addfontfeature{RawFeature=+ss05}W}}
+%\def\WikipediaSF{{\addfontfeature{RawFeature=+ss05}\sffamily WikipediA}}
+
+\def\Lsup#1{{\addfontfeature{RawFeature=+sups}#1}}
+\def\Lsinf#1{{\addfontfeature{RawFeature=+sinf}#1}}
+\def\Land{{\addfontfeature{RawFeature=+ss06}\&}}
+
+\def\Lcase#1{{\addfontfeature{RawFeature=case}#1}}
+\def\LCASE{\@ifnextchar-\L@CASE\L@@CASE}
+\def\L@CASE-{\addfontfeature{RawFeature=-case}}
+\def\L@@CASE#1{\addfontfeature{RawFeature=+case}\ifx#1+\else#1\fi}
+
+\def\Lfrac#1{{\addfontfeature{RawFeature=+frac}#1}}
+\def\LFRAC{\@ifnextchar-\L@FRAC\L@@FRAC}
+\def\L@FRAC-{\addfontfeature{RawFeature=-frac}}
+\def\L@@FRAC#1{\addfontfeature{RawFeature=+frac}\ifx#1+\else#1\fi}
+
+\def\Lcpsp#1{{\addfontfeature{RawFeature=+cpsp}#1}}
+\def\LCPSP{\@ifnextchar-\L@CPSP\L@@CPSP}
+\def\L@CPSP-{\addfontfeature{RawFeature=-cpsp}}
+\def\L@@CPSP#1{\addfontfeature{RawFeature=+cpsp}\ifx#1+\else#1\fi}
+
+\def\Lss#1#2#3{{\addfontfeature{RawFeature=ss#1#2}#3}}
+\def\LSS#1#2{\addfontfeature{RawFeature=ss#1#2}}
+
+\def\Lctosc#1{{\addfontfeature{RawFeature=+c2sc}#1}}
+\def\LCtoSC{\@ifnextchar-\L@CtoSC\L@@CtoSC}
+\def\L@CtoSC-{\addfontfeature{RawFeature=-c2sc}}
+\def\L@@CtoSC#1{\addfontfeature{RawFeature=+c2sc}\ifx#1+\else#1\fi}
+
+\def\Lctosmcp#1{{\addfontfeature{RawFeature={+c2sc,+smcp}}#1}}
+\def\LCtoSMCP{\@ifnextchar-\L@CtoSMCP\L@@CtoSMCP}
+\def\L@CtoSMCP-{\addfontfeature{RawFeature={-c2sc,-smcp}}}
+\def\L@@CtoSMCP#1{\addfontfeature{RawFeature={+c2sc,+smcp}}\ifx#1+\else#1\fi}
+
+\def\Lsalt#1{{\addfontfeature{RawFeature=+salt}#1}}
+\def\LSALT{\@ifnextchar-\L@SALT\L@@SALT}
+\def\L@SALT-{\addfontfeature{RawFeature=-salt}}
+\def\L@@SALT#1{\addfontfeature{RawFeature=+salt}\ifx#1+\else#1\fi}
+
+\def\Lliga#1{{\addfontfeature{RawFeature=+liga}#1}}
+\def\LLIGA{\@ifnextchar-\L@LIGA\L@@LIGA}
+\def\L@LIGA-{\addfontfeature{RawFeature=-liga}}
+\def\L@@LIGA#1{\addfontfeature{RawFeature=+liga}\ifx#1+\else#1\fi}
+
+
+\def\Lhlig#1{{\addfontfeature{RawFeature=+hlig}#1}}
+\def\LHLIG{\@ifnextchar-\L@HLIG\L@@HLIG}
+\def\L@HLIG-{\addfontfeature{RawFeature=-hlig}}
+\def\L@@HLIG#1{\addfontfeature{RawFeature=+hlig}\ifx#1+\else#1\fi}
+
+\def\Ldlig#1{{\addfontfeature{RawFeature=+dlig}#1}}
+\def\LDLIG{\@ifnextchar-\L@DLIG\L@@DLIG}
+\def\L@DLIG-{\addfontfeature{RawFeature=-dlig}}
+\def\L@@DLIG#1{\addfontfeature{RawFeature=+dlig}\ifx#1+\else#1\fi}
+
+
+
diff --git a/graphics/pgf/contrib/circuitikz/README.md b/graphics/pgf/contrib/circuitikz/README.md
index 0bdb53f164..26b73ef946 100644
--- a/graphics/pgf/contrib/circuitikz/README.md
+++ b/graphics/pgf/contrib/circuitikz/README.md
@@ -1,5 +1,3 @@
-### notice
-This package is in a kind of **feature-freeze state** until v1.0 is released, possibly around 2020 New Year.
circuitikz
==========
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index 8c56ba379d..af37be95ea 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -6,6 +6,28 @@ full list of changes.
\begin{itemize}
\tightlist
\item
+ Version 1.0.1 (2020-02-22)
+\end{itemize}
+
+Minor fixes and addition to 1.0, in time to catch the freeze for TL2020.
+
+\begin{itemize}
+\item
+ add v1.0 version snapshots
+\item
+ added crossed generic impedance (suggested by Radványi Patrik Tamás)
+\item
+ added open barrier bipole (suggested by Radványi Patrik Tamás)
+\item
+ added two flags to flip the direction of light's arrows on LED and
+ photodiode (suggested by karlkappe on GitHub)
+\item
+ added a special key to help with precision loss in case of fractional
+ scaling (thanks to AndreaDiPietro92 on GitHub for noticing and
+ reporting, and to Schrödinger's cat for finding a fix)
+\item
+ fixed a nasty bug for the flat file generation for ConTeXt
+\item
Version 1.0 (2020-02-04)
\end{itemize}
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index 18ae7854f6..de9bb9e6b1 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
index 88c21dac4a..ded6de75ca 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index fc156f1fc2..1475ffc16f 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -248,6 +248,33 @@ Correcting this will need a big rewrite of the path routines, and although the a
This same issue create a lot of problem of compatibility between \Circuitikz{} and the new \texttt{pic} Ti\emph{k}Z feature, so basically don't put components into \texttt{pic}s.
+\subsection{Scale factors inaccuracies}\label{sec:usefpu}
+
+Sometimes, when using fractional scaling factors and big values for the coordinates, the basic layer inaccuracies from \TeX{} can bite you, producing results like the following one:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[scale=1.2, transform shape,
+ ]
+ \draw (60,1) to [battery2, v_=$V_{cc}$, name=B] ++(0,2);
+ \node[draw,red,circle,inner sep=4pt] at(B.left) {};
+ \node[draw,red,circle,inner sep=4pt] at(B.right) {};
+\end{circuitikz}
+\end{LTXexample}
+
+A general solution for this problem is difficult to find; probably the best approach is to use a \verb|scalebox| command to scale the circuit instead of relying on internal scaling.
+
+Nevertheless, \href{https://tex.stackexchange.com/a/529159/38080}{Schrödinger's cat} found a solution which has been ported to \Circuitikz: you can use the key \texttt{use fpu reciprocal} which will patch a standard low-level math routine with a more precise one.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[scale=1.2, transform shape,
+ use fpu reciprocal,
+ ]
+\draw (60,1) to [battery2, v_=$V_{cc}$] ++(0,2);
+\end{circuitikz}
+\end{LTXexample}
+
+They \texttt{use fpu reciprocal} key seems to have no side effects, but given that it is patching an internal interface of \TikZ{} it can break any time, so it is advisable to use it only if and when needed.
+
\subsection{Incompabilities between version}
Here, we will provide a list of incompabilitys between different version of circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than including a lot of switches and compatibility layers.
@@ -266,14 +293,15 @@ You can check the used version at your local installation using the macro \verb!
If you have older projects that show compatibility problems, you have two options:
\begin{itemize}
\item you can use an older version locally using the git-version and picking the correct commit from the repository (branch gh-pages) or the main GitHub site directly;
- \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7}, \texttt{0.8.3}, \texttt{0.9.3} and \texttt{0.9.6}. To switch to use them, you simply change your \verb|\usepackage| invocation like
+ \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7}, \texttt{0.8.3}, \texttt{0.9.3}, \texttt{0.9.6} and \texttt{1.0}.
+ To switch to use them, you simply change your \verb|\usepackage| invocation like
\begin{lstlisting}
- \usepackage[]{circuitik-0.8.3} % or circuitikz-0.4, 0.6...
+ \usepackage[]{circuitikz-0.8.3} % or circuitikz-0.4, 0.6...
\end{lstlisting}
You have to take care of the options that may have changed between versions;
- \item if you are using \ConTeXt, only versions \texttt{0.8.3}, \texttt{0.9.3} and \texttt{0.9.6} are packaged for now; if can use it with
+ \item if you are using \ConTeXt, only versions \texttt{0.8.3}, \texttt{0.9.3}, \texttt{0.9.6} and \texttt{1.0} are packaged for now; if can use it with
\begin{lstlisting}
- \usemodule[circuitik-0.8.3]
+ \usemodule[circuitikz-0.8.3]
\end{lstlisting}
\end{itemize}
@@ -1268,6 +1296,7 @@ If you want that the arrows behave like the legacy symbols (which are shapes), \
\circuitdescbip{short}{Short circuit}{}
\circuitdescbip{open}{Open circuit}{}
\circuitdescbip*{generic}{Generic (symmetric) bipole}{}
+ \circuitdescbip*{xgeneric}{Crossed generic (symmetric) bipole}{}
\circuitdescbip*{tgeneric}{Tunable generic bipole}{}
\circuitdescbip*{ageneric}{Generic asymmetric bipole}{}
\circuitdescbip*{memristor}{Memristor}{Mr}
@@ -1551,6 +1580,30 @@ You can change the scale of the diodes by setting the key \texttt{diodes/scale}
\end{circuitikz}
\end{LTXexample}
+You can change the direction of the LEDs and photodiodes' arrows by using the binary keys \texttt{led arrows from cathode} and \texttt{pd arrows to cathode} (the default are \texttt{led arrows from anode} and \texttt{pd arrows to anode}), as you can see in the following example.
+
+\begin{LTXexample}[varwidth=true]
+ \begin{circuitikz}
+ \ctikzset{led arrows from anode} % default
+ \ctikzset{pd arrows to anode} % default
+ \ctikzset{full diodes}
+ \draw (0,0) to[leD] ++(1.5,0) to[pD] ++(1.5,0);
+ \ctikzset{stroke diodes}
+ \draw (0,-1) to[leD] ++(1.5,0) to[pD] ++(1.5,0);
+ \ctikzset{empty diodes}
+ \draw (0,-2) to[leD] ++(1.5,0) to[pD] ++(1.5,0);
+
+ \ctikzset{led arrows from cathode}
+ \ctikzset{pd arrows to cathode}
+ \ctikzset{full diodes}
+ \draw (0,-4) to[leD] ++(1.5,0) to[pD] ++(1.5,0);
+ \ctikzset{stroke diodes}
+ \draw (0,-5) to[leD] ++(1.5,0) to[pD] ++(1.5,0);
+ \ctikzset{empty diodes}
+ \draw (0,-6) to[leD] ++(1.5,0) to[pD] ++(1.5,0);
+ \end{circuitikz}
+\end{LTXexample}
+
\subsection{Sources and generators}
Notice that source and generators are divided in three classes that can be styled independently: traditional battery symbols (class \texttt{batteries}), independent generators (class \texttt{sources}) and dependent generators (class \texttt{csources}). This is because they are often treated differently, and so you can choose to, for example, fill the dependent sources but not the independent ones.
@@ -1922,8 +1975,11 @@ Here you'll find bipoles that are not easily grouped in the categories above.
\circuitdescbip*{afuse}{Asymmetric fuse}{asymmetric fuse}
\circuitdescbip{squid}{Squid}{}
\circuitdescbip{barrier}{Barrier}{}
+ \circuitdescbip{openbarrier}{Open barrier}{}
\end{groupdesc}
+ You can tune how big is the gap in the \texttt{openbarrier} component by setting the key \texttt{bipoles/openbarrier/gap} (default value \texttt{0.5}; \texttt{0} means no gap and \texttt{1} full gap).
+
\begin{groupdesc}
\circuitdescbip*{european gas filled surge arrester}{European gas filled surge arrester}{}
\circuitdescbip*{american gas filled surge arrester}{American gas filled surge arrester}{}
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz-1.0.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz-1.0.sty
new file mode 100644
index 0000000000..0c2d02e50a
--- /dev/null
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz-1.0.sty
@@ -0,0 +1,20155 @@
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+\NeedsTeXFormat{LaTeX2e}
+
+\def\pgfcircversion{1.0}
+\def\pgfcircversiondate{2020/02/04}
+
+\ProvidesPackage{circuitikz-1.0}
+[\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
+
+%% Version 3.0 of pgf/TikZ is required
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+%
+% "arrows" library is deprecated, and behave badly with
+% arrows on short paths. Change to the new arrows.meta
+% In pfgcirc.define, we will add the old definition of
+% latex' which we have lost in the transition
+%
+\usetikzlibrary{arrows.meta, bending}
+
+% The options are listed in the manual in this order
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{straightvoltages}{
+ \pgf@circuit@bipole@voltage@straighttrue
+}
+
+\DeclareOption{americanvoltage}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrent}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrent}{
+ \ctikzset{current = american}
+}
+
+
+
+\DeclareOption{americanresistor}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistor}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductor}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductor}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductor}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanport}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{european}{
+ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
+ \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
+}
+
+\DeclareOption{american}{
+ \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{fulldiodes}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiodes}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltages}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrents}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrents}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{americanresistors}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistors}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductors}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductors}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductors}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanports}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanports}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{americangfsurgearrester}{
+ \ctikzset{gas filled surge arrester choice = american}
+}
+
+\DeclareOption{europeangfsurgearrester}{
+ \ctikzset{gas filled surge arrester choice = european}
+}
+
+\DeclareOption{siunitx}{
+ \pgf@circ@siunitxtrue
+}
+
+\DeclareOption{nosiunitx}{
+ \pgf@circ@siunitxfalse
+}
+
+\DeclareOption{fulldiode}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiode}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{strokediode}{
+ \ctikzset{diode = stroke}
+}
+
+\DeclareOption{arrowmos}{
+ \pgf@circuit@mos@arrowstrue
+}
+
+\DeclareOption{noarrowmos}{
+ \pgf@circuit@mos@arrowsfalse
+}
+
+\DeclareOption{fetbodydiode}{
+ \pgf@circuit@fet@bodydiodetrue
+}
+
+\DeclareOption{nofetbodydiode}{
+ \pgf@circuit@fet@bodydiodefalse
+}
+
+\DeclareOption{fetsolderdot}{
+ \pgf@circuit@fet@solderdottrue
+}
+
+\DeclareOption{nofetsolderdot}{
+ \pgf@circuit@fet@solderdotfalse
+}
+
+\DeclareOption{emptypmoscircle}{
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+
+\DeclareOption{lazymos}{
+ \ctikzset{tripoles/nmos/width=.5}
+ \ctikzset{tripoles/nmos/gate height=.35}
+ \ctikzset{tripoles/nmos/base height=.35}
+ \ctikzset{tripoles/nmos/height/.initial=1.2}
+ \ctikzset{tripoles/nmos/base width=.5}
+ \ctikzset{tripoles/nmos/gate width=.65}
+
+ \ctikzset{tripoles/pmos/width=.5}
+ \ctikzset{tripoles/pmos/gate height=.35}
+ \ctikzset{tripoles/pmos/base height=.35}
+ \ctikzset{tripoles/pmos/height/.initial=1.2}
+ \ctikzset{tripoles/pmos/base width=.5}
+ \ctikzset{tripoles/pmos/gate width=.65}
+
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+\DeclareOption{straightlabels}{
+ \ctikzset{label/align = straight}
+}
+
+\DeclareOption{rotatelabels}{
+ \ctikzset{label/align = rotate}
+}
+
+\DeclareOption{smartlabels}{
+ \ctikzset{label/align = smart}
+}
+
+\DeclareOption{compatibility}{
+ \pgf@circuit@compattrue
+}
+
+\DeclareOption{oldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectiontrue
+ \pgf@circ@explicitvdirtrue
+ \pgf@circ@fixbatteriesfalse
+}
+\DeclareOption{nooldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectionfalse
+ \pgf@circ@explicitvdirtrue
+ \pgf@circ@fixbatteriesfalse
+}
+
+\DeclareOption{RPvoltages}{
+ \pgf@circ@oldvoltagedirectiontrue
+ \pgf@circ@explicitvdirtrue
+ \pgf@circ@fixbatteriestrue
+}
+\DeclareOption{EFvoltages}{
+ \pgf@circ@oldvoltagedirectionfalse
+ \pgf@circ@explicitvdirtrue
+ \pgf@circ@fixbatteriestrue
+}
+
+\DeclareOption{legacytransistorstext}{
+ \pgf@circuit@transisors@fixlabelsfalse
+}
+
+\DeclareOption{nolegacytransistorstext}{
+ \pgf@circuit@transisors@fixlabelstrue
+}
+
+\DeclareOption{centertransistorstext}{
+ \pgf@circuit@transisors@fixlabelstrue
+}
+
+\DeclareOption{betterproportions}{
+ \ctikzset{monopoles/ground/width/.initial=.15}
+
+ \ctikzset{bipoles/resistor/height/.initial=.23}
+ \ctikzset{bipoles/resistor/width/.initial=.6}
+ \ctikzset{bipoles/capacitor/height/.initial=.4}
+ \ctikzset{bipoles/capacitor/width/.initial=.1}
+ \ctikzset{bipoles/potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
+ \ctikzset{bipoles/photoresistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistor/main/.initial=.7}
+ \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
+ \ctikzset{bipoles/thermistorptc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorptc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/main/.initial=.7}
+ \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/width/.initial=.6}
+ \ctikzset{bipoles/vresistor/height/.initial=.45}
+ \ctikzset{bipoles/vresistor/width/.initial=.6}
+ \ctikzset{bipoles/generic/height/.initial=.23}
+ \ctikzset{bipoles/generic/width/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/ageneric/height/.initial=.23}
+ \ctikzset{bipoles/ageneric/width/.initial=.6}
+ \ctikzset{bipoles/memristor/height/.initial=.23}
+ \ctikzset{bipoles/memristor/wave height/.initial=.375}
+ \ctikzset{bipoles/memristor/width/.initial=.60}
+ \ctikzset{bipoles/tgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tgeneric/width/.initial=.6}
+ \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
+ \ctikzset{bipoles/fullgeneric/height/.initial=.23}
+ \ctikzset{bipoles/fullgeneric/width/.initial=.6}
+ \ctikzset{bipoles/diode/height/.initial=.3}
+ \ctikzset{bipoles/diode/width/.initial=.25}
+ \ctikzset{bipoles/bidirectionaldiode/height/.initial=.66}
+ \ctikzset{bipoles/bidirectionaldiode/width/.initial=.6}
+ \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+ \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
+
+ \ctikzset{tripoles/thyristor/height/.initial=.66}
+ \ctikzset{tripoles/thyristor/height 2/.initial=.3}
+ \ctikzset{tripoles/thyristor/width/.initial=.6}
+ \ctikzset{tripoles/thyristor/diode height/.initial=.3}
+ \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+ \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+ \ctikzset{tripoles/triac/height/.initial=.66}
+ \ctikzset{tripoles/triac/width/.initial=.6}
+ \ctikzset{tripoles/triac/diode width left/.initial=.3}
+ \ctikzset{tripoles/triac/diode width right/.initial=.3}
+}
+
+% This is a nice hack that prints all the shapes declared
+% by the package. Very useful for coverage testing and debugging.
+%
+% \let\origpgfdeclareshape=\pgfdeclareshape
+% \def\pgfdeclareshape#1{%
+% \typeout{SHAPE:\space"#1"}%
+% \origpgfdeclareshape{#1}
+% }
+
+
+%%%%%%%%%
+%%%%%%%%%%% Springe nach tex/pgfcirc.defines
+%%%---------- open: tex/pgfcirc.defines.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%
+%% Key managements
+
+\long\def\pgf@circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+%% Temporary Counters
+
+\newcount\pgf@circ@count@a
+\newcount\pgf@circ@count@b
+\newcount\pgf@circ@count@c
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinates
+\newdimen\pgf@circ@res@up
+\newdimen\pgf@circ@res@down
+\newdimen\pgf@circ@res@zero
+\newdimen\pgf@circ@res@left
+\newdimen\pgf@circ@res@right
+\newdimen\pgf@circ@res@other
+\newdimen\pgf@circ@res@step
+\newdimen\pgf@circ@res@temp
+% inital thickness
+\newdimen \pgfstartlinewidth
+
+% arrow tips, ported over old arrows library (deprecated)
+% see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
+% this was the original definition of latex' tips, renamed to avoid clashes
+%
+\pgfarrowsdeclare{latexslim}{latexslim}
+{
+ \pgfutil@tempdima=0.28pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfarrowsleftextend{+-4\pgfutil@tempdima}
+ \pgfarrowsrightextend{+6\pgfutil@tempdima}
+}
+{
+ \pgfutil@tempdima=0.28pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
+ {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
+ {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
+ {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
+ {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
+ {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
+ {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathclose
+ \pgfusepathqfill
+}
+
+\pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
+
+\def\pgf@circ@setifdefinedfill#1#2{%
+ % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
+ % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
+ \ifdefined\ctikzclass
+ \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
+ {% yes, it's defined
+ \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}%
+ \ifx\@@tmp\@@none % but it's none
+ \pgfusepath{#2}%
+ \else
+ \pgfsetfillcolor{\@@tmp}%
+ \pgfusepath{#1}%
+ \fi
+ }{% the class is defined but the fill key not; use #2
+ \pgfusepath{#2}%
+ }
+ \else
+ \pgfusepath{#2}%
+ \fi
+}
+
+%% Macro to fill or draw
+
+\def\pgf@circ@draworfill{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{draw,fill}{draw}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+}
+
+\def\pgf@circ@draworfillandclip{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
+ \pgfusepath{draw, clip}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, clip, fill}
+ \fi
+}
+
+\def\pgf@circ@maybefill{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{fill}{discard}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{fill}
+ \fi
+}
+
+%% Macros for setting linewidth
+% #1 is the legacy class (bipoles, tripoles) etc
+% #2 is the reference linewidth
+\def\pgf@circ@setlinewidth#1#2{%
+ \ifdefined\ctikzclass
+ \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}%
+ {% yes, it's defined
+ \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}%
+ \ifx\@@tmp\@@none % but it's none
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class
+ \else
+ \pgfsetlinewidth{\@@tmp #2}%
+ \fi
+ }{ % key not defined, do the legacy thing
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
+ }% Ok, do nothing
+ \else % no class
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
+ \fi
+}
+% use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case
+\ctikzset{none/thickness/.initial=1.0} % do not touch
+
+%% font changes compatible with plain/LaTeX/ConTeXt
+%% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment-537224605
+
+\ifpgfutil@format@is@latex
+ \long\def\pgf@circ@font@tiny{\tiny}
+ \long\def\pgf@circ@font@small{\small}
+ \long\def\pgf@circ@font@bold{\textbf}
+ \long\def\pgf@circ@font@boldmath{\boldmath}
+ \long\def\pgf@circ@font@sixbm{\fontsize{6}{7}\selectfont\boldmath}
+ \long\def\pgf@circ@font@tenbm{\fontsize{10}{12}\selectfont\boldmath}
+ \long\def\pgf@circ@font@twelve{\fontsize{12}{14}\selectfont}
+\else\ifpgfutil@format@is@plain
+ \long\def\pgf@circ@font@tiny{\fiverm}
+ \long\def\pgf@circ@font@small{\sevenrm}
+ \long\def\pgf@circ@font@bold#1{{\bf#1}}
+ \long\def\pgf@circ@font@boldmath{\bf} % to be tested
+ \long\def\pgf@circ@font@sixbm{\sevenrm\bf} %
+ \long\def\pgf@circ@font@tenbm{\tenrm\bf} %
+ \long\def\pgf@circ@font@twelve{\twelverm} %
+\else\ifpgfutil@format@is@context
+ \long\def\pgf@circ@font@tiny{\tfxx}
+ \long\def\pgf@circ@font@small{\tfx}
+ \long\def\pgf@circ@font@bold{\bold}
+ \long\def\pgf@circ@font@boldmath{\bold} % to be tested
+ \long\def\pgf@circ@font@sixbm{\tfx\bold} %
+ \long\def\pgf@circ@font@tenbm{\normal\bold}%
+ \long\def\pgf@circ@font@twelve{\tfa} %
+\fi\fi\fi
+
+
+%
+% Thanks to Phelype Oleinik https://tex.stackexchange.com/a/520806/38080
+%
+% this is needed to avoid problems with \ConTeXt
+\ifcsname normalunexpanded\endcsname
+ \let\pgfcircutil@unexpanded\normalunexpanded
+\else
+ \let\pgfcircutil@unexpanded\unexpanded
+\fi
+% minimally expand a pgfkey to check if it's {}/undefined or filled.
+\def\unexpandedvalueof#1{%
+ \pgfcircutil@unexpanded\expandafter\expandafter
+ \expandafter\pgf@circ@valueof@chk\pgfkeysvalueof{#1}}
+\def\pgf@circ@valueof@chk#1{%
+ \ifx\relax#1%
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {{}}% #1 is \relax, so consider empty
+ {\expandafter{#1}}% otherwise, leave the key after one more expansion
+}%
+
+% voltage options
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circuit@compat
+\newif\ifpgf@circ@oldvoltagedirection % default false
+\newif\ifpgf@circ@explicitvdir
+\newif\ifpgf@circ@fixbatteries
+
+\ctikzset{voltage dir/.is choice}
+\ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
+\ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
+\tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
+
+% Option ">" for twoports
+\newif\ifpgf@circuit@inputarrow
+\ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
+
+% Option "boxed" for nodes and twoports
+\newif\ifpgf@circuit@boxed
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+
+% Option "dashed" for nodes and twoports
+\newif\ifpgf@circuit@dashed
+\pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
+\ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
+
+% Option "t=*" for nodes
+\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
+
+\ctikzset{current arrow scale/.initial=16}
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{tripoles/thickness/.initial=2}
+\ctikzset{quadpoles/thickness/.initial=2}
+\ctikzset{nodes width/.initial=.04}
+
+% Base len for all circuitikz
+\newdimen\pgf@circ@Rlen
+% scaled length for internal use in scalable shapes
+\newdimen\pgf@circ@scaled@Rlen
+\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}}
+\pgf@circ@Rlen = 1.4cm
+% by default scale is 1.0
+\pgf@circ@scaled@Rlen=\pgf@circ@Rlen
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% main style definitions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+% load a style file: search ctikzstyle-NAME.tex in path
+\def\ctikzloadstyle#1{%
+ \pgfutil@InputIfFileExists{ctikzstyle-#1}{}{%
+ \tikzerror{I did not find the circuitikz style #1}}%
+}
+
+% load and enact a style
+\def\ctikzsetstyle#1{%
+ \ctikzloadstyle{#1}%
+ \tikzset{#1 circuit style}%
+}
+
+% global style parameters
+\ctikzset{default/scale/.initial=1.0} % do not touch
+\ctikzset{default/fill/.initial=none} % do not touch
+\ctikzset{default/thickness/.initial=none} % do not touch
+% default is use as the generic default style for bipoles
+
+% mostly bipoles:
+
+\ctikzset{resistors/scale/.initial=1.0}
+\ctikzset{resistors/fill/.initial=none}
+\ctikzset{resistors/thickness/.initial=none}
+
+\ctikzset{capacitors/scale/.initial=1.0}
+\ctikzset{capacitors/fill/.initial=none}
+\ctikzset{capacitors/thickness/.initial=none}
+
+\ctikzset{inductors/scale/.initial=1.0}
+\ctikzset{inductors/fill/.initial=none}
+\ctikzset{inductors/thickness/.initial=none}
+
+\ctikzset{diodes/scale/.initial=1.0}
+\ctikzset{diodes/fill/.initial=none}
+\ctikzset{diodes/thickness/.initial=none}
+
+\ctikzset{batteries/scale/.initial=1.0}
+\ctikzset{batteries/fill/.initial=none}
+\ctikzset{batteries/thickness/.initial=none}
+
+\ctikzset{sources/scale/.initial=1.0}
+\ctikzset{sources/fill/.initial=none}
+\ctikzset{sources/thickness/.initial=none}
+
+\ctikzset{csources/scale/.initial=1.0}
+\ctikzset{csources/fill/.initial=none}
+\ctikzset{csources/thickness/.initial=none}
+
+\ctikzset{instruments/scale/.initial=1.0}
+\ctikzset{instruments/fill/.initial=none}
+\ctikzset{instruments/thickness/.initial=none}
+
+\ctikzset{mechanicals/scale/.initial=1.0}
+\ctikzset{mechanicals/fill/.initial=none}
+\ctikzset{mechanicals/thickness/.initial=none}
+
+\ctikzset{misc/scale/.initial=1.0}
+\ctikzset{misc/fill/.initial=none}
+\ctikzset{misc/thickness/.initial=none}
+
+\ctikzset{blocks/scale/.initial=1.0}
+\ctikzset{blocks/fill/.initial=none}
+\ctikzset{blocks/thickness/.initial=none}
+
+% mostly nodes
+
+\ctikzset{grounds/scale/.initial=1.0}
+\ctikzset{grounds/fill/.initial=none}
+\ctikzset{grounds/thickness/.initial=none}
+
+\ctikzset{power supplies/scale/.initial=1.0}
+\ctikzset{power supplies/fill/.initial=none}
+\ctikzset{power supplies/thickness/.initial=none}
+
+\ctikzset{transistors/scale/.initial=1.0}
+\ctikzset{transistors/fill/.initial=none}
+\ctikzset{transistors/thickness/.initial=none}
+
+\ctikzset{tubes/scale/.initial=1.0}
+\ctikzset{tubes/fill/.initial=none}
+\ctikzset{tubes/thickness/.initial=none}
+
+\ctikzset{RF/scale/.initial=1.0}
+\ctikzset{RF/fill/.initial=none}
+\ctikzset{RF/thickness/.initial=none}
+
+\ctikzset{electromechanicals/scale/.initial=1.0}
+\ctikzset{electromechanicals/fill/.initial=none}
+\ctikzset{electromechanicals/thickness/.initial=none}
+
+% transformers go with inductors
+\ctikzset{amplifiers/scale/.initial=1.0}
+\ctikzset{amplifiers/fill/.initial=none}
+\ctikzset{amplifiers/thickness/.initial=none}
+
+\ctikzset{switches/scale/.initial=1.0}
+\ctikzset{switches/fill/.initial=none}
+\ctikzset{switches/thickness/.initial=none}
+
+\ctikzset{logic ports/scale/.initial=1.0}
+\ctikzset{logic ports/fill/.initial=none}
+\ctikzset{logic ports/thickness/.initial=none}
+
+\ctikzset{flipflops/scale/.initial=1.0}
+\ctikzset{flipflops/fill/.initial=none}
+\ctikzset{flipflops/thickness/.initial=none}
+
+\ctikzset{muxdemuxes/scale/.initial=1.0}
+\ctikzset{muxdemuxes/fill/.initial=none}
+\ctikzset{muxdemuxes/thickness/.initial=none}
+
+\ctikzset{chips/scale/.initial=1.0}
+\ctikzset{chips/fill/.initial=none}
+\ctikzset{chips/thickness/.initial=none}
+
+\ctikzset{displays/scale/.initial=1.0}
+\ctikzset{displays/fill/.initial=none}
+\ctikzset{displays/thickness/.initial=none}
+
+% grounds and power supplies
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/ground/connectionthickness/.initial=1}
+\ctikzset{monopoles/ground/thickness/.initial=2}
+\ctikzset{monopoles/rground/thickness/.initial=2}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/vcc/arrow/.initial=legacy}
+\ctikzset{monopoles/vee/arrow/.initial=legacy}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
+\ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
+\ctikzset{monopoles/waves/width/.initial=0.5}
+
+% microstrips
+\ctikzset{bipoles/mstline/height/.initial=0.3}
+\ctikzset{bipoles/mstline/width/.initial=1.2}
+\pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
+\ctikzset{monopoles/msport/width/.initial=.5}
+\ctikzset{monopoles/msrstub/height/.initial=1.0}
+\ctikzset{monopoles/msrstub/width/.initial=0.6}
+
+% microphone and loudspeaker
+\ctikzset{bipoles/loudspeaker/height/.initial=.8}
+\ctikzset{bipoles/loudspeaker/depth/.initial=.3}
+\ctikzset{bipoles/loudspeaker/width/.initial=.8}
+\ctikzset{bipoles/mic/height/.initial=1.2}
+\ctikzset{bipoles/mic/depth/.initial=.0}
+\ctikzset{bipoles/mic/width/.initial=.8}
+
+% Zig Zag resistors
+\ctikzset{resistors/zigs/.initial=3}
+\ctikzset{resistors/width/.code={%
+ \ctikzset{bipoles/resistor/width=#1}%
+ \ctikzset{bipoles/vresistor/width=#1}%
+ \ctikzset{bipoles/potentiometer/width=#1}%
+ \ctikzset{bipoles/resistivesens/width=#1}%
+ \ctikzset{bipoles/photoresistor/width=#1}%
+ \ctikzset{bipoles/thermistor/width=#1}%
+ \ctikzset{bipoles/thermistorntc/width=#1}%
+ \ctikzset{bipoles/thermistorptc/width=#1}%
+ \ctikzset{bipoles/varistor/width=#1}%
+ \ctikzset{bipoles/generic/width=#1}%
+ \ctikzset{bipoles/generic potentiometer/width=#1}%
+ \ctikzset{bipoles/ageneric/width=#1}%
+ \ctikzset{bipoles/tgeneric/width=#1}%
+}}
+\ctikzset{wiper pos/.code={%
+ \ctikzset{bipoles/potentiometer/wiper pos=#1}%
+ \ctikzset{bipoles/generic potentiometer/wiper pos=#1}%
+}}
+% zigzag resistor
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/wiper pos/.initial=.5}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/resistivesens/height/.initial=.6}
+\ctikzset{bipoles/resistivesens/width/.initial=.8}
+% square resistors
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+
+%% Capacitors
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/height/.initial=.5}
+\ctikzset{bipoles/ecapacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/font/.initial=\pgf@circ@font@sixbm}
+%%% pcapacitor is deprecated
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/ccapacitor/height/.initial=.6}
+\ctikzset{bipoles/ccapacitor/width/.initial=.12}
+\ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/piezoelectric/height/.initial=.7}
+\ctikzset{bipoles/piezoelectric/width/.initial=.5}
+
+% Inductors
+\ctikzset{inductors/coils/.code={%
+ \ctikzset{bipoles/cuteinductor/coils=#1}%
+ \ctikzset{bipoles/cutechoke/coils=#1}%
+ \ctikzset{bipoles/americaninductor/coils=#1}%
+ \ctikzset{bipoles/vcuteinductor/coils=#1}%
+ \ctikzset{bipoles/vamericaninductor/coils=#1}%
+}}
+\ctikzset{inductors/width/.code={%
+ \ctikzset{bipoles/cuteinductor/width=#1}%
+ \ctikzset{bipoles/cutechoke/width=#1}%
+ \ctikzset{bipoles/americaninductor/width=#1}%
+ \ctikzset{bipoles/vcuteinductor/width=#1}%
+ \ctikzset{bipoles/vamericaninductor/width=#1}%
+ \ctikzset{bipoles/fullgeneric/width=#1}%
+ \ctikzset{bipoles/tfullgeneric/width=#1}%
+}}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
+\ctikzset{bipoles/cuteinductor/width/.initial=.6}
+\ctikzset{bipoles/cuteinductor/coils/.initial=5}
+\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+%% Cute choke settings
+\ctikzset{bipoles/cutechoke/height/.initial=.3}
+\ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
+\ctikzset{bipoles/cutechoke/width/.initial=.6}
+\ctikzset{bipoles/cutechoke/coils/.initial=5}
+\ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
+\ctikzset{bipoles/cutechoke/cstep/.initial=.3}
+\ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
+\ctikzset{bipoles/cutechoke/cthick/.initial=1}
+\newif\ifpgf@circuit@bipole@twolineschoke
+\pgf@circuit@bipole@twolineschokefalse
+\pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
+\ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
+\pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
+\ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
+%
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/americaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=5}
+\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+
+% Sources
+
+\ctikzset{bipoles/esource/height/.initial=.60}
+\ctikzset{bipoles/esource/width/.initial=.60}
+\ctikzset{bipoles/pvsource/height/.initial=.60}
+\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/oosource/height/.initial=.60}
+\ctikzset{bipoles/oosource/width/.initial=.60}
+\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/angle/.initial=80}
+\ctikzset{bipoles/dcisource/height/.initial=.60}
+\ctikzset{bipoles/dcisource/width/.initial=.60}
+\ctikzset{bipoles/dcvsource/height/.initial=.60}
+\ctikzset{bipoles/dcvsource/width/.initial=.60}
+\ctikzset{bipoles/vsourcetri/height/.initial=.60}
+\ctikzset{bipoles/vsourcetri/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/ecsource/height/.initial=.7}
+\ctikzset{bipoles/ecsource/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/battery2/height/.initial=.6}
+\ctikzset{bipoles/battery2/width/.initial=.3}
+
+% diodes
+
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
+\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
+\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+
+% switches
+
+\ctikzset{bipoles/spst/height/.initial=.35}
+\ctikzset{bipoles/spst/width/.initial=.35}
+\ctikzset{bipoles/spst/depth/.initial=.2}
+\ctikzset{bipoles/nos/height/.initial=.3}
+\ctikzset{bipoles/nos/width/.initial=.35}
+\ctikzset{bipoles/nos/depth/.initial=.2}
+\ctikzset{bipoles/ncs/height/.initial=.35}
+\ctikzset{bipoles/ncs/width/.initial=.35}
+\ctikzset{bipoles/ncs/depth/.initial=.2}
+%%% reed switch
+\ctikzset{bipoles/reed/height/.initial=.4}
+\ctikzset{bipoles/reed/width/.initial=.8}% 0.35 in nos
+\ctikzset{bipoles/reed/depth/.initial=.4}
+
+% misc
+
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
+\ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
+\ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
+%\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
+%\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
+% multiwire
+\ctikzset{bipoles/multiwire/height/.initial=0.4}
+\ctikzset{bipoles/multiwire/width/.initial=0.2}
+\ctikzset{bipoles/multiwire/spacing/.initial=0.05}
+
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/ohmmeter/height/.initial=.60}
+\ctikzset{bipoles/ohmmeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/height/.initial=.60}
+\ctikzset{bipoles/smeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/voltage/additional label shift/.initial=1}
+\ctikzset{bipoles/qmeter/depth/.initial=.40}
+\ctikzset{bipoles/qmeter/height/.initial=.80}
+\ctikzset{bipoles/qmeter/width/.initial=.60}
+% this must be specified for each one
+\ctikzset{bipoles/qvprobe/voltage/additional label shift/.initial=.5}
+\ctikzset{bipoles/qiprobe/voltage/additional label shift/.initial=.5}
+\ctikzset{bipoles/qpprobe/voltage/additional label shift/.initial=.5}
+\ctikzset{bipoles/iloop/width/.initial=.40}
+\ctikzset{bipoles/iloop/height/.initial=.60}
+
+\ctikzset{bipoles/oscope/height/.initial=.60}
+\ctikzset{bipoles/oscope/width/.initial=.60}
+\ctikzset{bipoles/oscope/voltage/additional label shift/.initial=1}
+
+
+% option to not rotate the new (Romano's) instruments
+\newif\ifpgf@circuit@straightinstruments\pgf@circuit@straightinstrumentstrue
+\pgfkeys{/tikz/straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}}
+\ctikzset{straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}}
+\pgfkeys{/tikz/rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}}
+\ctikzset{rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}}
+
+
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/bulb/height/.initial=.8}
+\ctikzset{bipoles/bulb/width/.initial=.8}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.2}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/bandstop/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+% crossing wires
+\ctikzset{bipoles/crossing/size/.initial=.2}
+
+% Transistors starts here
+
+\newif\ifpgf@circuit@trans@depletiontype
+\pgf@circuit@trans@depletiontypefalse
+
+\newif\ifpgf@circuit@mos@arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
+\pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
+\pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
+
+% Fixed label positions
+\newif\ifpgf@circuit@transisors@fixlabels
+\pgf@circuit@transisors@fixlabelstrue
+\pgfkeys{/tikz/center transistors text/.add code={}{\pgf@circuit@transisors@fixlabelstrue}}
+\ctikzset{fix transistors text/.add code={}{\pgf@circuit@transisors@fixlabelstrue}}
+\pgfkeys{/tikz/legacy transistors text/.add code={}{\pgf@circuit@transisors@fixlabelsfalse}}
+\ctikzset{legacy transistors text/.add code={}{\pgf@circuit@transisors@fixlabelsfalse}}
+
+% Option solderdot for fet
+\newif\ifpgf@circuit@fet@solderdot
+\pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+\ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+
+% Option bodydiode for fet
+\newif\ifpgf@circuit@fet@bodydiode
+\pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+\ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+
+% Option draw fet without gate connection
+\newif\ifpgf@circuit@bpt@drawgate
+\pgf@circuit@bpt@drawgatetrue
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+
+% Option draw bpt without base connection
+\newif\ifpgf@circuit@bpt@drawbase
+\pgf@circuit@bpt@drawbasetrue
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+
+% Option draw bpt with optical input
+\newif\ifpgf@circuit@bpt@drawphoto
+\pgf@circuit@bpt@drawphotofalse
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+
+% Option draw fet without bulk connection -- Added by Burak Kelleci
+\newif\ifpgf@circuit@bpt@drawbulk
+\pgfkeys{/tikz/bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
+\ctikzset{bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
+\pgfkeys{/tikz/nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
+\ctikzset{nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
+
+% Option draw pmos with empty circle
+\newif\ifpgf@circuit@pmos@emptycircle
+\pgf@circuit@pmos@emptycirclefalse
+\ctikzset{tripoles/pmos style/.is choice}
+\pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+% Option draw pmos with no circle
+\newif\ifpgf@circuit@pmos@nocircle
+\pgf@circuit@pmos@nocirclefalse
+\pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
+\ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
+% back to normal
+\pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
+\ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
+% arrows at the end, the correct way
+\newif\ifpgf@circuit@trans@arrowatend
+\pgf@circuit@trans@arrowatendfalse
+\ctikzset{transistors/arrow pos/.is choice}
+\ctikzset{transistors/arrow pos/legacy/.code={\pgf@circuit@trans@arrowatendfalse}}
+\ctikzset{transistors/arrow pos/end/.code={\pgf@circuit@trans@arrowatendtrue}}
+
+\newif\ifpgf@circuit@trans@ntype
+\pgf@circuit@trans@ntypetrue %default true
+%\newif\ifpgf@circuit@trans@ptype
+%\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/conn height/.initial=0}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/arrow pos/.initial=.6}
+\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/conn height/.initial=0}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/arrow pos/.initial=.4}
+\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pmos/curr direction/.initial=-1}
+
+\ctikzset{tripoles/hemt/width/.initial=.7}
+\ctikzset{tripoles/hemt/gate height/.initial=.35}
+\ctikzset{tripoles/hemt/base height/.initial=.5}
+\ctikzset{tripoles/hemt/conn height/.initial=0}
+\ctikzset{tripoles/hemt/height/.initial=1.1}
+\ctikzset{tripoles/hemt/base width/.initial=.5}
+\ctikzset{tripoles/hemt/gate width/.initial=.62}
+\ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/hemt/curr direction/.initial=1}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/conn height/.initial=0}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/conn height/.initial=0}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/conn height/.initial=.35}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/conn height/.initial=.35}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfete/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/base height/.initial=.45}
+\ctikzset{tripoles/npn/base height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/conn height/.initial=0}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/arrow pos/.initial=.5}
+\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/npn/curr direction/.initial=1}
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/base height/.initial=.45}
+\ctikzset{tripoles/pnp/base height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/conn height/.initial=0}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/arrow pos/.initial=.5}
+\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pnp/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/conn height/.initial=0}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/conn height/.initial=0}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lpigbt/width/.initial=.6}
+\ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lpigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lpigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/Lnigbt/width/.initial=.6}
+\ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lnigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lnigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/conn height/.initial=.35}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/njfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/conn height/.initial=.35}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pjfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/conn height/.initial=0}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/isfet/curr direction/.initial=1}
+%
+% multi-emitter and multi-collector BJTs by Romano Giannetti
+%
+\ctikzset{tripoles/bjt/emitters/.initial=1}
+\ctikzset{tripoles/bjt/collectors/.initial=1}
+\pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}}
+\pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}}
+\ctikzset{tripoles/bjt/pins width/.initial=0.3}
+\pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}}
+\ctikzset{tripoles/bjt/multi height/.initial=.5}
+\pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}}
+%
+\ctikzset{tripoles/bjt/width/.initial=.3}
+\ctikzset{tripoles/bjt/base height 2/.initial=.4}
+\ctikzset{tripoles/bjt/base height/.initial=1.1}
+\ctikzset{tripoles/bjt/height/.initial=.4}
+\ctikzset{tripoles/bjt/base width/.initial=1}
+\ctikzset{tripoles/bjt/arrow pos/.initial=.5}
+% do NOT touch these two!
+\ctikzset{tripoles/bjt/npn/curr direction/.initial=1}
+\ctikzset{tripoles/bjt/pnp/curr direction/.initial=-1}
+
+%% transistors stop here
+
+%% Logic ports
+
+\newif\ifpgf@circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
+ \tikzset{and port/.style={shape=european and port}}%
+ \tikzset{or port/.style={shape=european or port}}%
+ \tikzset{xor port/.style={shape=european xor port}}%
+ \tikzset{buffer port/.style={shape=european buffer port}}%
+ \tikzset{not port/.style={shape=european not port}}%
+ \tikzset{nand port/.style={shape=european nand port}}%
+ \tikzset{nor port/.style={shape=european nor port}}%
+ \tikzset{xnor port/.style={shape=european xnor port}}%
+}}
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
+ \tikzset{and port/.style={shape=american and port}}%
+ \tikzset{or port/.style={shape=american or port}}%
+ \tikzset{xor port/.style={shape=american xor port}}%
+ \tikzset{buffer port/.style={shape=american buffer port}}%
+ \tikzset{not port/.style={shape=american not port}}%
+ \tikzset{nand port/.style={shape=american nand port}}%
+ \tikzset{nor port/.style={shape=american nor port}}%
+ \tikzset{xnor port/.style={shape=american xnor port}}%
+}}
+
+\ctikzset{logic ports origin/.is choice}
+\ctikzset{logic ports origin/legacy/.code={
+ \ctikzset{tripoles/american and port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american nand port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american nor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american or port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american xor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american xnor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european and port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european nand port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european or port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european nor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european xor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european xnor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european buffer port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european not port/origin/.initial=0.8}%
+ }%
+}
+\ctikzset{logic ports origin/center/.code={%
+ \ctikzset{tripoles/american and port/origin/.initial=0}%
+ \ctikzset{tripoles/american nand port/origin/.initial=0}%
+ \ctikzset{tripoles/american nor port/origin/.initial=0}%
+ \ctikzset{tripoles/american or port/origin/.initial=0}%
+ \ctikzset{tripoles/american xor port/origin/.initial=0}%
+ \ctikzset{tripoles/american xnor port/origin/.initial=0}%
+ \ctikzset{tripoles/european and port/origin/.initial=0}%
+ \ctikzset{tripoles/european nand port/origin/.initial=0}%
+ \ctikzset{tripoles/european or port/origin/.initial=0}%
+ \ctikzset{tripoles/european nor port/origin/.initial=0}%
+ \ctikzset{tripoles/european xor port/origin/.initial=0}%
+ \ctikzset{tripoles/european xnor port/origin/.initial=0}%
+ \ctikzset{tripoles/european buffer port/origin/.initial=0}%
+ \ctikzset{tripoles/european not port/origin/.initial=0}%
+ }%
+}
+
+\newif\ifpgfcirc@roundy@or@shapes\pgfcirc@roundy@or@shapesfalse
+\ctikzset{american or shape/.is choice}
+\ctikzset{american or shape/roundy/.code={\pgfcirc@roundy@or@shapestrue}}
+\ctikzset{american or shape/pointy/.code={\pgfcirc@roundy@or@shapesfalse}}
+
+\newif\ifpgfcirc@draw@leads\pgfcirc@draw@leadstrue
+\ctikzset{logic ports draw input leads/.is choice}
+\ctikzset{logic ports draw input leads/true/.code={\pgfcirc@draw@leadstrue}}
+\ctikzset{logic ports draw input leads/false/.code={\pgfcirc@draw@leadsfalse}}
+\tikzset{input leads/.code={\pgfcirc@draw@leadstrue}}
+\tikzset{no input leads/.code={\pgfcirc@draw@leadsfalse}}
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/american and port/origin/.initial=0.8}
+\ctikzset{tripoles/american and port/inputs/.initial=2}
+% variable number of inputs
+\ctikzset{tripoles/american nand port/origin/.initial=0.8}
+\ctikzset{tripoles/american nand port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/origin/.initial=0.8}
+\ctikzset{tripoles/american nor port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/angle/.initial=70}
+\ctikzset{tripoles/american nor port/inner/.initial=0.3}
+\ctikzset{tripoles/american or port/origin/.initial=0.8}
+\ctikzset{tripoles/american or port/inputs/.initial=2}
+\ctikzset{tripoles/american or port/angle/.initial=70}
+\ctikzset{tripoles/american or port/inner/.initial=0.3}
+\ctikzset{tripoles/american xor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xor port/inputs/.initial=2}
+\ctikzset{tripoles/american xor port/angle/.initial=70}
+\ctikzset{tripoles/american xor port/inner/.initial=0.3}
+\ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xnor port/inputs/.initial=2}
+\ctikzset{tripoles/american xnor port/angle/.initial=70}
+\ctikzset{tripoles/american xnor port/inner/.initial=0.3}
+
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european buffer port/width/.initial=1.4}
+\ctikzset{tripoles/european buffer port/not height/.initial=.3}
+\ctikzset{tripoles/european buffer port/not width/.initial=.8}
+\ctikzset{tripoles/european buffer port/height/.initial=.65}
+\ctikzset{tripoles/european buffer port/reserved/.initial=.6}
+\ctikzset{tripoles/european buffer port/input height/.initial=0}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+% variable number of inputs
+\ctikzset{tripoles/european and port/origin/.initial=0.8}
+\ctikzset{tripoles/european and port/inputs/.initial=2}
+\ctikzset{tripoles/european nand port/origin/.initial=0.8}
+\ctikzset{tripoles/european nand port/inputs/.initial=2}
+\ctikzset{tripoles/european or port/origin/.initial=0.8}
+\ctikzset{tripoles/european or port/inputs/.initial=2}
+\ctikzset{tripoles/european nor port/origin/.initial=0.8}
+\ctikzset{tripoles/european nor port/inputs/.initial=2}
+\ctikzset{tripoles/european xor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xor port/inputs/.initial=2}
+\ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xnor port/inputs/.initial=2}
+\ctikzset{tripoles/european buffer port/origin/.initial=0.8}
+\ctikzset{tripoles/european buffer port/inputs/.initial=1}%
+\ctikzset{tripoles/european not port/origin/.initial=0.8}
+\ctikzset{tripoles/european not port/inputs/.initial=1}%
+%%% parameters that are not used anymore after multi-input
+%%% gates --- left for compatibility of source code.
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+% switches for logic gates
+%
+\pgfkeys{/tikz/number inputs/.initial=0}
+\pgfkeys{/tikz/number inputs/.default=0}
+
+%% flip-flop specific keys (most others are the same as chips)
+
+\ctikzset{multipoles/flipflop/font/.initial=\pgf@circ@font@small}
+\ctikzset{multipoles/flipflop/fontud/.initial=\pgf@circ@font@tiny}
+\ctikzset{multipoles/flipflop/width/.initial=1.2}
+\ctikzset{multipoles/flipflop/pin spacing/.initial=0.6}
+\ctikzset{multipoles/flipflop/clock wedge size/.initial=0.2}
+
+%% muxdemuxes keys
+
+\ctikzset{multipoles/muxdemux/base len/.initial=0.4}
+\ctikzset{multipoles/muxdemux/Lh/.initial=8.0}
+\ctikzset{multipoles/muxdemux/Rh/.initial=6.0}
+\ctikzset{multipoles/muxdemux/w/.initial=3.0}
+\ctikzset{multipoles/muxdemux/inset w/.initial=0.0}
+\ctikzset{multipoles/muxdemux/inset Lh/.initial=0.0}
+\ctikzset{multipoles/muxdemux/inset Rh/.initial=0.0}
+\ctikzset{multipoles/muxdemux/NL/.initial=8}
+\ctikzset{multipoles/muxdemux/NR/.initial=1}
+\ctikzset{multipoles/muxdemux/NB/.initial=3}
+\ctikzset{multipoles/muxdemux/NT/.initial=0}
+\ctikzset{multipoles/muxdemux/square pins/.initial=0}
+%
+% switches for op amps
+% changing input polarity
+%
+\newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
+\pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
+\ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
+\pgfkeys{/tikz/noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
+\ctikzset{noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
+%
+% changing output polarity (for fully diff objects)
+%
+\newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
+\pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
+\ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
+\pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
+\ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
+
+% Operational amplifier
+\ctikzset{tripoles/op amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/op amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Fully differential operational amplifier
+\ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation
+\ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/fd op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+\ctikzset{tripoles/en amp/width/.initial=1.7}
+\ctikzset{tripoles/en amp/port width/.initial=.7}
+\ctikzset{tripoles/en amp/height/.initial=1.6}
+\ctikzset{tripoles/en amp/input height/.initial=.3}
+\ctikzset{tripoles/en amp/up pos/.initial=.45}
+\ctikzset{tripoles/en amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+\ctikzset{tripoles/en amp/font2/.initial=\pgf@circ@font@twelve} % Absolute font size needed!
+\ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
+\tikzset{
+ en amp text/.code = {%
+ \ctikzsetvalof{tripoles/en amp/text}{#1}%
+ },
+ en amp text A/.code = {%
+ \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}%
+ },
+}
+
+% Transconductance amplifier
+\ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid
+\ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/gm amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier
+\ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid
+\ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier with differential output
+\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid
+\ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation
+\ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/fd inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier with gain resistor terminals
+\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width
+\ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid
+\ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid
+\ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation
+\ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation
+\ctikzset{tripoles/inst amp ra/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Plain amplifier
+\ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position
+
+% changing fonts and symbols of amplifiers
+\ctikzset{amplifiers/symbol font/.code={%
+ \ctikzset{tripoles/inst amp ra/font=#1}%
+ \ctikzset{tripoles/fd inst amp/font=#1}%
+ \ctikzset{tripoles/inst amp/font=#1}%
+ \ctikzset{tripoles/gm amp/font=#1}%
+ \ctikzset{tripoles/en amp/font=#1}%
+ \ctikzset{tripoles/fd op amp/font=#1}%
+ \ctikzset{tripoles/op amp/font=#1}%
+}}
+\ctikzset{amplifiers/plus/.initial={$+$}}
+\ctikzset{amplifiers/minus/.initial={$-$}}
+\tikzset{amp symbol font/.code={%
+ \ctikzset{amplifiers/symbol font={#1}}%
+ }
+}
+\tikzset{amp plus/.code={\ctikzsetvalof{amplifiers/plus}{#1}}}
+\tikzset{amp minus/.code={\ctikzsetvalof{amplifiers/minus}{#1}}}
+\def\pgf@circ@ampli@plus{\ctikzvalof{amplifiers/plus}}
+\def\pgf@circ@ampli@minus{\ctikzvalof{amplifiers/minus}}
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+%% Cute switches
+\ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
+\ctikzset{bipoles/cuteswitch/height/.initial=.6}
+\ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
+\ctikzset{bipoles/cuteswitch/width/.initial=.50}
+\ctikzset{bipoles/cuteswitch/thickness/.initial=1}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+\ctikzset{tripoles/oscillator/width/.initial=.7}
+
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/inner/.initial=0.4}
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/inner/.initial=0.4}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/inner/.initial=0.4}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/fourport/width/.initial=1.3}
+\ctikzset{quadpoles/fourport/height/.initial=1.3}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+\ctikzset{quadpoles/coupler2/width/.initial=1.3}
+\ctikzset{quadpoles/coupler2/height/.initial=1.3}
+
+\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+
+\ctikzset{quadpoles style/.is choice}
+\ctikzset{quadpoles style/inward/.code={% default value
+ \ctikzset{quadpoles/transformer/inner=0.4}%
+ \ctikzset{quadpoles/transformer/width=1.5}%
+ \ctikzset{quadpoles/transformer core/inner=0.4}%
+ \ctikzset{quadpoles/transformer core/width=1.5}%
+ \ctikzset{quadpoles/gyrator/inner=0.4}%
+ \ctikzset{quadpoles/gyrator/width=1.5}%
+ }%
+}
+\ctikzset{quadpoles style/inline/.code={% now horizontal baffle
+ \ctikzset{quadpoles/transformer/inner=1}%
+ \ctikzset{quadpoles/transformer/width=0.6}%
+ \ctikzset{quadpoles/transformer core/inner=1}%
+ \ctikzset{quadpoles/transformer core/width=0.6}%
+ \ctikzset{quadpoles/gyrator/inner=1} % FIXME
+ \ctikzset{quadpoles/gyrator/width=0.6}%
+ }%
+}
+
+%
+% multipoles
+%
+\ctikzset{multipoles/thickness/.initial=2}
+\ctikzset{multipoles/font/.initial=\pgf@circ@font@tiny}
+% DIP (dual in line package) chips
+\ctikzset{multipoles/dipchip/width/.initial=1.2}
+\ctikzset{multipoles/dipchip/num pins/.initial=8}
+\ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
+% QFP (quad flat package) chips
+\ctikzset{multipoles/qfpchip/num pins/.initial=8}
+\ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
+% chip numbers
+\newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
+\pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
+\ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
+\pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
+\ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
+\newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
+\pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
+\ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
+\pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
+\ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
+% external chip pins
+\ctikzset{multipoles/external pins thickness/.initial=1}
+\ctikzset{multipoles/external pins width/.initial=0.2}
+\ctikzset{multipoles/external pad fraction/.initial=0}
+\pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
+\pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
+% topmarks
+\newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
+\pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
+\ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
+\pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
+\ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
+
+% rotary switch by Romano
+\ctikzset{multipoles/rotary/thickness/.initial=1}
+\ctikzset{multipoles/rotary/shape/.initial=ocirc}
+\ctikzset{multipoles/rotary/channels/.initial=5}
+\ctikzset{multipoles/rotary/angle/.initial=60}
+\ctikzset{multipoles/rotary/wiper/.initial=20}
+\ctikzset{multipoles/rotary/arrow/.is choice}
+\newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
+\newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
+\newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
+\ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
+\ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
+
+\tikzset{%
+ rotary switch/.style args={#1in#2wiper#3}{%
+ shape=rotaryswitch,
+ /tikz/circuitikz/multipoles/rotary/channels=#1,
+ /tikz/circuitikz/multipoles/rotary/angle=#2,
+ /tikz/circuitikz/multipoles/rotary/wiper=#3,
+ },
+ rotary switch -/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=none,
+ },
+ rotary switch <-/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=ccw,
+ },
+ rotary switch ->/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=cw,
+ },
+ rotary switch <->/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=both,
+ },
+ % Notice that these should be the same as the initial values of the keys
+ rotary switch/.default={5 in 60 wiper 20},
+ rotary switch -/.default={5 in 60 wiper 20},
+ rotary switch <-/.default={5 in 60 wiper 20},
+ rotary switch ->/.default={5 in 60 wiper 20},
+ rotary switch <->/.default={5 in 60 wiper 20},
+}
+
+% %Mechanical section
+\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
+\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
+\ctikzset{bipoles/spring/height/.initial=.5}
+\ctikzset{bipoles/spring/width/.initial=.5}
+\ctikzset{bipoles/mass/height/.initial=.55}
+\ctikzset{bipoles/mass/box height/.initial=.4}
+\ctikzset{bipoles/mass/width/.initial=.5}
+
+\ctikzset{bipoles/damper/height/.initial=.35}
+\ctikzset{bipoles/damper/length/.initial=.3}
+\ctikzset{bipoles/damper/width/.initial=.4}
+
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial=}
+\ctikzset{bipole/name/.initial=}
+\newif\ifpgf@circuit@bipole@isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
+\newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
+\ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
+\newif\ifpgf@circuit@bipole@strokedsymbol
+\ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
+\newif\ifpgf@circuit@bipole@iscurrent
+\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+\newif\ifpgf@circuit@bipole@voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf@circuit@bipole@current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
+\newif\ifpgf@circuit@bipole@current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
+\newif\ifpgf@circuit@bipole@current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/flow/.is family}
+\newif\ifpgf@circuit@bipole@flow@backward
+\ctikzset{bipole/flow/direction/.is choice}
+\ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
+\ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
+\newif\ifpgf@circuit@bipole@flow@before
+\ctikzset{bipole/flow/x position/.is choice}
+\ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
+\ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
+\newif\ifpgf@circuit@bipole@flow@below
+\ctikzset{bipole/flow/y position/.is choice}
+\ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
+\ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
+\ctikzset{bipole/flow/label/unit/.initial=}
+\ctikzset{bipole/flow/label/name/.initial=}
+\ctikzset{flow/distance/.initial = .5}
+\ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/annotation/.is family}
+\ctikzset{bipole/annotation/position/.initial=-90}
+\ctikzset{bipole/annotation/unit/.initial=}
+\ctikzset{bipole/annotation/name/.initial=}
+
+\newif\ifpgf@circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf@circuit@strokediode
+\newif\ifpgf@circuit@fulldiode
+\pgf@circuit@strokediodefalse
+\pgf@circuit@fulldiodefalse
+
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
+\ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
+
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
+\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}}
+
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circ@siunitx@res
+
+\ctikzset{straight/.is choice}
+\ctikzset{straightvoltage value/.initial=true}
+\ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
+\ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
+\ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
+\newif\ifpgf@circuit@bipole@voltage@straight
+\ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
+
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
+\ctikzset{voltage shift/.style={voltage/shift=#1}}
+\tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% shaping the +/- sign, see pgfcircvoltage.tex
+\ctikzset{voltage/american font/.initial={}}
+\ctikzset{voltage/american plus/.initial={$+$}}
+\ctikzset{voltage/american minus/.initial={$-$}}
+
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+
+\tikzset{american currents/.style = {\circuitikzbasekey/current = american}}
+\tikzset{european currents/.style = {\circuitikzbasekey/current = european}}
+\tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}}
+\tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}}
+\tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}}
+\tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}
+
+\newif\ifpgf@circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester choice/.is choice}
+\ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}}
+\ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}}
+
+\tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}}
+\tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}}
+\tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}}
+\tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}}
+\tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}}
+\tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}}
+\tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}}
+\tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}}
+\tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}}
+\tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
+
+% I should try to make the tree clearer (this voltage conflicts with the options above)
+
+\newif\ifpgf@circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse}}
+\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue}}
+
+\newif\ifpgf@circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse}
+\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue}
+
+% noise sources
+\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+
+% seven segment displays by RGtti
+
+\newif\ifpgf@circ@sevenseg@dot
+\newif\ifpgf@circ@sevenseg@box
+\def\pgf@circ@sevenseg@dotstate{empty}
+\ctikzset{seven seg/.is family}
+\ctikzset{seven seg/dot/.is choice}
+% none means no dot, not space for it. Empty means no dot, but space
+\ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
+\ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
+\ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
+\ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
+%
+\ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
+\ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
+\ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
+\ctikzset{seven seg/box sep/.initial=1pt}% external box gap
+\ctikzset{seven seg/color on/.initial=red}% color for segment "on"
+\ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
+\ctikzset{seven seg/box/.is choice}
+\ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
+\ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
+
+\ctikzset{seven seg/bits/.initial=0000000}
+
+\ctikzset{seven seg/value/.code={%
+ \edef\@@tmp{#1}%
+ \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
+ \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
+ \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
+ \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
+ \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
+ \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
+ \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
+ \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
+ \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
+ \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
+ \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
+}}
+
+\tikzset{%
+ seven segment val/.style args={#1dot#2box#3}{%
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/value=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+ seven segment bits/.style args={#1dot#2box#3}{%
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/bits=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+}
+
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+
+% Electronic tubes: diodetube, triode, tetrode and pentode
+\ctikzset{tubes/width/.initial=1} % relative width
+\ctikzset{tubes/height/.initial=1.4} % relative height
+\ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
+\ctikzset{tubes/anode distance/.initial=0.40} % distance from center
+\ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
+\ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
+\ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
+\ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
+\ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
+\ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
+\ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
+\ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
+\ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
+\ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
+\ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
+
+\newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
+\pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
+\ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
+\newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
+\pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
+\ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
+\newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
+\pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
+\ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
+
+%%%---------- close: tex/pgfcirc.defines
+%%%%%%%%%%% Springe nach tex/pgfcircutils
+%%%---------- open: tex/pgfcircutils.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ %\typeout{si |#1|}
+ }{
+ \pgf@circ@siunitx@resfalse
+ %\typeout{no si |#1|}
+ }
+\fi
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+ }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% useful commands
+
+\ifpgfutil@format@is@latex
+ %% flipping text
+ \def\ctikzflipx#1{\scalebox{-1}[1]{#1}}
+ \def\ctikzflipy#1{\scalebox{1}[-1]{#1}}
+ \def\ctikzflipxy#1{\scalebox{-1}[-1]{#1}}
+ % text mode overbar
+ % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
+ \def\ctikztextnot#1{$\overline{\hbox{#1}}\m@th$}
+\else\ifpgfutil@format@is@plain
+ % text mode overbar
+ % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
+ \def\ctikztextnot#1{$\overline{\hbox{#1}}$}
+\else\ifpgfutil@format@is@context
+ % text mode overbar
+ % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
+ \def\ctikztextnot#1{$\overline{\hbox{#1}}$}
+\fi\fi\fi
+
+
+%%%---------- close: tex/pgfcircutils
+
+%%%%%%%%%%% Springe nach tex/pgfcircshapes
+%%%---------- open: tex/pgfcircshapes.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+%
+% Provision for changing opacity. Only expert use, see the manual.
+%
+\ctikzset{poles/open fill opacity/.initial=1.0}% better not touch it
+\tikzset{open poles opacity/.code={%
+ \ctikzset{poles/open fill opacity=#1}%
+}}
+\ctikzset{poles/full fill opacity/.initial=1.0}% better not touch it
+\tikzset{full poles opacity/.code={%
+ \ctikzset{poles/full fill opacity=#1}%
+}}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty round terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Diamond terminal
+
+\pgfdeclareshape{diamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Diamond terminal, unfilled
+
+\pgfdeclareshape{odiamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% square terminal, filled
+
+\pgfdeclareshape{squarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+%% square terminal, unfilled
+
+\pgfdeclareshape{osquarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+% BNC connector
+
+\pgfdeclareshape{bnc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ % BNC size is 2.5 times the size of the internal "ocirc"
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@y=2.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ % center is on the opening
+ \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{zero}{ \pgfpointorigin }
+ \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ % geo-anchors
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{left}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
+ }
+ \behindforegroundpath{
+ \pgfextracty{\pgf@circ@res@other}{\northwest}
+ \pgf@circ@res@step=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external circle
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
+ % next the opening to the right
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal circle
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ % and the contact line to the right
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%% Fill for correct rectangular joins
+
+\pgfdeclareshape{rectjoinfill}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\pgflinewidth%
+ \pgf@y=.5\pgflinewidth%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfpathrectanglecorners
+ {\pgfpoint{0}{.5\pgflinewidth}}
+ {\pgfpoint{0}{-.5\pgflinewidth}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% transistor arrow
+
+\def\pgf@circ@find@linescale{
+ % find the scale inverse of the scale factor: line width do not scale
+ % with scale=..., transform shape so we have to counteract it.
+ \iftikz@fullytransformed % this is true if `transform shape` is active
+ % from @Circumscribe https://tex.stackexchange.com/a/474035/38080
+ % Note that this trick is not working inside a `spy` environment...
+ \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}%
+ \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD-\scaleB*\scaleC))}%
+ \else
+ \pgfmathsetmacro{\@@factor}{1.0}
+ \fi
+}
+
+\pgfdeclareshape{trarrow}{%
+ % this arrow is only filled but grows with the linewidth, more or less
+ % like currarrow do
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \pgf@circ@find@linescale
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgfpoint{0.7*\pgf@circ@res@step +0.5*\@@factor*\pgflinewidth}
+ {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
+ }
+ % The arrow size should be more or less the same of a currarrow, which is
+ % both filled and stroke, for backward output compatibility (more or less)
+ %
+ % angle \beta W is \pgf@circ@Rlen/\ctikzvalof{current arrow scale}
+ % |-\__ currarrow as the tip at (W,0)
+ % | | and the upper tail at (-0.7*W, 0.8*W)
+ % | \__ it then "overshoot" do to the linew width L
+ % | \__ xangle \alpha
+ % ---0------->
+ %
+ % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7)
+ % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction
+ % tail overshoot is -(L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y
+ %
+ \savedanchor{\northwest}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@circ@find@linescale
+ \pgfpoint{-0.7*\pgf@circ@res@step -0.5*\@@factor*\pgflinewidth}
+ {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
+ }
+ \savedanchor{\tip}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@circ@find@linescale
+ \pgfpoint{\pgf@circ@res@step + 1.743*\@@factor*\pgflinewidth}{0pt}
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \anchor{btip}{% this anchor is behind the tip of half a linewidth
+ \tip
+ \pgf@circ@find@linescale
+ \pgf@circ@res@temp=\@@factor\pgflinewidth
+ \advance\pgf@x by -.5\pgf@circ@res@temp
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \northwest
+ \pgf@circ@res@up=\pgf@y
+ \pgf@circ@res@left=\pgf@x
+ \tip
+ \pgf@circ@res@step = \pgf@x
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{fill} % just fill
+ \endpgfscope
+ }
+}
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+}
+
+%% Flow arrow
+
+\pgfdeclareshape{flowarrow}{
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@y=.5\pgf@circ@res@step
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgf@x=\pgf@circ@res@step%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{text}{% text centered above
+ \pgfpointorigin
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+ }
+}
+
+%% Input arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\northeast}{% this is really not northeast, really -northwest
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@y=.5\pgf@circ@res@step
+ \pgf@x=1.7\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@x=0cm\relax}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+}
+
+
+%% box
+
+\pgfdeclareshape{box}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+%% box scaled with blocks
+
+\pgfdeclareshape{blockbox}{
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+% full nodes for wire crossing
+
+\pgfdeclareshape{jump crossing}
+{
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \behindbackgroundpath{
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+\pgfdeclareshape{plain crossing}
+{
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \behindbackgroundpath{
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+%%%---------- close: tex/pgfcircshapes
+%%%%%%%%%%% Springe nach tex/pgfcircmonopoles
+%%%---------- open: tex/pgfcircmonopoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%
+%% Grounds
+%%%%%%%%%%%%%
+
+
+%% Ground symbol
+% #1 -> name
+% #2 -> width
+% #3 -> depth
+% #4 -> code
+\long\def\pgf@circ@declareground#1#2#3#4{
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
+ \pgf@x=#2\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
+ \pgf@y=-#3\pgf@y
+ }
+ \anchor{north}{\pgfpointorigin}
+ \anchor{north east}{\southeast\pgf@y=0pt\relax}
+ \anchor{east}{\southeast\pgf@y=.5\pgf@y}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ #4
+ \endpgfscope
+ }
+ }
+}
+
+
+\pgf@circ@declareground{ground}{0.6}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+\pgf@circ@declareground{tlground}{0.6}{0.4}{
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+
+\pgf@circ@declareground{rground}{0.6}{1}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+\pgf@circ@declareground{tground}{0.6}{0}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+}
+
+\pgf@circ@declareground{sground}{0.6}{1.8}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}
+
+% noiseless ground
+\pgf@circ@declareground{nground}{0.9}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
+ \pgfusepath{draw}
+}
+
+% protective ground
+\pgf@circ@declareground{pground}{0.9}{1.8}{
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% chassis ground
+\pgf@circ@declareground{cground}{1}{2}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% Contributed by @fotesan https://github.com/fotesan
+% european ground
+\pgf@circ@declareground{eground}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+\pgf@circ@declareground{eground2}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%
+%% Power supplies
+%%%%%%%%%%%%%%%%%%
+
+% Vcc
+\pgfdeclareshape{vcc}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=3\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=-3\pgf@x%
+ }
+ \anchor{south}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{north}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast}
+ \anchor{south west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@y=0pt\relax}
+ \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%
+%% RF elements
+%%%%%%%%%%%%%%%%
+
+% Legacy tlinestub
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@x=1.2\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@y=.2\pgf@circ@res@step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=0cm\relax}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
+
+ \pgfscope\begin{pgftransparencygroup}
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgf@circ@maybefill
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \end{pgftransparencygroup} \endpgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ }
+}
+
+%% New antennas without tails
+
+% main body of antennas
+\def\pgf@circ@antennabody{%
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfsetbeveljoin
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% Waves for the antennas.
+\def\pgf@circ@antennawaves{%
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>2
+ \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% additional shape with the waves
+\pgfdeclareshape{waves}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0pt}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
+ \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{north east}{\northeast}
+ \anchor{east}{\northeast\pgf@y=0pt}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@step=0.5\pgf@circ@res@step
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>1
+ \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% the three types of antennas: simple, TX, RX. Notice that you can flip them...
+
+\pgfdeclareshape{bareantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ }
+}
+
+\pgfdeclareshape{bareTXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{\savedwaves}
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ \pgf@circ@antennawaves
+ }
+}
+
+\pgfdeclareshape{bareRXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{\savedwaves}
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ \pgftransformxshift{-5.2\pgf@circ@res@step}
+ \pgf@circ@antennawaves
+ }
+}
+
+% Microstrip monopoles
+
+\pgfdeclareshape{mslstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=-.5\pgf@y
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf@y=0pt\relax}
+ \anchor{left}{\northwest\pgf@y=0pt\relax}
+ \anchor{right}{\southeast\pgf@y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msrstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt\relax
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
+ \pgfpatharc{135}{45}{\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
+ \pgfpatharc{45}{135}{\pgf@circ@res@up}
+ \pgfclosepath
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msport}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=-.5\pgf@y
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf@y=0pt\relax}
+ \anchor{left}{\northwest\pgf@y=0pt\relax}
+ \anchor{right}{\southeast\pgf@y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+% Legacy antennas (with tails)
+\def\pgf@circ@shift@antenna@xy#1#2{%
+ \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
+ \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
+\relax}
+
+% Legacy antenna
+\pgfdeclareshape{antenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+
+ \pgftransformxshift{ -4\pgf@circ@res@step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Legacy TX antenna
+\pgfdeclareshape{txantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Legacy RX antenna
+\pgfdeclareshape{rxantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+}
+
+% Legacy match
+\pgfdeclareshape{match}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
+ \pgf@x=2\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@circ@res@step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=0cm\relax}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\pgfpointorigin}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
+ \pgf@x=1.5\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+%%%---------- close: tex/pgfcircmonopoles
+%%%%%%%%%%% Springe nach tex/pgfcircbipoles
+%%%---------- open: tex/pgfcircbipoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%% Generic macro for defining a bipole shape
+% #1 - additional anchors
+% #2 - lower y-size of the bipole (from the center).
+% #3 - #shape is the name of the shape
+% #4 - upper y-size of the bipole (from the center)
+% #5 - width of the bipole
+% #6 - macros drawing the bipole
+%
+\long\def\pgfcircdeclarebipole{%
+ \pgfcircdeclarebipolescaled{default}}
+
+%% Generic macro for defining a bipole shape
+% #1 - scale factor
+% #2 - additional anchors
+% #3 - lower y-size of the bipole (from the center).
+% #4 - #shape is the name of the shape
+% #5 - upper y-size of the bipole (from the center)
+% #6 - width of the bipole
+% #7 - macros drawing the bipole
+%
+\long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{
+ \pgfdeclareshape{#4shape}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\northeast}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=#5\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=#5\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=-#3\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=-#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwest}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=-#3\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@circ@res@down=-#3\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=#5\pgf@circ@scaled@Rlen
+ \pgfpointorigin
+ \pgf@y=\pgf@circ@res@up
+ \advance\pgf@y by\pgf@circ@res@down
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{ne}{
+ \northeast
+ }
+ \anchor{nw}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{s}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{south east}{
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \southwest
+ }
+ \anchor{se}{
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{sw}{
+ \southwest
+ }
+ \anchor{w}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{right}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{above}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{left}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{below}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{a}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{b}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf@y=\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{
+ \textanchor
+ }
+ \anchorborder{%
+ \ifpgf@circuit@bipole@inverted
+ \pgf@circ@res@left=-\pgf@x
+ \pgf@circ@res@right=-\pgf@y
+ \else
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@right=\pgf@y
+ \fi
+ \ifdim\pgf@circ@res@right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
+ \fi
+ }
+
+ #2
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@zero = 0cm
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@res@right = \pgf@x
+ \southwest
+ \pgf@circ@res@down = \pgf@y
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ #7
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%
+% Resistive components
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Short circuit
+
+%%% NOTICE that the short is really NOT drawn; we trust the fact that its
+%%% natural length is zero.
+\pgfcircdeclarebipole
+{}
+{0}
+{short}
+{0}
+{0}
+{ }
+
+%% Open circuit
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/open/height}}
+{open}
+{\ctikzvalof{bipoles/open/height}}
+{\ctikzvalof{bipoles/open/width}}
+{ }
+
+% multiwire(s)
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/multiwire/height}}
+{multiwire}
+{\ctikzvalof{bipoles/multiwire/height}}
+{\ctikzvalof{bipoles/multiwire/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/multiwire/height}}
+{bmultiwire}
+{\ctikzvalof{bipoles/multiwire/height}}
+{\ctikzvalof{bipoles/multiwire/width}}
+{
+ \pgf@circ@res@other=\ctikzvalof{bipoles/multiwire/spacing}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+%% Generic bipole - used as resistor by some (bleah)
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{generic}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+%% Generic empty tunable
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{tgeneric}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{\ctikzvalof{bipoles/tgeneric/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Generic asymmetric bipole
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/ageneric/height}}
+{ageneric}
+{\ctikzvalof{bipoles/ageneric/height}}
+{\ctikzvalof{bipoles/ageneric/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% Memristor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/memristor/height}}
+{memristor}
+{\ctikzvalof{bipoles/memristor/height}}
+{\ctikzvalof{bipoles/memristor/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% Photoresistor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/photoresistor/height 2}}
+{photoresistor}
+{\ctikzvalof{bipoles/photoresistor/height}}
+{\ctikzvalof{bipoles/photoresistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Thermistor
+\pgfcircdeclarebipolescaled{resistors}
+{{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.4\pgf@x
+ \pgf@y=1.2\pgf@y
+ }%
+}}
+{\ctikzvalof{bipoles/thermistor/height}}
+{thermistor}
+{\ctikzvalof{bipoles/thermistor/height}}
+{\ctikzvalof{bipoles/thermistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+%% Thermistor PTC
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/thermistorptc/height 2}}
+{thermistorptc}
+{\ctikzvalof{bipoles/thermistorptc/height}}
+{\ctikzvalof{bipoles/thermistorptc/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/thermistorntc/height 2}}
+{thermistorntc}
+{\ctikzvalof{bipoles/thermistorntc/height}}
+{\ctikzvalof{bipoles/thermistorntc/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Generic tunable
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@ya
+ \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
+}
+{\ctikzvalof{bipoles/generic potentiometer/height 2}}
+{genericpotentiometer}
+{\ctikzvalof{bipoles/generic potentiometer/height}}
+{\ctikzvalof{bipoles/generic potentiometer/width}}
+{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfextractx{\pgf@circ@res@other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Zig zag resistores
+\def\pgf@circ@zigzag#1{%
+ \divide \pgf@circ@res@step by \numexpr4*\zigs\relax
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \pgf@circ@count@a=\zigs\relax
+ % first half zig
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
+ \pgfmathloop%
+ \advance\pgf@circ@count@a by -1\relax% Loop zigs -1 times
+ \ifnum\pgf@circ@count@a>0
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
+ \repeatpgfmathloop%
+ % last zig and a half
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+%% Resistor
+\pgfcircdeclarebipolescaled{resistors}
+{
+\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/resistor/height}}
+{resistor}
+{\ctikzvalof{bipoles/resistor/height}}
+{\ctikzvalof{bipoles/resistor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{1}
+}
+
+
+%% Variable resistor
+\pgfcircdeclarebipolescaled{resistors}
+{
+\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/vresistor/height}}
+{vresistor}
+{\ctikzvalof{bipoles/vresistor/height}}
+{\ctikzvalof{bipoles/vresistor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{.5}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Potentiometer
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@ya
+ \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/potentiometer/height 2}}
+{potentiometer}
+{\ctikzvalof{bipoles/potentiometer/height}}
+{\ctikzvalof{bipoles/potentiometer/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{1}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfextractx{\pgf@circ@res@other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Resistive sensor
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.4\pgf@x}%
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{resistivesens}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{\ctikzvalof{bipoles/resistivesens/width}}
+{%
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{.5}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%
+%% Capacitors
+%%%%%%%%%%%%%
+
+%% Plain Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitor}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+}
+
+%% Capacitive sensor
+\pgfcircdeclarebipolescaled{capacitors}
+{
+ \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}%
+}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitivesens}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Polar Capacitor (DEPRECATED)
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{polarcapacitor}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{\ctikzvalof{bipoles/pcapacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% Curved capacitor
+% see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong
+% for a rationale
+%
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{ccapacitor}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{\ctikzvalof{bipoles/ccapacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Electrolytic Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{ecapacitor}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{\ctikzvalof{bipoles/ecapacitor/width}}
+{
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ % % plus pole annotation
+ \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
+ {\ctikzvalof{bipoles/ecapacitor/font} $+$}
+}
+
+%% Variable Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{vcapacitor}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{\ctikzvalof{bipoles/vcapacitor/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+
+%% Piezoelectric Element
+
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{piezoelectric}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{\ctikzvalof{bipoles/piezoelectric/width}}
+{
+ % \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
+ % \divide \pgf@circ@res@step by 5
+
+ %% Outer markings
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %% Inner Box
+ \pgf@circ@res@step = \pgf@circ@res@right \divide \pgf@circ@res@step by 10
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf@circ@res@left+4*\pgf@circ@res@step}{\pgf@circ@res@up-\pgf@circ@res@step}}
+ {\pgfpoint{\pgf@circ@res@right-4*\pgf@circ@res@step}{\pgf@circ@res@down+\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%%
+%% Inductors
+%%%%%%%%%%%%%%%
+
+%% cute inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{cuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% cute inductive sensor
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{scuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% cute choke
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cutechoke/lower coil height}}
+{cutechoke}
+{\ctikzvalof{bipoles/cutechoke/height}}
+{\ctikzvalof{bipoles/cutechoke/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+ \pgfusepath{stroke}
+
+ \ifpgf@circuit@bipole@twolineschoke
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+ \pgfusepath{stroke}
+ \fi
+}
+
+%% variable cute inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
+{vcuteinductor}
+{\ctikzvalof{bipoles/vcuteinductor/height}}
+{\ctikzvalof{bipoles/vcuteinductor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% american inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{americaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+
+%% american inductive sensor
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{samericaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% variable american inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/vamericaninductor/height 2}}
+{vamericaninductor}
+{\ctikzvalof{bipoles/vamericaninductor/height}}
+{\ctikzvalof{bipoles/vamericaninductor/width}}
+{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Generic bipole, filled - used as inductor by some
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{fullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+%% Generic sensor, filled - used as inductive sensor by some
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}%
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{sfullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+%% Generic full tunable
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{tfullgeneric}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{\ctikzvalof{bipoles/tfullgeneric/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%
+%% Battery
+%%%%%%%%%%%
+
+%% Battery
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery/height}}
+{battery}
+{\ctikzvalof{bipoles/battery/height}}
+{\ctikzvalof{bipoles/battery/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 6
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1 % poles with equl thickness
+
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery1/height}}
+{battery1}
+{\ctikzvalof{bipoles/battery1/height}}
+{\ctikzvalof{bipoles/battery1/width}}
+{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+%% Battery 2 % negative pole thicker
+
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery2/height}}
+{battery2}
+{\ctikzvalof{bipoles/battery2/height}}
+{\ctikzvalof{bipoles/battery2/width}}
+{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%
+%% Round and diamond sources
+%%%%%%%%%%%
+
+%% Independent voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsource}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+%% Independent voltage source - American style
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{vsourceAM}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{\ctikzvalof{bipoles/vsourceam/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
+ \fi
+}
+
+%% Independent sinusoidal voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{vsourcesin}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{\ctikzvalof{bipoles/vsourcesin/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Square Voltage source - contributed by Alistair Kwan
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcesquare/height}}
+{vsourcesquare}
+{\ctikzvalof{bipoles/vsourcesquare/height}}
+{\ctikzvalof{bipoles/vsourcesquare/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcetri/height}}
+{vsourcetri}
+{\ctikzvalof{bipoles/vsourcetri/height}}
+{\ctikzvalof{bipoles/vsourcetri/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% PV Source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/pvsource/height}}
+{pvsource}
+{\ctikzvalof{bipoles/pvsource/height}}
+{\ctikzvalof{bipoles/pvsource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %Arrow Part
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty Source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{esource}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+}
+
+%% DC Current Source with open shape
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/dcisource/height}}
+{dcisource}
+{\ctikzvalof{bipoles/dcisource/height}}
+{\ctikzvalof{bipoles/dcisource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@maybefill
+ \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
+ \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
+ \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
+ \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% DC-Voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/dcvsource/height}}
+{dcvsource}
+{\ctikzvalof{bipoles/dcvsource/height}}
+{\ctikzvalof{bipoles/dcvsource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
+ \pgfusepath{draw}
+}
+
+%% Independent current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isource}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+}
+
+%% Independent double oo source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/oosource/height}}
+{oosource}
+{\ctikzvalof{bipoles/oosource/height}}
+{\ctikzvalof{bipoles/oosource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgf@circ@maybefill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
+ \pgf@circ@draworfill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgfusepath{draw}
+}
+
+%% Independent current source - American
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isourceam/height}}
+{isourceAM}
+{\ctikzvalof{bipoles/isourceam/height}}
+{\ctikzvalof{bipoles/isourceam/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Independent sinusoidal current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourcesin}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty controlled source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/ecsource/height}}
+{ecsource}
+{\ctikzvalof{bipoles/ecsource/height}}
+{\ctikzvalof{bipoles/ecsource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}
+
+%% Controlled voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsource}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+%% Controlled voltage source - American
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{cvsourceAM}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{\ctikzvalof{bipoles/cvsourceam/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
+ \fi
+}
+
+%% Controlled sinusoidal voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cvsourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Controlled sinusoidal current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cisourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Controlled current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisource}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Controlled current source - American
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisourceam/height}}
+{cisourceAM}
+{\ctikzvalof{bipoles/cisourceam/height}}
+{\ctikzvalof{bipoles/cisourceam/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Cute Independent voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceC}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Independent current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceC}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Controlled voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsourceC}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Controlled current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisourceC}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Noise voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceN}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ %
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
+ \edef\pgf@noise@temp{dashed}
+ \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
+ \ifx\pgf@noise@temp\pgf@noise@fill
+ % fillable in this case
+ \pgf@circ@draworfillandclip
+ \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ %
+ \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf@noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+%% Noise current source
+
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceN}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ %
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
+ \edef\pgf@noise@temp{dashed}
+ \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
+ \ifx\pgf@noise@temp\pgf@noise@fill
+ % fillable in this case
+ \pgf@circ@draworfillandclip
+ \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ %
+ \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf@noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%
+%% Diodes
+%%%%%%%%%%%%%%
+
+%% Black generic diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulldiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black alternative zigzag Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulltdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulllediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullpdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{fullvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfusepath{draw,fill}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Code for the diode triangle
+\def\pgf@circ@basicdiodeshape{
+ % \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitly the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ % \endpgfscope
+}
+
+%% Empty generic diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptydiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty alternative zigzag Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Empty Schottky diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptysdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptylediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptypdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{emptyvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty bidirectionaldiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{emptybidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgf@circ@draworfill
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Full bidirectionaldiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{fullbidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw, fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Black thyristor
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{fullthyristor}
+{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty thyristor
+
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{emptythyristor}
+{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Empty triac
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/triac/height}}
+{emptytriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgf@circ@draworfill
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Full triac
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/triac/height}}
+{fulltriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%
+%% switches
+%%%%%%%%%%%%%
+
+%% (Closing) SPST
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{cspst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Opening SPST
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{ospst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Normal open Switch
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/nos/depth}}
+{nos}
+{\ctikzvalof{bipoles/nos/height}}
+{\ctikzvalof{bipoles/nos/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+}
+
+%% Normal closed Switch
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/ncs/depth}}
+{ncs}
+{\ctikzvalof{bipoles/ncs/height}}
+{\ctikzvalof{bipoles/ncs/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Push Button
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{pushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+%% Normally closed Push Button
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{ncpushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % Warning, if the nodes will have a class, we have to touch this.
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
+ \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+%%% reed switches
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/reed/depth}}
+{reed}
+{\ctikzvalof{bipoles/reed/height}}
+{\ctikzvalof{bipoles/reed/width}}
+{
+ % this is designed to be the same as a "nos".
+ \pgfmathsetmacro{\@@tmpx}{0.9*\ctikzvalof{bipoles/nos/width}/\ctikzvalof{bipoles/reed/width}}
+ \pgfmathsetmacro{\@@tmpy}{\ctikzvalof{bipoles/nos/height}/\ctikzvalof{bipoles/reed/height}}
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % eclosure
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{90}{\pgf@circ@res@up}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ % switch
+ \pgfpathmoveto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{\@@tmpy\pgf@circ@res@up}}
+ % connection lines
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ % connection lines
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+
+% cute switch "to" shapes help function
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutesw#1#2#3{
+ \pgfcircdeclarebipolescaled{switches}
+ {
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgf@circ@res@down = -.5\pgf@y
+ \pgf@circ@res@up = .5\pgf@y
+ \pgfextracty{\pgf@circ@res@other}{#2}
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@circ@res@other
+ }
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % If cnnecting nodes are scaled, we have to modify this
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ \anchor{cout}{\northeast \pgf@y=0cm}
+ \anchor{cin}{\southwest\pgf@y=0cm}
+ \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
+ \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
+ }
+ {\ctikzvalof{bipoles/cuteswitch/height 2}}
+ {#1}
+ {\ctikzvalof{bipoles/cuteswitch/height}}
+ {\ctikzvalof{bipoles/cuteswitch/width}}{
+ \pgfscope
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % If cnnecting nodes are scaled, we have to modify this
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
+ }
+}
+
+%% closed cute switch
+\pgfcircdeclarecutesw{cuteclosedswitch}
+ {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
+ {}
+
+%% open cute switch
+\pgfcircdeclarecutesw{cuteopenswitch}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ {}
+
+%% closing cute switch
+\pgfcircdeclarecutesw{cuteclosingswitch}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%% opening cute switch
+\pgfcircdeclarecutesw{cuteopeningswitch}
+ {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%%%%%%%%%%%%%%%%%
+%% Instruments
+%%%%%%%%%%%%%%%%%
+
+% % METERINGSHAPE
+\long\def\drawmeteringcircle{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+ %draw connections to circle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ %draw circle
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \endpgfscope
+ %draw arrow
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%AMPEREMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/ammeter/height}}
+{ammeter}
+{\ctikzvalof{bipoles/ammeter/height}}
+{\ctikzvalof{bipoles/ammeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{}
+}
+%OHMMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{ohmmeter}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{\ctikzvalof{bipoles/ohmmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+}
+%VOLTMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{voltmeter}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{\ctikzvalof{bipoles/voltmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{}
+
+}
+
+% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
+ \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/oscope/height}}
+{oscope}
+{\ctikzvalof{bipoles/oscope/height}}
+{\ctikzvalof{bipoles/oscope/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % this would create a round (analog?) scope...
+ % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % grid
+ \pgfscope
+ \pgfsetlinewidth{0.5\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
+ {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfsetstrokeopacity{0.5}
+ \pgfusepath{draw}
+ \endpgfscope
+ % function displayed, thanks to
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, no arrow
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeter}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ % draw the text label
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgftransformrotate{\rot}
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, with arrow
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeterwa}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ % draw the text label
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ % arrow: create a center hole to have better visual
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next open a circle into it
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfsetarrowsend{latexslim}
+ % the arrow is better if it has a bit of breath and it's not 45º
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic square meter with always horizontal text
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
+ \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/smeter/height}}
+{smeter}
+{\ctikzvalof{bipoles/smeter/height}}
+{\ctikzvalof{bipoles/smeter/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % the metering window
+ \pgfscope
+ \def\@starta{105}\def\@stopa{75}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
+ \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% probes qucs style:
+% #1 : name
+% #2 : extra code
+\long\def\pgfcirc@qucsprobe#1#2{
+ \pgfcircdeclarebipolescaled{instruments}
+ {
+ \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
+ \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ }
+ {\ctikzvalof{bipoles/qmeter/depth}}
+ {#1}
+ {\ctikzvalof{bipoles/qmeter/height}}
+ {\ctikzvalof{bipoles/qmeter/width}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \def\@starta{103}\def\@stopa{77}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
+ \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgf@circ@draworfill
+ \endpgfscope
+ #2
+ \endpgfscope
+ }
+}
+
+\pgfcirc@qucsprobe{qiprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+}
+
+\pgfcirc@qucsprobe{qvprobe}{
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "-", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+\pgfcirc@qucsprobe{qpprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "-", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% current loop for oscope and similar: stylized
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{i}{\northeast\pgf@x=0pt\relax}
+ \anchor{text}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgf@circ@res@left=-\pgf@circ@res@right
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external ellipse
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
+ {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathellipse{\pgfpointorigin}{
+ \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
+ \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % and the contact line up
+ \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% current loop for oscope and similar: real (double connection)
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{i+}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgf@y=\pgf@circ@res@up
+ }
+ \anchor{i-}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgf@y=\pgf@circ@res@up
+ }
+ \anchor{text}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop2}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgf@circ@res@left=-\pgf@circ@res@right
+ % must be the same than internal i+ and i- anchors definition
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
+ \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external ellipse
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
+ {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathmoveto{\@plus}
+ \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % and the contact line up
+ % I use ...left and ---right as temporal lengths here to avoid defining more
+ \pgfextractx{\pgf@circ@res@left}{\@plus}
+ \pgfextractx{\pgf@circ@res@right}{\@minus}
+ \pgfpathmoveto{\@plus}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\@minus}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Varistor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/varistor/height}}
+{varistor}
+{\ctikzvalof{bipoles/varistor/height}}
+{\ctikzvalof{bipoles/varistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
+}
+
+%%%%%%%%%%%%%%
+%% RF bipoles
+%%%%%%%%%%%%%%
+
+% transmission line
+\pgfcircdeclarebipolescaled{RF}
+{}
+{\ctikzvalof{bipoles/tline/height}}
+{tline}
+{\ctikzvalof{bipoles/tline/height}}
+{\ctikzvalof{bipoles/tline/width}}
+{
+ \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
+ \begin{pgftransparencygroup}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \end{pgftransparencygroup}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{stroke}
+}
+
+% microstrip transmission line
+\pgfcircdeclarebipolescaled{RF}
+{}
+{\ctikzvalof{bipoles/mstline/height}}
+{mstline}
+{\ctikzvalof{bipoles/mstline/height}}
+{\ctikzvalof{bipoles/mstline/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+%%%%%%%%%%%%%%%%%%%
+%% Block diagrams
+%%%%%%%%%%%%%%%%%%%
+
+%% Draw the two-port fillable box
+\def\pgf@circ@twoportbox{
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+}
+
+%% Generic two port box
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/twoport/height}}
+{twoport}
+{\ctikzvalof{bipoles/twoport/height}}
+{\ctikzvalof{bipoles/twoport/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw outer box
+ \pgf@circ@twoportbox
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vco/width}}
+{vco}
+{\ctikzvalof{bipoles/twoport/width}}
+{\ctikzvalof{bipoles/vco/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw circle
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% bandpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/bandpass/width}}
+{bandpass}
+{\ctikzvalof{bipoles/bandpass/width}}
+{\ctikzvalof{bipoles/bandpass/width}}
+{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% bandstop filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/bandstop/width}}
+{bandstop}
+{\ctikzvalof{bipoles/bandstop/width}}
+{\ctikzvalof{bipoles/bandstop/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt}% always draw solid line for inner symbol
+ \pgfsetarrows{-}%never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% highpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/highpass/width}}
+{highpass}
+{\ctikzvalof{bipoles/highpass/width}}
+{\ctikzvalof{bipoles/highpass/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/lowpass/width}}
+{lowpass}
+{\ctikzvalof{bipoles/lowpass/width}}
+{\ctikzvalof{bipoles/lowpass/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% ADC
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/adc/width}}
+{adc}
+{\ctikzvalof{bipoles/adc/width}}
+{\ctikzvalof{bipoles/adc/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/dac/width}}
+{dac}
+{\ctikzvalof{bipoles/dac/width}}
+{\ctikzvalof{bipoles/dac/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/dsp/width}}
+{dsp}
+{\ctikzvalof{bipoles/dsp/width}}
+{\ctikzvalof{bipoles/dsp/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/fft/width}}
+{fft}
+{\ctikzvalof{bipoles/fft/width}}
+{\ctikzvalof{bipoles/fft/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{amp}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \pgf@circ@draworfill
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
+ \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+
+ \pgfsetarrows{-} %never draw arrows
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
+
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{vamp}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
+ \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
+
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+ % draw arrow
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{piattenuator}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% variable pi attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{vpiattenuator}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{tattenuator}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% variable T attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{vtattenuator}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{phaseshifter}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{vphaseshifter}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/detector/width}}
+{detector}
+{\ctikzvalof{bipoles/detector/width}}
+{\ctikzvalof{bipoles/detector/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{0.8\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@fulldiode
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%
+%% MECHANICAL SYMBOLS
+%%%%%%%%%%%%%%%%%%%%%%%
+
+%% mechanical capacitance - stiffness/spring
+
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/spring/height}}
+{spring}
+{\ctikzvalof{bipoles/spring/height}}
+{\ctikzvalof{bipoles/spring/width}}{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@scaled@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical inductance - mass
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/mass/box height}}
+{mass}
+{\ctikzvalof{bipoles/mass/height}}
+{\ctikzvalof{bipoles/mass/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical resistor - damper
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/damper/height}}
+{damper}
+{\ctikzvalof{bipoles/damper/height}}
+{\ctikzvalof{bipoles/damper/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@maybefill
+
+ % line into the damper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {\pgf@circ@res@zero}}
+ \pgfusepath{stroke}
+
+ % damper box
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ % damper vertical element
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+%% mechanical viscoelastic element, suggested by @alex
+%% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
+\pgfcircdeclarebipolescaled{mechanicals}
+{} % extra anchors
+{\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
+{viscoe} % name
+{\ctikzvalof{bipoles/damper/height}} % height (above the path line)
+{\ctikzvalof{bipoles/damper/width}} % width
+{ % draw the bipole
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@maybefill
+
+ % spring into the damper
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
+ \pgfusepath{stroke}
+ \endpgfscope
+ % damper box
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ % damper vertical element
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+
+%%%%%%%%%%%%%%%%
+%% Crossing
+%%%%%%%%%%%%%%%%
+
+%% crossing bipole (but see also nodes)
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/crossing/size}}
+{crossing}
+{\ctikzvalof{bipoles/crossing/size}}
+{\ctikzvalof{bipoles/crossing/size}}{
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Miscellaneous bipoles
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% loudspeaker and microphone
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/loudspeaker/depth}}
+{loudspeaker}
+{\ctikzvalof{bipoles/loudspeaker/height}}
+{\ctikzvalof{bipoles/loudspeaker/width}}{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/mic/depth}}
+{mic}
+{\ctikzvalof{bipoles/mic/height}}
+{\ctikzvalof{bipoles/mic/width}}{
+
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
+ % 0.25358 is 0.6-0.4*cos(30)
+ \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% european gas filled surge arrester
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/european gas filled surge arrester/height}}
+{european gas filled surge arrester}
+{\ctikzvalof{bipoles/european gas filled surge arrester/height}}
+{\ctikzvalof{bipoles/european gas filled surge arrester/width}}
+{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@draworfill
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% american gas filled surge arrester
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/american gas filled surge arrester/height}}
+{american gas filled surge arrester}
+{\ctikzvalof{bipoles/american gas filled surge arrester/height}}
+{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ \pgfcircle{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\ctikzvalof{bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\ctikzvalof{bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
+ \pgfusepath{fill}
+}
+
+%% thermocouple
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/thermocouple/height 2}}
+{thermocouple}
+{\ctikzvalof{bipoles/thermocouple/height}}
+{\ctikzvalof{bipoles/thermocouple/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+}
+
+%% fuse
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/fuse/height}}
+{fuse}
+{\ctikzvalof{bipoles/fuse/height}}
+{\ctikzvalof{bipoles/fuse/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@draworfill
+}
+
+%% asymmetric fuse
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/afuse/height}}
+{afuse}
+{\ctikzvalof{bipoles/afuse/height}}
+{\ctikzvalof{bipoles/afuse/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% SQUID added by Cor Molenaar 5 March 2010
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/squid/height}}
+{squid}
+{\ctikzvalof{bipoles/squid/height}}
+{\ctikzvalof{bipoles/squid/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/barrier/height}}
+{barrier}
+{\ctikzvalof{bipoles/barrier/height}}
+{\ctikzvalof{bipoles/barrier/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
+
+%% Lamp
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/lamp/height}}
+{lamp}
+{\ctikzvalof{bipoles/lamp/height}}
+{\ctikzvalof{bipoles/lamp/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% bulb
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/bulb/height}}
+{bulb}
+{\ctikzvalof{bipoles/bulb/height}}
+{\ctikzvalof{bipoles/bulb/width}}
+{%
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+% end of pgfcircbipoles.tex
+%%%---------- close: tex/pgfcircbipoles
+%%%%%%%%%%% Springe nach tex/pgfcirctripoles
+%%%---------- open: tex/pgfcirctripoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+%%%%%%%%%%%%%
+%% switches
+%%%%%%%%%%%%%
+
+% Legacy spdt
+\pgfdeclareshape{spdt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/spdt/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
+ {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
+ }
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+% cute switch "node" shapes, matching with cute "to" shapes
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutespdt#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.25\pgf@x
+ }
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgf@circ@res@down = -.5\pgf@y
+ \pgf@circ@res@up = .5\pgf@y
+ \pgfextracty{\pgf@circ@res@other}{#2}
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@circ@res@other
+ }
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ % center anchors
+ \anchor{cin}{ \northwest \pgf@y=0pt}
+ \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
+ \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
+ \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
+
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf@circ@res@temp=\radius\relax
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ % terminals
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ }
+ }
+}
+
+\pgfcircdeclarecutespdt{cute spdt up}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt mid}
+{\pgfpoint{\pgf@circ@res@right}{0pt}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt down}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt up arrow}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt mid arrow}
+{\pgfpoint{\pgf@circ@res@right}{0pt}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt down arrow}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+%% Code from John Kormylo at tex.stackexchange.com
+%% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
+%% Integration and fixes from Romano Giannetti and TheTeXnician <38565529+TheTeXnician@users.noreply.github.com>
+%%
+
+\newcount\pgf@circ@res@count% reserve global register
+
+\def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
+{%
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+}%
+
+% #1 = \pgfmathcounter #2=type #3 specificic port
+% type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
+\def\pgf@circ@logicport@baseinput#1#2#3%
+{%
+ % and and nand
+ \ifnum #2=1\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@x=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@left
+ \fi
+ % or and nor
+ \ifnum #2=2\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american #3 port/angle}}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\pgf@y
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgf@x=\pgf@circ@res@other
+ \fi
+ % xor and xnor
+ \ifnum #2=3\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/american #3 port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@circ@res@temp=\pgf@y
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgf@x=\pgf@circ@res@other
+ \fi
+ % european
+ \ifnum #2=4\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@other}{\left}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@x=\pgf@circ@res@other
+ \fi
+}%
+
+%%% american
+\long\def\pgfcircdeclarelogicport#1#2#3{%
+ \pgfdeclareshape{american #1 port}%
+ {%
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\resize{% automatic
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgf@circ@res@down = -\pgf@circ@res@up
+ \pgf@circ@res@right = \ctikzvalof{tripoles/american #1 port/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right = .5\pgf@circ@res@right
+ \pgf@circ@res@left = -\pgf@circ@res@right
+ }%
+ \savedmacro\inputs{% get number of inputs
+ \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+ \ifnum\pgf@circ@res@count=0
+ \pgf@circ@res@count=\ctikzvalof{tripoles/american #1 port/inputs}\relax%
+ \fi
+ \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
+ \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
+ \def\inputs{\the\pgf@circ@res@count}%
+ }%
+ \savedanchor\step{% 1/2 gap at edges
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
+ \divide\pgf@circ@res@step by \pgf@circ@res@count
+ \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
+ \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
+ \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
+
+ \anchor{center}{\origin}% for backwards compatibility
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % create input anchors
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@circ@res@count%
+ \else%
+ %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+
+ \anchor{out}{\northeast\pgf@y=0pt}
+ \anchor{bout}{\right\pgf@y=0pt}
+
+
+ \anchor{left}{\left}% edges of component minus leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfpoint{0cm}{\pgf@circ@res@up}}
+ \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfpoint{0cm}{\pgf@circ@res@down}}
+ \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ #3
+ }
+}
+}
+%%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{and}{1}{
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+ % output lead
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+ \pgfusepath{draw}
+
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ }
+%%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \pgfcircdeclarelogicport{nand}{1}{
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american nand port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@other = \ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
+ \pgfpathclose
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgf@circ@draworfill
+}
+%%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{nor}{2}{
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american nor port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \advance\pgf@circ@res@other by -\pgf@circ@res@step
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+
+ % not dot
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgf@circ@draworfill
+}
+%%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{or}{2}{
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+
+ \pgf@circ@draworfill
+}
+%%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xor}{3}{
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xor port/angle}}%
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+ \pgf@circ@draworfill
+
+ \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
+
+ \pgfusepath{draw}
+}
+%%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xnor}{3}{
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xnor port/angle}}%
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american xnor port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \advance\pgf@circ@res@other by -\pgf@circ@res@step
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@left
+ \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
+
+ \pgfusepath{draw}
+}
+
+%%% Original one-input ports
+
+\pgfdeclareshape{american not port}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgf@circ@draworfill
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+
+\pgfdeclareshape{american buffer port}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+\pgfdeclareshape{invschmitt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+}
+
+\pgfdeclareshape{schmitt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+}
+
+
+%%% start european logic ports, from John Kormylo
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+
+% #1 - name
+% #2 - text inside
+% #3 - number of inputs
+% #4 = is it a not?
+
+\long\def\pgfcircdeclareeurologicport#1#2#3#4{
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\resize{% automatic
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgf@circ@res@down = -\pgf@circ@res@up
+ \pgf@circ@res@right = \ctikzvalof{tripoles/european #1 port/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right = .5\pgf@circ@res@right
+ \pgf@circ@res@left = -\pgf@circ@res@right
+ }%
+ \savedmacro\inputs{% get number of inputs
+ \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+ \ifnum\pgf@circ@res@count=0
+ \pgf@circ@res@count=\ctikzvalof{tripoles/european #1 port/inputs}\relax%
+ \fi
+ \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
+ \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
+ \def\inputs{\the\pgf@circ@res@count}%
+ }%
+ \savedanchor\step{% 1/2 gap at edges
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
+ \divide\pgf@circ@res@step by #3
+ \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
+ \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
+ \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
+ \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
+ \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
+
+ \anchor{center}{\origin}% for backwards compatibility
+ % the text anchor overlaps the logic symbol
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
+ % create input anchors
+ \ifnum#3=1\relax
+ \anchor{in}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
+ \anchor{in 1}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
+ \anchor{bin}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
+ \anchor{bin 1}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
+ \else
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>#3%
+ \else%
+ %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
+ \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+ \fi
+ \anchor{out}{\northeast\pgf@y=0pt}
+ \anchor{bout}{\right\pgf@y=0pt}
+
+ \anchor{left}{\left}% edges of component minus leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfpoint{0cm}{\pgf@circ@res@up}}
+ \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfpoint{0cm}{\pgf@circ@res@down}}
+ \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \ifpgfcirc@draw@leads
+ %input leads
+ \ifnum#3=1\relax
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
+ \else
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ %\pgf@circ@res@count = #3\relax% redundant
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+ \fi
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{%
+ \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ %
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/european #1 port/not height}\pgf@circ@res@up}}
+ \fi
+ %
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgftext{#2}
+ }
+ }
+}
+\pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
+\pgfcircdeclareeurologicport{buffer}{$1$}{1}{}
+\pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
+
+%% end european logic ports
+
+%%%%%%%%%%%%%%%%%%%%%%%%
+%% Transistors
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\long\def\pgfcircdeclaretransistor#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northeast{% upper right
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%center left
+ \pgf@y=0pt
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
+ }
+ \savedanchor\right{%center right -- added by Burak Kelleci % this is really 0,0
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{text}{
+ \northeast
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@transisors@fixlabels
+ \ifpgf@circuit@fet@bodydiode
+ % try to put the text to the right of the flyback diode
+ \pgfmathsetlength{\pgf@circ@res@other}{(
+ \ctikzvalof{tripoles/#1/bodydiode distance}*
+ \ctikzvalof{tripoles/#1/width} +
+ \ctikzvalof{tripoles/#1/bodydiode scale}*
+ \ctikzvalof{bipoles/diode/height}/2
+ )*\pgf@circ@scaled@Rlen}
+ \advance\pgf@x by \pgf@circ@res@other
+ \fi
+ % add a bit of space to avoid central (substrate) terminal if drawn
+ \advance\pgf@x by 0.05\pgf@circ@scaled@Rlen\relax
+ \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ \else
+ \pgf@y=.7\pgf@y
+ \pgf@x= \pgf@circ@scaled@Rlen
+ \pgf@x=0.1\pgf@x
+ \fi
+ }
+ \anchor{pathstart}{ % south
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{pathend}{
+ \northeast
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{south east}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{base}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{bulk}{ %added by Burak Kelleci
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \right
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobulk}{ %added by Burak Kelleci
+ \left
+ \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobase}{
+ \left
+ \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
+ }
+ \anchor{nogate}{
+ \left
+ \pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{body C in}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
+ }
+ \anchor{body E in}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
+ }
+ \anchor{body C out}{
+ \northeast
+ \pgf@ya=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@ya=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@ya
+ \pgf@y=\pgf@ya
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
+ \pgf@y=\pgf@ya
+ }
+ \anchor{body E out}{
+ \northeast
+ \pgf@ya=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@ya=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@ya
+ \pgf@y=\pgf@ya
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
+ \pgf@y=\pgf@ya
+ }
+ #2
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ \ifnum \ctikzvalof{tripoles/#1/curr direction} > 0
+ \pgf@circuit@trans@ntypetrue
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \fi
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \left
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ %
+ #3
+ % BODY DIODE
+ \ifpgf@circuit@fet@bodydiode
+ \drawbodydiode{#1}
+ \fi
+ %
+ }
+}
+}
+
+\long\def\drawbodydiode#1{
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgftransformrotate{90}
+ % diode scale and bodydiode scale interacts. We want the size of the diode
+ % proportional to the transistor, so we will:
+ % 1) undo diode scale 2) apply transistor scale (using the current class) 3) apply bodydiode scale
+ \pgfmathsetmacro{\@@BDscale}{\ctikzvalof{tripoles/#1/bodydiode scale}* \ctikzvalof{\ctikzclass/scale}/\ctikzvalof{diodes/scale}}
+ \pgftransformscale{\@@BDscale}
+ \ifpgf@circuit@fulldiode
+ \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \else
+ \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \fi
+ \endpgfscope
+ % Draw stroke line
+ \ifpgf@circuit@strokediode
+ \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{stroke}
+ \fi
+ %Draw upper connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope{}
+ %Draw lower connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+}
+
+\long\def\declarebpt#1{
+ \pgfcircdeclaretransistor{#1}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/base height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
+ }
+ }{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transistor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \edef\@@anchor{center}
+ \ifpgf@circuit@trans@ntype
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{btip}
+ \pgftransformlineattime{1.0}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \fi
+ \else % p-type
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{tip}
+ \pgftransformlineattime{1.0}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \else
+ \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \fi
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \ifpgf@circuit@bpt@drawphoto
+ \pgfscope
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \else
+ \ifpgf@circuit@bpt@drawbase
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \fi
+ }
+}
+
+\declarebpt{npn}
+\declarebpt{pnp}
+%
+% multi-emitter and multi-collector BJTs by Romano Giannetti
+%
+\def\pgf@circ@bjt@C@anchor#1{% #1: collector number
+ \pgfextractx{\pgf@circ@res@temp}{\basedimension}
+ \pgfextracty{\pgf@circ@res@other}{\basedimension}
+ \ifnum\cdir>0 % NPN, above
+ \pgfpoint{\pgf@circ@res@temp}{%
+ \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
+ \else % PNP, below
+ \pgfpoint{\pgf@circ@res@temp}{%
+ -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
+ \fi
+}
+\def\pgf@circ@bjt@E@anchor#1{% #1: collector number
+ \pgfextractx{\pgf@circ@res@temp}{\basedimension}
+ \pgfextracty{\pgf@circ@res@other}{\basedimension}
+ \ifnum\cdir<0 % PNP, above
+ \pgfpoint{\pgf@circ@res@temp}{%
+ \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
+ \else % PNP, below
+ \pgfpoint{\pgf@circ@res@temp}{%
+ -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
+ \fi
+}
+
+\long\def\declarebjt#1{
+ \pgfdeclareshape{bjt#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % \cdir is 1 for npn, -1 for pnp
+ \savedmacro{\cdir}{\edef\cdir{\ctikzvalof{tripoles/bjt/#1/curr direction}}}
+ \savedmacro{\numE}{\edef\numE{\ctikzvalof{tripoles/bjt/emitters}}}
+ \savedmacro{\numC}{\edef\numC{\ctikzvalof{tripoles/bjt/collectors}}}
+ % step up or down for the additional C/Es
+ \saveddimen{\multistep}{\pgfmathsetlength{\pgf@x}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
+ \saveddimen{\external}{\pgfmathsetlength{\pgf@x}{%
+ \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
+ \savedanchor\basedimension{% these are the dimensions if nC=1 y nE=1
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\northeast{% upper right
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@step}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \ifnum\cdir> 0
+ \edef\numup{\numC}\edef\numdown{\numE}
+ \else
+ \edef\numup{\numE}\edef\numdown{\numC}
+ \fi
+ \pgfmathsetlength{\pgf@y}{0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ + (\numup-1)*\pgf@circ@res@step+\pgfverticaltransformationadjustment*.5*\pgflinewidth
+ + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\southeast{% lower right
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@step}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \ifnum\cdir> 0
+ \edef\numup{\numC}\edef\numdown{\numE}
+ \else
+ \edef\numup{\numE}\edef\numdown{\numC}
+ \fi
+ \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
+ - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\southwest{% lower left
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@step}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \ifnum\cdir> 0
+ \edef\numup{\numC}\edef\numdown{\numE}
+ \else
+ \edef\numup{\numE}\edef\numdown{\numC}
+ \fi
+ \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
+ - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{tripoles/bjt/width}*\pgf@circ@scaled@Rlen
+ - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\southwest\pgf@x=0cm\relax}
+ \anchor{west}{\southwest\pgf@y=0cm}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@ya=\pgf@y\southwest\pgf@y=\pgf@ya}
+ \anchor{south west}{\southwest}
+ \anchor{south east}{\southeast}
+
+ \anchor{text}{\northeast\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax}
+ \anchor{B}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
+ \anchor{base}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
+ \anchor{nobase}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x}
+ % center of the base "bar"
+ \anchor{cbase}{\basedimension\pgf@x=-\pgf@x
+ \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
+ }
+ % geometrical centers
+ \anchor{vcenter}{\pgf@x=0cm\relax
+ \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
+ }
+ \anchor{gcenter}{%
+ \northeast\pgf@xa=0.5\pgf@x
+ \southwest\advance\pgf@xa by 0.5\pgf@x
+ \pgf@x=\pgf@xa
+ \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
+ }
+ % external connections
+ \anchor{E}{
+ \ifnum\cdir>0% npn, emitter down
+ \southeast
+ \else
+ \northeast
+ \fi
+ }% first emitter
+ \anchor{emitter}{\ifnum\cdir>0\southeast\else\northeast\fi}% first emitter
+ \anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi}
+ \anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi}
+
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ % set the type and up and down number of connections
+ %
+ \ifnum\cdir> 0
+ \pgf@circuit@trans@ntypetrue
+ \edef\numup{\numC}
+ \edef\numdown{\numE}
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \edef\numup{\numE}
+ \edef\numdown{\numC}
+ \fi
+ \basedimension
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\multistep
+ %
+ % set arrow positions options
+ %
+ \edef\@@anchor{center}\edef\@@pos{\ctikzvalof{tripoles/#1/arrow pos}}
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@pos{1.0}
+ \ifpgf@circuit@trans@ntype % arrow is toward outside, push it a bit
+ \edef\@@anchor{btip}
+ \else
+ \edef\@@anchor{tip}
+ \fi
+ \fi
+ %
+ % Drawing upper connections
+ %
+ \pgfscope
+ \pgf@circ@count@a=\numup\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \advance\pgf@circ@count@a-1\relax
+ \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
+ \ifnum\pgf@circ@count@a=\numexpr\numup-1\relax % draw the external pin connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\external+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
+ \fi
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}}%
+ \pgfsetroundcap % better when connecting to sloped lines
+ \pgfusepath{draw}
+ \ifpgf@circuit@trans@ntype\else % it's a PNP; draw arrow
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}%
+ }{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+ \repeatpgfmathloop
+ \endpgfscope
+ %
+ % Drawing base
+ %
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@up+(\numup-1)*\multistep}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@down-(\numdown-1)*\multistep}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfsetroundcap % I like it more...
+ \pgfusepath{draw}
+ \endpgfscope
+ %
+ % draw base external connection
+ %
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left-\external}{0pt}}
+ \pgfusepath{draw}
+ %
+ % Drawing lower connections
+ %
+ \pgfscope
+ \pgf@circ@count@a=\numdown\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \advance\pgf@circ@count@a-1\relax
+ \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@right}
+ {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}}
+ \ifnum\pgf@circ@count@a=\numexpr\numdown-1\relax % draw the external pin connection
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@right}
+ {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other-\external}}
+ \fi
+ \pgfsetroundcap % better when connecting to sloped lines
+ \pgfusepath{draw}
+ \ifpgf@circuit@trans@ntype % it's a NPN; draw arrow
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}%
+ }{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+ \repeatpgfmathloop
+ \endpgfscope
+ }
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@bjt#1\endcsname{%
+ % Start with the maximum collector number and go backwards.
+ \pgf@circ@count@a=\numC\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@bjt#1@C\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@bjt@C@anchor{\the\pgf@circ@count@a}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % and emitters
+ \pgf@circ@count@a=\numE\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@bjt#1@E\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@bjt@E@anchor{\the\pgf@circ@count@a}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+}
+
+\declarebjt{npn}
+\declarebjt{pnp}
+
+% end of multi-bjts
+
+\long\def\declareigbt#1{
+ \pgfcircdeclaretransistor{#1}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ }
+ {
+ %draw upper connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %draw thicker gate lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw lower connection
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transistor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \ifpgf@circuit@trans@ntype
+ \edef\@@anchor{btip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{tip}\edef\@@pos{1.0}
+ \fi
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.5}
+ \fi
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ %draw gate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
+ \fi
+ \pgfusepath{draw}
+ }
+}
+
+\declareigbt{pigbt}
+\declareigbt{nigbt}
+\declareigbt{Lnigbt}
+\declareigbt{Lpigbt}
+
+\pgfcircdeclaretransistor{nmos}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/nmos/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \ifpgf@circuit@trans@arrowatend
+ \pgftransformshift{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{trarrow}{btip}{}{}{\pgfusepath{stroke}}
+ \else
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\ctikzvalof{tripoles/nmos/arrow pos}}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \fi
+ \endpgfscope
+ \fi
+
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+
+ \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+}
+
+\pgfcircdeclaretransistor{pmos}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/pmos/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \ifpgf@circuit@trans@arrowatend
+ \pgftransformshift{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgftransformrotate{180}
+ \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}}
+ \else
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\ctikzvalof{tripoles/pmos/arrow pos}}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \fi
+ \endpgfscope
+ \fi
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+
+
+ \pgfusepath{draw}
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+
+ \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+
+ \ifpgf@circuit@pmos@nocircle\else
+ % we are not scaling the circle with the MOS --- I think it's better to have it
+ % coherent with the poles/nodes of the rest of the circuit.
+ \pgfpathcircle{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left - \ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \ifpgf@circuit@pmos@emptycircle
+ \pgfsetfillcolor{white}
+ \fi
+ \pgfusepath{draw,fill}
+ \fi
+}
+
+%% HEMT FET Transistor
+\pgfcircdeclaretransistor{hemt}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+\long\def\drawfetcore#1{
+ \pgftransformationadjustments
+ %top connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
+ \ifpgf@circuit@trans@depletiontype
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \else
+
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \fi
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %Bulk connection line
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ %bottom connection
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ %draw thick gate line
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \ifpgf@circuit@trans@ntype
+ \edef\@@anchor{tip}
+ \edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{btip}
+ \edef\@@pos{0.0}
+ \fi
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.6}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \ifpgf@circuit@trans@ntype
+ \else
+ \pgftransformrotate{180}
+ \fi
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+% GATE CONNECTION
+\ifpgf@circuit@bpt@drawgate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+\fi
+
+}
+
+\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
+{\pgfcircdeclaretransistor{#1}{
+ \anchor{bulk}{\left\pgf@x=0pt}
+ \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ #2
+ }
+ {#3}
+}
+
+\pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nfet}
+}
+
+\pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pfet}
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfete}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+\fi
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
+\pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfetebulk}
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% N-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{nigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfete}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
+\pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfetebulk}
+}
+
+% P-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{pigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+\pgfcircdeclaretransistor{njfet}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % arrow
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{tip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.6}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclaretransistor{pjfet}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{btip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.4}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+\pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DEPLETION TYPE
+ \pgfscope %% added
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} %% added
+ \pgfusepath{draw} %% added
+ \endpgfscope %% added
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{tip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.6}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfusepath{draw}
+
+ % Wavy lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% end of transistors
+
+%%%%%%%%%%%%%
+%% Switches
+%%%%%%%%%%%%%
+
+\pgfcircdeclarebipole{
+ \anchor{out 1}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{out 2}{
+ \northeast
+ \pgf@y=.8\pgf@y
+ }
+}
+{\ctikzvalof{tripoles/toggleswitch/height 2}}
+{toggleswitch}
+{\ctikzvalof{tripoles/toggleswitch/height}}
+{\ctikzvalof{tripoles/toggleswitch/width}}
+{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetdash{}{0cm}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% operational and instrumentation amplifiers
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{op amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % Triangle
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Output terminal
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Op amp shape as in european standard EN 60617
+\pgfdeclareshape{en amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{up}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{down}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+
+ \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
+ % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
+ }
+}
+
+% Fully differential output op amp
+% Contributed by Kristofer M. Monisit
+\pgfdeclareshape{fd op amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\outline{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/fd op amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out up}{
+ \northwest
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out down}{
+ \northwest
+ \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out +}{
+ \outline
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out -}{
+ \outline
+ \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout +}{
+ \outline
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ }
+ \anchor{bout -}{
+ \outline
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bout up}{
+ \northwest
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ }
+ \anchor{bout down}{
+ \northwest
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ \pgf@y=-\pgf@y
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out}{% should not be used
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x \pgf@y=-\pgf@y }
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % Triangle
+ % Includes output terminals in the traingular shape
+ % to ensure that diagonal joins are properly displayed
+ % we first draw the main triangle and the leads with normal thickness,
+ % and the redraw the main triangle with the component shape
+ \pgfscope
+ % shift origin a bit to ease calculations
+ \pgftransformxshift{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@step
+
+ % Initial point (right vertex)
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+
+ % Negative output terminal
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
+
+ % Top vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+
+ % Bottom vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+
+ % Positive output terminal
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
+
+ % Right vertex
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+
+ \pgfpathclose
+ \pgfusepath{stroke}
+
+ % ok, now we'll redraw the triangle with the class specific
+ % thickness and optionally fill
+
+ \pgfscope
+ \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
+
+ % Initial point (right vertex)
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ % Top vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ % Bottom vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope % thick and fill
+ \endpgfscope % shift
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Negative output terminal label
+ \pgftext[right, bottom, x=3pt, y=1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Positive output terminal label
+ \pgftext[right, top, x=3pt, y=-1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+
+% Instrumentation amplifier with differential output
+\pgfdeclareshape{fd inst amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % when tikz calls the anchor it wants the relative position in the lengths
+ % \pgf@x \pgf@y
+ % \pgfpoint* functions set that variables
+ % anchors are visible outside and run on use
+ \anchor{center}{\pgfpointorigin}
+ % savedanchors are internals and run on node creation (not use)
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/fd inst amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/fd inst amp/refv pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\outport{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
+ }
+ \anchor{out}{
+ \outport
+ \pgf@y=0pt
+ }
+ \anchor{out +}{
+ \outport
+ }
+ \anchor{out -}{
+ \outport
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\outportfixed{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ }
+ \anchor{out up}{
+ \outportfixed
+ }
+ \anchor{out down}{
+ \outportfixed
+ \pgf@y=-\pgf@y
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@x=-\pgf@x \pgf@y=0pt
+ }
+ \anchor{bout +}{
+ \outport
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ \anchor{bout -}{
+ \outport
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ \anchor{bout up}{
+ \outportfixed
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ \anchor{bout down}{
+ \outportfixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ % end border anchors
+ %
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % let's start drawing the component
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ % main component, normally in thicker lines
+ \pgfscope
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@step
+ %first point (near output)
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % input terminal up
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % input terminal down
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % output leads down and up
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} %
+ \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} %
+ \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Transconductance amplifier (Transkonduktanzverstärker)
+\pgfdeclareshape{gm amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/gm amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/gm amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgfscope
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@step
+ %Umrandung:
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{0}} %geändert startpunkt neu am ausgangsstrich
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}%vom Ausgang nach oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@down}}%ecke links unten nach rechts unten
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{0pt}} %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+ }
+}
+
+% Instrumentation amplifier
+\pgfdeclareshape{inst amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % when tikz calls the anchor it wants the relative position in the lengths
+ % \pgf@x \pgf@y
+ % \pgfpoint* functions set that variables
+ % anchors are visible outside and run on use
+ \anchor{center}{\pgfpointorigin}
+ % savedanchors are internals and run on node creation (not use)
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp/refv pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/inst amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % let's start drawing the component
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % main component, normally in thicker lines
+ \pgfscope
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@step
+ %first point (near output)
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Output terminal
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{0pt}} %
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Instrumentation amplifier with terminals for gain resistance between inputs
+\pgfdeclareshape{inst amp ra}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ }
+ % inputs (+-)
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ % R ampli anchors. They are by default at 20% more than R-length distance
+ % you can change that with the `ra pos` key (use 0.5 for one-R).
+ \savedanchor\raOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{ra up}{
+ \raOneFixed
+ }
+ \anchor{ra down}{
+ \raOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\raOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{ra-}{
+ \raOne
+ }
+ \anchor{ra+}{
+ \raOne
+ \pgf@y=-\pgf@y
+ }
+ % power supplies
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp ra/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=0.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=0.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp ra/refv pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/inst amp ra/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra up}{
+ \raOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra down}{
+ \raOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra-}{
+ \raOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra+}{
+ \raOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % drawing of the component
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ % main component, normally in thicker lines
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@step
+ %primer punto: la linea de salida (lado componente)
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up anchor
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % ra terminal -
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ % ra terminal +
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Output terminal
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{0pt}} %
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Buffer
+% Contributed by Danilo Piazzalunga
+\pgfdeclareshape{buffer}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/buffer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/buffer/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+
+% plain amplifier, no symbols
+\pgfdeclareshape{plain amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/plain amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+
+% plain amplifier, no symbols, one input
+\pgfdeclareshape{plain mono amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt\relax
+ }
+ \anchor{in}{
+ \inOne
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/plain amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% electromechanical device (motor/generator)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{elmech}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{electromechanicals}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{%
+ \@tempdima=\pgf@x\@tempdimb=\pgf@y
+ \northwest\pgf@circ@res@other=-\pgf@x
+ \pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}{\pgfqpoint{\pgf@circ@res@other}{\pgf@circ@res@other}}
+ }
+ \anchor{block north west}{\northwest\pgf@x=0.5\pgf@x}
+ \anchor{block south west}{\northwest\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y}
+ \anchor{block north east}{\northwest\pgf@x=-0.5\pgf@x}
+ \anchor{block south east}{\northwest\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y}
+ \anchor{block up right}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@x=-0.5\pgf@x
+ }
+ \anchor{block up left}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@x=0.5\pgf@x
+ }
+ \anchor{block down right}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@y=-\pgf@y
+ \pgf@x=-0.5\pgf@x
+ }
+ \anchor{block down left}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@y=-\pgf@y
+ \pgf@x=0.5\pgf@x
+ }
+ \behindbackgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope % clip the bar: whole size minus the circle
+ \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgfusepath{fill, draw}
+ \endpgfscope
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%
+%% Magnetron
+%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{magnetron}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{anode}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{cathode1}{
+ \northwest
+ \pgf@circ@res@step=\pgf@y
+ \pgfmathparse{cos(105)}
+ \pgf@x=\pgfmathresult\pgf@circ@res@step
+ \pgfmathparse{sin(105)}
+ \pgf@y=\pgfmathresult\pgf@circ@res@step
+ %\pgfpointorigin
+ %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
+ }
+ \anchor{cathode2}{
+ \northwest
+ \pgf@circ@res@step=\pgf@y
+ \pgfmathparse{cos(75)}
+ \pgf@x=\pgfmathresult\pgf@circ@res@step
+ \pgfmathparse{sin(75)}
+ \pgf@y=\pgfmathresult\pgf@circ@res@step
+ %\pgfpointorigin
+ %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ %create outer circle
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
+ \pgf@circ@draworfill
+ %create chambers
+ \foreach \angle in {45,135,225,315}{
+ \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
+ \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
+ }
+ \pgfsetroundcap
+ \pgfusepath{draw}
+ \pgfscope
+ %draw connection from outside
+ %anode
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ %cathodes
+ \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ %create cathode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %create anode
+ \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Electronic tubes, submitted by J. op den Brouw
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Draw tube outline
+\def\pgf@circ@tubes@drawtube{%
+ \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfutil@tempdima=\pgf@circ@res@right
+ \advance\pgfutil@tempdima by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{90}{\pgf@circ@res@up}
+ \else
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
+ \pgfutil@tempdima=\pgf@circ@res@up
+ \advance\pgfutil@tempdima by -\pgf@circ@res@right
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{\pgf@circ@res@right}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{-\pgf@circ@res@right}
+ \fi
+ \pgfpathclose
+}
+
+%% The diode (tube), triode, tetrode and pentode only differ in the
+%% number of grids. So we construct a generic declare function in
+%% which we can put code for the grid anchors and grid drawing code
+%% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
+\long\def\pgfcircdeclaretube#1#2#3{%
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ % x and y should be half the Rlen
+ \pgf@y=\pgf@circ@res@up
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@circ@res@right
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{north} {%
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{east}{%
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{west}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{north west}{%
+ \northwest
+ }
+ \anchor{north east}{%
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{anode} {%
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{cathode}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{cathode 1}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{cathode 2}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{filament 1}{%
+ \northwest
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@x=\pgfmathresult\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{filament 2}{%
+ \northwest
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@x=-\pgfmathresult\pgf@x
+ \pgf@y=-\pgf@y
+ }
+
+ % Extra anchors
+ #2
+
+ \backgroundpath{
+ \pgfscope
+ % Line width for tripoles
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % Setup to draw tube
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
+ \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+
+ % Tube outline
+ \pgf@circ@tubes@drawtube
+
+ % Setup to draw grid, filament, anode and cathode
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=0.5\pgf@circ@res@up
+ \pgf@circ@res@right=0.5\pgf@circ@res@right
+
+ % Tube fill color (if any)
+ \pgf@circ@draworfill
+
+ % Grid drawing
+ #3
+
+ % Filament (is not drawn by default)
+ \ifpgf@circuit@tubes@filament
+ \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
+ \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@xa=\pgfmathresult\pgf@circ@res@right
+ \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
+ \pgf@ya=\pgfmathresult\pgf@circ@res@up
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
+ \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@filamentfalse
+ \fi
+
+ % Anode (or plate)
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
+ \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+
+ % Cathode
+ \ifpgf@circuit@tubes@nocathode
+ \pgf@circuit@tubes@nocathodefalse
+ \else
+ \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \ifpgf@circuit@tubes@fullcathode
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@fullcathodefalse
+ \else
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}}
+ \fi
+ \fi
+
+ % Draw the background
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+}
+
+\pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
+
+\pgfcircdeclaretube{triode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{control} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+}
+{
+ % Grid protrusion
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{tetrode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{control} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \pgfutil@tempdima=0.5\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgfutil@tempdimb=0.5\pgfutil@tempdimb
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{pentode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{control} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{suppressor} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{pentode suppressor to cathode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{control} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \ifnum\pgf@circ@count@a>1\relax
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
+ \fi
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+ % Grid: connection from suppressor to cathode
+ \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+
+}
+
+%%%---------- close: tex/pgfcirctripoles
+%%%%%%%%%%% Springe nach tex/pgfcircquadpoles
+%%%---------- open: tex/pgfcircquadpoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Quadripoles
+
+\long\def\pgfcircdeclarequadpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{inductors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@scaled@Rlen
+ \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
+ }
+ %% we define the upper right (positive coord) dot (which is B1)
+ \savedanchor{\innerdot}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@xa=.5\pgf@circ@scaled@Rlen
+ \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
+ % by default use the cute inductor size
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
+ % check if it's american
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}
+ \edef\pgf@temp{american}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ % check if it's european
+ \edef\pgf@temp{european}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
+ }
+ \savedanchor{\outerdot}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@xa=.5\pgf@circ@scaled@Rlen
+ \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
+ % by default use the cute inductor size
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
+ % check if it's american
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}
+ \edef\pgf@temp{american}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ % check if it's european
+ \edef\pgf@temp{european}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ %% dot's anchors
+ \anchor{inner dot A1}{\innerdot\pgf@x=-\pgf@x}
+ \anchor{outer dot A1}{\outerdot\pgf@x=-\pgf@x}
+ \anchor{inner dot A2}{\innerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{outer dot A2}{\outerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{inner dot B1}{\innerdot}
+ \anchor{outer dot B1}{\outerdot}
+ \anchor{inner dot B2}{\innerdot\pgf@y=-\pgf@y}
+ \anchor{outer dot B2}{\outerdot\pgf@y=-\pgf@y}
+ % geographical
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ #2
+ }
+ }
+}
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \ctikzvalof{quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+%% Null styles that can be used to change individually the L1 and L2
+%% inductors of the transformer.
+
+\ctikzset{transformer L1/.style={}}
+\ctikzset{transformer L2/.style={}}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \pgfkeys{\circuitikzbasekey/.cd, transformer L1}
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \pgfkeys{\circuitikzbasekey/.cd, transformer L2}
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{\thisshape-L1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{\thisshape-L1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{\thisshape-L2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{\thisshape-L2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+\pgfcircdeclarequadpole{transformer}{
+ \pgf@circ@drawtransformerbasicbody
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ % use the chocke line thickness
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+
+ % Find the distance from center for the lines representing the core
+ % the 2.5 is for backward compatibility --- the distance was calculated as a fraction
+ % of the whole component, now as a fraction of the distance between coils, to be
+ % compatible with the quadpoles "inner" style.
+ \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right}
+
+ \pgfmoveto{\pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ %% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday...
+ \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left}
+ \pgfmoveto{\pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@other}{min(.7*\stretto*\pgf@circ@res@up, .8*\pgf@circ@res@right)} % radius
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{-\pgf@circ@res@other}}
+ \pgfpatharc{-90}{90}{\pgf@circ@res@other}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpatharc{90}{270}{\pgf@circ@res@other}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}{}
+
+%%%%%%%%%%%%%%%%%%%%
+%% Block elements
+%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{mixer}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{adder}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{oscillator}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \else
+ \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
+ \anchor{north east}{ \northwest \pgf@x=0pt\relax}
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{text}{
+ \pgf@x=-2\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
+
+ % draw outer box
+ \ifpgf@circuit@boxed{}
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{circulator}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed{}
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % inner arrow
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
+ \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+ }
+
+
+% Wilkinson divider
+\pgfdeclareshape{wilkinson}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/wilkinson/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{out2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ % draw inner resisitor - european or american style is recognised
+ {
+ \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgftransformrotate{90}
+
+ % calculate size of resistor
+ \ifpgf@circuit@europeanresistor
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{genericshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
+ \fi
+ }
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}}
+
+ \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+%% couplers generics
+\long\def\pgfcircdeclarefourport#1#2{
+
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@scaled@Rlen
+ \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{port1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{port4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+
+ % draw inner stuff
+ #2
+
+ % draw inner text
+ \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ }
+ }
+}
+
+% four-port
+\pgfcircdeclarefourport{fourport}{}
+
+% straight coupler
+\pgfcircdeclarefourport{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarefourport{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%---------- close: tex/pgfcircquadpoles
+%%%%%%%%%%% Springe nach tex/pgfcircmultipoles
+%%%---------- open: tex/pgfcircmultipoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Multipoles by Romano Giannetti
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%
+%% Chips
+%%%%%%%%%
+
+% let's use the same shifts everywhere, no magic numbers
+\def\pgf@circ@dip@pin@shift{0.5}
+\def\pgf@circ@qfp@pin@shift{0.25}
+
+% derived from https://tex.stackexchange.com/a/146753/38080
+% original author Mark Wibrow
+% Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
+% a lot of thanks to @marmot for the un-rotation hint
+% https://tex.stackexchange.com/a/473571/38080
+
+% DIP (dual in line package) chips
+
+\pgfdeclareshape{dipchip}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\numpins{%
+ \pgf@circ@count@a=\ctikzvalof{multipoles/dipchip/num pins}%
+ \def\numpins{\the\pgf@circ@count@a}
+ }
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins)
+ *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ }%
+ \saveddimen{\chipspacing}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/pin spacing}}}
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ % standard anchors
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{0.5*((\numpins)
+ *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step = \ctikzvalof{multipoles/dipchip/pin spacing}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
+ \pgf@circ@draworfill
+ %% upside mark
+ \ifpgf@circuit@chip@topmark
+ \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
+ \fi
+ \pgfusepath{stroke}%
+ \pgfsetcolor{\ctikzvalof{color}}
+ % Adding the pin number
+ \ifpgf@circuit@chip@shownumbers
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+ \ifpgf@circuit@chip@straightnumbers
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \fi
+ \endpgfscope
+ \ifdim\pgf@circ@res@other>0pt
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
+ \ifnum\padfrac>0
+ \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
+ % left side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % right side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \else
+ % left side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % right side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{stroke}
+ \endpgfscope
+ \fi
+ }%
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\numpins\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+
+% QFP (quad flat package) chips
+
+\pgfdeclareshape{qfpchip}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\numpins{%
+ \pgf@circ@count@a=\ctikzvalof{multipoles/qfpchip/num pins}%
+ \def\numpins{\the\pgf@circ@count@a}
+ }
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins+2)
+ *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
+ }%
+ \saveddimen\width{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins+2)
+ *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
+ }%
+ \saveddimen{\chipspacing}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/qfpchip/pin spacing}}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ % standard anchors
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
+ *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
+ \pgf@x=-\pgf@y
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step = \ctikzvalof{multipoles/qfpchip/pin spacing}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ %% upside mark
+ \ifpgf@circuit@chip@topmark
+ \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
+ \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
+ \else
+ \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
+ \fi
+ %% rest of the shape
+ \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
+ \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
+ \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ % Adding the pin number
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf@circuit@chip@shownumbers
+ \pgf@circ@count@a=\numpins%
+ \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
+ % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+ \ifpgf@circuit@chip@straightnumbers
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \fi
+ \endpgfscope
+ \ifdim\pgf@circ@res@other>0pt
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins%
+ \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
+ \ifnum\padfrac>0
+ \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
+ % left side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % bottom side pads
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ % right side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % top side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \else
+ % left side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % bottom side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ % right side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % top side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{stroke}
+ \endpgfscope
+ \fi
+ }%
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\numpins%
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+
+%% anchors for DIP
+\def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \c@pgf@countc=\numpins\relax
+ \divide\c@pgf@countc by 2
+ \ifnum #1 > \the\c@pgf@countc
+ % right side
+ \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
+ \else
+ \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
+\fi
+}
+
+%% anchors for QFP
+\def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \c@pgf@countc=\numpins\relax
+ \divide\c@pgf@countc by 4
+ \ifnum #1 > \the\c@pgf@countc
+ \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
+ \ifnum #1 > \the\c@pgf@countb
+ \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
+ \ifnum #1 > \the\c@pgf@countb
+ % 3*npins/4 < pin, top side
+ \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
+ \else
+ % 2*npins/4 < pin <= 3*npins/4, right side
+ \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
+ \fi
+ \else
+ % npins/4 < pin <= 2*npins/4, bottom side
+ \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
+ \fi
+ \else
+ % <= npins/4, left side
+ \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+ \fi
+}
+
+%%%%%%%%%%%%%%%%%
+%% Rotary Switch
+%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{rotaryswitch}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northeast{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@scaled@Rlen + \pgf@circ@res@temp}
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@scaled@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
+ }
+ \savedanchor\central{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
+ }
+ % external square limits
+ \savedanchor\extnorthwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
+ \pgf@x=2.5\pgf@x % external square size
+ \pgf@y=-\pgf@x %square thing when angle=180?
+ }
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{0.3052*\pgf@circ@scaled@Rlen*\ctikzvalof{tripoles/spdt/width}}}
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
+ \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
+ \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
+ \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
+ \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
+ % mid of the lever, to stack switches
+ %\anchor{mid}{\midlever}
+ \anchor{mid}{\northwest
+ \pgf@circ@res@temp=-\pgf@x
+ \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
+ \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
+ }
+ % center anchors
+ \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf@y=0pt}
+ \anchor{ain}{ \northwest \pgf@y=0pt}
+
+ \anchor{center}{ \central \pgf@y=0pt }
+ \anchor{east}{ \northeast \pgf@y=0pt }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \central \pgf@y=-\pgf@y }
+ \anchor{north}{ \central }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northeast }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
+
+ \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
+ \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
+ \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
+ \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+ \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
+ \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+ \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
+ \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
+ \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@res@right = \width
+ \pgf@circ@res@left = -\width
+
+ \pgfscope %wiper
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf@circ@res@temp=\radius\relax
+ \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+
+ \ifpgf@circ@rotaryarrow
+ \pgfscope % arrow
+ \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
+ \pgftransformrotate{\wiper}
+ \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
+ \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
+ \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
+ \pgfusepath{draw}
+ \endpgfscope
+ \fi
+
+ % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
+ \pgf@circ@count@a=\channels\relax
+ \pgfmathsetmacro{\currenta}{-\angle}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
+ \pgfscope
+ \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfmathsetmacro{\currenta}{\currenta+\stepa}
+ % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+
+ \pgfscope % input
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
+ \endpgfscope
+ }
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\channels\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+
+\def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
+ \pgf@circ@res@temp=\width
+ \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
+ \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
+ \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
+ \advance\pgf@x by -\pgf@circ@res@temp
+}
+
+\def\pgf@circ@rotarysqanchor#1{% external square anchors
+ \pgf@circ@res@temp=\width
+ \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
+ \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
+ \advance\pgf@x by -\pgf@circ@res@temp
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Seven segments displays
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{bare7seg}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{displays}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
+ \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
+ \ifpgf@circ@sevenseg@dot
+ \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
+ \else
+ \pgf@x=0pt
+ \fi
+ }
+ % The object extension is more or less (-width/2,-width) to (width/2,width)
+ % and adjusted for line thickness (both sides) and eventually the dot
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}}
+ \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
+ \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
+ \savedanchor{\southwest}{% both negative
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
+ \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
+ }
+ \savedanchor{\northeast}{% both positive
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circ@sevenseg@dot
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
+ \else
+ \pgf@circ@res@other=0pt
+ \fi
+ \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
+ }
+ \savedanchor{\topright}{% anchor without the box sep and the thickness
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{north west}{\southwest\pgf@y=-\pgf@y}
+ \anchor{north east}{\northeast}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\southwest}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0pt}
+ \anchor{south}{\southwest\pgf@x=0pt}
+ \anchor{west}{\southwest\pgf@y=0pt}
+ \anchor{a}{\topright\pgf@x=0pt}
+ \anchor{b}{\topright\pgf@y=0.5\pgf@y}
+ \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
+ \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
+ \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{g}{\pgfpointorigin}
+ \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
+ \behindbackgroundpath{%
+ \southwest % I do not want the dot here, it will stick out
+ \pgf@circ@res@up = -\pgf@y
+ \pgf@circ@res@down = \pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \pgf@circ@res@left = -\pgf@x
+ \pgfscope
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfpathrectanglecorners%
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
+ \ifpgf@circ@sevenseg@box
+ \pgf@circ@draworfill
+ \else
+ \pgf@circ@maybefill
+ \fi
+ \endpgfscope
+ \edef\bits{\ctikzvalof{seven seg/bits}}
+ \pgfscope
+ \pfg@circ@sseg@drawbits{\bits}
+ \endpgfscope
+ \pgfscope
+ \ifpgf@circ@sevenseg@dot
+ \pgf@circ@sseg@drawdots
+ \fi
+ \endpgfscope
+ }
+}
+
+\def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
+ \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
+}
+\def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
+ \ifnum #1 > 0\relax
+ \pgfsetcolor{\ctikzvalof{seven seg/color on}}
+ \else
+ \pgfsetcolor{\ctikzvalof{seven seg/color off}}
+ \fi
+ \pgfpathmoveto{\pgfpoint{#2}{#3}}
+ \pgfpathlineto{\pgfpoint{#4}{#5}}
+ \pgfusepath{draw}
+}
+\def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
+ \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
+ \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
+ \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
+ % \pgfsetroundcap
+ \pgfsetarrowsstart{Triangle Cap[]}
+ \pgfsetarrowsend{Triangle Cap[]}
+ % segments
+ \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
+ \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
+ \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
+ \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
+ \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
+ \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
+ \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
+}
+\def\pgf@circ@sseg@drawdots{% dots
+ \edef\what{empty}
+ \ifx\what\pgf@circ@sevenseg@dotstate
+ % do nothing
+ \else
+ \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
+ \edef\what{off}
+ \ifx\what\pgf@circ@sevenseg@dotstate
+ % dot off
+ \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
+ \pgfsetcolor{\ctikzvalof{seven seg/color off}}
+ \else
+ % dot on
+ \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
+ \pgfsetcolor{\ctikzvalof{seven seg/color on}}
+ \fi
+ \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
+ \pgfusepath{draw,fill}
+ \fi
+}
+
+
+%%%%%%
+%%%%%% Flip-flops
+%%%%%%
+
+% Flip flops are a specialized kind of dipchip.
+% they have a class by themselves
+
+%% flip flop definitions --- by default empty
+%% pin texts
+\ctikzset{multipoles/flipflop/t1/.initial={}}
+\ctikzset{multipoles/flipflop/t2/.initial={}}
+\ctikzset{multipoles/flipflop/t3/.initial={}}
+\ctikzset{multipoles/flipflop/t4/.initial={}}
+\ctikzset{multipoles/flipflop/t5/.initial={}}
+\ctikzset{multipoles/flipflop/t6/.initial={}}
+\ctikzset{multipoles/flipflop/tu/.initial={}}
+\ctikzset{multipoles/flipflop/td/.initial={}}
+% pin clock wedge flags
+\ctikzset{multipoles/flipflop/c1/.initial={0}}
+\ctikzset{multipoles/flipflop/c2/.initial={0}}
+\ctikzset{multipoles/flipflop/c3/.initial={0}}
+\ctikzset{multipoles/flipflop/c4/.initial={0}}
+\ctikzset{multipoles/flipflop/c5/.initial={0}}
+\ctikzset{multipoles/flipflop/c6/.initial={0}}
+\ctikzset{multipoles/flipflop/cu/.initial={0}}
+\ctikzset{multipoles/flipflop/cd/.initial={0}}
+% pin negation circle flags
+\ctikzset{multipoles/flipflop/n1/.initial={0}}
+\ctikzset{multipoles/flipflop/n2/.initial={0}}
+\ctikzset{multipoles/flipflop/n3/.initial={0}}
+\ctikzset{multipoles/flipflop/n4/.initial={0}}
+\ctikzset{multipoles/flipflop/n5/.initial={0}}
+\ctikzset{multipoles/flipflop/n6/.initial={0}}
+\ctikzset{multipoles/flipflop/nu/.initial={0}}
+\ctikzset{multipoles/flipflop/nd/.initial={0}}
+
+
+% Thanks to @marmot
+\tikzset{flipflop def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/flipflop}{#1}}
+
+% default set of flip flops
+\tikzset{
+ % async
+ latch/.style={flipflop, flipflop def={t1=D, t6=Q, t3=CLK, t4=\ctikztextnot{Q}}},
+ flipflop SR/.style={flipflop, flipflop def={t1=S, t3=R, t6=Q, t4=\ctikztextnot{Q}}},
+ % sync
+ flipflop D/.style={flipflop, flipflop def={t1=D, t6=Q, c3=1, t4=\ctikztextnot{Q}}},
+ flipflop T/.style={flipflop, flipflop def={t1=T, t6=Q, c3=1, t4=\ctikztextnot{Q}}},
+ flipflop JK/.style={flipflop, flipflop def={t1=J, t3=K, c2=1, t6=Q, t4=\ctikztextnot{Q}}},
+ % additional features
+ add async SR/.style={flipflop def={tu={\ctikztextnot{SET}}, td={\ctikztextnot{RST}}}},
+ dot on notQ/.style={flipflop def={t4={Q}, n4=1}},
+}
+
+%
+% commodity macro to draw the clock wedges. They leave the size of the
+% wedge in \pgf@circ@res@temp so that a possible label can be displaced.
+%
+\def\pgf@circ@do@wedge@left{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step+\wedge}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\wedge}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step-\wedge}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=\wedge
+ \fi
+}
+\def\pgf@circ@do@wedge@right{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step+\wedge}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\wedge}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step-\wedge}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=-\wedge
+ \fi
+}
+\def\pgf@circ@do@wedge@up{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/cu}>0
+ \pgfpathmoveto{\pgfpoint{-\wedge}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up-\wedge}}
+ \pgfpathlineto{\pgfpoint{\wedge}{\pgf@circ@res@up}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=-\wedge
+ \fi
+}
+\def\pgf@circ@do@wedge@down{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/cd}>0
+ \pgfpathmoveto{\pgfpoint{-\wedge}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down+\wedge}}
+ \pgfpathlineto{\pgfpoint{\wedge}{\pgf@circ@res@down}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=\wedge
+ \fi
+}
+% generic flip-flop shape
+\pgfdeclareshape{flipflop}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{flipflops}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ \savedmacro\numpins{\def\numpins{6}}
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins)
+ *\ctikzvalof{multipoles/flipflop/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ }%
+ \saveddimen{\chipspacing}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/pin spacing}}}
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/width}}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ % standard anchors
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{0.5*((\numpins)
+ *\ctikzvalof{multipoles/flipflop/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/width}}
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % upper and lower pin
+ \anchor{up}{\northwest\pgf@x=0pt\advance\pgf@y by\extshift }
+ \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y\advance\pgf@y by-\extshift}
+ \anchor{bup}{\northwest\pgf@x=0pt }
+ \anchor{bdown}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step = \ctikzvalof{multipoles/flipflop/pin spacing}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
+ \pgf@circ@draworfill
+ \pgfusepath{stroke}%
+ \endpgfscope
+ % Adding the pin number
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+ \ifpgf@circuit@chip@straightnumbers
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ % text
+ \def\mytext{\ctikzvalof{multipoles/flipflop/font}\space
+ \ctikzvalof{multipoles/flipflop/t\the\pgf@circ@count@c}%
+ \pgf@circ@strut\space}
+ % \typeout{TEXT\space\mytext}
+ \pgfmathloop%
+ \def\wedge{\ctikzvalof{multipoles/flipflop/clock wedge size}\pgf@circ@res@step}
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\pgf@circ@count@a>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ % \typeout{TEXT Left Q1\space\mytext}
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ % Now the up and down text
+ % up
+ \def\mytext{\ctikzvalof{multipoles/flipflop/fontud}\space\pgf@circ@strut\ctikzvalof{multipoles/flipflop/tu}\space}
+ \pgf@circ@do@wedge@up
+ \ifcase\quadrant % rotation 0
+ \pgftext[top,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ \pgftext[right,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ \pgftext[bottom,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ \pgftext[left,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \fi
+ % down
+ \def\mytext{\ctikzvalof{multipoles/flipflop/fontud}\space\pgf@circ@strut\ctikzvalof{multipoles/flipflop/td}\space}
+ \pgf@circ@do@wedge@down
+ \ifcase\quadrant % rotation 0
+ \pgftext[bottom,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ \pgftext[left,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ \pgftext[top,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ \pgftext[right,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \fi
+ % external pins
+ \ifdim\pgf@circ@res@other>0pt
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % left side pins
+ \pgf@circ@count@c=\pgf@circ@count@a
+ %% we draw the pin only if it's defined either a text, a clock wedge or a not pin
+ %% Or'ing tests in core TeX is tough
+ \edef\@@or{0}
+ % Just expand the key the minimum needed
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/t\the\pgf@circ@count@c}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfusepath{stroke}
+ \fi
+ % right side pins
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \edef\@@or{0}
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/t\the\pgf@circ@count@c}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ % \typeout{TEST\space\@@tmp\space\@@x}
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfusepath{stroke}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+ % up side
+ \edef\@@or{0}
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/tu}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/cu}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ % \typeout{TEST\space\@@tmp\space\@@x}
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfusepath{stroke}
+ \fi
+ % down side
+ \edef\@@or{0}
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/td}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/cd}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ % \typeout{TEST\space\@@tmp\space\@@x}
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfusepath{stroke}
+ \fi
+ \endpgfscope
+ \fi % external pin width >0
+ %
+ % draw "inverting" circles on outputs, they must be last
+ %
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % left side pins
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfnode{ocirc}{east}{}{\thisshape-N\the\pgf@circ@count@c}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ % right side pins
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfnode{ocirc}{west}{}{\thisshape-N\the\pgf@circ@count@c}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+ % up side
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{south}{}{\thisshape-Nu}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ % down side
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nd}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{north}{}{\thisshape-Nd}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ \endpgfscope
+ }%
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@flipflop{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\numpins\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@flipflop@pin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@flipflop@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+
+%
+% MUX-DEMUXES
+%
+% Thanks to @marmot
+\tikzset{muxdemux def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/muxdemux}{#1}}
+\tikzset{demux/.style={muxdemux, muxdemux def={Lh=4, Rh=8, NL=1, NB=3, NR=8}}}
+\tikzset{one bit adder/.style={muxdemux,
+ muxdemux def={Lh=4, NL=2, Rh=2, NR=1, NB=1, w=1.5,
+ inset w=0.5, inset Lh=2, inset Rh=1.5}}}
+\tikzset{ALU/.style={muxdemux,
+ muxdemux def={Lh=5, NL=2, Rh=2, NR=1, NB=2, NT=1, w=2,
+ inset w=1, inset Lh=2, inset Rh=0, square pins=1}}}
+%generic mux-demux shape
+\pgfdeclareshape{muxdemux}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{muxdemuxes}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % pins on the four sides
+ % \savedmacro\NL{%
+ % \pgf@circ@count@a=\ctikzvalof{multipoles/muxdemux/NL}%
+ % \def\NL{\the\pgf@circ@count@a}
+ % }
+ \savedmacro\NL{\edef\NL{\ctikzvalof{multipoles/muxdemux/NL}}}
+ \savedmacro\NR{\edef\NR{\ctikzvalof{multipoles/muxdemux/NR}}}
+ \savedmacro\NT{\edef\NT{\ctikzvalof{multipoles/muxdemux/NT}}}
+ \savedmacro\NB{\edef\NB{\ctikzvalof{multipoles/muxdemux/NB}}}
+ \savedmacro\squarepins{\edef\squarepins{\ctikzvalof{multipoles/muxdemux/square pins}}}
+ % topleft and topright sizes
+ \savedanchor{\topleft}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Lh}*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
+ }
+ \savedanchor{\topright}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Rh}*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
+ }
+ \savedanchor{\insetnortheast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Lh}*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*
+ (\ctikzvalof{multipoles/muxdemux/w}-2*\ctikzvalof{multipoles/muxdemux/inset w})*\pgf@circ@scaled@Rlen/2}
+ }
+ \saveddimen{\insethright}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Rh}*\pgf@circ@scaled@Rlen/2}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ \savedanchor{\northwest}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*max(\ctikzvalof{multipoles/muxdemux/Rh},\ctikzvalof{multipoles/muxdemux/Lh})*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{top right}{\topright}
+ \anchor{bottom right}{\topright\pgf@y=-\pgf@y}
+ \anchor{right}{\topright\pgf@y=0pt\relax}
+ \anchor{top left}{\topleft}
+ \anchor{bottom left}{\topleft\pgf@y=-\pgf@y}
+ \anchor{left}{\topleft\pgf@y=0pt\relax}
+ \anchor{top}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2 \pgf@x=0pt\relax}
+ \anchor{bottom}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2 \pgf@y=-\pgf@y \pgf@x=0pt\relax}
+ \anchor{inset top right}{\pgf@ya=\insethright\insetnortheast\advance\pgf@y by -0.5\pgf@ya}
+ \anchor{inset bottom right}{\pgf@ya=\insethright\insetnortheast\advance\pgf@y by -0.5\pgf@ya\pgf@y=-\pgf@y}
+ \anchor{inset right}{\insetnortheast\pgf@y=0pt\relax}
+ \anchor{inset top left}{\insetnortheast\pgf@ya=\pgf@y\topleft\pgf@y=\pgf@ya}
+ \anchor{inset bottom left}{\insetnortheast\pgf@ya=\pgf@y\topleft\pgf@y=-\pgf@ya}
+ \anchor{inset left}{\topleft\pgf@y=0pt\relax}
+ \anchor{inset bottom}{\topleft\pgf@xa=\pgf@x\pgf@ya=\insethright
+ \insetnortheast\pgf@xb=\pgf@x\pgf@yb=\pgf@x
+ \pgfpoint{(\pgf@xa+\pgf@xb)/2}{-\pgf@ya+\pgf@yb/2}}
+ \anchor{inset top}{\topleft\pgf@xa=\pgf@x\pgf@ya=\insethright
+ \insetnortheast\pgf@xb=\pgf@x\pgf@yb=\pgf@x
+ \pgfpoint{(\pgf@xa+\pgf@xb)/2}{\pgf@ya-\pgf@yb/2}}
+ \anchor{inset center}{\topleft\pgf@xa=\pgf@x\insetnortheast
+ \advance\pgf@x by \pgf@xa \divide\pgf@x by 2 \pgf@y=0pt\relax}
+ \anchor{narrow center}{\insetnortheast\pgf@xa=\pgf@x\topright
+ \advance\pgf@x by \pgf@xa \divide\pgf@x by 2\pgf@y=0pt\relax}
+ \anchor{center up}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2
+ \pgf@yb = \insethright \advance\pgf@y by \pgf@yb
+ \divide\pgf@y by 2 \pgf@x=0pt\relax}
+ \anchor{center down}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2
+ \pgf@yb = \insethright \advance\pgf@y by \pgf@yb
+ \divide\pgf@y by 2 \pgf@y=-\pgf@y \pgf@x=0pt\relax}
+ \anchor{text}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*
+ \ctikzvalof{multipoles/muxdemux/inset w}*\pgf@circ@scaled@Rlen/2}
+ \advance\pgf@x by -.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \backgroundpath{%
+ \topleft
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@left = \pgf@x
+ \topright
+ \pgf@circ@res@other = \pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \insetnortheast
+ \pgf@circ@res@step = \pgf@x
+ \pgf@circ@res@temp = \pgf@y
+ %
+ % external block
+ %
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ % inset, starting down
+ \ifdim\pgf@circ@res@temp>0pt % inset
+ % \typeout{INSETw\space\the\pgf@circ@res@right\space x\space\the\pgf@circ@res@step\space y\space\the\pgf@circ@res@temp}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\insethright}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\insethright}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}
+ \fi
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ % now we have to draw the pins, if needed
+ \ifdim\extshift>0pt\ifpgfcirc@draw@leads\pgfscope % let's avoid too much indent
+ % Ok, we have to draw the leads (a.k.a. pins)
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ % We mimic the anchors here --- probably there is a better way
+ % left pins
+ \ifnum\NL>0\relax % not indented, closed on \repeatpgfmathloop
+ \pgf@circ@count@a=\NL\relax
+ \pgf@circ@count@b=\NL \divide\pgf@circ@count@b by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
+ \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
+ \insetnortheast\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
+ \ifdim\pgf@circ@res@down>0pt % check if we have an inset
+ % we have to check oddity
+ \ifodd\NL
+ \ifnum\NL=1
+ % only centerpin, step should not be used, but anyway...
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/(\NL)}
+ \else
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/(\NL-1)}
+ \fi
+ \else
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/\NL}
+ \fi
+ \else % no inset
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@up/\NL}
+ \fi
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ %%%%%
+ \ifdim\pgf@circ@res@down>0pt % check if we have an inset
+ \ifnum\pgf@circ@count@a>\pgf@circ@count@b\relax
+ % for lower pins we have to shift them down
+ % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
+ \ifodd\NL
+ % odd number of pins
+ \ifnum\pgf@circ@count@a=\numexpr\the\pgf@circ@count@b+1\relax
+ % centerpin!
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \ifnum\squarepins>0
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{0pt}}
+ \else
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\extshift}{0pt}}
+ \fi
+ \else
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a+1)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a+1)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \fi
+ \else
+ % even numer of pins: just go down
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \fi
+ \else
+ % nothing need for #1<=NL/2
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \fi
+ \else
+ % no inset
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \fi
+ %%%%%
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % right pins
+ \ifnum\NR>0\pgf@circ@count@a=\NR\relax
+ \pgfmathloop%
+ \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@up=\pgf@y
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@up/\NR}
+ \ifnum\pgf@circ@count@a>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % bottom pins
+ \ifnum\NB>0\pgf@circ@count@a=\NB\relax %%%
+ \pgfmathloop%
+ \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
+ \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@right/\NB}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@circ@res@down-\pgf@circ@res@up)/(\pgf@circ@res@right-\pgf@circ@res@left)*\pgf@circ@res@step}
+ \ifnum\pgf@circ@count@a>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {-\pgf@circ@res@down+(\NB-\pgf@circ@count@a+0.5)*\pgf@circ@res@other}}
+ \ifnum\squarepins>0
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {-max(\pgf@circ@res@down, \pgf@circ@res@up)-\extshift}}
+ \else
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {-\pgf@circ@res@down+(\NB-\pgf@circ@count@a+0.5)*\pgf@circ@res@other-\extshift}}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % top pins
+ \ifnum\NT>0\pgf@circ@count@a=\NT\relax
+ \pgfmathloop%
+ \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
+ \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@right/\NT}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@circ@res@down-\pgf@circ@res@up)/(\pgf@circ@res@right-\pgf@circ@res@left)*\pgf@circ@res@step}
+ \ifnum\pgf@circ@count@a>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {\pgf@circ@res@down-(\NT-\pgf@circ@count@a+0.5)*\pgf@circ@res@other}}
+ \ifnum\squarepins>0
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {max(\pgf@circ@res@down, \pgf@circ@res@up)+\extshift}}
+ \else
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {\pgf@circ@res@down-(\NT-\pgf@circ@count@a+0.5)*\pgf@circ@res@other+\extshift}}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % end drawing pins; stroke them
+ \pgfusepath{stroke}
+ \endpgfscope\fi\fi
+ }
+ % let's start adding anchors
+ \pgfutil@g@addto@macro\pgf@sh@s@muxdemux{%
+ % left side anchors
+ \pgf@circ@count@a=\NL\relax
+ % \typeout{STARTGENERATINGLEFT\space\the\pgf@circ@count@a\space FOR\space\thisshape\space\NL}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % \typeout{GENERATINGLEFT\space\the\pgf@circ@count@a\space FOR\space\thisshape\space\NL}
+ % we will create two anchors per pin: the "normal one" like `lpin 1` for the
+ % external leads, and the "border one" like `blpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@lpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@L@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@blpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@L@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % right anchors
+ \pgf@circ@count@a=\NR\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `rpin 1` for the
+ % external leads, and the "border one" like `brpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@rpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@R@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@brpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@R@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % bottom anchors
+ \pgf@circ@count@a=\NB\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `bpin 1` for the
+ % external leads, and the "border one" like `bbpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@B@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@bbpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@B@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % top anchors
+ \pgf@circ@count@a=\NT\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `tpin 1` for the
+ % external leads, and the "border one" like `btpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@tpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@T@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@btpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@T@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+
+%% left anchors for muxdemux
+
+\def\pgf@circ@muxdemux@L@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topleft
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \insetnortheast
+ \pgf@xb=\pgf@x
+ \pgf@yb=\pgf@y
+ \ifnum#1>\NL
+ \PackageError{circuitikz}{%
+ You requested left pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NL\space left pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \pgf@circ@count@a=\NL \divide\pgf@circ@count@a by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
+ % \typeout{LEFT \the\pgf@xa \space \the\pgf@ya \space \NL}
+ \ifnum\NL>1
+ \ifdim\pgf@yb>0pt % check if we have an inset
+ % we have to check oddity
+ \ifodd\NL
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@ya-\pgf@yb)/(\NL-1)}
+ \else
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@ya-\pgf@yb)/\NL}
+ \fi
+ \else % no inset
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@ya/\NL}
+ \fi
+ \ifdim\pgf@yb>0pt % check if we have an inset
+ \ifnum#1>\pgf@circ@count@a\relax
+ % for lower pins we have to shift them down
+ % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
+ \ifodd\NL
+ % odd number of pins
+ \ifnum#1=\numexpr\the\pgf@circ@count@a+1\relax
+ % centerpin!
+ \ifnum#2=0\relax
+ \pgfpoint{\pgf@xb}{0pt}
+ \else
+ \ifnum\squarepins>0
+ \pgfpoint{\pgf@xa-#2*\extshift}{0pt}
+ \else
+ \pgfpoint{\pgf@xb-#2*\extshift}{0pt}
+ \fi
+ \fi
+ \else
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1+1)*\pgf@circ@res@step-2*\pgf@yb}
+ \fi
+ \else
+ % even numer of pins: just go down
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step-2*\pgf@yb}
+ \fi
+ \else
+ % nothing need for #1<=NL/2
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
+ \fi
+ \else
+ % no inset
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
+ \fi
+ \else
+ \pgfpoint{\pgf@xa-#2*\extshift}{0pt}
+ \fi
+}
+
+% right anchors
+\def\pgf@circ@muxdemux@R@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topright
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \ifnum#1>\NR
+ \PackageError{circuitikz}{%
+ You requested right pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NR\space right pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \ifnum\NR>1
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@ya/\NR}
+ \pgfpoint{\pgf@xa+#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
+ \else
+ \pgfpoint{\pgf@xa+#2*\extshift}{0pt}
+ \fi
+}
+
+% bottom anchors
+\def\pgf@circ@muxdemux@B@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topleft
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \topright
+ \pgf@xb=\pgf@x
+ \pgf@yb=\pgf@y
+ \ifnum#1>\NB
+ \PackageError{circuitikz}{%
+ You requested bottom pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NB\space bottom pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \ifnum\NB>0
+ % \typeout{DEBUGTESTtopleft\space\the\pgf@ya \space topright\space\the\pgf@yb \space\NB}
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@xb/\NB}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@yb-\pgf@ya)/(\pgf@xb-\pgf@xa)*\pgf@circ@res@step}
+ \pgfmathsetlength\pgf@x{\pgf@xa+(#1-0.5)*\pgf@circ@res@step}
+ \ifnum#2=0\relax
+ \pgfmathsetlength\pgf@y{-\pgf@yb+(\NB-#1+0.5)*\pgf@circ@res@other}
+ \else
+ \ifnum\squarepins>0\relax
+ \pgfmathsetlength\pgf@y{-max(\pgf@ya,\pgf@yb)-\extshift}
+ \else
+ \pgfmathsetlength\pgf@y{-\pgf@yb+(\NB-#1+0.5)*\pgf@circ@res@other-\extshift}
+ \fi
+ \fi
+ \else
+ % should not happen, give the same as pin 1 anyway
+ \ifnum#2=0\relax
+ \pgfpoint{0pt}{-\pgf@yb+(\pgf@yb-\pgf@ya)/2}
+ \else
+ \pgfpoint{0pt}{-max(\pgf@ya,\pgf@yb)-\extshift}
+ \fi
+ \fi
+}
+
+% top anchors
+\def\pgf@circ@muxdemux@T@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topleft
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \topright
+ \pgf@xb=\pgf@x
+ \pgf@yb=\pgf@y
+ \ifnum#1>\NT
+ \PackageError{circuitikz}{%
+ You requested top pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NT\space top pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \ifnum\NT>0
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@xb/\NT}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@yb-\pgf@ya)/(\pgf@xb-\pgf@xa)*\pgf@circ@res@step}
+ \pgfmathsetlength\pgf@x{\pgf@xa+(#1-0.5)*\pgf@circ@res@step}
+ \ifnum#2=0\relax
+ \pgfmathsetlength\pgf@y{\pgf@yb-(\NT-#1+0.5)*\pgf@circ@res@other}
+ \else
+ \ifnum\squarepins>0
+ \pgfmathsetlength\pgf@y{max(\pgf@ya,\pgf@yb)+\extshift}
+ \else
+ \pgfmathsetlength\pgf@y{\pgf@yb-(\NT-#1+0.5)*\pgf@circ@res@other+\extshift}
+ \fi
+ \fi
+ \else
+ % should not happen, give the same as pin 1 anyway
+ \ifnum#2=0\relax
+ \pgfpoint{0pt}{\pgf@yb-(\pgf@yb-\pgf@ya)/2}
+ \else
+ \pgfpoint{0pt}{max(\pgf@ya,\pgf@yb)+\extshift}
+ \fi
+ \fi
+}
+%%%---------- close: tex/pgfcircmultipoles
+
+%%%%%%%%%%% Springe nach tex/pgfcirclabel
+%%%---------- open: tex/pgfcirclabel.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bipole label positioning
+
+%% bipole labels and annotation extra style
+
+\ctikzset{bipole label style/.style={}}
+\tikzset{bipole label style/.code={
+ \ctikzset{bipole label style/.style={#1}}
+}}
+\tikzset{bipole label append style/.code={
+ \ctikzset{bipole label style/.append style={#1}}
+}}
+\ctikzset{bipole annotation style/.style={}}
+\tikzset{bipole annotation style/.code={
+ \ctikzset{bipole annotation style/.style={#1}}
+}}
+\tikzset{bipole annotation append style/.code={
+ \ctikzset{bipole annotation style/.append style={#1}}
+}}
+
+%% Options
+\ctikzset{label/.style = { l=#1 } }
+\ctikzset{l/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{l^/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\ctikzset{l_/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\ctikzset{annotation/.style = { a=#1 } }
+\ctikzset{a/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
+ \ctikzsetvalof{bipole/annotation/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{annotation above/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{a^/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{annotation below/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+\ctikzset{a_/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+
+% This is to adjust spacing for the labels so that they are not cramped on components
+\def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
+
+\def\pgf@circ@drawlabels#1{
+ \pgfextra{
+ % This function will be called with argument #1 equal
+ % to "label" or "annotation" form pgfcircpath.tex.
+ % pgf@circ@direction is the direction of the path,
+ % its value is set in pgfcircpath.tex
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \pgfmathround{\pgfmathresult} % avoid precision loss errors
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
+ \ifnum \pgf@circ@temp < 0
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
+ %
+ % normalize the angle values
+ %
+ \pgfmathmod{\pgf@circ@labanc}{360}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ %
+ \ifpgf@circuit@bipole@inverted
+ \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ %
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
+ }
+ %Firstly, place a coordinate directly at the edge of the shape
+ (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
+ %now decide, which labels should be drawn
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{label/align}}
+ \def\pgf@circ@temp{straight}
+ }
+ \ifx\pgf@temp\pgf@circ@temp %straight
+ \pgf@circ@drawreglabels{#1}
+ \else
+ \pgfextra{\def\pgf@circ@temp{rotate}}
+ \ifx\pgf@temp\pgf@circ@temp %rotate
+ \pgf@circ@drawrotlabels{#1}
+ \else% smart
+ \pgf@circ@drawsmartlabels{#1}
+ \fi
+ \fi
+}
+
+
+\def\pgf@circ@drawsmartlabels#1{
+ \pgfextra{
+ \pgfmathmod{\pgf@circ@direction}{90}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \ifnum \pgfcircmathresult > 20
+ \ifnum \pgfcircmathresult < 70
+ \pgf@circ@drawrotlabels{#1}
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+ }
+
+
+\def\pgf@circ@drawrotlabels#1{
+ \pgfextra{
+ % scale the distances in function of zoom, so that they are not
+ % dependent on it but on font size. Thanks to @marmot
+ % https://tex.stackexchange.com/a/476018/38080
+ % the coeffcient is adjusted so that the distance is more or less
+ % the same for rotated labels and straight ones (although it will
+ % depend on the font, so it's not exact).
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
+ \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ %we need some more space for placement below, due to mid-anchor
+ \else % we do not have <= in \ifnum...
+ \pgf@circ@res@temp=1.5\pgf@circ@res@temp
+ \fi
+ %Calculate rotation of the label from direction and strip decimals
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ % rotate the label at second or third quadrant:
+ \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
+ \pgfmathsubtract{\pgf@circ@direction}{180}
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ %invert the space relationships due to rotated strings
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ \pgf@circ@res@temp=1.5\pgf@circ@res@temp
+ \fi
+ \fi\fi
+ \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
+ \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ % reset cm is not working correctly here
+ (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
+ node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style]
+ (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
+}
+
+\def\pgf@circ@drawreglabels#1{
+ %Now calculate all shape positions
+ %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
+ %All points between will be addressed by angled-anchors:
+ \pgfextra{
+ % scale ex-distance to make it independent on scale
+ % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
+ \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
+ \pgfmathadd{\pgf@circ@labanc}{90}
+ \pgfmathround{\pgfmathresult}
+ \def\pgf@circ@labanctext{\pgf@circ@labanc}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ %Values around 90 are at both y-axis
+ \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
+ \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
+ \ifnum \pgf@circ@labpos > 180
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanctext{mid west}}
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{mid east}}
+ \fi
+ \else
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanctext{mid east}}
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{mid west}}
+ \fi
+ \fi
+ \fi\fi
+ %Values between -5 and 5 are at pos /neg x-axis
+ \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
+ \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
+ \ifnum \ctikzvalof{bipole/#1/position} < 0
+ \ifnum \pgf@circ@labanc > 90
+ % using base coordinate instead of south to naturally align
+ % symbols with descendants; but this invalidate the effect of
+ % the inner sep, so recover it by shifting the anchor
+ % reset cm is not working sometime, use @marmot solution
+ % see https://tex.stackexchange.com/a/476018/38080
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{north}}%north
+ \fi
+ \else
+ \ifnum \pgf@circ@labanc < 90
+ % shift, as above
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \ifnum \pgf@circ@labanc > 180
+ % this shouldn't happen, but somehow it does (270 degree anchors)
+ % shift, as above
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{north}}%north
+ \fi
+ \fi
+ \fi
+ \fi\fi
+ (labelcoor) node[anchor=\pgf@circ@labanctext,
+ inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, \circuitikzbasekey/bipole #1 style,
+ ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
+ }
+}
+
+\def\pgf@circ@finallabels#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
+ \fi%
+}
+
+\ctikzset{text/.style={t=#1}}
+\ctikzset{t/.code={%
+ \ctikzsetvalof{bipoles/twoport/text}{#1}%
+}}
+
+%%%% Stacked labels
+%
+% stacked labels by Romano Giannetti romano@rgtti.com
+% heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
+% \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
+%
+% labels are in a tabular, globally aligned:
+% vertically with key l2 valign (default c)
+% c: center t: top b: bottom
+% horizontally with key l2 align (default l)
+% l: left c: centered r: right
+% you can switch sides using l2_=... and l2^=...
+% syntax is l2_ = line1 and line2 (same for l2^)
+%
+\ctikzset{%
+ l2 valign/.store in=\ltwo@valign, l2 valign=c,
+ l2 halign/.store in=\ltwo@halign, l2 halign=l,
+}
+\ctikzset{l2base/.code n args={2}{
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=%
+ \bgroup
+ \setlength{\tabcolsep}{2pt}%
+ \def\ltwo@tabu{\tabular[\ltwo@valign]}%
+ \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
+ #1\\ #2%
+ \endtabular
+ \egroup
+ }%
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#2}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+\ctikzset{l2/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 above/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2^/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 below/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l2_/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+%%%---------- close: tex/pgfcirclabel
+%%%%%%%%%%% Springe nach tex/pgfcircvoltage
+%%%---------- open: tex/pgfcircvoltage.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Voltage management
+
+%% styles
+\ctikzset{bipole voltage style/.style={}}
+\tikzset{bipole voltage style/.code={
+ \ctikzset{bipole voltage style/.style={#1}}
+}}
+\tikzset{bipole voltage append style/.code={
+ \ctikzset{bipole voltage style/.append style={#1}}
+}}
+
+\ctikzset{v^>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v^</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v_>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
+\ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
+\ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
+\ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
+
+% Default position varies whether the component is a voltage source
+% or not
+\ctikzset{v/.code = {
+ \ifpgf@circuit@bipole@isvoltage
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi
+ \fi
+ \ifpgf@circ@oldvoltagedirection
+ \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi\fi
+ \else
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@bipole@current@backward
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \fi\fi\fi
+ \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+ \ctikzsetvalof{bipole/voltage/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }
+}
+
+% american voltage font selection and symbol definition
+% the default font command is {} --- nothing
+\def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
+%
+% plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
+%
+\def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
+\def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
+
+%%
+\def\setscaledRlenforclass{%
+ \csname pgf@sh@ma@\ctikzvalof{bipole/name}\endcsname
+ \ifdefined\ctikzclass
+ \edef\pgf@temp{/tikz/circuitikz/\ctikzclass/scale}
+ \pgfkeysifdefined{\pgf@temp}
+ {\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ {\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}
+ \else
+ \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
+ \fi
+}
+
+%% Output routine for generic bipoles
+
+\def\pgf@circ@drawvoltagegeneric{
+ \pgfextra{
+ % \typeout{NAME:\ctikzvalof{bipole/name}}
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\partheight{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
+ }
+ {
+ \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
+ {
+ \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
+ }
+ {%calculate default value from part height
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\partheight{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen+0.2\pgf@circ@scaled@Rlen)}
+ }
+ {
+ \edef\tmpdistfromline{(.5\pgf@circ@scaled@Rlen)} %fallback to fixed value
+ }
+ }
+ }
+ % \typeout{KIND:\ctikzvalof{bipole/kind}\space RLEN:\the\pgf@circ@Rlen\space SCALED:\the\pgf@circ@scaled@Rlen}
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\tmpdistfromline}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\tmpdistfromline}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\tmpdistfromline}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\tmpdistfromline}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \fi
+ \fi
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@voltage@angle{90}
+ \else
+ \def\pgf@circ@voltage@angle{-90}
+ \fi
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\distancefromnode{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}} }
+ { \edef\distancefromnode{\ctikzvalof{voltage/distance from node}} }
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\bumpb{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}} }
+ { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ % additional per-bipole voltage shift (internal)
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/additional label shift}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\addvshift{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/additional label shift}}
+ }
+ {
+ \edef\addvshift{0}
+ }
+ \newdimen{\absvshift}
+ \pgfmathsetlength{\absvshift}{(1+\shiftv+\addvshift)*(\distfromline)}
+ % put this to true to see the voltage label coordinate anchors
+ \newif\ifpgf@circ@debugv\pgf@circ@debugvfalse
+ }
+ % %\pgf@circ@Rlen/\ctikzvalof{current arrow scale} is equal to the length of the currarrow
+ coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
+ coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorstartnode)$)
+ coordinate (pgfcirc@Vfrom@flat) at (pgfcirc@midtmp)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
+
+ coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
+ coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorendnode)$)
+ coordinate (pgfcirc@Vto@flat) at (pgfcirc@midtmp)
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
+
+ \ifpgf@circuit@bipole@voltage@below
+ \ifpgf@circ@debugv
+ node [ocirc, fill=red] at (anchorstartnode) {}
+ node [ocirc, fill=blue] at (anchorendnode) {}
+ node [ocirc, fill=green] at (pgfcirc@Vto) {}
+ node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
+ \fi
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! \absvshift!90 : (anchorendnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! \absvshift!-90 : (anchorstartnode)$)
+ coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+ coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+ coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! -\absvshift!90 : (pgfcirc@Vcont2t)$)
+ coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! -\absvshift!-90 : (pgfcirc@Vcont1t)$)
+ \ifpgf@circ@debugv
+ node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
+ node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
+ \fi
+ \else
+ \ifpgf@circ@debugv
+ node [ocirc, fill=red] at (anchorstartnode) {}
+ node [ocirc, fill=blue] at (anchorendnode) {}
+ node [ocirc, fill=green] at (pgfcirc@Vto) {}
+ node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
+ \fi
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! -\absvshift!90 : (anchorendnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! -\absvshift!-90 : (anchorstartnode)$)
+ coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+ coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+ coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! \absvshift!90 : (pgfcirc@Vcont2t)$)
+ coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! \absvshift!-90 : (pgfcirc@Vcont1t)$)
+ \ifpgf@circ@debugv
+ node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
+ node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
+ \fi
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@straight
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
+ \else
+ (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
+ node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
+ (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
+ node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
+ (pgfcirc@Vto)
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ \fi
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine for voltage sources
+\def\pgf@circ@drawvoltagegenerator{
+ % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
+ % it's not perfect, but I can't find the way to do it correctly...
+ \pgfextra{
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ \edef\bumpa{\ctikzvalof{voltage/bump a}}
+ \pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv} % coefficient added "by feel". Sorry.
+ }
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
+ \fi
+ % fix the (unused in this case) Vcont1/2 coords for label placement along the line
+ coordinate (pgfcirc@Vcont1) at (pgfcirc@Vto)
+ coordinate (pgfcirc@Vcont2) at (pgfcirc@Vfrom)
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto)
+ \fi
+ \else% american voltage
+ \ifpgf@circuit@bipole@voltageoutsideofsymbol
+ % if it is a battery, must put + and -
+
+ \ifpgf@circ@fixbatteries
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ \else
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ \else
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine
+\def\pgf@circ@drawvoltage{% node name
+ \pgfextra{ %WARNING: indentation is probably wrong
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \else
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \else
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+
+ % this must be set *before* changing for mirroring and inverting; in that case
+ % the xscale/yscale parameters take it into account
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@voltage@label@where{90}
+ \fi
+
+ % magic to counteract the scale and yscale effects (there should be a better way...)
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ % take into account scaling
+ \setscaledRlenforclass
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\eudist{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}} }
+ { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+ % find the height of the bipole or use a default value
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
+ \pgfkeysifdefined{\pgf@temp}
+ {\pgfmathsetmacro{\partheightf}{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
+ \edef\partheight{\partheightf\pgf@circ@scaled@Rlen}}
+ {\edef\partheight{(.5\pgf@circ@scaled@Rlen)}} %fallback to fixed value
+ \newdimen{\alshift}
+ % this is more or less the same of the legacy code; we shift the american label a bit
+ % outside the (+) -- (-) line
+ \pgfmathsetlength{\alshift}{(\ctikzvalof{voltage/american label distance}-0.6)*\partheight}
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ }%end pgfextra
+
+ \ifpgf@circuit@bipole@isvoltage
+ \pgf@circ@drawvoltagegenerator
+ \else
+ \pgf@circ@drawvoltagegeneric
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@straight
+ coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
+ \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
+ at (Vlab) {\pgf@circ@finallabels{voltage/label}}
+ \else
+ \ifpgf@circuit@europeanvoltage
+ coordinate (Vlab) at ($(pgfcirc@Vcont1)!0.5!(pgfcirc@Vcont2)$)
+ \else
+ coordinate (Vlab) at ($(pgfcirc@Vfrom)!0.5!(pgfcirc@Vto)$)
+ \ifpgf@circuit@bipole@isvoltage\else
+ % add a bit of space for american labels above their symbols in the normal case. You can avoid that
+ % with voltage/american label distance=0.5 (it's measured from the center of the component, in heights)
+ coordinate (Vlab) at ($(Vlab) ! \alshift ! \pgf@circ@bipole@voltage@label@where :(pgfcirc@Vto)$)
+ \fi
+ \fi
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
+ \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
+ at (Vlab) {\pgf@circ@finallabels{voltage/label}}
+ \fi
+}%end drawvoltages
+%%%---------- close: tex/pgfcircvoltage
+%%%%%%%%%%% Springe nach tex/pgfcirccurrent
+%%%---------- open: tex/pgfcirccurrent.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Current handling
+
+%% styles
+\ctikzset{bipole current style/.style={}}
+\tikzset{bipole current style/.code={
+ \ctikzset{bipole current style/.style={#1}}
+}}
+\tikzset{bipole current append style/.code={
+ \ctikzset{bipole current style/.append style={#1}}
+}}
+
+%% Options
+\ctikzset{i^>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i>^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i>_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i^</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i<^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i<_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i/.code = {
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+ \ctikzsetvalof{bipole/current/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ %reverse current direction for voltage sources
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@isvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below }
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \fi\fi\fi
+ }
+}
+
+\ifpgf@circ@oldvoltagedirection
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+\else
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
+\fi
+\ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
+\ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
+\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
+
+%% Output routine
+\def\pgf@circ@drawcurrent{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@bipole@current@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@current@label@where{+90}
+ \fi
+ }
+
+ \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
+ \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
+ (\tikztostart)--(\tikztotarget)
+ \else% normal bipole or source
+ \ifpgf@circuit@bipole@current@before
+ (\tikztostart)--(anchorstartnode)
+ \else
+ (anchorendnode)--(\tikztotarget)
+ \fi
+ \fi
+ \ifpgf@circuit@bipole@current@backward
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@ffffff}{180}
+ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \fi
+ coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff,
+ anchor=center](Iarrow)
+ (Iarrow.\pgf@circ@bipole@current@label@where)
+ node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style]
+ (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}}
+}
+
+%%%---------- close: tex/pgfcirccurrent
+%%%%%%%%%%% Springe nach tex/pgfcircflow
+%%%---------- open: tex/pgfcircflow.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% flow handling
+
+%% styles
+\ctikzset{bipole flow style/.style={}}
+\tikzset{bipole flow style/.code={
+ \ctikzset{bipole flow style/.style={#1}}
+}}
+\tikzset{bipole flow append style/.code={
+ \ctikzset{bipole flow style/.append style={#1}}
+}}
+
+%% Options
+\ctikzset{f^>/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/curflowrent/y position = above
+ }
+}
+
+\ctikzset{f_>/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f>^/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f>_/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f^</.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f_</.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f<^/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f<_/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
+\ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
+\ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
+\ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
+
+\ctikzset{f/.code = {
+ \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
+ \ctikzsetvalof{bipole/flow/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}
+}
+
+%% Output routine
+\def\pgf@circ@drawflow{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@bipole@flow@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@flow@label@where{+90}
+ \fi
+ }
+
+ \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
+ \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
+ (\tikztostart)--(\tikztotarget)
+ \else% normal bipole or source
+ \ifpgf@circuit@bipole@flow@before
+ (\tikztostart)--(anchorstartnode)
+ \else
+ (anchorendnode)--(\tikztotarget)
+ \fi
+ \fi
+ \pgfextra{
+ \ifpgf@circuit@bipole@flow@backward
+ \ifpgf@circuit@bipole@flow@below
+ \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \else
+ \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \fi
+ \pgfmathsubtract{\pgf@circ@ffffff}{180}
+ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \else
+ \ifpgf@circuit@bipole@flow@below
+ \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \else
+ \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \fi
+ \fi
+ }
+ coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset, anchor=center](Farrowpos)
+ (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style]
+ (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}}
+}
+
+%%%---------- close: tex/pgfcircflow
+
+% notice that the default is nooldvoltagedirection; it's not explicitly set to allow for the warning
+\ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels}
+
+\ProcessOptions\relax
+
+%%%%%%%%%%% Springe nach tex/pgfcircpath
+%%%---------- open: tex/pgfcircpath.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+
+\def\pgf@circ@direction{0.0}
+
+% Names
+\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
+\ctikzset{n/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/name=#1}
+}}
+
+% Reflect the node along
+\ctikzset{mirrored/.is choice}
+\ctikzset{mirror value/.initial=1}
+\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
+\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
+\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
+
+% Invert node along path
+\ctikzset{inverted/.is choice}
+\ctikzset{invert value/.initial=1}
+\ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
+\ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
+\ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
+\newif\ifpgf@circuit@bipole@inverted
+\ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
+
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+
+% Initialize paths
+\def\pgfcircresetpath{
+ \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
+ bipole/inverted=false, bipole/kind=,
+ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
+ bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
+ bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
+ bipole/current/y position=above, bipole/current/direction=forward,
+ mirrored=false
+ }
+}
+
+%% Helper function for path-function to ensure using anchors between nodes
+\def\set@explicit@center@anchor#1{
+ \pgfutil@ifundefined{pgf@sh@ns@#1}
+ {
+ %This coordinate is no node(but a relative position or a coordinate), no further handling needed
+ }{
+ \pgfutil@in@.{#1}
+ \ifpgfutil@in@
+ % Anchor is used, do nothing!
+ \else%
+ \let\tikz@moveto@waiting=\relax
+ \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
+ \edef#1{#1.center}%ensure using center anchor
+ \fi
+}
+}
+
+
+%% Generic bipole path
+%% I am not user what the second argument is needed for
+\def\pgf@circ@bipole@path#1#2{
+
+ \pgfextra{
+ \set@explicit@center@anchor{\tikztostart}
+ \set@explicit@center@anchor{\tikztotarget}
+ \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
+ \ctikzset{bipole/kind = #1}
+ \edef\pgf@temp{\ctikzvalof{bipole/name}}
+ \def\pgf@circ@temp{}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = #1\pgf@circ@rand} % create it (re-usage should not create problem, but...)
+ \fi
+ }
+
+ (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
+ (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
+ \pgfextra{
+ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathround{\pgfmathresult}
+ \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
+ \pgfsyssoftpath@setcurrentpath{\myp@th}
+ }
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
+ \fi
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
+ node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
+ (\ctikzvalof{bipole/name}) {}
+ \ifpgf@circuit@bipole@inverted
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
+ \fi
+ \else
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
+ \fi
+ \fi
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
+ (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+
+ \drawpoles
+ \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
+ \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
+ \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
+ \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
+ \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ (\ctikzvalof{bipole/name}end)%Move to end of path
+ \else
+ ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
+ %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
+
+ \fi
+ % reset
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ \tikztonodes%draw pending nodes an path
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.initial=none}
+\ctikzset{bipole/nodes/right/.initial=none}
+\tikzset{bipole nodes/.style n args={2}{%
+ \circuitikzbasekey/bipole/nodes/left=#1,
+ \circuitikzbasekey/bipole/nodes/right=#2
+ }
+}
+
+%% Easily usable styles
+
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+
+% rectjoinfill workarounds
+
+\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
+ \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
+ \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
+}
+
+%% Path definitions
+\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
+\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
+\def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
+\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
+\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
+\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
+\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
+\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
+\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
+\def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
+\def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
+%% polar capacitor is deprectaed, use curved capacitor instead
+\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
+\def\pgf@circ@ccapacitor@path#1{\pgf@circ@bipole@path{ccapacitor}{#1}}
+\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
+\def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
+\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
+\def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
+\def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
+\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
+\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
+\def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
+\def\pgf@circ@inductor@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductor@path{#1}%
+ \else%
+ \pgf@circ@americaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@vinductor@path#1{
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@veuropeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@vcuteinductor@path{#1}%
+ \else%
+ \pgf@circ@vamericaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@inductivesens@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductivesens@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductivesens@path{#1}%
+ \else%
+ \pgf@circ@americaninductivesens@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
+\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
+\def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
+\def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
+\def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
+\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
+\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
+\def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
+\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
+\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
+\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
+\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
+\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
+\def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
+\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
+\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
+\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
+\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
+\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
+\def\pgf@circ@ecsource@path#1{\pgf@circ@bipole@path{ecsource}{#1}}
+\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
+\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
+\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
+\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
+\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
+\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
+\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
+\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
+\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
+\def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
+\def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
+\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
+\def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
+\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
+\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
+\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
+\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
+\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
+\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
+\def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
+\def\pgf@circ@empty@path#1{}
+\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
+\def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
+\def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
+\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
+\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
+\def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
+\def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
+\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
+\def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
+\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
+\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
+\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
+\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
+
+\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
+\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
+\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
+
+\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
+\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
+\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
+\def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
+\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
+\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
+\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
+\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
+\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
+\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
+\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
+\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
+\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
+\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
+\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
+\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
+\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
+\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
+\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
+
+%%Mechanical
+\def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
+\def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
+\def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
+\def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
+
+%% Styles
+
+\def\comnpatname{\ifpgf@circuit@compat *\else\fi}
+\def\compattikzset#1{\tikzset{\comnpatname#1}}
+
+%\def\ctikzsetbipole#1#2{%
+% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
+%}
+
+\compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
+\compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
+\compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
+\compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
+\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
+\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
+\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
+\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
+\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
+\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
+\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
+\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
+\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
+\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
+\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
+\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
+\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
+\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
+\compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+% polar capacitor is deprecated, use curved capacitor instead
+\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
+\compattikzset{curved capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ccapacitor@path, l=#1}}
+\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
+\compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
+\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
+\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
+\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
+\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
+\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
+\compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
+\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
+\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
+\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
+\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
+\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
+\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
+\compattikzset{transmission line/.style = {tline = #1}}
+\compattikzset{TL/.style = {tline = #1}}
+\compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
+\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{empty controlled source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
+\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
+
+
+\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
+\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
+\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
+\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
+\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
+\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
+
+\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+\compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
+
+\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
+\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
+\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
+\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
+
+\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
+\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
+\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
+\compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
+\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
+\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
+\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
+\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
+\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
+\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
+\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
+\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
+\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
+\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
+\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
+\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
+\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
+\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
+\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
+
+% % % % % %
+% % Begin of Diodes
+% % % % % %
+
+\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
+\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
+\def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
+\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
+\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
+\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
+\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
+\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
+\def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
+\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
+\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
+\def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
+\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
+\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
+\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
+\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
+\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
+\def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
+
+\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
+\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
+\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
+\compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
+\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
+\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
+\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
+\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
+\compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
+\compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
+\compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
+
+\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
+\compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
+\compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
+%\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
+
+\compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
+\compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
+\compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
+\compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
+\compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
+\compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
+\compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
+\compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
+\compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
+\compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
+\compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
+
+%% Define Shortcuts
+\compattikzset{Do/.style = {\comnpatname empty diode}}
+\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
+\compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
+\compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
+\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
+\compattikzset{pDo/.style = {\comnpatname empty photodiode}}
+\compattikzset{leDo/.style = {\comnpatname empty led}}
+\compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
+\compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
+\compattikzset{Tro/.style = {\comnpatname empty triac}}
+
+\compattikzset{D*/.style = {\comnpatname full diode}}
+\compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
+\compattikzset{zD*/.style = {\comnpatname full Zener diode}}
+\compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
+\compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
+\compattikzset{pD*/.style = {\comnpatname full photodiode}}
+\compattikzset{leD*/.style = {\comnpatname full led}}
+\compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
+\compattikzset{Ty*/.style = {\comnpatname full thyristor}}
+\compattikzset{Tr*/.style = {\comnpatname full triac}}
+
+\compattikzset{D/.style = {\comnpatname diode}}
+\compattikzset{tD/.style = {\comnpatname tunnel diode}}
+\compattikzset{zD/.style = {\comnpatname Zener diode}}
+\compattikzset{zzD/.style = {\comnpatname ZZener diode}}
+\compattikzset{sD/.style = {\comnpatname Schottky diode}}
+\compattikzset{pD/.style = {\comnpatname photodiode}}
+\compattikzset{leD/.style = {\comnpatname led}}
+\compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
+\compattikzset{Ty/.style = {\comnpatname thyristor}}
+\compattikzset{Tr/.style = {\comnpatname triac}}
+
+\compattikzset{D-/.style = {\comnpatname stroke diode}}
+\compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
+\compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
+\compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
+\compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
+\compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
+\compattikzset{leD-/.style = {\comnpatname stroke led}}
+\compattikzset{VC-/.style = {\comnpatname stroke varcap}}
+\compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
+\compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+\compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
+
+% % % % % %
+% % End of Diodes
+% % % % % %
+
+
+\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
+\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
+\compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
+\compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
+\compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
+\compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
+\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
+\compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
+\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
+
+\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
+\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
+\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
+\tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
+
+% cute switches
+%% closed cute switch
+\def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
+\compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
+\compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
+
+%% open cute switch
+\def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
+\compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
+\compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
+
+%% closing cute switch
+\def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
+\compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
+\compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
+
+%% opening cute switch
+\def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
+\compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
+\compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
+
+
+% short forms
+\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
+
+\compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
+\compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
+
+\compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
+\compattikzset{isource/.style = {\comnpatname current source = #1}}
+\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{ecsource/.style = {\comnpatname empty controlled source = #1}}
+\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
+\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+
+\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+
+\compattikzset{R/.style= {\comnpatname resistor = #1}}
+\compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
+\compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
+\compattikzset{thR/.style= {\comnpatname thermistor = #1}}
+\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
+\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
+\compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
+\compattikzset{C/.style = {\comnpatname capacitor = #1}}
+\compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
+%% pC is deprecated, use cC instead
+\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
+\compattikzset{cC/.style = {\comnpatname curved capacitor = #1}}
+\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
+\compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
+\compattikzset{L/.style = {\comnpatname inductor = #1}}
+\compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
+\compattikzset{V/.style = {\comnpatname voltage source = #1}}
+\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
+\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
+ \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
+ \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
+ \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+%current sources
+\compattikzset{I/.style = {\comnpatname current source = #1}}
+\compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
+ \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
+ \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
+ \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+% cute sources
+\def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
+\compattikzset{cute european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
+\compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
+
+\def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
+\compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
+\compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
+
+\def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
+\compattikzset{cute european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
+\compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
+
+\def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
+\compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
+\compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
+
+% noise sources
+\def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
+\compattikzset{noise voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceN@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
+\compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
+
+\def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
+\compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
+\compattikzset{nI/.style= {\comnpatname noise current source= #1}}
+
+% resistive sensor american style
+\def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
+\compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
+\compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
+\compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
+
+\compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
+\compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
+
+\compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
+\compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
+\compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
+\compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
+\compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
+
+\compattikzset{Mr/.style = {\comnpatname memristor}}
+
+\compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
+\compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
+\compattikzset{spst/.style = {\comnpatname switch = #1}}
+
+\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
+
+\compattikzset{vdd/.style = {\comnpatname vcc = #1}}
+\compattikzset{vss/.style = {\comnpatname vee = #1}}
+
+% activate the to-style crossing
+\def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
+\compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
+\compattikzset{xing/.style= {\comnpatname crossing= #1}}
+
+%% loudspeaker and microphone
+
+\def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
+\compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
+
+\def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
+\compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
+
+% more instrument
+\def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
+\compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
+\def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
+\compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
+\def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
+\compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
+% current loop probes
+\def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
+\compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
+\def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
+\compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
+% qucs-style probes
+\def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
+\compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
+\def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
+\compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
+\def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
+\compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
+% multiwire(s)
+\def\pgf@circ@bmultiwire@path#1{\pgf@circ@bipole@path{bmultiwire}{#1}}
+\compattikzset{bmultiwire/.style = {\circuitikzbasekey,
+/tikz/to path=\pgf@circ@bmultiwire@path, l=#1}}
+\def\pgf@circ@multiwire@path#1{\pgf@circ@bipole@path{multiwire}{#1}}
+\compattikzset{multiwire/.style = {\circuitikzbasekey,
+/tikz/to path=\pgf@circ@multiwire@path, l=#1}}
+
+% reed switches
+\def\pgf@circ@reed@path#1{\pgf@circ@bipole@path{reed}{#1}}
+\compattikzset{reed/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@reed@path, l=#1}}
+
+% Transistor like bipoles
+
+\def\pgf@circ@trans@path#1#2{
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{bipole/name}}
+ \def\pgf@circ@temp{#2}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
+ \fi
+ }
+ \ifpgf@circuit@bipole@inverted
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathadd{\pgfmathresult}{-90}
+ \pgfmathround{\pgfmathresult}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {}
+ node {\ctikzvalof{bipole/label/name}}
+ \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+ (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \drawpoles
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+\def\pgf@circ@definetranspath#1{
+ \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
+}
+
+\pgf@circ@definetranspath{elmech}
+\pgf@circ@definetranspath{nmos}
+\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{hemt}
+\pgf@circ@definetranspath{npn}
+\pgf@circ@definetranspath{pnp}
+\pgf@circ@definetranspath{nfet}
+\pgf@circ@definetranspath{nigfete}
+\pgf@circ@definetranspath{nigfetd}
+\pgf@circ@definetranspath{nigfetebulk}
+\pgf@circ@definetranspath{pfet}
+\pgf@circ@definetranspath{pigfete}
+\pgf@circ@definetranspath{pigfetd}
+\pgf@circ@definetranspath{pigfetebulk}
+\pgf@circ@definetranspath{njfet}
+\pgf@circ@definetranspath{pjfet}
+\pgf@circ@definetranspath{pigbt}
+\pgf@circ@definetranspath{nigbt}
+\pgf@circ@definetranspath{Lpigbt}
+\pgf@circ@definetranspath{Lnigbt}
+%%%---------- close: tex/pgfcircpath
+
+\ifpgf@circ@siunitx
+ \RequirePackage{xstring}[2009/03/13]
+ %\expandafter\let\csname angstrom\endcsname\relax
+ \RequirePackage{siunitx}
+\fi
+
+\ifpgf@circ@explicitvdir\else
+ \PackageWarningNoLine{circuitikz}{%
+ You did not specify one of the voltage directions:\MessageBreak
+ \space\space oldvoltagedirection, nooldvoltagedirection, \MessageBreak
+ \space\space RPvoltages or EFvoltages \MessageBreak
+ Default directions may have changed, \MessageBreak
+ please check the manual%
+ }
+\fi
+
+\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
+%override (unused) circuitikz environment for compability to externalization)
+\let\circuitikz\tikzpicture
+\let\endcircuitikz\endtikzpicture
+
+\endinput
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index 162020c387..0460d13c90 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -12,8 +12,8 @@
\NeedsTeXFormat{LaTeX2e}
-\def\pgfcircversion{1.0}
-\def\pgfcircversiondate{2020/02/04}
+\def\pgfcircversion{1.0.1}
+\def\pgfcircversiondate{2020/02/22}
\ProvidesPackage{circuitikz}%
[\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
@@ -28,6 +28,7 @@
% latex' which we have lost in the transition
%
\usetikzlibrary{arrows.meta, bending}
+\usetikzlibrary{fpu} % may be needed for use fpu reciprocal (v1.0.1)
% The options are listed in the manual in this order
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
index f550af644b..ae0f8ee642 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
@@ -726,6 +726,7 @@
\ctikzset{bipoles/squid/width/.initial=.60}
\ctikzset{bipoles/barrier/height/.initial=.60}
\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/openbarrier/gap/.initial=0.5}
\ctikzset{bipoles/thermocouple/height/.initial=.250}
\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
\ctikzset{bipoles/thermocouple/width/.initial=.140}
@@ -1728,6 +1729,24 @@
\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+%
+% Flipping arrows in LED and photodiodes
+%
+\newif\ifpgf@led@fliparrows
+\newif\ifpgf@pd@fliparrows
+\pgf@led@fliparrowsfalse
+\pgf@pd@fliparrowsfalse
+%
+% by default the arrows start (LED) and go (PD) to the anode.
+%
+\ctikzset{led arrows from anode/.code=\pgf@led@fliparrowsfalse}
+\ctikzset{pd arrows to anode/.code=\pgf@pd@fliparrowsfalse}
+%
+% but they can start form the cathode (LED) or go to it (PD)
+%
+\ctikzset{led arrows from cathode/.code=\pgf@led@fliparrowstrue}
+\ctikzset{pd arrows to cathode/.code=\pgf@pd@fliparrowstrue}
+
\newif\ifpgf@circuit@strokediode
\newif\ifpgf@circuit@fulldiode
\pgf@circuit@strokediodefalse
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index cd4b14fcab..a315f97806 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -278,6 +278,27 @@
\pgf@circ@draworfill
}
+%
+% generic crossed, suggested by Radványi Patrik Tamás <patrikradvanyi@gmail.com>
+% inherit "generic" properties
+%
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{xgeneric}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ % cross it
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
%% Generic empty tunable
\pgfcircdeclarebipolescaled{resistors}
{}
@@ -2128,6 +2149,50 @@
\endpgfscope
}
+%
+% draw LED arrows
+%
+\def\pgf@circ@draw@ledarrows{%
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \ifpgf@led@fliparrows
+ \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{0.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{1.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \else
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \fi
+}
+%
+% ---and photodiode arrows
+%
+\def\pgf@circ@draw@pdarrows{%
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \ifpgf@pd@fliparrows
+ \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{0.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{1.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \else
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \fi
+}
%% Black light emitting diode
\pgfcircdeclarebipolescaled{diodes}
{}
@@ -2150,15 +2215,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfsetarrowsend{latexslim}
- \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
- \pgfusepath{draw}
-
+ \pgf@circ@draw@ledarrows
}
%% Black photodiode
@@ -2183,14 +2240,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfsetarrowsstart{latexslim}
- \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
- \pgfusepath{draw}
+ \pgf@circ@draw@pdarrows
}
%% Black varcap
@@ -2355,14 +2405,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfsetarrowsend{latexslim}
- \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
- \pgfusepath{draw}
+ \pgf@circ@draw@ledarrows
}
%% Empty photodiode
@@ -2382,14 +2425,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfsetarrowsstart{latexslim}
- \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
- \pgfusepath{draw}
+ \pgf@circ@draw@pdarrows
}
%% Empty varcap
@@ -5059,6 +5095,34 @@
\pgfusepath{draw}
}
+%
+% open version of the barrier symbol
+% suggested by Radványi Patrik Tamás <patrikradvanyi@gmail.com>
+%
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/barrier/height}}
+{openbarrier}
+{\ctikzvalof{bipoles/barrier/height}}
+{\ctikzvalof{bipoles/barrier/width}}
+{
+ % this is set with normal wire linewidth
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/openbarrier/gap}*\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/openbarrier/gap}*\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+
+ % do the cross part
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
%% Lamp
\pgfcircdeclarebipolescaled{misc}
{}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
index 337443da27..858e388363 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
@@ -92,8 +92,10 @@
\pgfextra{
\pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
{\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
- \pgfmathround{\pgfmathresult}
+ % DO NOT ROUND HERE! pgfcirclabel.tex will do that when needed
+ % \pgfmathround{\pgfmathresult}
\edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
+ % \typeout{DIRECTION:\pgf@circ@direction}
\pgfsyssoftpath@setcurrentpath{\myp@th}
}
\pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
@@ -311,6 +313,7 @@
\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@xgeneric@path#1{\pgf@circ@bipole@path{xgeneric}{#1}}
\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
@@ -329,6 +332,7 @@
\def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@openbarrier@path#1{\pgf@circ@bipole@path{openbarrier}{#1}}
\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
@@ -441,6 +445,7 @@
\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\compattikzset{xgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@xgeneric@path, l=#1}}
\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
@@ -453,6 +458,7 @@
\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\compattikzset{openbarrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@openbarrier@path}}
\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
index 81192ba913..2860ef9a32 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
@@ -65,5 +65,19 @@
\def\ctikztextnot#1{$\overline{\hbox{#1}}$}
\fi\fi\fi
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% switch to use fpu in reciprocal scale transformations
+%%
+%% 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
+}}}%
\endinput
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz-1.0.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz-1.0.tex
new file mode 100644
index 0000000000..1a1b42393c
--- /dev/null
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz-1.0.tex
@@ -0,0 +1,19914 @@
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+\def\pgfcircversion{1.0}
+\def\pgfcircversiondate{2020/02/04}
+\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
+
+\usemodule[tikz]
+
+\startmodule[circuitikz-1.0]
+\usetikzlibrary[calc]
+\usetikzlibrary[arrows.meta, bending]
+
+\unprotect
+
+\edef\tikzatcode{\the\catcode`\@}
+\edef\tikzbarcode{\the\catcode`\|}
+\edef\tikzexclaimcode{\the\catcode`\!}
+\catcode`\@=11
+\catcode`\|=12
+\catcode`\!=12
+
+%%%%%%%%%%% Springe nach tex/pgfcirc.defines
+%%%---------- open: tex/pgfcirc.defines.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%
+%% Key managements
+
+\long\def\pgf@circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+%% Temporary Counters
+
+\newcount\pgf@circ@count@a
+\newcount\pgf@circ@count@b
+\newcount\pgf@circ@count@c
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinates
+\newdimen\pgf@circ@res@up
+\newdimen\pgf@circ@res@down
+\newdimen\pgf@circ@res@zero
+\newdimen\pgf@circ@res@left
+\newdimen\pgf@circ@res@right
+\newdimen\pgf@circ@res@other
+\newdimen\pgf@circ@res@step
+\newdimen\pgf@circ@res@temp
+% inital thickness
+\newdimen \pgfstartlinewidth
+
+% arrow tips, ported over old arrows library (deprecated)
+% see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
+% this was the original definition of latex' tips, renamed to avoid clashes
+%
+\pgfarrowsdeclare{latexslim}{latexslim}
+{
+ \pgfutil@tempdima=0.28pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfarrowsleftextend{+-4\pgfutil@tempdima}
+ \pgfarrowsrightextend{+6\pgfutil@tempdima}
+}
+{
+ \pgfutil@tempdima=0.28pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
+ {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
+ {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
+ {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
+ {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
+ {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
+ {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathclose
+ \pgfusepathqfill
+}
+
+\pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
+
+\def\pgf@circ@setifdefinedfill#1#2{%
+ % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
+ % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
+ \ifdefined\ctikzclass
+ \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
+ {% yes, it's defined
+ \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}%
+ \ifx\@@tmp\@@none % but it's none
+ \pgfusepath{#2}%
+ \else
+ \pgfsetfillcolor{\@@tmp}%
+ \pgfusepath{#1}%
+ \fi
+ }{% the class is defined but the fill key not; use #2
+ \pgfusepath{#2}%
+ }
+ \else
+ \pgfusepath{#2}%
+ \fi
+}
+
+%% Macro to fill or draw
+
+\def\pgf@circ@draworfill{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{draw,fill}{draw}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+}
+
+\def\pgf@circ@draworfillandclip{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
+ \pgfusepath{draw, clip}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, clip, fill}
+ \fi
+}
+
+\def\pgf@circ@maybefill{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{fill}{discard}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{fill}
+ \fi
+}
+
+%% Macros for setting linewidth
+% #1 is the legacy class (bipoles, tripoles) etc
+% #2 is the reference linewidth
+\def\pgf@circ@setlinewidth#1#2{%
+ \ifdefined\ctikzclass
+ \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}%
+ {% yes, it's defined
+ \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}%
+ \ifx\@@tmp\@@none % but it's none
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class
+ \else
+ \pgfsetlinewidth{\@@tmp #2}%
+ \fi
+ }{ % key not defined, do the legacy thing
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
+ }% Ok, do nothing
+ \else % no class
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
+ \fi
+}
+% use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case
+\ctikzset{none/thickness/.initial=1.0} % do not touch
+
+%% font changes compatible with plain/LaTeX/ConTeXt
+%% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment-537224605
+
+\ifpgfutil@format@is@latex
+ \long\def\pgf@circ@font@tiny{\tiny}
+ \long\def\pgf@circ@font@small{\small}
+ \long\def\pgf@circ@font@bold{\textbf}
+ \long\def\pgf@circ@font@boldmath{\boldmath}
+ \long\def\pgf@circ@font@sixbm{\fontsize{6}{7}\selectfont\boldmath}
+ \long\def\pgf@circ@font@tenbm{\fontsize{10}{12}\selectfont\boldmath}
+ \long\def\pgf@circ@font@twelve{\fontsize{12}{14}\selectfont}
+\else\ifpgfutil@format@is@plain
+ \long\def\pgf@circ@font@tiny{\fiverm}
+ \long\def\pgf@circ@font@small{\sevenrm}
+ \long\def\pgf@circ@font@bold#1{{\bf#1}}
+ \long\def\pgf@circ@font@boldmath{\bf} % to be tested
+ \long\def\pgf@circ@font@sixbm{\sevenrm\bf} %
+ \long\def\pgf@circ@font@tenbm{\tenrm\bf} %
+ \long\def\pgf@circ@font@twelve{\twelverm} %
+\else\ifpgfutil@format@is@context
+ \long\def\pgf@circ@font@tiny{\tfxx}
+ \long\def\pgf@circ@font@small{\tfx}
+ \long\def\pgf@circ@font@bold{\bold}
+ \long\def\pgf@circ@font@boldmath{\bold} % to be tested
+ \long\def\pgf@circ@font@sixbm{\tfx\bold} %
+ \long\def\pgf@circ@font@tenbm{\normal\bold}%
+ \long\def\pgf@circ@font@twelve{\tfa} %
+\fi\fi\fi
+
+
+%
+% Thanks to Phelype Oleinik https://tex.stackexchange.com/a/520806/38080
+%
+% this is needed to avoid problems with \ConTeXt
+\ifcsname normalunexpanded\endcsname
+ \let\pgfcircutil@unexpanded\normalunexpanded
+\else
+ \let\pgfcircutil@unexpanded\unexpanded
+\fi
+% minimally expand a pgfkey to check if it's {}/undefined or filled.
+\def\unexpandedvalueof#1{%
+ \pgfcircutil@unexpanded\expandafter\expandafter
+ \expandafter\pgf@circ@valueof@chk\pgfkeysvalueof{#1}}
+\def\pgf@circ@valueof@chk#1{%
+ \ifx\relax#1%
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {{}}% #1 is \relax, so consider empty
+ {\expandafter{#1}}% otherwise, leave the key after one more expansion
+}%
+
+% voltage options
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circuit@compat
+\newif\ifpgf@circ@oldvoltagedirection % default false
+\newif\ifpgf@circ@explicitvdir
+\newif\ifpgf@circ@fixbatteries
+
+\ctikzset{voltage dir/.is choice}
+\ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
+\ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
+\tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
+
+% Option ">" for twoports
+\newif\ifpgf@circuit@inputarrow
+\ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
+
+% Option "boxed" for nodes and twoports
+\newif\ifpgf@circuit@boxed
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+
+% Option "dashed" for nodes and twoports
+\newif\ifpgf@circuit@dashed
+\pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
+\ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
+
+% Option "t=*" for nodes
+\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
+
+\ctikzset{current arrow scale/.initial=16}
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{tripoles/thickness/.initial=2}
+\ctikzset{quadpoles/thickness/.initial=2}
+\ctikzset{nodes width/.initial=.04}
+
+% Base len for all circuitikz
+\newdimen\pgf@circ@Rlen
+% scaled length for internal use in scalable shapes
+\newdimen\pgf@circ@scaled@Rlen
+\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}}
+\pgf@circ@Rlen = 1.4cm
+% by default scale is 1.0
+\pgf@circ@scaled@Rlen=\pgf@circ@Rlen
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% main style definitions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+% load a style file: search ctikzstyle-NAME.tex in path
+\def\ctikzloadstyle#1{%
+ \pgfutil@InputIfFileExists{ctikzstyle-#1}{}{%
+ \tikzerror{I did not find the circuitikz style #1}}%
+}
+
+% load and enact a style
+\def\ctikzsetstyle#1{%
+ \ctikzloadstyle{#1}%
+ \tikzset{#1 circuit style}%
+}
+
+% global style parameters
+\ctikzset{default/scale/.initial=1.0} % do not touch
+\ctikzset{default/fill/.initial=none} % do not touch
+\ctikzset{default/thickness/.initial=none} % do not touch
+% default is use as the generic default style for bipoles
+
+% mostly bipoles:
+
+\ctikzset{resistors/scale/.initial=1.0}
+\ctikzset{resistors/fill/.initial=none}
+\ctikzset{resistors/thickness/.initial=none}
+
+\ctikzset{capacitors/scale/.initial=1.0}
+\ctikzset{capacitors/fill/.initial=none}
+\ctikzset{capacitors/thickness/.initial=none}
+
+\ctikzset{inductors/scale/.initial=1.0}
+\ctikzset{inductors/fill/.initial=none}
+\ctikzset{inductors/thickness/.initial=none}
+
+\ctikzset{diodes/scale/.initial=1.0}
+\ctikzset{diodes/fill/.initial=none}
+\ctikzset{diodes/thickness/.initial=none}
+
+\ctikzset{batteries/scale/.initial=1.0}
+\ctikzset{batteries/fill/.initial=none}
+\ctikzset{batteries/thickness/.initial=none}
+
+\ctikzset{sources/scale/.initial=1.0}
+\ctikzset{sources/fill/.initial=none}
+\ctikzset{sources/thickness/.initial=none}
+
+\ctikzset{csources/scale/.initial=1.0}
+\ctikzset{csources/fill/.initial=none}
+\ctikzset{csources/thickness/.initial=none}
+
+\ctikzset{instruments/scale/.initial=1.0}
+\ctikzset{instruments/fill/.initial=none}
+\ctikzset{instruments/thickness/.initial=none}
+
+\ctikzset{mechanicals/scale/.initial=1.0}
+\ctikzset{mechanicals/fill/.initial=none}
+\ctikzset{mechanicals/thickness/.initial=none}
+
+\ctikzset{misc/scale/.initial=1.0}
+\ctikzset{misc/fill/.initial=none}
+\ctikzset{misc/thickness/.initial=none}
+
+\ctikzset{blocks/scale/.initial=1.0}
+\ctikzset{blocks/fill/.initial=none}
+\ctikzset{blocks/thickness/.initial=none}
+
+% mostly nodes
+
+\ctikzset{grounds/scale/.initial=1.0}
+\ctikzset{grounds/fill/.initial=none}
+\ctikzset{grounds/thickness/.initial=none}
+
+\ctikzset{power supplies/scale/.initial=1.0}
+\ctikzset{power supplies/fill/.initial=none}
+\ctikzset{power supplies/thickness/.initial=none}
+
+\ctikzset{transistors/scale/.initial=1.0}
+\ctikzset{transistors/fill/.initial=none}
+\ctikzset{transistors/thickness/.initial=none}
+
+\ctikzset{tubes/scale/.initial=1.0}
+\ctikzset{tubes/fill/.initial=none}
+\ctikzset{tubes/thickness/.initial=none}
+
+\ctikzset{RF/scale/.initial=1.0}
+\ctikzset{RF/fill/.initial=none}
+\ctikzset{RF/thickness/.initial=none}
+
+\ctikzset{electromechanicals/scale/.initial=1.0}
+\ctikzset{electromechanicals/fill/.initial=none}
+\ctikzset{electromechanicals/thickness/.initial=none}
+
+% transformers go with inductors
+\ctikzset{amplifiers/scale/.initial=1.0}
+\ctikzset{amplifiers/fill/.initial=none}
+\ctikzset{amplifiers/thickness/.initial=none}
+
+\ctikzset{switches/scale/.initial=1.0}
+\ctikzset{switches/fill/.initial=none}
+\ctikzset{switches/thickness/.initial=none}
+
+\ctikzset{logic ports/scale/.initial=1.0}
+\ctikzset{logic ports/fill/.initial=none}
+\ctikzset{logic ports/thickness/.initial=none}
+
+\ctikzset{flipflops/scale/.initial=1.0}
+\ctikzset{flipflops/fill/.initial=none}
+\ctikzset{flipflops/thickness/.initial=none}
+
+\ctikzset{muxdemuxes/scale/.initial=1.0}
+\ctikzset{muxdemuxes/fill/.initial=none}
+\ctikzset{muxdemuxes/thickness/.initial=none}
+
+\ctikzset{chips/scale/.initial=1.0}
+\ctikzset{chips/fill/.initial=none}
+\ctikzset{chips/thickness/.initial=none}
+
+\ctikzset{displays/scale/.initial=1.0}
+\ctikzset{displays/fill/.initial=none}
+\ctikzset{displays/thickness/.initial=none}
+
+% grounds and power supplies
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/ground/connectionthickness/.initial=1}
+\ctikzset{monopoles/ground/thickness/.initial=2}
+\ctikzset{monopoles/rground/thickness/.initial=2}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/vcc/arrow/.initial=legacy}
+\ctikzset{monopoles/vee/arrow/.initial=legacy}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
+\ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
+\ctikzset{monopoles/waves/width/.initial=0.5}
+
+% microstrips
+\ctikzset{bipoles/mstline/height/.initial=0.3}
+\ctikzset{bipoles/mstline/width/.initial=1.2}
+\pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
+\ctikzset{monopoles/msport/width/.initial=.5}
+\ctikzset{monopoles/msrstub/height/.initial=1.0}
+\ctikzset{monopoles/msrstub/width/.initial=0.6}
+
+% microphone and loudspeaker
+\ctikzset{bipoles/loudspeaker/height/.initial=.8}
+\ctikzset{bipoles/loudspeaker/depth/.initial=.3}
+\ctikzset{bipoles/loudspeaker/width/.initial=.8}
+\ctikzset{bipoles/mic/height/.initial=1.2}
+\ctikzset{bipoles/mic/depth/.initial=.0}
+\ctikzset{bipoles/mic/width/.initial=.8}
+
+% Zig Zag resistors
+\ctikzset{resistors/zigs/.initial=3}
+\ctikzset{resistors/width/.code={%
+ \ctikzset{bipoles/resistor/width=#1}%
+ \ctikzset{bipoles/vresistor/width=#1}%
+ \ctikzset{bipoles/potentiometer/width=#1}%
+ \ctikzset{bipoles/resistivesens/width=#1}%
+ \ctikzset{bipoles/photoresistor/width=#1}%
+ \ctikzset{bipoles/thermistor/width=#1}%
+ \ctikzset{bipoles/thermistorntc/width=#1}%
+ \ctikzset{bipoles/thermistorptc/width=#1}%
+ \ctikzset{bipoles/varistor/width=#1}%
+ \ctikzset{bipoles/generic/width=#1}%
+ \ctikzset{bipoles/generic potentiometer/width=#1}%
+ \ctikzset{bipoles/ageneric/width=#1}%
+ \ctikzset{bipoles/tgeneric/width=#1}%
+}}
+\ctikzset{wiper pos/.code={%
+ \ctikzset{bipoles/potentiometer/wiper pos=#1}%
+ \ctikzset{bipoles/generic potentiometer/wiper pos=#1}%
+}}
+% zigzag resistor
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/wiper pos/.initial=.5}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/resistivesens/height/.initial=.6}
+\ctikzset{bipoles/resistivesens/width/.initial=.8}
+% square resistors
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+
+%% Capacitors
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/height/.initial=.5}
+\ctikzset{bipoles/ecapacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/font/.initial=\pgf@circ@font@sixbm}
+%%% pcapacitor is deprecated
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/ccapacitor/height/.initial=.6}
+\ctikzset{bipoles/ccapacitor/width/.initial=.12}
+\ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/piezoelectric/height/.initial=.7}
+\ctikzset{bipoles/piezoelectric/width/.initial=.5}
+
+% Inductors
+\ctikzset{inductors/coils/.code={%
+ \ctikzset{bipoles/cuteinductor/coils=#1}%
+ \ctikzset{bipoles/cutechoke/coils=#1}%
+ \ctikzset{bipoles/americaninductor/coils=#1}%
+ \ctikzset{bipoles/vcuteinductor/coils=#1}%
+ \ctikzset{bipoles/vamericaninductor/coils=#1}%
+}}
+\ctikzset{inductors/width/.code={%
+ \ctikzset{bipoles/cuteinductor/width=#1}%
+ \ctikzset{bipoles/cutechoke/width=#1}%
+ \ctikzset{bipoles/americaninductor/width=#1}%
+ \ctikzset{bipoles/vcuteinductor/width=#1}%
+ \ctikzset{bipoles/vamericaninductor/width=#1}%
+ \ctikzset{bipoles/fullgeneric/width=#1}%
+ \ctikzset{bipoles/tfullgeneric/width=#1}%
+}}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
+\ctikzset{bipoles/cuteinductor/width/.initial=.6}
+\ctikzset{bipoles/cuteinductor/coils/.initial=5}
+\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+%% Cute choke settings
+\ctikzset{bipoles/cutechoke/height/.initial=.3}
+\ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
+\ctikzset{bipoles/cutechoke/width/.initial=.6}
+\ctikzset{bipoles/cutechoke/coils/.initial=5}
+\ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
+\ctikzset{bipoles/cutechoke/cstep/.initial=.3}
+\ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
+\ctikzset{bipoles/cutechoke/cthick/.initial=1}
+\newif\ifpgf@circuit@bipole@twolineschoke
+\pgf@circuit@bipole@twolineschokefalse
+\pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
+\ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
+\pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
+\ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
+%
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/americaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=5}
+\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+
+% Sources
+
+\ctikzset{bipoles/esource/height/.initial=.60}
+\ctikzset{bipoles/esource/width/.initial=.60}
+\ctikzset{bipoles/pvsource/height/.initial=.60}
+\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/oosource/height/.initial=.60}
+\ctikzset{bipoles/oosource/width/.initial=.60}
+\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/angle/.initial=80}
+\ctikzset{bipoles/dcisource/height/.initial=.60}
+\ctikzset{bipoles/dcisource/width/.initial=.60}
+\ctikzset{bipoles/dcvsource/height/.initial=.60}
+\ctikzset{bipoles/dcvsource/width/.initial=.60}
+\ctikzset{bipoles/vsourcetri/height/.initial=.60}
+\ctikzset{bipoles/vsourcetri/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/ecsource/height/.initial=.7}
+\ctikzset{bipoles/ecsource/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/battery2/height/.initial=.6}
+\ctikzset{bipoles/battery2/width/.initial=.3}
+
+% diodes
+
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
+\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
+\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+
+% switches
+
+\ctikzset{bipoles/spst/height/.initial=.35}
+\ctikzset{bipoles/spst/width/.initial=.35}
+\ctikzset{bipoles/spst/depth/.initial=.2}
+\ctikzset{bipoles/nos/height/.initial=.3}
+\ctikzset{bipoles/nos/width/.initial=.35}
+\ctikzset{bipoles/nos/depth/.initial=.2}
+\ctikzset{bipoles/ncs/height/.initial=.35}
+\ctikzset{bipoles/ncs/width/.initial=.35}
+\ctikzset{bipoles/ncs/depth/.initial=.2}
+%%% reed switch
+\ctikzset{bipoles/reed/height/.initial=.4}
+\ctikzset{bipoles/reed/width/.initial=.8}% 0.35 in nos
+\ctikzset{bipoles/reed/depth/.initial=.4}
+
+% misc
+
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
+\ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
+\ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
+%\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
+%\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
+% multiwire
+\ctikzset{bipoles/multiwire/height/.initial=0.4}
+\ctikzset{bipoles/multiwire/width/.initial=0.2}
+\ctikzset{bipoles/multiwire/spacing/.initial=0.05}
+
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/ohmmeter/height/.initial=.60}
+\ctikzset{bipoles/ohmmeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/height/.initial=.60}
+\ctikzset{bipoles/smeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/voltage/additional label shift/.initial=1}
+\ctikzset{bipoles/qmeter/depth/.initial=.40}
+\ctikzset{bipoles/qmeter/height/.initial=.80}
+\ctikzset{bipoles/qmeter/width/.initial=.60}
+% this must be specified for each one
+\ctikzset{bipoles/qvprobe/voltage/additional label shift/.initial=.5}
+\ctikzset{bipoles/qiprobe/voltage/additional label shift/.initial=.5}
+\ctikzset{bipoles/qpprobe/voltage/additional label shift/.initial=.5}
+\ctikzset{bipoles/iloop/width/.initial=.40}
+\ctikzset{bipoles/iloop/height/.initial=.60}
+
+\ctikzset{bipoles/oscope/height/.initial=.60}
+\ctikzset{bipoles/oscope/width/.initial=.60}
+\ctikzset{bipoles/oscope/voltage/additional label shift/.initial=1}
+
+
+% option to not rotate the new (Romano's) instruments
+\newif\ifpgf@circuit@straightinstruments\pgf@circuit@straightinstrumentstrue
+\pgfkeys{/tikz/straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}}
+\ctikzset{straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}}
+\pgfkeys{/tikz/rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}}
+\ctikzset{rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}}
+
+
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/bulb/height/.initial=.8}
+\ctikzset{bipoles/bulb/width/.initial=.8}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.2}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/bandstop/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+% crossing wires
+\ctikzset{bipoles/crossing/size/.initial=.2}
+
+% Transistors starts here
+
+\newif\ifpgf@circuit@trans@depletiontype
+\pgf@circuit@trans@depletiontypefalse
+
+\newif\ifpgf@circuit@mos@arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
+\pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
+\pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
+
+% Fixed label positions
+\newif\ifpgf@circuit@transisors@fixlabels
+\pgf@circuit@transisors@fixlabelstrue
+\pgfkeys{/tikz/center transistors text/.add code={}{\pgf@circuit@transisors@fixlabelstrue}}
+\ctikzset{fix transistors text/.add code={}{\pgf@circuit@transisors@fixlabelstrue}}
+\pgfkeys{/tikz/legacy transistors text/.add code={}{\pgf@circuit@transisors@fixlabelsfalse}}
+\ctikzset{legacy transistors text/.add code={}{\pgf@circuit@transisors@fixlabelsfalse}}
+
+% Option solderdot for fet
+\newif\ifpgf@circuit@fet@solderdot
+\pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+\ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+
+% Option bodydiode for fet
+\newif\ifpgf@circuit@fet@bodydiode
+\pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+\ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+
+% Option draw fet without gate connection
+\newif\ifpgf@circuit@bpt@drawgate
+\pgf@circuit@bpt@drawgatetrue
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+
+% Option draw bpt without base connection
+\newif\ifpgf@circuit@bpt@drawbase
+\pgf@circuit@bpt@drawbasetrue
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+
+% Option draw bpt with optical input
+\newif\ifpgf@circuit@bpt@drawphoto
+\pgf@circuit@bpt@drawphotofalse
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+
+% Option draw fet without bulk connection -- Added by Burak Kelleci
+\newif\ifpgf@circuit@bpt@drawbulk
+\pgfkeys{/tikz/bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
+\ctikzset{bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
+\pgfkeys{/tikz/nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
+\ctikzset{nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
+
+% Option draw pmos with empty circle
+\newif\ifpgf@circuit@pmos@emptycircle
+\pgf@circuit@pmos@emptycirclefalse
+\ctikzset{tripoles/pmos style/.is choice}
+\pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+% Option draw pmos with no circle
+\newif\ifpgf@circuit@pmos@nocircle
+\pgf@circuit@pmos@nocirclefalse
+\pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
+\ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
+% back to normal
+\pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
+\ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
+% arrows at the end, the correct way
+\newif\ifpgf@circuit@trans@arrowatend
+\pgf@circuit@trans@arrowatendfalse
+\ctikzset{transistors/arrow pos/.is choice}
+\ctikzset{transistors/arrow pos/legacy/.code={\pgf@circuit@trans@arrowatendfalse}}
+\ctikzset{transistors/arrow pos/end/.code={\pgf@circuit@trans@arrowatendtrue}}
+
+\newif\ifpgf@circuit@trans@ntype
+\pgf@circuit@trans@ntypetrue %default true
+%\newif\ifpgf@circuit@trans@ptype
+%\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/conn height/.initial=0}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/arrow pos/.initial=.6}
+\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/conn height/.initial=0}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/arrow pos/.initial=.4}
+\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pmos/curr direction/.initial=-1}
+
+\ctikzset{tripoles/hemt/width/.initial=.7}
+\ctikzset{tripoles/hemt/gate height/.initial=.35}
+\ctikzset{tripoles/hemt/base height/.initial=.5}
+\ctikzset{tripoles/hemt/conn height/.initial=0}
+\ctikzset{tripoles/hemt/height/.initial=1.1}
+\ctikzset{tripoles/hemt/base width/.initial=.5}
+\ctikzset{tripoles/hemt/gate width/.initial=.62}
+\ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/hemt/curr direction/.initial=1}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/conn height/.initial=0}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/conn height/.initial=0}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/conn height/.initial=.35}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/conn height/.initial=.35}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfete/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/base height/.initial=.45}
+\ctikzset{tripoles/npn/base height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/conn height/.initial=0}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/arrow pos/.initial=.5}
+\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/npn/curr direction/.initial=1}
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/base height/.initial=.45}
+\ctikzset{tripoles/pnp/base height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/conn height/.initial=0}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/arrow pos/.initial=.5}
+\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pnp/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/conn height/.initial=0}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/conn height/.initial=0}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lpigbt/width/.initial=.6}
+\ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lpigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lpigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/Lnigbt/width/.initial=.6}
+\ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lnigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lnigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/conn height/.initial=.35}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/njfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/conn height/.initial=.35}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pjfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/conn height/.initial=0}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/isfet/curr direction/.initial=1}
+%
+% multi-emitter and multi-collector BJTs by Romano Giannetti
+%
+\ctikzset{tripoles/bjt/emitters/.initial=1}
+\ctikzset{tripoles/bjt/collectors/.initial=1}
+\pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}}
+\pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}}
+\ctikzset{tripoles/bjt/pins width/.initial=0.3}
+\pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}}
+\ctikzset{tripoles/bjt/multi height/.initial=.5}
+\pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}}
+%
+\ctikzset{tripoles/bjt/width/.initial=.3}
+\ctikzset{tripoles/bjt/base height 2/.initial=.4}
+\ctikzset{tripoles/bjt/base height/.initial=1.1}
+\ctikzset{tripoles/bjt/height/.initial=.4}
+\ctikzset{tripoles/bjt/base width/.initial=1}
+\ctikzset{tripoles/bjt/arrow pos/.initial=.5}
+% do NOT touch these two!
+\ctikzset{tripoles/bjt/npn/curr direction/.initial=1}
+\ctikzset{tripoles/bjt/pnp/curr direction/.initial=-1}
+
+%% transistors stop here
+
+%% Logic ports
+
+\newif\ifpgf@circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
+ \tikzset{and port/.style={shape=european and port}}%
+ \tikzset{or port/.style={shape=european or port}}%
+ \tikzset{xor port/.style={shape=european xor port}}%
+ \tikzset{buffer port/.style={shape=european buffer port}}%
+ \tikzset{not port/.style={shape=european not port}}%
+ \tikzset{nand port/.style={shape=european nand port}}%
+ \tikzset{nor port/.style={shape=european nor port}}%
+ \tikzset{xnor port/.style={shape=european xnor port}}%
+}}
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
+ \tikzset{and port/.style={shape=american and port}}%
+ \tikzset{or port/.style={shape=american or port}}%
+ \tikzset{xor port/.style={shape=american xor port}}%
+ \tikzset{buffer port/.style={shape=american buffer port}}%
+ \tikzset{not port/.style={shape=american not port}}%
+ \tikzset{nand port/.style={shape=american nand port}}%
+ \tikzset{nor port/.style={shape=american nor port}}%
+ \tikzset{xnor port/.style={shape=american xnor port}}%
+}}
+
+\ctikzset{logic ports origin/.is choice}
+\ctikzset{logic ports origin/legacy/.code={
+ \ctikzset{tripoles/american and port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american nand port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american nor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american or port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american xor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american xnor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european and port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european nand port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european or port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european nor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european xor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european xnor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european buffer port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european not port/origin/.initial=0.8}%
+ }%
+}
+\ctikzset{logic ports origin/center/.code={%
+ \ctikzset{tripoles/american and port/origin/.initial=0}%
+ \ctikzset{tripoles/american nand port/origin/.initial=0}%
+ \ctikzset{tripoles/american nor port/origin/.initial=0}%
+ \ctikzset{tripoles/american or port/origin/.initial=0}%
+ \ctikzset{tripoles/american xor port/origin/.initial=0}%
+ \ctikzset{tripoles/american xnor port/origin/.initial=0}%
+ \ctikzset{tripoles/european and port/origin/.initial=0}%
+ \ctikzset{tripoles/european nand port/origin/.initial=0}%
+ \ctikzset{tripoles/european or port/origin/.initial=0}%
+ \ctikzset{tripoles/european nor port/origin/.initial=0}%
+ \ctikzset{tripoles/european xor port/origin/.initial=0}%
+ \ctikzset{tripoles/european xnor port/origin/.initial=0}%
+ \ctikzset{tripoles/european buffer port/origin/.initial=0}%
+ \ctikzset{tripoles/european not port/origin/.initial=0}%
+ }%
+}
+
+\newif\ifpgfcirc@roundy@or@shapes\pgfcirc@roundy@or@shapesfalse
+\ctikzset{american or shape/.is choice}
+\ctikzset{american or shape/roundy/.code={\pgfcirc@roundy@or@shapestrue}}
+\ctikzset{american or shape/pointy/.code={\pgfcirc@roundy@or@shapesfalse}}
+
+\newif\ifpgfcirc@draw@leads\pgfcirc@draw@leadstrue
+\ctikzset{logic ports draw input leads/.is choice}
+\ctikzset{logic ports draw input leads/true/.code={\pgfcirc@draw@leadstrue}}
+\ctikzset{logic ports draw input leads/false/.code={\pgfcirc@draw@leadsfalse}}
+\tikzset{input leads/.code={\pgfcirc@draw@leadstrue}}
+\tikzset{no input leads/.code={\pgfcirc@draw@leadsfalse}}
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/american and port/origin/.initial=0.8}
+\ctikzset{tripoles/american and port/inputs/.initial=2}
+% variable number of inputs
+\ctikzset{tripoles/american nand port/origin/.initial=0.8}
+\ctikzset{tripoles/american nand port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/origin/.initial=0.8}
+\ctikzset{tripoles/american nor port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/angle/.initial=70}
+\ctikzset{tripoles/american nor port/inner/.initial=0.3}
+\ctikzset{tripoles/american or port/origin/.initial=0.8}
+\ctikzset{tripoles/american or port/inputs/.initial=2}
+\ctikzset{tripoles/american or port/angle/.initial=70}
+\ctikzset{tripoles/american or port/inner/.initial=0.3}
+\ctikzset{tripoles/american xor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xor port/inputs/.initial=2}
+\ctikzset{tripoles/american xor port/angle/.initial=70}
+\ctikzset{tripoles/american xor port/inner/.initial=0.3}
+\ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xnor port/inputs/.initial=2}
+\ctikzset{tripoles/american xnor port/angle/.initial=70}
+\ctikzset{tripoles/american xnor port/inner/.initial=0.3}
+
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european buffer port/width/.initial=1.4}
+\ctikzset{tripoles/european buffer port/not height/.initial=.3}
+\ctikzset{tripoles/european buffer port/not width/.initial=.8}
+\ctikzset{tripoles/european buffer port/height/.initial=.65}
+\ctikzset{tripoles/european buffer port/reserved/.initial=.6}
+\ctikzset{tripoles/european buffer port/input height/.initial=0}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+% variable number of inputs
+\ctikzset{tripoles/european and port/origin/.initial=0.8}
+\ctikzset{tripoles/european and port/inputs/.initial=2}
+\ctikzset{tripoles/european nand port/origin/.initial=0.8}
+\ctikzset{tripoles/european nand port/inputs/.initial=2}
+\ctikzset{tripoles/european or port/origin/.initial=0.8}
+\ctikzset{tripoles/european or port/inputs/.initial=2}
+\ctikzset{tripoles/european nor port/origin/.initial=0.8}
+\ctikzset{tripoles/european nor port/inputs/.initial=2}
+\ctikzset{tripoles/european xor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xor port/inputs/.initial=2}
+\ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xnor port/inputs/.initial=2}
+\ctikzset{tripoles/european buffer port/origin/.initial=0.8}
+\ctikzset{tripoles/european buffer port/inputs/.initial=1}%
+\ctikzset{tripoles/european not port/origin/.initial=0.8}
+\ctikzset{tripoles/european not port/inputs/.initial=1}%
+%%% parameters that are not used anymore after multi-input
+%%% gates --- left for compatibility of source code.
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+% switches for logic gates
+%
+\pgfkeys{/tikz/number inputs/.initial=0}
+\pgfkeys{/tikz/number inputs/.default=0}
+
+%% flip-flop specific keys (most others are the same as chips)
+
+\ctikzset{multipoles/flipflop/font/.initial=\pgf@circ@font@small}
+\ctikzset{multipoles/flipflop/fontud/.initial=\pgf@circ@font@tiny}
+\ctikzset{multipoles/flipflop/width/.initial=1.2}
+\ctikzset{multipoles/flipflop/pin spacing/.initial=0.6}
+\ctikzset{multipoles/flipflop/clock wedge size/.initial=0.2}
+
+%% muxdemuxes keys
+
+\ctikzset{multipoles/muxdemux/base len/.initial=0.4}
+\ctikzset{multipoles/muxdemux/Lh/.initial=8.0}
+\ctikzset{multipoles/muxdemux/Rh/.initial=6.0}
+\ctikzset{multipoles/muxdemux/w/.initial=3.0}
+\ctikzset{multipoles/muxdemux/inset w/.initial=0.0}
+\ctikzset{multipoles/muxdemux/inset Lh/.initial=0.0}
+\ctikzset{multipoles/muxdemux/inset Rh/.initial=0.0}
+\ctikzset{multipoles/muxdemux/NL/.initial=8}
+\ctikzset{multipoles/muxdemux/NR/.initial=1}
+\ctikzset{multipoles/muxdemux/NB/.initial=3}
+\ctikzset{multipoles/muxdemux/NT/.initial=0}
+\ctikzset{multipoles/muxdemux/square pins/.initial=0}
+%
+% switches for op amps
+% changing input polarity
+%
+\newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
+\pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
+\ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
+\pgfkeys{/tikz/noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
+\ctikzset{noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
+%
+% changing output polarity (for fully diff objects)
+%
+\newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
+\pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
+\ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
+\pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
+\ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
+
+% Operational amplifier
+\ctikzset{tripoles/op amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/op amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Fully differential operational amplifier
+\ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation
+\ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/fd op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+\ctikzset{tripoles/en amp/width/.initial=1.7}
+\ctikzset{tripoles/en amp/port width/.initial=.7}
+\ctikzset{tripoles/en amp/height/.initial=1.6}
+\ctikzset{tripoles/en amp/input height/.initial=.3}
+\ctikzset{tripoles/en amp/up pos/.initial=.45}
+\ctikzset{tripoles/en amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+\ctikzset{tripoles/en amp/font2/.initial=\pgf@circ@font@twelve} % Absolute font size needed!
+\ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
+\tikzset{
+ en amp text/.code = {%
+ \ctikzsetvalof{tripoles/en amp/text}{#1}%
+ },
+ en amp text A/.code = {%
+ \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}%
+ },
+}
+
+% Transconductance amplifier
+\ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid
+\ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/gm amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier
+\ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid
+\ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier with differential output
+\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid
+\ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation
+\ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/fd inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier with gain resistor terminals
+\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width
+\ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid
+\ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid
+\ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation
+\ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation
+\ctikzset{tripoles/inst amp ra/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
+
+% Plain amplifier
+\ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position
+
+% changing fonts and symbols of amplifiers
+\ctikzset{amplifiers/symbol font/.code={%
+ \ctikzset{tripoles/inst amp ra/font=#1}%
+ \ctikzset{tripoles/fd inst amp/font=#1}%
+ \ctikzset{tripoles/inst amp/font=#1}%
+ \ctikzset{tripoles/gm amp/font=#1}%
+ \ctikzset{tripoles/en amp/font=#1}%
+ \ctikzset{tripoles/fd op amp/font=#1}%
+ \ctikzset{tripoles/op amp/font=#1}%
+}}
+\ctikzset{amplifiers/plus/.initial={$+$}}
+\ctikzset{amplifiers/minus/.initial={$-$}}
+\tikzset{amp symbol font/.code={%
+ \ctikzset{amplifiers/symbol font={#1}}%
+ }
+}
+\tikzset{amp plus/.code={\ctikzsetvalof{amplifiers/plus}{#1}}}
+\tikzset{amp minus/.code={\ctikzsetvalof{amplifiers/minus}{#1}}}
+\def\pgf@circ@ampli@plus{\ctikzvalof{amplifiers/plus}}
+\def\pgf@circ@ampli@minus{\ctikzvalof{amplifiers/minus}}
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+%% Cute switches
+\ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
+\ctikzset{bipoles/cuteswitch/height/.initial=.6}
+\ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
+\ctikzset{bipoles/cuteswitch/width/.initial=.50}
+\ctikzset{bipoles/cuteswitch/thickness/.initial=1}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+\ctikzset{tripoles/oscillator/width/.initial=.7}
+
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/inner/.initial=0.4}
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/inner/.initial=0.4}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/inner/.initial=0.4}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/fourport/width/.initial=1.3}
+\ctikzset{quadpoles/fourport/height/.initial=1.3}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+\ctikzset{quadpoles/coupler2/width/.initial=1.3}
+\ctikzset{quadpoles/coupler2/height/.initial=1.3}
+
+\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+
+\ctikzset{quadpoles style/.is choice}
+\ctikzset{quadpoles style/inward/.code={% default value
+ \ctikzset{quadpoles/transformer/inner=0.4}%
+ \ctikzset{quadpoles/transformer/width=1.5}%
+ \ctikzset{quadpoles/transformer core/inner=0.4}%
+ \ctikzset{quadpoles/transformer core/width=1.5}%
+ \ctikzset{quadpoles/gyrator/inner=0.4}%
+ \ctikzset{quadpoles/gyrator/width=1.5}%
+ }%
+}
+\ctikzset{quadpoles style/inline/.code={% now horizontal baffle
+ \ctikzset{quadpoles/transformer/inner=1}%
+ \ctikzset{quadpoles/transformer/width=0.6}%
+ \ctikzset{quadpoles/transformer core/inner=1}%
+ \ctikzset{quadpoles/transformer core/width=0.6}%
+ \ctikzset{quadpoles/gyrator/inner=1} % FIXME
+ \ctikzset{quadpoles/gyrator/width=0.6}%
+ }%
+}
+
+%
+% multipoles
+%
+\ctikzset{multipoles/thickness/.initial=2}
+\ctikzset{multipoles/font/.initial=\pgf@circ@font@tiny}
+% DIP (dual in line package) chips
+\ctikzset{multipoles/dipchip/width/.initial=1.2}
+\ctikzset{multipoles/dipchip/num pins/.initial=8}
+\ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
+% QFP (quad flat package) chips
+\ctikzset{multipoles/qfpchip/num pins/.initial=8}
+\ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
+% chip numbers
+\newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
+\pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
+\ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
+\pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
+\ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
+\newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
+\pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
+\ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
+\pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
+\ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
+% external chip pins
+\ctikzset{multipoles/external pins thickness/.initial=1}
+\ctikzset{multipoles/external pins width/.initial=0.2}
+\ctikzset{multipoles/external pad fraction/.initial=0}
+\pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
+\pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
+% topmarks
+\newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
+\pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
+\ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
+\pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
+\ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
+
+% rotary switch by Romano
+\ctikzset{multipoles/rotary/thickness/.initial=1}
+\ctikzset{multipoles/rotary/shape/.initial=ocirc}
+\ctikzset{multipoles/rotary/channels/.initial=5}
+\ctikzset{multipoles/rotary/angle/.initial=60}
+\ctikzset{multipoles/rotary/wiper/.initial=20}
+\ctikzset{multipoles/rotary/arrow/.is choice}
+\newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
+\newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
+\newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
+\ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
+\ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
+
+\tikzset{%
+ rotary switch/.style args={#1in#2wiper#3}{%
+ shape=rotaryswitch,
+ /tikz/circuitikz/multipoles/rotary/channels=#1,
+ /tikz/circuitikz/multipoles/rotary/angle=#2,
+ /tikz/circuitikz/multipoles/rotary/wiper=#3,
+ },
+ rotary switch -/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=none,
+ },
+ rotary switch <-/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=ccw,
+ },
+ rotary switch ->/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=cw,
+ },
+ rotary switch <->/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=both,
+ },
+ % Notice that these should be the same as the initial values of the keys
+ rotary switch/.default={5 in 60 wiper 20},
+ rotary switch -/.default={5 in 60 wiper 20},
+ rotary switch <-/.default={5 in 60 wiper 20},
+ rotary switch ->/.default={5 in 60 wiper 20},
+ rotary switch <->/.default={5 in 60 wiper 20},
+}
+
+% %Mechanical section
+\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
+\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
+\ctikzset{bipoles/spring/height/.initial=.5}
+\ctikzset{bipoles/spring/width/.initial=.5}
+\ctikzset{bipoles/mass/height/.initial=.55}
+\ctikzset{bipoles/mass/box height/.initial=.4}
+\ctikzset{bipoles/mass/width/.initial=.5}
+
+\ctikzset{bipoles/damper/height/.initial=.35}
+\ctikzset{bipoles/damper/length/.initial=.3}
+\ctikzset{bipoles/damper/width/.initial=.4}
+
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial=}
+\ctikzset{bipole/name/.initial=}
+\newif\ifpgf@circuit@bipole@isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
+\newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
+\ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
+\newif\ifpgf@circuit@bipole@strokedsymbol
+\ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
+\newif\ifpgf@circuit@bipole@iscurrent
+\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+\newif\ifpgf@circuit@bipole@voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf@circuit@bipole@current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
+\newif\ifpgf@circuit@bipole@current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
+\newif\ifpgf@circuit@bipole@current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/flow/.is family}
+\newif\ifpgf@circuit@bipole@flow@backward
+\ctikzset{bipole/flow/direction/.is choice}
+\ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
+\ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
+\newif\ifpgf@circuit@bipole@flow@before
+\ctikzset{bipole/flow/x position/.is choice}
+\ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
+\ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
+\newif\ifpgf@circuit@bipole@flow@below
+\ctikzset{bipole/flow/y position/.is choice}
+\ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
+\ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
+\ctikzset{bipole/flow/label/unit/.initial=}
+\ctikzset{bipole/flow/label/name/.initial=}
+\ctikzset{flow/distance/.initial = .5}
+\ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/annotation/.is family}
+\ctikzset{bipole/annotation/position/.initial=-90}
+\ctikzset{bipole/annotation/unit/.initial=}
+\ctikzset{bipole/annotation/name/.initial=}
+
+\newif\ifpgf@circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf@circuit@strokediode
+\newif\ifpgf@circuit@fulldiode
+\pgf@circuit@strokediodefalse
+\pgf@circuit@fulldiodefalse
+
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
+\ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
+
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
+\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}}
+
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circ@siunitx@res
+
+\ctikzset{straight/.is choice}
+\ctikzset{straightvoltage value/.initial=true}
+\ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
+\ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
+\ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
+\newif\ifpgf@circuit@bipole@voltage@straight
+\ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
+
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
+\ctikzset{voltage shift/.style={voltage/shift=#1}}
+\tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% shaping the +/- sign, see pgfcircvoltage.tex
+\ctikzset{voltage/american font/.initial={}}
+\ctikzset{voltage/american plus/.initial={$+$}}
+\ctikzset{voltage/american minus/.initial={$-$}}
+
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+
+\tikzset{american currents/.style = {\circuitikzbasekey/current = american}}
+\tikzset{european currents/.style = {\circuitikzbasekey/current = european}}
+\tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}}
+\tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}}
+\tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}}
+\tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}
+
+\newif\ifpgf@circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester choice/.is choice}
+\ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}}
+\ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}}
+
+\tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}}
+\tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}}
+\tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}}
+\tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}}
+\tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}}
+\tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}}
+\tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}}
+\tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}}
+\tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}}
+\tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
+
+% I should try to make the tree clearer (this voltage conflicts with the options above)
+
+\newif\ifpgf@circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse}}
+\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue}}
+
+\newif\ifpgf@circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse}
+\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue}
+
+% noise sources
+\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+
+% seven segment displays by RGtti
+
+\newif\ifpgf@circ@sevenseg@dot
+\newif\ifpgf@circ@sevenseg@box
+\def\pgf@circ@sevenseg@dotstate{empty}
+\ctikzset{seven seg/.is family}
+\ctikzset{seven seg/dot/.is choice}
+% none means no dot, not space for it. Empty means no dot, but space
+\ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
+\ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
+\ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
+\ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
+%
+\ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
+\ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
+\ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
+\ctikzset{seven seg/box sep/.initial=1pt}% external box gap
+\ctikzset{seven seg/color on/.initial=red}% color for segment "on"
+\ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
+\ctikzset{seven seg/box/.is choice}
+\ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
+\ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
+
+\ctikzset{seven seg/bits/.initial=0000000}
+
+\ctikzset{seven seg/value/.code={%
+ \edef\@@tmp{#1}%
+ \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
+ \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
+ \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
+ \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
+ \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
+ \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
+ \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
+ \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
+ \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
+ \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
+ \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
+}}
+
+\tikzset{%
+ seven segment val/.style args={#1dot#2box#3}{%
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/value=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+ seven segment bits/.style args={#1dot#2box#3}{%
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/bits=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+}
+
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+
+% Electronic tubes: diodetube, triode, tetrode and pentode
+\ctikzset{tubes/width/.initial=1} % relative width
+\ctikzset{tubes/height/.initial=1.4} % relative height
+\ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
+\ctikzset{tubes/anode distance/.initial=0.40} % distance from center
+\ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
+\ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
+\ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
+\ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
+\ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
+\ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
+\ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
+\ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
+\ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
+\ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
+\ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
+
+\newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
+\pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
+\ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
+\newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
+\pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
+\ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
+\newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
+\pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
+\ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
+
+%%%---------- close: tex/pgfcirc.defines
+%%%%%%%%%%% Springe nach tex/pgfcircutils
+%%%---------- open: tex/pgfcircutils.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ %\typeout{si |#1|}
+ }{
+ \pgf@circ@siunitx@resfalse
+ %\typeout{no si |#1|}
+ }
+\fi
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+ }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% useful commands
+
+\ifpgfutil@format@is@latex
+ %% flipping text
+ \def\ctikzflipx#1{\scalebox{-1}[1]{#1}}
+ \def\ctikzflipy#1{\scalebox{1}[-1]{#1}}
+ \def\ctikzflipxy#1{\scalebox{-1}[-1]{#1}}
+ % text mode overbar
+ % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
+ \def\ctikztextnot#1{$\overline{\hbox{#1}}\m@th$}
+\else\ifpgfutil@format@is@plain
+ % text mode overbar
+ % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
+ \def\ctikztextnot#1{$\overline{\hbox{#1}}$}
+\else\ifpgfutil@format@is@context
+ % text mode overbar
+ % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
+ \def\ctikztextnot#1{$\overline{\hbox{#1}}$}
+\fi\fi\fi
+
+
+%%%---------- close: tex/pgfcircutils
+
+%%%%%%%%%%% Springe nach tex/pgfcircshapes
+%%%---------- open: tex/pgfcircshapes.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+%
+% Provision for changing opacity. Only expert use, see the manual.
+%
+\ctikzset{poles/open fill opacity/.initial=1.0}% better not touch it
+\tikzset{open poles opacity/.code={%
+ \ctikzset{poles/open fill opacity=#1}%
+}}
+\ctikzset{poles/full fill opacity/.initial=1.0}% better not touch it
+\tikzset{full poles opacity/.code={%
+ \ctikzset{poles/full fill opacity=#1}%
+}}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty round terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Diamond terminal
+
+\pgfdeclareshape{diamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Diamond terminal, unfilled
+
+\pgfdeclareshape{odiamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% square terminal, filled
+
+\pgfdeclareshape{squarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+%% square terminal, unfilled
+
+\pgfdeclareshape{osquarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+% BNC connector
+
+\pgfdeclareshape{bnc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ % BNC size is 2.5 times the size of the internal "ocirc"
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@y=2.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ % center is on the opening
+ \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{zero}{ \pgfpointorigin }
+ \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ % geo-anchors
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{left}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
+ }
+ \behindforegroundpath{
+ \pgfextracty{\pgf@circ@res@other}{\northwest}
+ \pgf@circ@res@step=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external circle
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
+ % next the opening to the right
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal circle
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ % and the contact line to the right
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%% Fill for correct rectangular joins
+
+\pgfdeclareshape{rectjoinfill}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\pgflinewidth%
+ \pgf@y=.5\pgflinewidth%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfpathrectanglecorners
+ {\pgfpoint{0}{.5\pgflinewidth}}
+ {\pgfpoint{0}{-.5\pgflinewidth}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% transistor arrow
+
+\def\pgf@circ@find@linescale{
+ % find the scale inverse of the scale factor: line width do not scale
+ % with scale=..., transform shape so we have to counteract it.
+ \iftikz@fullytransformed % this is true if `transform shape` is active
+ % from @Circumscribe https://tex.stackexchange.com/a/474035/38080
+ % Note that this trick is not working inside a `spy` environment...
+ \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}%
+ \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD-\scaleB*\scaleC))}%
+ \else
+ \pgfmathsetmacro{\@@factor}{1.0}
+ \fi
+}
+
+\pgfdeclareshape{trarrow}{%
+ % this arrow is only filled but grows with the linewidth, more or less
+ % like currarrow do
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \pgf@circ@find@linescale
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgfpoint{0.7*\pgf@circ@res@step +0.5*\@@factor*\pgflinewidth}
+ {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
+ }
+ % The arrow size should be more or less the same of a currarrow, which is
+ % both filled and stroke, for backward output compatibility (more or less)
+ %
+ % angle \beta W is \pgf@circ@Rlen/\ctikzvalof{current arrow scale}
+ % |-\__ currarrow as the tip at (W,0)
+ % | | and the upper tail at (-0.7*W, 0.8*W)
+ % | \__ it then "overshoot" do to the linew width L
+ % | \__ xangle \alpha
+ % ---0------->
+ %
+ % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7)
+ % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction
+ % tail overshoot is -(L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y
+ %
+ \savedanchor{\northwest}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@circ@find@linescale
+ \pgfpoint{-0.7*\pgf@circ@res@step -0.5*\@@factor*\pgflinewidth}
+ {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
+ }
+ \savedanchor{\tip}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@circ@find@linescale
+ \pgfpoint{\pgf@circ@res@step + 1.743*\@@factor*\pgflinewidth}{0pt}
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \anchor{btip}{% this anchor is behind the tip of half a linewidth
+ \tip
+ \pgf@circ@find@linescale
+ \pgf@circ@res@temp=\@@factor\pgflinewidth
+ \advance\pgf@x by -.5\pgf@circ@res@temp
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \northwest
+ \pgf@circ@res@up=\pgf@y
+ \pgf@circ@res@left=\pgf@x
+ \tip
+ \pgf@circ@res@step = \pgf@x
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{fill} % just fill
+ \endpgfscope
+ }
+}
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+}
+
+%% Flow arrow
+
+\pgfdeclareshape{flowarrow}{
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@y=.5\pgf@circ@res@step
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgf@x=\pgf@circ@res@step%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{text}{% text centered above
+ \pgfpointorigin
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+ }
+}
+
+%% Input arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\northeast}{% this is really not northeast, really -northwest
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+ \pgf@y=.5\pgf@circ@res@step
+ \pgf@x=1.7\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@x=0cm\relax}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+}
+
+
+%% box
+
+\pgfdeclareshape{box}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+%% box scaled with blocks
+
+\pgfdeclareshape{blockbox}{
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+% full nodes for wire crossing
+
+\pgfdeclareshape{jump crossing}
+{
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \behindbackgroundpath{
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+\pgfdeclareshape{plain crossing}
+{
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \behindbackgroundpath{
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+%%%---------- close: tex/pgfcircshapes
+%%%%%%%%%%% Springe nach tex/pgfcircmonopoles
+%%%---------- open: tex/pgfcircmonopoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%
+%% Grounds
+%%%%%%%%%%%%%
+
+
+%% Ground symbol
+% #1 -> name
+% #2 -> width
+% #3 -> depth
+% #4 -> code
+\long\def\pgf@circ@declareground#1#2#3#4{
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
+ \pgf@x=#2\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
+ \pgf@y=-#3\pgf@y
+ }
+ \anchor{north}{\pgfpointorigin}
+ \anchor{north east}{\southeast\pgf@y=0pt\relax}
+ \anchor{east}{\southeast\pgf@y=.5\pgf@y}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ #4
+ \endpgfscope
+ }
+ }
+}
+
+
+\pgf@circ@declareground{ground}{0.6}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+\pgf@circ@declareground{tlground}{0.6}{0.4}{
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+
+\pgf@circ@declareground{rground}{0.6}{1}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+\pgf@circ@declareground{tground}{0.6}{0}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+}
+
+\pgf@circ@declareground{sground}{0.6}{1.8}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}
+
+% noiseless ground
+\pgf@circ@declareground{nground}{0.9}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
+ \pgfusepath{draw}
+}
+
+% protective ground
+\pgf@circ@declareground{pground}{0.9}{1.8}{
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% chassis ground
+\pgf@circ@declareground{cground}{1}{2}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% Contributed by @fotesan https://github.com/fotesan
+% european ground
+\pgf@circ@declareground{eground}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+\pgf@circ@declareground{eground2}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%
+%% Power supplies
+%%%%%%%%%%%%%%%%%%
+
+% Vcc
+\pgfdeclareshape{vcc}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=3\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=-3\pgf@x%
+ }
+ \anchor{south}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{north}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast}
+ \anchor{south west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@y=0pt\relax}
+ \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%
+%% RF elements
+%%%%%%%%%%%%%%%%
+
+% Legacy tlinestub
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@x=1.2\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@y=.2\pgf@circ@res@step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=0cm\relax}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
+
+ \pgfscope\begin{pgftransparencygroup}
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgf@circ@maybefill
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \end{pgftransparencygroup} \endpgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ }
+}
+
+%% New antennas without tails
+
+% main body of antennas
+\def\pgf@circ@antennabody{%
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfsetbeveljoin
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% Waves for the antennas.
+\def\pgf@circ@antennawaves{%
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>2
+ \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% additional shape with the waves
+\pgfdeclareshape{waves}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0pt}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
+ \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{north east}{\northeast}
+ \anchor{east}{\northeast\pgf@y=0pt}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@step=0.5\pgf@circ@res@step
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>1
+ \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% the three types of antennas: simple, TX, RX. Notice that you can flip them...
+
+\pgfdeclareshape{bareantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ }
+}
+
+\pgfdeclareshape{bareTXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{\savedwaves}
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ \pgf@circ@antennawaves
+ }
+}
+
+\pgfdeclareshape{bareRXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{\savedwaves}
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ \pgftransformxshift{-5.2\pgf@circ@res@step}
+ \pgf@circ@antennawaves
+ }
+}
+
+% Microstrip monopoles
+
+\pgfdeclareshape{mslstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=-.5\pgf@y
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf@y=0pt\relax}
+ \anchor{left}{\northwest\pgf@y=0pt\relax}
+ \anchor{right}{\southeast\pgf@y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msrstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt\relax
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
+ \pgfpatharc{135}{45}{\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
+ \pgfpatharc{45}{135}{\pgf@circ@res@up}
+ \pgfclosepath
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msport}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=-.5\pgf@y
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf@y=0pt\relax}
+ \anchor{left}{\northwest\pgf@y=0pt\relax}
+ \anchor{right}{\southeast\pgf@y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+% Legacy antennas (with tails)
+\def\pgf@circ@shift@antenna@xy#1#2{%
+ \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
+ \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
+\relax}
+
+% Legacy antenna
+\pgfdeclareshape{antenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+
+ \pgftransformxshift{ -4\pgf@circ@res@step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Legacy TX antenna
+\pgfdeclareshape{txantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Legacy RX antenna
+\pgfdeclareshape{rxantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+}
+
+% Legacy match
+\pgfdeclareshape{match}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
+ \pgf@x=2\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@circ@res@step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=0cm\relax}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\pgfpointorigin}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
+ \pgf@x=1.5\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+%%%---------- close: tex/pgfcircmonopoles
+%%%%%%%%%%% Springe nach tex/pgfcircbipoles
+%%%---------- open: tex/pgfcircbipoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%% Generic macro for defining a bipole shape
+% #1 - additional anchors
+% #2 - lower y-size of the bipole (from the center).
+% #3 - #shape is the name of the shape
+% #4 - upper y-size of the bipole (from the center)
+% #5 - width of the bipole
+% #6 - macros drawing the bipole
+%
+\long\def\pgfcircdeclarebipole{%
+ \pgfcircdeclarebipolescaled{default}}
+
+%% Generic macro for defining a bipole shape
+% #1 - scale factor
+% #2 - additional anchors
+% #3 - lower y-size of the bipole (from the center).
+% #4 - #shape is the name of the shape
+% #5 - upper y-size of the bipole (from the center)
+% #6 - width of the bipole
+% #7 - macros drawing the bipole
+%
+\long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{
+ \pgfdeclareshape{#4shape}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor{\northeast}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=#5\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=#5\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=-#3\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=-#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwest}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@y=-#3\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-#6\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@circ@res@down=-#3\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=#5\pgf@circ@scaled@Rlen
+ \pgfpointorigin
+ \pgf@y=\pgf@circ@res@up
+ \advance\pgf@y by\pgf@circ@res@down
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{ne}{
+ \northeast
+ }
+ \anchor{nw}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{s}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{south east}{
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \southwest
+ }
+ \anchor{se}{
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{sw}{
+ \southwest
+ }
+ \anchor{w}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{right}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{above}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{left}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{below}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{a}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{b}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf@y=\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{
+ \textanchor
+ }
+ \anchorborder{%
+ \ifpgf@circuit@bipole@inverted
+ \pgf@circ@res@left=-\pgf@x
+ \pgf@circ@res@right=-\pgf@y
+ \else
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@right=\pgf@y
+ \fi
+ \ifdim\pgf@circ@res@right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
+ \fi
+ }
+
+ #2
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@zero = 0cm
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@res@right = \pgf@x
+ \southwest
+ \pgf@circ@res@down = \pgf@y
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ #7
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%
+% Resistive components
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Short circuit
+
+%%% NOTICE that the short is really NOT drawn; we trust the fact that its
+%%% natural length is zero.
+\pgfcircdeclarebipole
+{}
+{0}
+{short}
+{0}
+{0}
+{ }
+
+%% Open circuit
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/open/height}}
+{open}
+{\ctikzvalof{bipoles/open/height}}
+{\ctikzvalof{bipoles/open/width}}
+{ }
+
+% multiwire(s)
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/multiwire/height}}
+{multiwire}
+{\ctikzvalof{bipoles/multiwire/height}}
+{\ctikzvalof{bipoles/multiwire/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/multiwire/height}}
+{bmultiwire}
+{\ctikzvalof{bipoles/multiwire/height}}
+{\ctikzvalof{bipoles/multiwire/width}}
+{
+ \pgf@circ@res@other=\ctikzvalof{bipoles/multiwire/spacing}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+%% Generic bipole - used as resistor by some (bleah)
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{generic}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+%% Generic empty tunable
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{tgeneric}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{\ctikzvalof{bipoles/tgeneric/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Generic asymmetric bipole
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/ageneric/height}}
+{ageneric}
+{\ctikzvalof{bipoles/ageneric/height}}
+{\ctikzvalof{bipoles/ageneric/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% Memristor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/memristor/height}}
+{memristor}
+{\ctikzvalof{bipoles/memristor/height}}
+{\ctikzvalof{bipoles/memristor/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% Photoresistor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/photoresistor/height 2}}
+{photoresistor}
+{\ctikzvalof{bipoles/photoresistor/height}}
+{\ctikzvalof{bipoles/photoresistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Thermistor
+\pgfcircdeclarebipolescaled{resistors}
+{{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.4\pgf@x
+ \pgf@y=1.2\pgf@y
+ }%
+}}
+{\ctikzvalof{bipoles/thermistor/height}}
+{thermistor}
+{\ctikzvalof{bipoles/thermistor/height}}
+{\ctikzvalof{bipoles/thermistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+%% Thermistor PTC
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/thermistorptc/height 2}}
+{thermistorptc}
+{\ctikzvalof{bipoles/thermistorptc/height}}
+{\ctikzvalof{bipoles/thermistorptc/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/thermistorntc/height 2}}
+{thermistorntc}
+{\ctikzvalof{bipoles/thermistorntc/height}}
+{\ctikzvalof{bipoles/thermistorntc/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Generic tunable
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@ya
+ \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
+}
+{\ctikzvalof{bipoles/generic potentiometer/height 2}}
+{genericpotentiometer}
+{\ctikzvalof{bipoles/generic potentiometer/height}}
+{\ctikzvalof{bipoles/generic potentiometer/width}}
+{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfextractx{\pgf@circ@res@other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Zig zag resistores
+\def\pgf@circ@zigzag#1{%
+ \divide \pgf@circ@res@step by \numexpr4*\zigs\relax
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \pgf@circ@count@a=\zigs\relax
+ % first half zig
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
+ \pgfmathloop%
+ \advance\pgf@circ@count@a by -1\relax% Loop zigs -1 times
+ \ifnum\pgf@circ@count@a>0
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
+ \repeatpgfmathloop%
+ % last zig and a half
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+%% Resistor
+\pgfcircdeclarebipolescaled{resistors}
+{
+\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/resistor/height}}
+{resistor}
+{\ctikzvalof{bipoles/resistor/height}}
+{\ctikzvalof{bipoles/resistor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{1}
+}
+
+
+%% Variable resistor
+\pgfcircdeclarebipolescaled{resistors}
+{
+\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/vresistor/height}}
+{vresistor}
+{\ctikzvalof{bipoles/vresistor/height}}
+{\ctikzvalof{bipoles/vresistor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{.5}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Potentiometer
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@ya
+ \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/potentiometer/height 2}}
+{potentiometer}
+{\ctikzvalof{bipoles/potentiometer/height}}
+{\ctikzvalof{bipoles/potentiometer/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{1}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfextractx{\pgf@circ@res@other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Resistive sensor
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.4\pgf@x}%
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{resistivesens}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{\ctikzvalof{bipoles/resistivesens/width}}
+{%
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{.5}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%
+%% Capacitors
+%%%%%%%%%%%%%
+
+%% Plain Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitor}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+}
+
+%% Capacitive sensor
+\pgfcircdeclarebipolescaled{capacitors}
+{
+ \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}%
+}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitivesens}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Polar Capacitor (DEPRECATED)
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{polarcapacitor}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{\ctikzvalof{bipoles/pcapacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% Curved capacitor
+% see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong
+% for a rationale
+%
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{ccapacitor}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{\ctikzvalof{bipoles/ccapacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Electrolytic Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{ecapacitor}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{\ctikzvalof{bipoles/ecapacitor/width}}
+{
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ % % plus pole annotation
+ \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
+ {\ctikzvalof{bipoles/ecapacitor/font} $+$}
+}
+
+%% Variable Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{vcapacitor}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{\ctikzvalof{bipoles/vcapacitor/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+
+%% Piezoelectric Element
+
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{piezoelectric}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{\ctikzvalof{bipoles/piezoelectric/width}}
+{
+ % \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
+ % \divide \pgf@circ@res@step by 5
+
+ %% Outer markings
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %% Inner Box
+ \pgf@circ@res@step = \pgf@circ@res@right \divide \pgf@circ@res@step by 10
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf@circ@res@left+4*\pgf@circ@res@step}{\pgf@circ@res@up-\pgf@circ@res@step}}
+ {\pgfpoint{\pgf@circ@res@right-4*\pgf@circ@res@step}{\pgf@circ@res@down+\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%%
+%% Inductors
+%%%%%%%%%%%%%%%
+
+%% cute inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{cuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% cute inductive sensor
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{scuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% cute choke
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cutechoke/lower coil height}}
+{cutechoke}
+{\ctikzvalof{bipoles/cutechoke/height}}
+{\ctikzvalof{bipoles/cutechoke/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+ \pgfusepath{stroke}
+
+ \ifpgf@circuit@bipole@twolineschoke
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+ \pgfusepath{stroke}
+ \fi
+}
+
+%% variable cute inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
+{vcuteinductor}
+{\ctikzvalof{bipoles/vcuteinductor/height}}
+{\ctikzvalof{bipoles/vcuteinductor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% american inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{americaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+
+%% american inductive sensor
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{samericaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% variable american inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/vamericaninductor/height 2}}
+{vamericaninductor}
+{\ctikzvalof{bipoles/vamericaninductor/height}}
+{\ctikzvalof{bipoles/vamericaninductor/width}}
+{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@scaled@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Generic bipole, filled - used as inductor by some
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{fullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+%% Generic sensor, filled - used as inductive sensor by some
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}%
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{sfullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+%% Generic full tunable
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{tfullgeneric}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{\ctikzvalof{bipoles/tfullgeneric/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%
+%% Battery
+%%%%%%%%%%%
+
+%% Battery
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery/height}}
+{battery}
+{\ctikzvalof{bipoles/battery/height}}
+{\ctikzvalof{bipoles/battery/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 6
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1 % poles with equl thickness
+
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery1/height}}
+{battery1}
+{\ctikzvalof{bipoles/battery1/height}}
+{\ctikzvalof{bipoles/battery1/width}}
+{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+%% Battery 2 % negative pole thicker
+
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery2/height}}
+{battery2}
+{\ctikzvalof{bipoles/battery2/height}}
+{\ctikzvalof{bipoles/battery2/width}}
+{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%
+%% Round and diamond sources
+%%%%%%%%%%%
+
+%% Independent voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsource}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+%% Independent voltage source - American style
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{vsourceAM}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{\ctikzvalof{bipoles/vsourceam/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
+ \fi
+}
+
+%% Independent sinusoidal voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{vsourcesin}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{\ctikzvalof{bipoles/vsourcesin/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Square Voltage source - contributed by Alistair Kwan
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcesquare/height}}
+{vsourcesquare}
+{\ctikzvalof{bipoles/vsourcesquare/height}}
+{\ctikzvalof{bipoles/vsourcesquare/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcetri/height}}
+{vsourcetri}
+{\ctikzvalof{bipoles/vsourcetri/height}}
+{\ctikzvalof{bipoles/vsourcetri/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% PV Source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/pvsource/height}}
+{pvsource}
+{\ctikzvalof{bipoles/pvsource/height}}
+{\ctikzvalof{bipoles/pvsource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %Arrow Part
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty Source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{esource}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+}
+
+%% DC Current Source with open shape
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/dcisource/height}}
+{dcisource}
+{\ctikzvalof{bipoles/dcisource/height}}
+{\ctikzvalof{bipoles/dcisource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@maybefill
+ \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
+ \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
+ \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
+ \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% DC-Voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/dcvsource/height}}
+{dcvsource}
+{\ctikzvalof{bipoles/dcvsource/height}}
+{\ctikzvalof{bipoles/dcvsource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
+ \pgfusepath{draw}
+}
+
+%% Independent current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isource}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+}
+
+%% Independent double oo source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/oosource/height}}
+{oosource}
+{\ctikzvalof{bipoles/oosource/height}}
+{\ctikzvalof{bipoles/oosource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgf@circ@maybefill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
+ \pgf@circ@draworfill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgfusepath{draw}
+}
+
+%% Independent current source - American
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isourceam/height}}
+{isourceAM}
+{\ctikzvalof{bipoles/isourceam/height}}
+{\ctikzvalof{bipoles/isourceam/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Independent sinusoidal current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourcesin}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty controlled source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/ecsource/height}}
+{ecsource}
+{\ctikzvalof{bipoles/ecsource/height}}
+{\ctikzvalof{bipoles/ecsource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}
+
+%% Controlled voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsource}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+%% Controlled voltage source - American
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{cvsourceAM}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{\ctikzvalof{bipoles/cvsourceam/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
+ \fi
+}
+
+%% Controlled sinusoidal voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cvsourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Controlled sinusoidal current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cisourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Controlled current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisource}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Controlled current source - American
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisourceam/height}}
+{cisourceAM}
+{\ctikzvalof{bipoles/cisourceam/height}}
+{\ctikzvalof{bipoles/cisourceam/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Cute Independent voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceC}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Independent current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceC}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Controlled voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsourceC}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Controlled current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisourceC}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Noise voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceN}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ %
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
+ \edef\pgf@noise@temp{dashed}
+ \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
+ \ifx\pgf@noise@temp\pgf@noise@fill
+ % fillable in this case
+ \pgf@circ@draworfillandclip
+ \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ %
+ \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf@noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+%% Noise current source
+
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceN}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ %
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
+ \edef\pgf@noise@temp{dashed}
+ \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
+ \ifx\pgf@noise@temp\pgf@noise@fill
+ % fillable in this case
+ \pgf@circ@draworfillandclip
+ \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ %
+ \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf@noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%
+%% Diodes
+%%%%%%%%%%%%%%
+
+%% Black generic diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulldiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black alternative zigzag Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulltdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulllediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullpdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{fullvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfusepath{draw,fill}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Code for the diode triangle
+\def\pgf@circ@basicdiodeshape{
+ % \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitly the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ % \endpgfscope
+}
+
+%% Empty generic diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptydiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty alternative zigzag Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Empty Schottky diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptysdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptylediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptypdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{emptyvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty bidirectionaldiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{emptybidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgf@circ@draworfill
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Full bidirectionaldiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{fullbidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw, fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Black thyristor
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{fullthyristor}
+{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty thyristor
+
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{emptythyristor}
+{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Empty triac
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/triac/height}}
+{emptytriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgf@circ@draworfill
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Full triac
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+}
+{\ctikzvalof{tripoles/triac/height}}
+{fulltriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%
+%% switches
+%%%%%%%%%%%%%
+
+%% (Closing) SPST
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{cspst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Opening SPST
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{ospst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Normal open Switch
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/nos/depth}}
+{nos}
+{\ctikzvalof{bipoles/nos/height}}
+{\ctikzvalof{bipoles/nos/width}}
+{
+
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+}
+
+%% Normal closed Switch
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/ncs/depth}}
+{ncs}
+{\ctikzvalof{bipoles/ncs/height}}
+{\ctikzvalof{bipoles/ncs/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Push Button
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{pushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+%% Normally closed Push Button
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{ncpushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % Warning, if the nodes will have a class, we have to touch this.
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
+ \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+%%% reed switches
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/reed/depth}}
+{reed}
+{\ctikzvalof{bipoles/reed/height}}
+{\ctikzvalof{bipoles/reed/width}}
+{
+ % this is designed to be the same as a "nos".
+ \pgfmathsetmacro{\@@tmpx}{0.9*\ctikzvalof{bipoles/nos/width}/\ctikzvalof{bipoles/reed/width}}
+ \pgfmathsetmacro{\@@tmpy}{\ctikzvalof{bipoles/nos/height}/\ctikzvalof{bipoles/reed/height}}
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % eclosure
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{90}{\pgf@circ@res@up}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ % switch
+ \pgfpathmoveto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{\@@tmpy\pgf@circ@res@up}}
+ % connection lines
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ % connection lines
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+
+% cute switch "to" shapes help function
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutesw#1#2#3{
+ \pgfcircdeclarebipolescaled{switches}
+ {
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgf@circ@res@down = -.5\pgf@y
+ \pgf@circ@res@up = .5\pgf@y
+ \pgfextracty{\pgf@circ@res@other}{#2}
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@circ@res@other
+ }
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % If cnnecting nodes are scaled, we have to modify this
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ \anchor{cout}{\northeast \pgf@y=0cm}
+ \anchor{cin}{\southwest\pgf@y=0cm}
+ \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
+ \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
+ }
+ {\ctikzvalof{bipoles/cuteswitch/height 2}}
+ {#1}
+ {\ctikzvalof{bipoles/cuteswitch/height}}
+ {\ctikzvalof{bipoles/cuteswitch/width}}{
+ \pgfscope
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % If cnnecting nodes are scaled, we have to modify this
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
+ }
+}
+
+%% closed cute switch
+\pgfcircdeclarecutesw{cuteclosedswitch}
+ {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
+ {}
+
+%% open cute switch
+\pgfcircdeclarecutesw{cuteopenswitch}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ {}
+
+%% closing cute switch
+\pgfcircdeclarecutesw{cuteclosingswitch}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%% opening cute switch
+\pgfcircdeclarecutesw{cuteopeningswitch}
+ {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%%%%%%%%%%%%%%%%%
+%% Instruments
+%%%%%%%%%%%%%%%%%
+
+% % METERINGSHAPE
+\long\def\drawmeteringcircle{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+ %draw connections to circle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ %draw circle
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \endpgfscope
+ %draw arrow
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%AMPEREMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/ammeter/height}}
+{ammeter}
+{\ctikzvalof{bipoles/ammeter/height}}
+{\ctikzvalof{bipoles/ammeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{}
+}
+%OHMMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{ohmmeter}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{\ctikzvalof{bipoles/ohmmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+}
+%VOLTMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{voltmeter}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{\ctikzvalof{bipoles/voltmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{}
+
+}
+
+% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
+ \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/oscope/height}}
+{oscope}
+{\ctikzvalof{bipoles/oscope/height}}
+{\ctikzvalof{bipoles/oscope/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % this would create a round (analog?) scope...
+ % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % grid
+ \pgfscope
+ \pgfsetlinewidth{0.5\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
+ {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfsetstrokeopacity{0.5}
+ \pgfusepath{draw}
+ \endpgfscope
+ % function displayed, thanks to
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, no arrow
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeter}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ % draw the text label
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgftransformrotate{\rot}
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, with arrow
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeterwa}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ % draw the text label
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ % arrow: create a center hole to have better visual
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next open a circle into it
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfsetarrowsend{latexslim}
+ % the arrow is better if it has a bit of breath and it's not 45º
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic square meter with always horizontal text
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
+ \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/smeter/height}}
+{smeter}
+{\ctikzvalof{bipoles/smeter/height}}
+{\ctikzvalof{bipoles/smeter/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \ifpgf@circuit@straightinstruments
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \else
+ \edef\rot{0}
+ \fi
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % the metering window
+ \pgfscope
+ \def\@starta{105}\def\@stopa{75}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
+ \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% probes qucs style:
+% #1 : name
+% #2 : extra code
+\long\def\pgfcirc@qucsprobe#1#2{
+ \pgfcircdeclarebipolescaled{instruments}
+ {
+ \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
+ \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ }
+ {\ctikzvalof{bipoles/qmeter/depth}}
+ {#1}
+ {\ctikzvalof{bipoles/qmeter/height}}
+ {\ctikzvalof{bipoles/qmeter/width}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \def\@starta{103}\def\@stopa{77}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
+ \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgf@circ@draworfill
+ \endpgfscope
+ #2
+ \endpgfscope
+ }
+}
+
+\pgfcirc@qucsprobe{qiprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+}
+
+\pgfcirc@qucsprobe{qvprobe}{
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "-", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+\pgfcirc@qucsprobe{qpprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "-", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% current loop for oscope and similar: stylized
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{i}{\northeast\pgf@x=0pt\relax}
+ \anchor{text}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgf@circ@res@left=-\pgf@circ@res@right
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external ellipse
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
+ {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathellipse{\pgfpointorigin}{
+ \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
+ \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % and the contact line up
+ \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% current loop for oscope and similar: real (double connection)
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{i+}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgf@y=\pgf@circ@res@up
+ }
+ \anchor{i-}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgf@y=\pgf@circ@res@up
+ }
+ \anchor{text}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop2}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgf@circ@res@left=-\pgf@circ@res@right
+ % must be the same than internal i+ and i- anchors definition
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
+ \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external ellipse
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
+ {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathmoveto{\@plus}
+ \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % and the contact line up
+ % I use ...left and ---right as temporal lengths here to avoid defining more
+ \pgfextractx{\pgf@circ@res@left}{\@plus}
+ \pgfextractx{\pgf@circ@res@right}{\@minus}
+ \pgfpathmoveto{\@plus}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\@minus}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Varistor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/varistor/height}}
+{varistor}
+{\ctikzvalof{bipoles/varistor/height}}
+{\ctikzvalof{bipoles/varistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
+}
+
+%%%%%%%%%%%%%%
+%% RF bipoles
+%%%%%%%%%%%%%%
+
+% transmission line
+\pgfcircdeclarebipolescaled{RF}
+{}
+{\ctikzvalof{bipoles/tline/height}}
+{tline}
+{\ctikzvalof{bipoles/tline/height}}
+{\ctikzvalof{bipoles/tline/width}}
+{
+ \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
+ \begin{pgftransparencygroup}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \end{pgftransparencygroup}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{stroke}
+}
+
+% microstrip transmission line
+\pgfcircdeclarebipolescaled{RF}
+{}
+{\ctikzvalof{bipoles/mstline/height}}
+{mstline}
+{\ctikzvalof{bipoles/mstline/height}}
+{\ctikzvalof{bipoles/mstline/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+%%%%%%%%%%%%%%%%%%%
+%% Block diagrams
+%%%%%%%%%%%%%%%%%%%
+
+%% Draw the two-port fillable box
+\def\pgf@circ@twoportbox{
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+}
+
+%% Generic two port box
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/twoport/height}}
+{twoport}
+{\ctikzvalof{bipoles/twoport/height}}
+{\ctikzvalof{bipoles/twoport/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw outer box
+ \pgf@circ@twoportbox
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vco/width}}
+{vco}
+{\ctikzvalof{bipoles/twoport/width}}
+{\ctikzvalof{bipoles/vco/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw circle
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% bandpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/bandpass/width}}
+{bandpass}
+{\ctikzvalof{bipoles/bandpass/width}}
+{\ctikzvalof{bipoles/bandpass/width}}
+{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% bandstop filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/bandstop/width}}
+{bandstop}
+{\ctikzvalof{bipoles/bandstop/width}}
+{\ctikzvalof{bipoles/bandstop/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt}% always draw solid line for inner symbol
+ \pgfsetarrows{-}%never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% highpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/highpass/width}}
+{highpass}
+{\ctikzvalof{bipoles/highpass/width}}
+{\ctikzvalof{bipoles/highpass/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/lowpass/width}}
+{lowpass}
+{\ctikzvalof{bipoles/lowpass/width}}
+{\ctikzvalof{bipoles/lowpass/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% ADC
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/adc/width}}
+{adc}
+{\ctikzvalof{bipoles/adc/width}}
+{\ctikzvalof{bipoles/adc/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/dac/width}}
+{dac}
+{\ctikzvalof{bipoles/dac/width}}
+{\ctikzvalof{bipoles/dac/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/dsp/width}}
+{dsp}
+{\ctikzvalof{bipoles/dsp/width}}
+{\ctikzvalof{bipoles/dsp/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/fft/width}}
+{fft}
+{\ctikzvalof{bipoles/fft/width}}
+{\ctikzvalof{bipoles/fft/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{amp}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \pgf@circ@draworfill
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
+ \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+
+ \pgfsetarrows{-} %never draw arrows
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
+
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{vamp}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \ifpgf@circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
+ \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
+
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+ % draw arrow
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{piattenuator}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% variable pi attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{vpiattenuator}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{tattenuator}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% variable T attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{vtattenuator}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{phaseshifter}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{vphaseshifter}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/detector/width}}
+{detector}
+{\ctikzvalof{bipoles/detector/width}}
+{\ctikzvalof{bipoles/detector/width}}
+{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@scaled@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{0.8\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@fulldiode
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%
+%% MECHANICAL SYMBOLS
+%%%%%%%%%%%%%%%%%%%%%%%
+
+%% mechanical capacitance - stiffness/spring
+
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/spring/height}}
+{spring}
+{\ctikzvalof{bipoles/spring/height}}
+{\ctikzvalof{bipoles/spring/width}}{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@scaled@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical inductance - mass
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/mass/box height}}
+{mass}
+{\ctikzvalof{bipoles/mass/height}}
+{\ctikzvalof{bipoles/mass/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical resistor - damper
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/damper/height}}
+{damper}
+{\ctikzvalof{bipoles/damper/height}}
+{\ctikzvalof{bipoles/damper/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@maybefill
+
+ % line into the damper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {\pgf@circ@res@zero}}
+ \pgfusepath{stroke}
+
+ % damper box
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ % damper vertical element
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+%% mechanical viscoelastic element, suggested by @alex
+%% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
+\pgfcircdeclarebipolescaled{mechanicals}
+{} % extra anchors
+{\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
+{viscoe} % name
+{\ctikzvalof{bipoles/damper/height}} % height (above the path line)
+{\ctikzvalof{bipoles/damper/width}} % width
+{ % draw the bipole
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@maybefill
+
+ % spring into the damper
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
+ \pgfusepath{stroke}
+ \endpgfscope
+ % damper box
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ % damper vertical element
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+
+%%%%%%%%%%%%%%%%
+%% Crossing
+%%%%%%%%%%%%%%%%
+
+%% crossing bipole (but see also nodes)
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/crossing/size}}
+{crossing}
+{\ctikzvalof{bipoles/crossing/size}}
+{\ctikzvalof{bipoles/crossing/size}}{
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Miscellaneous bipoles
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% loudspeaker and microphone
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/loudspeaker/depth}}
+{loudspeaker}
+{\ctikzvalof{bipoles/loudspeaker/height}}
+{\ctikzvalof{bipoles/loudspeaker/width}}{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/mic/depth}}
+{mic}
+{\ctikzvalof{bipoles/mic/height}}
+{\ctikzvalof{bipoles/mic/width}}{
+
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
+ % 0.25358 is 0.6-0.4*cos(30)
+ \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% european gas filled surge arrester
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/european gas filled surge arrester/height}}
+{european gas filled surge arrester}
+{\ctikzvalof{bipoles/european gas filled surge arrester/height}}
+{\ctikzvalof{bipoles/european gas filled surge arrester/width}}
+{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@draworfill
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% american gas filled surge arrester
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/american gas filled surge arrester/height}}
+{american gas filled surge arrester}
+{\ctikzvalof{bipoles/american gas filled surge arrester/height}}
+{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ \pgfcircle{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\ctikzvalof{bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\ctikzvalof{bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
+ \pgfusepath{fill}
+}
+
+%% thermocouple
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/thermocouple/height 2}}
+{thermocouple}
+{\ctikzvalof{bipoles/thermocouple/height}}
+{\ctikzvalof{bipoles/thermocouple/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+}
+
+%% fuse
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/fuse/height}}
+{fuse}
+{\ctikzvalof{bipoles/fuse/height}}
+{\ctikzvalof{bipoles/fuse/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf@circ@draworfill
+}
+
+%% asymmetric fuse
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/afuse/height}}
+{afuse}
+{\ctikzvalof{bipoles/afuse/height}}
+{\ctikzvalof{bipoles/afuse/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% SQUID added by Cor Molenaar 5 March 2010
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/squid/height}}
+{squid}
+{\ctikzvalof{bipoles/squid/height}}
+{\ctikzvalof{bipoles/squid/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/barrier/height}}
+{barrier}
+{\ctikzvalof{bipoles/barrier/height}}
+{\ctikzvalof{bipoles/barrier/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
+
+%% Lamp
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/lamp/height}}
+{lamp}
+{\ctikzvalof{bipoles/lamp/height}}
+{\ctikzvalof{bipoles/lamp/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% bulb
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/bulb/height}}
+{bulb}
+{\ctikzvalof{bipoles/bulb/height}}
+{\ctikzvalof{bipoles/bulb/width}}
+{%
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+% end of pgfcircbipoles.tex
+%%%---------- close: tex/pgfcircbipoles
+%%%%%%%%%%% Springe nach tex/pgfcirctripoles
+%%%---------- open: tex/pgfcirctripoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+%%%%%%%%%%%%%
+%% switches
+%%%%%%%%%%%%%
+
+% Legacy spdt
+\pgfdeclareshape{spdt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/spdt/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
+ {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
+ }
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+% cute switch "node" shapes, matching with cute "to" shapes
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutespdt#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.25\pgf@x
+ }
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgf@circ@res@down = -.5\pgf@y
+ \pgf@circ@res@up = .5\pgf@y
+ \pgfextracty{\pgf@circ@res@other}{#2}
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@circ@res@other
+ }
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ % center anchors
+ \anchor{cin}{ \northwest \pgf@y=0pt}
+ \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
+ \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
+ \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
+
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf@circ@res@temp=\radius\relax
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ % terminals
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ }
+ }
+}
+
+\pgfcircdeclarecutespdt{cute spdt up}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt mid}
+{\pgfpoint{\pgf@circ@res@right}{0pt}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt down}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt up arrow}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt mid arrow}
+{\pgfpoint{\pgf@circ@res@right}{0pt}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt down arrow}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+%% Code from John Kormylo at tex.stackexchange.com
+%% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
+%% Integration and fixes from Romano Giannetti and TheTeXnician <38565529+TheTeXnician@users.noreply.github.com>
+%%
+
+\newcount\pgf@circ@res@count% reserve global register
+
+\def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
+{%
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+}%
+
+% #1 = \pgfmathcounter #2=type #3 specificic port
+% type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
+\def\pgf@circ@logicport@baseinput#1#2#3%
+{%
+ % and and nand
+ \ifnum #2=1\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@x=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@left
+ \fi
+ % or and nor
+ \ifnum #2=2\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american #3 port/angle}}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\pgf@y
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgf@x=\pgf@circ@res@other
+ \fi
+ % xor and xnor
+ \ifnum #2=3\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/american #3 port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@circ@res@temp=\pgf@y
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgf@x=\pgf@circ@res@other
+ \fi
+ % european
+ \ifnum #2=4\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@other}{\left}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@x=\pgf@circ@res@other
+ \fi
+}%
+
+%%% american
+\long\def\pgfcircdeclarelogicport#1#2#3{%
+ \pgfdeclareshape{american #1 port}%
+ {%
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\resize{% automatic
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgf@circ@res@down = -\pgf@circ@res@up
+ \pgf@circ@res@right = \ctikzvalof{tripoles/american #1 port/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right = .5\pgf@circ@res@right
+ \pgf@circ@res@left = -\pgf@circ@res@right
+ }%
+ \savedmacro\inputs{% get number of inputs
+ \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+ \ifnum\pgf@circ@res@count=0
+ \pgf@circ@res@count=\ctikzvalof{tripoles/american #1 port/inputs}\relax%
+ \fi
+ \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
+ \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
+ \def\inputs{\the\pgf@circ@res@count}%
+ }%
+ \savedanchor\step{% 1/2 gap at edges
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
+ \divide\pgf@circ@res@step by \pgf@circ@res@count
+ \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
+ \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
+ \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
+
+ \anchor{center}{\origin}% for backwards compatibility
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % create input anchors
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@circ@res@count%
+ \else%
+ %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+
+ \anchor{out}{\northeast\pgf@y=0pt}
+ \anchor{bout}{\right\pgf@y=0pt}
+
+
+ \anchor{left}{\left}% edges of component minus leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfpoint{0cm}{\pgf@circ@res@up}}
+ \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfpoint{0cm}{\pgf@circ@res@down}}
+ \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ #3
+ }
+}
+}
+%%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{and}{1}{
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+ % output lead
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+ \pgfusepath{draw}
+
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ }
+%%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \pgfcircdeclarelogicport{nand}{1}{
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american nand port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@other = \ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
+ \pgfpathclose
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgf@circ@draworfill
+}
+%%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{nor}{2}{
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american nor port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \advance\pgf@circ@res@other by -\pgf@circ@res@step
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+
+ % not dot
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgf@circ@draworfill
+}
+%%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{or}{2}{
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+
+ \pgf@circ@draworfill
+}
+%%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xor}{3}{
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xor port/angle}}%
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+ \pgf@circ@draworfill
+
+ \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
+
+ \pgfusepath{draw}
+}
+%%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xnor}{3}{
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \ifpgfcirc@draw@leads
+ %input leads
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xnor port/angle}}%
+ \pgf@circ@res@step = \ctikzvalof{tripoles/american xnor port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \advance\pgf@circ@res@other by -\pgf@circ@res@step
+
+ % main shape
+ \ifpgfcirc@roundy@or@shapes
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpathclose
+ \else
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \fi
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+ \pgf@circ@draworfill
+
+ \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@left
+ \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
+
+ \pgfusepath{draw}
+}
+
+%%% Original one-input ports
+
+\pgfdeclareshape{american not port}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgf@circ@draworfill
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+
+\pgfdeclareshape{american buffer port}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+\pgfdeclareshape{invschmitt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+}
+
+\pgfdeclareshape{schmitt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{bin 1}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \ifpgfcirc@draw@leads
+ %input leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+}
+
+
+%%% start european logic ports, from John Kormylo
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+
+% #1 - name
+% #2 - text inside
+% #3 - number of inputs
+% #4 = is it a not?
+
+\long\def\pgfcircdeclareeurologicport#1#2#3#4{
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\resize{% automatic
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgf@circ@res@down = -\pgf@circ@res@up
+ \pgf@circ@res@right = \ctikzvalof{tripoles/european #1 port/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right = .5\pgf@circ@res@right
+ \pgf@circ@res@left = -\pgf@circ@res@right
+ }%
+ \savedmacro\inputs{% get number of inputs
+ \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+ \ifnum\pgf@circ@res@count=0
+ \pgf@circ@res@count=\ctikzvalof{tripoles/european #1 port/inputs}\relax%
+ \fi
+ \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
+ \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
+ \def\inputs{\the\pgf@circ@res@count}%
+ }%
+ \savedanchor\step{% 1/2 gap at edges
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
+ \divide\pgf@circ@res@step by #3
+ \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
+ \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
+ \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
+ \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
+ \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
+
+ \anchor{center}{\origin}% for backwards compatibility
+ % the text anchor overlaps the logic symbol
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
+ % create input anchors
+ \ifnum#3=1\relax
+ \anchor{in}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
+ \anchor{in 1}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
+ \anchor{bin}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
+ \anchor{bin 1}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
+ \else
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>#3%
+ \else%
+ %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
+ \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+ \fi
+ \anchor{out}{\northeast\pgf@y=0pt}
+ \anchor{bout}{\right\pgf@y=0pt}
+
+ \anchor{left}{\left}% edges of component minus leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfpoint{0cm}{\pgf@circ@res@up}}
+ \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfpoint{0cm}{\pgf@circ@res@down}}
+ \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \ifpgfcirc@draw@leads
+ %input leads
+ \ifnum#3=1\relax
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
+ \else
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ %\pgf@circ@res@count = #3\relax% redundant
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \fi
+ \fi
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{%
+ \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ %
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/european #1 port/not height}\pgf@circ@res@up}}
+ \fi
+ %
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgftext{#2}
+ }
+ }
+}
+\pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
+\pgfcircdeclareeurologicport{buffer}{$1$}{1}{}
+\pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
+
+%% end european logic ports
+
+%%%%%%%%%%%%%%%%%%%%%%%%
+%% Transistors
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\long\def\pgfcircdeclaretransistor#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northeast{% upper right
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%center left
+ \pgf@y=0pt
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
+ }
+ \savedanchor\right{%center right -- added by Burak Kelleci % this is really 0,0
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{text}{
+ \northeast
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@transisors@fixlabels
+ \ifpgf@circuit@fet@bodydiode
+ % try to put the text to the right of the flyback diode
+ \pgfmathsetlength{\pgf@circ@res@other}{(
+ \ctikzvalof{tripoles/#1/bodydiode distance}*
+ \ctikzvalof{tripoles/#1/width} +
+ \ctikzvalof{tripoles/#1/bodydiode scale}*
+ \ctikzvalof{bipoles/diode/height}/2
+ )*\pgf@circ@scaled@Rlen}
+ \advance\pgf@x by \pgf@circ@res@other
+ \fi
+ % add a bit of space to avoid central (substrate) terminal if drawn
+ \advance\pgf@x by 0.05\pgf@circ@scaled@Rlen\relax
+ \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ \else
+ \pgf@y=.7\pgf@y
+ \pgf@x= \pgf@circ@scaled@Rlen
+ \pgf@x=0.1\pgf@x
+ \fi
+ }
+ \anchor{pathstart}{ % south
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{pathend}{
+ \northeast
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{south east}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{base}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{bulk}{ %added by Burak Kelleci
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \right
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobulk}{ %added by Burak Kelleci
+ \left
+ \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobase}{
+ \left
+ \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
+ }
+ \anchor{nogate}{
+ \left
+ \pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{body C in}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
+ }
+ \anchor{body E in}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
+ }
+ \anchor{body C out}{
+ \northeast
+ \pgf@ya=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@ya=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@ya
+ \pgf@y=\pgf@ya
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
+ \pgf@y=\pgf@ya
+ }
+ \anchor{body E out}{
+ \northeast
+ \pgf@ya=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
+ \pgf@ya=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@ya
+ \pgf@y=\pgf@ya
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
+ \pgf@y=\pgf@ya
+ }
+ #2
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ \ifnum \ctikzvalof{tripoles/#1/curr direction} > 0
+ \pgf@circuit@trans@ntypetrue
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \fi
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \left
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ %
+ #3
+ % BODY DIODE
+ \ifpgf@circuit@fet@bodydiode
+ \drawbodydiode{#1}
+ \fi
+ %
+ }
+}
+}
+
+\long\def\drawbodydiode#1{
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgftransformrotate{90}
+ % diode scale and bodydiode scale interacts. We want the size of the diode
+ % proportional to the transistor, so we will:
+ % 1) undo diode scale 2) apply transistor scale (using the current class) 3) apply bodydiode scale
+ \pgfmathsetmacro{\@@BDscale}{\ctikzvalof{tripoles/#1/bodydiode scale}* \ctikzvalof{\ctikzclass/scale}/\ctikzvalof{diodes/scale}}
+ \pgftransformscale{\@@BDscale}
+ \ifpgf@circuit@fulldiode
+ \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \else
+ \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \fi
+ \endpgfscope
+ % Draw stroke line
+ \ifpgf@circuit@strokediode
+ \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{stroke}
+ \fi
+ %Draw upper connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope{}
+ %Draw lower connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+}
+
+\long\def\declarebpt#1{
+ \pgfcircdeclaretransistor{#1}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/base height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
+ }
+ }{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transistor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \edef\@@anchor{center}
+ \ifpgf@circuit@trans@ntype
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{btip}
+ \pgftransformlineattime{1.0}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \fi
+ \else % p-type
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{tip}
+ \pgftransformlineattime{1.0}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \else
+ \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \fi
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \ifpgf@circuit@bpt@drawphoto
+ \pgfscope
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \else
+ \ifpgf@circuit@bpt@drawbase
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \fi
+ }
+}
+
+\declarebpt{npn}
+\declarebpt{pnp}
+%
+% multi-emitter and multi-collector BJTs by Romano Giannetti
+%
+\def\pgf@circ@bjt@C@anchor#1{% #1: collector number
+ \pgfextractx{\pgf@circ@res@temp}{\basedimension}
+ \pgfextracty{\pgf@circ@res@other}{\basedimension}
+ \ifnum\cdir>0 % NPN, above
+ \pgfpoint{\pgf@circ@res@temp}{%
+ \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
+ \else % PNP, below
+ \pgfpoint{\pgf@circ@res@temp}{%
+ -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
+ \fi
+}
+\def\pgf@circ@bjt@E@anchor#1{% #1: collector number
+ \pgfextractx{\pgf@circ@res@temp}{\basedimension}
+ \pgfextracty{\pgf@circ@res@other}{\basedimension}
+ \ifnum\cdir<0 % PNP, above
+ \pgfpoint{\pgf@circ@res@temp}{%
+ \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
+ \else % PNP, below
+ \pgfpoint{\pgf@circ@res@temp}{%
+ -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
+ \fi
+}
+
+\long\def\declarebjt#1{
+ \pgfdeclareshape{bjt#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % \cdir is 1 for npn, -1 for pnp
+ \savedmacro{\cdir}{\edef\cdir{\ctikzvalof{tripoles/bjt/#1/curr direction}}}
+ \savedmacro{\numE}{\edef\numE{\ctikzvalof{tripoles/bjt/emitters}}}
+ \savedmacro{\numC}{\edef\numC{\ctikzvalof{tripoles/bjt/collectors}}}
+ % step up or down for the additional C/Es
+ \saveddimen{\multistep}{\pgfmathsetlength{\pgf@x}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
+ \saveddimen{\external}{\pgfmathsetlength{\pgf@x}{%
+ \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
+ \savedanchor\basedimension{% these are the dimensions if nC=1 y nE=1
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\northeast{% upper right
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@step}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \ifnum\cdir> 0
+ \edef\numup{\numC}\edef\numdown{\numE}
+ \else
+ \edef\numup{\numE}\edef\numdown{\numC}
+ \fi
+ \pgfmathsetlength{\pgf@y}{0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ + (\numup-1)*\pgf@circ@res@step+\pgfverticaltransformationadjustment*.5*\pgflinewidth
+ + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\southeast{% lower right
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@step}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \ifnum\cdir> 0
+ \edef\numup{\numC}\edef\numdown{\numE}
+ \else
+ \edef\numup{\numE}\edef\numdown{\numC}
+ \fi
+ \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
+ - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\southwest{% lower left
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@step}{%
+ \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
+ \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \ifnum\cdir> 0
+ \edef\numup{\numC}\edef\numdown{\numE}
+ \else
+ \edef\numup{\numE}\edef\numdown{\numC}
+ \fi
+ \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
+ - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
+ - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{tripoles/bjt/width}*\pgf@circ@scaled@Rlen
+ - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\southwest\pgf@x=0cm\relax}
+ \anchor{west}{\southwest\pgf@y=0cm}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@ya=\pgf@y\southwest\pgf@y=\pgf@ya}
+ \anchor{south west}{\southwest}
+ \anchor{south east}{\southeast}
+
+ \anchor{text}{\northeast\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax}
+ \anchor{B}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
+ \anchor{base}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
+ \anchor{nobase}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x}
+ % center of the base "bar"
+ \anchor{cbase}{\basedimension\pgf@x=-\pgf@x
+ \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
+ }
+ % geometrical centers
+ \anchor{vcenter}{\pgf@x=0cm\relax
+ \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
+ }
+ \anchor{gcenter}{%
+ \northeast\pgf@xa=0.5\pgf@x
+ \southwest\advance\pgf@xa by 0.5\pgf@x
+ \pgf@x=\pgf@xa
+ \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
+ }
+ % external connections
+ \anchor{E}{
+ \ifnum\cdir>0% npn, emitter down
+ \southeast
+ \else
+ \northeast
+ \fi
+ }% first emitter
+ \anchor{emitter}{\ifnum\cdir>0\southeast\else\northeast\fi}% first emitter
+ \anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi}
+ \anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi}
+
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ % set the type and up and down number of connections
+ %
+ \ifnum\cdir> 0
+ \pgf@circuit@trans@ntypetrue
+ \edef\numup{\numC}
+ \edef\numdown{\numE}
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \edef\numup{\numE}
+ \edef\numdown{\numC}
+ \fi
+ \basedimension
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\multistep
+ %
+ % set arrow positions options
+ %
+ \edef\@@anchor{center}\edef\@@pos{\ctikzvalof{tripoles/#1/arrow pos}}
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@pos{1.0}
+ \ifpgf@circuit@trans@ntype % arrow is toward outside, push it a bit
+ \edef\@@anchor{btip}
+ \else
+ \edef\@@anchor{tip}
+ \fi
+ \fi
+ %
+ % Drawing upper connections
+ %
+ \pgfscope
+ \pgf@circ@count@a=\numup\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \advance\pgf@circ@count@a-1\relax
+ \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
+ \ifnum\pgf@circ@count@a=\numexpr\numup-1\relax % draw the external pin connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\external+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
+ \fi
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}}%
+ \pgfsetroundcap % better when connecting to sloped lines
+ \pgfusepath{draw}
+ \ifpgf@circuit@trans@ntype\else % it's a PNP; draw arrow
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}%
+ }{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+ \repeatpgfmathloop
+ \endpgfscope
+ %
+ % Drawing base
+ %
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@up+(\numup-1)*\multistep}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@down-(\numdown-1)*\multistep}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfsetroundcap % I like it more...
+ \pgfusepath{draw}
+ \endpgfscope
+ %
+ % draw base external connection
+ %
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left-\external}{0pt}}
+ \pgfusepath{draw}
+ %
+ % Drawing lower connections
+ %
+ \pgfscope
+ \pgf@circ@count@a=\numdown\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \advance\pgf@circ@count@a-1\relax
+ \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@right}
+ {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}}
+ \ifnum\pgf@circ@count@a=\numexpr\numdown-1\relax % draw the external pin connection
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@right}
+ {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other-\external}}
+ \fi
+ \pgfsetroundcap % better when connecting to sloped lines
+ \pgfusepath{draw}
+ \ifpgf@circuit@trans@ntype % it's a NPN; draw arrow
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}%
+ }{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+ \repeatpgfmathloop
+ \endpgfscope
+ }
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@bjt#1\endcsname{%
+ % Start with the maximum collector number and go backwards.
+ \pgf@circ@count@a=\numC\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@bjt#1@C\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@bjt@C@anchor{\the\pgf@circ@count@a}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % and emitters
+ \pgf@circ@count@a=\numE\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@bjt#1@E\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@bjt@E@anchor{\the\pgf@circ@count@a}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+}
+
+\declarebjt{npn}
+\declarebjt{pnp}
+
+% end of multi-bjts
+
+\long\def\declareigbt#1{
+ \pgfcircdeclaretransistor{#1}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ }
+ {
+ %draw upper connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %draw thicker gate lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw lower connection
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transistor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \ifpgf@circuit@trans@ntype
+ \edef\@@anchor{btip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{tip}\edef\@@pos{1.0}
+ \fi
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.5}
+ \fi
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ %draw gate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
+ \fi
+ \pgfusepath{draw}
+ }
+}
+
+\declareigbt{pigbt}
+\declareigbt{nigbt}
+\declareigbt{Lnigbt}
+\declareigbt{Lpigbt}
+
+\pgfcircdeclaretransistor{nmos}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/nmos/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \ifpgf@circuit@trans@arrowatend
+ \pgftransformshift{\pgfpoint
+ {\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{trarrow}{btip}{}{}{\pgfusepath{stroke}}
+ \else
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\ctikzvalof{tripoles/nmos/arrow pos}}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \fi
+ \endpgfscope
+ \fi
+
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+
+ \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+}
+
+\pgfcircdeclaretransistor{pmos}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/pmos/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \ifpgf@circuit@trans@arrowatend
+ \pgftransformshift{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgftransformrotate{180}
+ \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}}
+ \else
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\ctikzvalof{tripoles/pmos/arrow pos}}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \fi
+ \endpgfscope
+ \fi
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+
+
+ \pgfusepath{draw}
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+
+ \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+
+ \ifpgf@circuit@pmos@nocircle\else
+ % we are not scaling the circle with the MOS --- I think it's better to have it
+ % coherent with the poles/nodes of the rest of the circuit.
+ \pgfpathcircle{\pgfpoint
+ {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left - \ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \ifpgf@circuit@pmos@emptycircle
+ \pgfsetfillcolor{white}
+ \fi
+ \pgfusepath{draw,fill}
+ \fi
+}
+
+%% HEMT FET Transistor
+\pgfcircdeclaretransistor{hemt}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+\long\def\drawfetcore#1{
+ \pgftransformationadjustments
+ %top connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
+ \ifpgf@circuit@trans@depletiontype
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \else
+
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
+ \fi
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %Bulk connection line
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ %bottom connection
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ %draw thick gate line
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \ifpgf@circuit@trans@ntype
+ \edef\@@anchor{tip}
+ \edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{btip}
+ \edef\@@pos{0.0}
+ \fi
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.6}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \ifpgf@circuit@trans@ntype
+ \else
+ \pgftransformrotate{180}
+ \fi
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+% GATE CONNECTION
+\ifpgf@circuit@bpt@drawgate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
+ {-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+\fi
+
+}
+
+\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
+{\pgfcircdeclaretransistor{#1}{
+ \anchor{bulk}{\left\pgf@x=0pt}
+ \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
+ }
+ #2
+ }
+ {#3}
+}
+
+\pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nfet}
+}
+
+\pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pfet}
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfete}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+\fi
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
+\pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfetebulk}
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% N-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{nigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfete}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
+\pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfetebulk}
+}
+
+% P-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{pigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+\pgfcircdeclaretransistor{njfet}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % arrow
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{tip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.6}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclaretransistor{pjfet}{
+ \anchor{inner up}{
+ \northeast
+ \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
+ }
+ \anchor{inner down}{
+ \northeast
+ \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
+ }
+ }{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{btip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.4}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+\pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DEPLETION TYPE
+ \pgfscope %% added
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} %% added
+ \pgfusepath{draw} %% added
+ \endpgfscope %% added
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@arrowatend
+ \edef\@@anchor{tip}\edef\@@pos{1.0}
+ \else
+ \edef\@@anchor{center}\edef\@@pos{0.6}
+ \fi
+ \pgftransformlineattime{\@@pos}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfusepath{draw}
+
+ % Wavy lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% end of transistors
+
+%%%%%%%%%%%%%
+%% Switches
+%%%%%%%%%%%%%
+
+\pgfcircdeclarebipole{
+ \anchor{out 1}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{out 2}{
+ \northeast
+ \pgf@y=.8\pgf@y
+ }
+}
+{\ctikzvalof{tripoles/toggleswitch/height 2}}
+{toggleswitch}
+{\ctikzvalof{tripoles/toggleswitch/height}}
+{\ctikzvalof{tripoles/toggleswitch/width}}
+{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetdash{}{0cm}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% operational and instrumentation amplifiers
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{op amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % Triangle
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Output terminal
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Op amp shape as in european standard EN 60617
+\pgfdeclareshape{en amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{up}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{down}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+
+ \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
+ % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
+ }
+}
+
+% Fully differential output op amp
+% Contributed by Kristofer M. Monisit
+\pgfdeclareshape{fd op amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\outline{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/fd op amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out up}{
+ \northwest
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out down}{
+ \northwest
+ \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out +}{
+ \outline
+ \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out -}{
+ \outline
+ \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bout +}{
+ \outline
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ }
+ \anchor{bout -}{
+ \outline
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bout up}{
+ \northwest
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ }
+ \anchor{bout down}{
+ \northwest
+ \pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
+ {\pgfpoint{\pgf@xa}{0pt}}
+ {\pgfpoint{0pt}{\pgf@ya}}
+ \pgf@y=-\pgf@y
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{out}{% should not be used
+ \left
+ \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x \pgf@y=-\pgf@y }
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % Triangle
+ % Includes output terminals in the traingular shape
+ % to ensure that diagonal joins are properly displayed
+ % we first draw the main triangle and the leads with normal thickness,
+ % and the redraw the main triangle with the component shape
+ \pgfscope
+ % shift origin a bit to ease calculations
+ \pgftransformxshift{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@step
+
+ % Initial point (right vertex)
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+
+ % Negative output terminal
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
+
+ % Top vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+
+ % Bottom vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+
+ % Positive output terminal
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
+
+ % Right vertex
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+
+ \pgfpathclose
+ \pgfusepath{stroke}
+
+ % ok, now we'll redraw the triangle with the class specific
+ % thickness and optionally fill
+
+ \pgfscope
+ \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
+
+ % Initial point (right vertex)
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ % Top vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ % Bottom vertex
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope % thick and fill
+ \endpgfscope % shift
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Negative output terminal label
+ \pgftext[right, bottom, x=3pt, y=1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Positive output terminal label
+ \pgftext[right, top, x=3pt, y=-1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+
+% Instrumentation amplifier with differential output
+\pgfdeclareshape{fd inst amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % when tikz calls the anchor it wants the relative position in the lengths
+ % \pgf@x \pgf@y
+ % \pgfpoint* functions set that variables
+ % anchors are visible outside and run on use
+ \anchor{center}{\pgfpointorigin}
+ % savedanchors are internals and run on node creation (not use)
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/fd inst amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/fd inst amp/refv pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\outport{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
+ }
+ \anchor{out}{
+ \outport
+ \pgf@y=0pt
+ }
+ \anchor{out +}{
+ \outport
+ }
+ \anchor{out -}{
+ \outport
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\outportfixed{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-.5\pgf@x
+ }
+ \anchor{out up}{
+ \outportfixed
+ }
+ \anchor{out down}{
+ \outportfixed
+ \pgf@y=-\pgf@y
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@x=-\pgf@x \pgf@y=0pt
+ }
+ \anchor{bout +}{
+ \outport
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ \anchor{bout -}{
+ \outport
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ \anchor{bout up}{
+ \outportfixed
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ \anchor{bout down}{
+ \outportfixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
+ }
+ % end border anchors
+ %
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % let's start drawing the component
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ % main component, normally in thicker lines
+ \pgfscope
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@step
+ %first point (near output)
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % input terminal up
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % input terminal down
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % output leads down and up
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} %
+ \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} %
+ \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Transconductance amplifier (Transkonduktanzverstärker)
+\pgfdeclareshape{gm amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/gm amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/gm amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgfscope
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@step
+ %Umrandung:
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{0}} %geändert startpunkt neu am ausgangsstrich
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}%vom Ausgang nach oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@down}}%ecke links unten nach rechts unten
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{0pt}} %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+ }
+}
+
+% Instrumentation amplifier
+\pgfdeclareshape{inst amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % when tikz calls the anchor it wants the relative position in the lengths
+ % \pgf@x \pgf@y
+ % \pgfpoint* functions set that variables
+ % anchors are visible outside and run on use
+ \anchor{center}{\pgfpointorigin}
+ % savedanchors are internals and run on node creation (not use)
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp/refv pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/inst amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % let's start drawing the component
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ %
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % main component, normally in thicker lines
+ \pgfscope
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@step
+ %first point (near output)
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Output terminal
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{0pt}} %
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Instrumentation amplifier with terminals for gain resistance between inputs
+\pgfdeclareshape{inst amp ra}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
+ }
+ % inputs (+-)
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ % R ampli anchors. They are by default at 20% more than R-length distance
+ % you can change that with the `ra pos` key (use 0.5 for one-R).
+ \savedanchor\raOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{ra up}{
+ \raOneFixed
+ }
+ \anchor{ra down}{
+ \raOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\raOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{ra-}{
+ \raOne
+ }
+ \anchor{ra+}{
+ \raOne
+ \pgf@y=-\pgf@y
+ }
+ % power supplies
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp ra/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
+ \pgf@y=0.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=0.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/inst amp ra/refv pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/inst amp ra/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra up}{
+ \raOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra down}{
+ \raOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra-}{
+ \raOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bra+}{
+ \raOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % drawing of the component
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \newdimen\pgf@circ@res@right@double
+ \pgf@circ@res@right@double=2\pgf@circ@res@right
+
+ % main component, normally in thicker lines
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@step
+ %primer punto: la linea de salida (lado componente)
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up anchor
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % ra terminal -
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ % ra terminal +
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+
+ % Output terminal
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{0pt}} %
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+
+% Buffer
+% Contributed by Danilo Piazzalunga
+\pgfdeclareshape{buffer}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/buffer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/buffer/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{bin}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
+ \anchor{bout}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+
+% plain amplifier, no symbols
+\pgfdeclareshape{plain amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \savedanchor\inOneFixed{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/plain amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin up}{
+ \inOneFixed
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bin down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b-}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{b+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+
+% plain amplifier, no symbols, one input
+\pgfdeclareshape{plain mono amp}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt\relax
+ }
+ \anchor{in}{
+ \inOne
+ }
+ % support for border anchors
+ \savedanchor\leftedge{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x = \ctikzvalof{tripoles/plain amp/port width}\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}{\leftedge}
+ \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
+ \anchor{bin}{
+ \inOne
+ \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
+ }
+ \anchor{bout}{
+ \leftedge
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ % end border anchors
+ \savedanchor\up{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \ctikzvalof{tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
+ {0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+ }
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% electromechanical device (motor/generator)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{elmech}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{electromechanicals}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{%
+ \@tempdima=\pgf@x\@tempdimb=\pgf@y
+ \northwest\pgf@circ@res@other=-\pgf@x
+ \pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}{\pgfqpoint{\pgf@circ@res@other}{\pgf@circ@res@other}}
+ }
+ \anchor{block north west}{\northwest\pgf@x=0.5\pgf@x}
+ \anchor{block south west}{\northwest\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y}
+ \anchor{block north east}{\northwest\pgf@x=-0.5\pgf@x}
+ \anchor{block south east}{\northwest\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y}
+ \anchor{block up right}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@x=-0.5\pgf@x
+ }
+ \anchor{block up left}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@x=0.5\pgf@x
+ }
+ \anchor{block down right}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@y=-\pgf@y
+ \pgf@x=-0.5\pgf@x
+ }
+ \anchor{block down left}{
+ \northwest
+ % remember that pgf@x is negative
+ % center of the block is at 0.5*H+W*cos(30)/2
+ \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
+ \pgf@y=-\pgf@y
+ \pgf@x=0.5\pgf@x
+ }
+ \behindbackgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope % clip the bar: whole size minus the circle
+ \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgfusepath{fill, draw}
+ \endpgfscope
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%
+%% Magnetron
+%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{magnetron}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{anode}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{cathode1}{
+ \northwest
+ \pgf@circ@res@step=\pgf@y
+ \pgfmathparse{cos(105)}
+ \pgf@x=\pgfmathresult\pgf@circ@res@step
+ \pgfmathparse{sin(105)}
+ \pgf@y=\pgfmathresult\pgf@circ@res@step
+ %\pgfpointorigin
+ %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
+ }
+ \anchor{cathode2}{
+ \northwest
+ \pgf@circ@res@step=\pgf@y
+ \pgfmathparse{cos(75)}
+ \pgf@x=\pgfmathresult\pgf@circ@res@step
+ \pgfmathparse{sin(75)}
+ \pgf@y=\pgfmathresult\pgf@circ@res@step
+ %\pgfpointorigin
+ %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ %create outer circle
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
+ \pgf@circ@draworfill
+ %create chambers
+ \foreach \angle in {45,135,225,315}{
+ \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
+ \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
+ }
+ \pgfsetroundcap
+ \pgfusepath{draw}
+ \pgfscope
+ %draw connection from outside
+ %anode
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ %cathodes
+ \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ %create cathode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %create anode
+ \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Electronic tubes, submitted by J. op den Brouw
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Draw tube outline
+\def\pgf@circ@tubes@drawtube{%
+ \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfutil@tempdima=\pgf@circ@res@right
+ \advance\pgfutil@tempdima by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{90}{\pgf@circ@res@up}
+ \else
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
+ \pgfutil@tempdima=\pgf@circ@res@up
+ \advance\pgfutil@tempdima by -\pgf@circ@res@right
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{\pgf@circ@res@right}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{-\pgf@circ@res@right}
+ \fi
+ \pgfpathclose
+}
+
+%% The diode (tube), triode, tetrode and pentode only differ in the
+%% number of grids. So we construct a generic declare function in
+%% which we can put code for the grid anchors and grid drawing code
+%% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
+\long\def\pgfcircdeclaretube#1#2#3{%
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ % x and y should be half the Rlen
+ \pgf@y=\pgf@circ@res@up
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@circ@res@right
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{north} {%
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{east}{%
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{west}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{north west}{%
+ \northwest
+ }
+ \anchor{north east}{%
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{anode} {%
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{cathode}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{cathode 1}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{cathode 2}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{filament 1}{%
+ \northwest
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@x=\pgfmathresult\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{filament 2}{%
+ \northwest
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@x=-\pgfmathresult\pgf@x
+ \pgf@y=-\pgf@y
+ }
+
+ % Extra anchors
+ #2
+
+ \backgroundpath{
+ \pgfscope
+ % Line width for tripoles
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ % Setup to draw tube
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
+ \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+
+ % Tube outline
+ \pgf@circ@tubes@drawtube
+
+ % Setup to draw grid, filament, anode and cathode
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=0.5\pgf@circ@res@up
+ \pgf@circ@res@right=0.5\pgf@circ@res@right
+
+ % Tube fill color (if any)
+ \pgf@circ@draworfill
+
+ % Grid drawing
+ #3
+
+ % Filament (is not drawn by default)
+ \ifpgf@circuit@tubes@filament
+ \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
+ \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@xa=\pgfmathresult\pgf@circ@res@right
+ \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
+ \pgf@ya=\pgfmathresult\pgf@circ@res@up
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
+ \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@filamentfalse
+ \fi
+
+ % Anode (or plate)
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
+ \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+
+ % Cathode
+ \ifpgf@circuit@tubes@nocathode
+ \pgf@circuit@tubes@nocathodefalse
+ \else
+ \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \ifpgf@circuit@tubes@fullcathode
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@fullcathodefalse
+ \else
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}}
+ \fi
+ \fi
+
+ % Draw the background
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+}
+
+\pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
+
+\pgfcircdeclaretube{triode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{control} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+}
+{
+ % Grid protrusion
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{tetrode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{control} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \pgfutil@tempdima=0.5\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgfutil@tempdimb=0.5\pgfutil@tempdimb
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{pentode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{control} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{suppressor} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{pentode suppressor to cathode}
+{
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{control} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \ifnum\pgf@circ@count@a>1\relax
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
+ \fi
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+ % Grid: connection from suppressor to cathode
+ \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+
+}
+
+%%%---------- close: tex/pgfcirctripoles
+%%%%%%%%%%% Springe nach tex/pgfcircquadpoles
+%%%---------- open: tex/pgfcircquadpoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Quadripoles
+
+\long\def\pgfcircdeclarequadpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{inductors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@scaled@Rlen
+ \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
+ }
+ %% we define the upper right (positive coord) dot (which is B1)
+ \savedanchor{\innerdot}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@xa=.5\pgf@circ@scaled@Rlen
+ \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
+ % by default use the cute inductor size
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
+ % check if it's american
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}
+ \edef\pgf@temp{american}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ % check if it's european
+ \edef\pgf@temp{european}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
+ }
+ \savedanchor{\outerdot}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@xa=.5\pgf@circ@scaled@Rlen
+ \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
+ % by default use the cute inductor size
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
+ % check if it's american
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}
+ \edef\pgf@temp{american}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ % check if it's european
+ \edef\pgf@temp{european}
+ \ifx\pgf@circ@temp\pgf@temp
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
+ \fi
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ %% dot's anchors
+ \anchor{inner dot A1}{\innerdot\pgf@x=-\pgf@x}
+ \anchor{outer dot A1}{\outerdot\pgf@x=-\pgf@x}
+ \anchor{inner dot A2}{\innerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{outer dot A2}{\outerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{inner dot B1}{\innerdot}
+ \anchor{outer dot B1}{\outerdot}
+ \anchor{inner dot B2}{\innerdot\pgf@y=-\pgf@y}
+ \anchor{outer dot B2}{\outerdot\pgf@y=-\pgf@y}
+ % geographical
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ #2
+ }
+ }
+}
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \ctikzvalof{quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+%% Null styles that can be used to change individually the L1 and L2
+%% inductors of the transformer.
+
+\ctikzset{transformer L1/.style={}}
+\ctikzset{transformer L2/.style={}}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \pgfkeys{\circuitikzbasekey/.cd, transformer L1}
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \pgfkeys{\circuitikzbasekey/.cd, transformer L2}
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{\thisshape-L1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{\thisshape-L1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{\thisshape-L2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{\thisshape-L2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+\pgfcircdeclarequadpole{transformer}{
+ \pgf@circ@drawtransformerbasicbody
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ % use the chocke line thickness
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+
+ % Find the distance from center for the lines representing the core
+ % the 2.5 is for backward compatibility --- the distance was calculated as a fraction
+ % of the whole component, now as a fraction of the distance between coils, to be
+ % compatible with the quadpoles "inner" style.
+ \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right}
+
+ \pgfmoveto{\pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ %% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday...
+ \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left}
+ \pgfmoveto{\pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint%
+ {\pgf@circ@res@other}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@other}{min(.7*\stretto*\pgf@circ@res@up, .8*\pgf@circ@res@right)} % radius
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{-\pgf@circ@res@other}}
+ \pgfpatharc{-90}{90}{\pgf@circ@res@other}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpatharc{90}{270}{\pgf@circ@res@other}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}{}
+
+%%%%%%%%%%%%%%%%%%%%
+%% Block elements
+%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{mixer}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{adder}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{oscillator}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \else
+ \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
+ \anchor{north east}{ \northwest \pgf@x=0pt\relax}
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{text}{
+ \pgf@x=-2\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
+
+ % draw outer box
+ \ifpgf@circuit@boxed{}
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{circulator}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@boxed
+ \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed{}
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgf@circ@draworfill
+
+ % inner arrow
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
+ \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+ }
+
+
+% Wilkinson divider
+\pgfdeclareshape{wilkinson}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{tripoles/wilkinson/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{out2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgf@circ@twoportbox
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ % draw inner resisitor - european or american style is recognised
+ {
+ \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgftransformrotate{90}
+
+ % calculate size of resistor
+ \ifpgf@circuit@europeanresistor
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{genericshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
+ \fi
+ }
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}}
+
+ \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+%% couplers generics
+\long\def\pgfcircdeclarefourport#1#2{
+
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@scaled@Rlen
+ \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{port1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{port4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+
+ % draw inner stuff
+ #2
+
+ % draw inner text
+ \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ }
+ }
+}
+
+% four-port
+\pgfcircdeclarefourport{fourport}{}
+
+% straight coupler
+\pgfcircdeclarefourport{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarefourport{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%---------- close: tex/pgfcircquadpoles
+%%%%%%%%%%% Springe nach tex/pgfcircmultipoles
+%%%---------- open: tex/pgfcircmultipoles.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Multipoles by Romano Giannetti
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%
+%% Chips
+%%%%%%%%%
+
+% let's use the same shifts everywhere, no magic numbers
+\def\pgf@circ@dip@pin@shift{0.5}
+\def\pgf@circ@qfp@pin@shift{0.25}
+
+% derived from https://tex.stackexchange.com/a/146753/38080
+% original author Mark Wibrow
+% Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
+% a lot of thanks to @marmot for the un-rotation hint
+% https://tex.stackexchange.com/a/473571/38080
+
+% DIP (dual in line package) chips
+
+\pgfdeclareshape{dipchip}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\numpins{%
+ \pgf@circ@count@a=\ctikzvalof{multipoles/dipchip/num pins}%
+ \def\numpins{\the\pgf@circ@count@a}
+ }
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins)
+ *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ }%
+ \saveddimen{\chipspacing}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/pin spacing}}}
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ % standard anchors
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{0.5*((\numpins)
+ *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step = \ctikzvalof{multipoles/dipchip/pin spacing}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
+ \pgf@circ@draworfill
+ %% upside mark
+ \ifpgf@circuit@chip@topmark
+ \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
+ \fi
+ \pgfusepath{stroke}%
+ \pgfsetcolor{\ctikzvalof{color}}
+ % Adding the pin number
+ \ifpgf@circuit@chip@shownumbers
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+ \ifpgf@circuit@chip@straightnumbers
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \fi
+ \endpgfscope
+ \ifdim\pgf@circ@res@other>0pt
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
+ \ifnum\padfrac>0
+ \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
+ % left side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % right side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \else
+ % left side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % right side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{stroke}
+ \endpgfscope
+ \fi
+ }%
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\numpins\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+
+% QFP (quad flat package) chips
+
+\pgfdeclareshape{qfpchip}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro\numpins{%
+ \pgf@circ@count@a=\ctikzvalof{multipoles/qfpchip/num pins}%
+ \def\numpins{\the\pgf@circ@count@a}
+ }
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins+2)
+ *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
+ }%
+ \saveddimen\width{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins+2)
+ *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
+ }%
+ \saveddimen{\chipspacing}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/qfpchip/pin spacing}}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ % standard anchors
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
+ *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
+ \pgf@x=-\pgf@y
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step = \ctikzvalof{multipoles/qfpchip/pin spacing}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ %% upside mark
+ \ifpgf@circuit@chip@topmark
+ \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
+ \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
+ \else
+ \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
+ \fi
+ %% rest of the shape
+ \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
+ \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
+ \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ % Adding the pin number
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf@circuit@chip@shownumbers
+ \pgf@circ@count@a=\numpins%
+ \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
+ % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+ \ifpgf@circuit@chip@straightnumbers
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \fi
+ \endpgfscope
+ \ifdim\pgf@circ@res@other>0pt
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins%
+ \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
+ \ifnum\padfrac>0
+ \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
+ % left side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % bottom side pads
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ % right side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % top side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \else
+ % left side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % bottom side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ % right side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ % top side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{stroke}
+ \endpgfscope
+ \fi
+ }%
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\numpins%
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+
+%% anchors for DIP
+\def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \c@pgf@countc=\numpins\relax
+ \divide\c@pgf@countc by 2
+ \ifnum #1 > \the\c@pgf@countc
+ % right side
+ \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
+ \else
+ \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
+\fi
+}
+
+%% anchors for QFP
+\def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \c@pgf@countc=\numpins\relax
+ \divide\c@pgf@countc by 4
+ \ifnum #1 > \the\c@pgf@countc
+ \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
+ \ifnum #1 > \the\c@pgf@countb
+ \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
+ \ifnum #1 > \the\c@pgf@countb
+ % 3*npins/4 < pin, top side
+ \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
+ \else
+ % 2*npins/4 < pin <= 3*npins/4, right side
+ \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
+ \fi
+ \else
+ % npins/4 < pin <= 2*npins/4, bottom side
+ \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
+ \fi
+ \else
+ % <= npins/4, left side
+ \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+ \fi
+}
+
+%%%%%%%%%%%%%%%%%
+%% Rotary Switch
+%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{rotaryswitch}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northeast{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@scaled@Rlen + \pgf@circ@res@temp}
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@scaled@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
+ }
+ \savedanchor\central{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
+ }
+ % external square limits
+ \savedanchor\extnorthwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
+ \pgf@x=2.5\pgf@x % external square size
+ \pgf@y=-\pgf@x %square thing when angle=180?
+ }
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{0.3052*\pgf@circ@scaled@Rlen*\ctikzvalof{tripoles/spdt/width}}}
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
+ \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
+ \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
+ \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
+ \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
+ % mid of the lever, to stack switches
+ %\anchor{mid}{\midlever}
+ \anchor{mid}{\northwest
+ \pgf@circ@res@temp=-\pgf@x
+ \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
+ \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
+ }
+ % center anchors
+ \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf@y=0pt}
+ \anchor{ain}{ \northwest \pgf@y=0pt}
+
+ \anchor{center}{ \central \pgf@y=0pt }
+ \anchor{east}{ \northeast \pgf@y=0pt }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \central \pgf@y=-\pgf@y }
+ \anchor{north}{ \central }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northeast }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
+
+ \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
+ \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
+ \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
+ \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+ \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
+ \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+ \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
+ \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
+ \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@res@right = \width
+ \pgf@circ@res@left = -\width
+
+ \pgfscope %wiper
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf@circ@res@temp=\radius\relax
+ \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+
+ \ifpgf@circ@rotaryarrow
+ \pgfscope % arrow
+ \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
+ \pgftransformrotate{\wiper}
+ \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
+ \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
+ \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
+ \pgfusepath{draw}
+ \endpgfscope
+ \fi
+
+ % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
+ \pgf@circ@count@a=\channels\relax
+ \pgfmathsetmacro{\currenta}{-\angle}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
+ \pgfscope
+ \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfmathsetmacro{\currenta}{\currenta+\stepa}
+ % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+
+ \pgfscope % input
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
+ \endpgfscope
+ }
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\channels\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+
+\def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
+ \pgf@circ@res@temp=\width
+ \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
+ \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
+ \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
+ \advance\pgf@x by -\pgf@circ@res@temp
+}
+
+\def\pgf@circ@rotarysqanchor#1{% external square anchors
+ \pgf@circ@res@temp=\width
+ \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
+ \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
+ \advance\pgf@x by -\pgf@circ@res@temp
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Seven segments displays
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\pgfdeclareshape{bare7seg}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{displays}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
+ \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
+ \ifpgf@circ@sevenseg@dot
+ \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
+ \else
+ \pgf@x=0pt
+ \fi
+ }
+ % The object extension is more or less (-width/2,-width) to (width/2,width)
+ % and adjusted for line thickness (both sides) and eventually the dot
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}}
+ \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
+ \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
+ \savedanchor{\southwest}{% both negative
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
+ \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
+ }
+ \savedanchor{\northeast}{% both positive
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circ@sevenseg@dot
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
+ \else
+ \pgf@circ@res@other=0pt
+ \fi
+ \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
+ +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
+ }
+ \savedanchor{\topright}{% anchor without the box sep and the thickness
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{north west}{\southwest\pgf@y=-\pgf@y}
+ \anchor{north east}{\northeast}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\southwest}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0pt}
+ \anchor{south}{\southwest\pgf@x=0pt}
+ \anchor{west}{\southwest\pgf@y=0pt}
+ \anchor{a}{\topright\pgf@x=0pt}
+ \anchor{b}{\topright\pgf@y=0.5\pgf@y}
+ \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
+ \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
+ \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{g}{\pgfpointorigin}
+ \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
+ \behindbackgroundpath{%
+ \southwest % I do not want the dot here, it will stick out
+ \pgf@circ@res@up = -\pgf@y
+ \pgf@circ@res@down = \pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \pgf@circ@res@left = -\pgf@x
+ \pgfscope
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfpathrectanglecorners%
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
+ \ifpgf@circ@sevenseg@box
+ \pgf@circ@draworfill
+ \else
+ \pgf@circ@maybefill
+ \fi
+ \endpgfscope
+ \edef\bits{\ctikzvalof{seven seg/bits}}
+ \pgfscope
+ \pfg@circ@sseg@drawbits{\bits}
+ \endpgfscope
+ \pgfscope
+ \ifpgf@circ@sevenseg@dot
+ \pgf@circ@sseg@drawdots
+ \fi
+ \endpgfscope
+ }
+}
+
+\def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
+ \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
+}
+\def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
+ \ifnum #1 > 0\relax
+ \pgfsetcolor{\ctikzvalof{seven seg/color on}}
+ \else
+ \pgfsetcolor{\ctikzvalof{seven seg/color off}}
+ \fi
+ \pgfpathmoveto{\pgfpoint{#2}{#3}}
+ \pgfpathlineto{\pgfpoint{#4}{#5}}
+ \pgfusepath{draw}
+}
+\def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
+ \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
+ \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
+ \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
+ % \pgfsetroundcap
+ \pgfsetarrowsstart{Triangle Cap[]}
+ \pgfsetarrowsend{Triangle Cap[]}
+ % segments
+ \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
+ \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
+ \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
+ \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
+ \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
+ \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
+ \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
+}
+\def\pgf@circ@sseg@drawdots{% dots
+ \edef\what{empty}
+ \ifx\what\pgf@circ@sevenseg@dotstate
+ % do nothing
+ \else
+ \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
+ \edef\what{off}
+ \ifx\what\pgf@circ@sevenseg@dotstate
+ % dot off
+ \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
+ \pgfsetcolor{\ctikzvalof{seven seg/color off}}
+ \else
+ % dot on
+ \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
+ \pgfsetcolor{\ctikzvalof{seven seg/color on}}
+ \fi
+ \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
+ \pgfusepath{draw,fill}
+ \fi
+}
+
+
+%%%%%%
+%%%%%% Flip-flops
+%%%%%%
+
+% Flip flops are a specialized kind of dipchip.
+% they have a class by themselves
+
+%% flip flop definitions --- by default empty
+%% pin texts
+\ctikzset{multipoles/flipflop/t1/.initial={}}
+\ctikzset{multipoles/flipflop/t2/.initial={}}
+\ctikzset{multipoles/flipflop/t3/.initial={}}
+\ctikzset{multipoles/flipflop/t4/.initial={}}
+\ctikzset{multipoles/flipflop/t5/.initial={}}
+\ctikzset{multipoles/flipflop/t6/.initial={}}
+\ctikzset{multipoles/flipflop/tu/.initial={}}
+\ctikzset{multipoles/flipflop/td/.initial={}}
+% pin clock wedge flags
+\ctikzset{multipoles/flipflop/c1/.initial={0}}
+\ctikzset{multipoles/flipflop/c2/.initial={0}}
+\ctikzset{multipoles/flipflop/c3/.initial={0}}
+\ctikzset{multipoles/flipflop/c4/.initial={0}}
+\ctikzset{multipoles/flipflop/c5/.initial={0}}
+\ctikzset{multipoles/flipflop/c6/.initial={0}}
+\ctikzset{multipoles/flipflop/cu/.initial={0}}
+\ctikzset{multipoles/flipflop/cd/.initial={0}}
+% pin negation circle flags
+\ctikzset{multipoles/flipflop/n1/.initial={0}}
+\ctikzset{multipoles/flipflop/n2/.initial={0}}
+\ctikzset{multipoles/flipflop/n3/.initial={0}}
+\ctikzset{multipoles/flipflop/n4/.initial={0}}
+\ctikzset{multipoles/flipflop/n5/.initial={0}}
+\ctikzset{multipoles/flipflop/n6/.initial={0}}
+\ctikzset{multipoles/flipflop/nu/.initial={0}}
+\ctikzset{multipoles/flipflop/nd/.initial={0}}
+
+
+% Thanks to @marmot
+\tikzset{flipflop def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/flipflop}{#1}}
+
+% default set of flip flops
+\tikzset{
+ % async
+ latch/.style={flipflop, flipflop def={t1=D, t6=Q, t3=CLK, t4=\ctikztextnot{Q}}},
+ flipflop SR/.style={flipflop, flipflop def={t1=S, t3=R, t6=Q, t4=\ctikztextnot{Q}}},
+ % sync
+ flipflop D/.style={flipflop, flipflop def={t1=D, t6=Q, c3=1, t4=\ctikztextnot{Q}}},
+ flipflop T/.style={flipflop, flipflop def={t1=T, t6=Q, c3=1, t4=\ctikztextnot{Q}}},
+ flipflop JK/.style={flipflop, flipflop def={t1=J, t3=K, c2=1, t6=Q, t4=\ctikztextnot{Q}}},
+ % additional features
+ add async SR/.style={flipflop def={tu={\ctikztextnot{SET}}, td={\ctikztextnot{RST}}}},
+ dot on notQ/.style={flipflop def={t4={Q}, n4=1}},
+}
+
+%
+% commodity macro to draw the clock wedges. They leave the size of the
+% wedge in \pgf@circ@res@temp so that a possible label can be displaced.
+%
+\def\pgf@circ@do@wedge@left{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step+\wedge}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\wedge}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step-\wedge}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=\wedge
+ \fi
+}
+\def\pgf@circ@do@wedge@right{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step+\wedge}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\wedge}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step-\wedge}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=-\wedge
+ \fi
+}
+\def\pgf@circ@do@wedge@up{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/cu}>0
+ \pgfpathmoveto{\pgfpoint{-\wedge}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up-\wedge}}
+ \pgfpathlineto{\pgfpoint{\wedge}{\pgf@circ@res@up}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=-\wedge
+ \fi
+}
+\def\pgf@circ@do@wedge@down{
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\ctikzvalof{multipoles/flipflop/cd}>0
+ \pgfpathmoveto{\pgfpoint{-\wedge}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down+\wedge}}
+ \pgfpathlineto{\pgfpoint{\wedge}{\pgf@circ@res@down}}
+ \pgfusepath{stroke}
+ \pgf@circ@res@temp=\wedge
+ \fi
+}
+% generic flip-flop shape
+\pgfdeclareshape{flipflop}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{flipflops}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ \savedmacro\numpins{\def\numpins{6}}
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{((\numpins)
+ *\ctikzvalof{multipoles/flipflop/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ }%
+ \saveddimen{\chipspacing}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/pin spacing}}}
+ \saveddimen{\width}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/width}}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ % standard anchors
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{0.5*((\numpins)
+ *\ctikzvalof{multipoles/flipflop/pin spacing})*\pgf@circ@scaled@Rlen/2}%
+ \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/width}}
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % upper and lower pin
+ \anchor{up}{\northwest\pgf@x=0pt\advance\pgf@y by\extshift }
+ \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y\advance\pgf@y by-\extshift}
+ \anchor{bup}{\northwest\pgf@x=0pt }
+ \anchor{bdown}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step = \ctikzvalof{multipoles/flipflop/pin spacing}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
+ \pgf@circ@draworfill
+ \pgfusepath{stroke}%
+ \endpgfscope
+ % Adding the pin number
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+ \ifpgf@circuit@chip@straightnumbers
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ % text
+ \def\mytext{\ctikzvalof{multipoles/flipflop/font}\space
+ \ctikzvalof{multipoles/flipflop/t\the\pgf@circ@count@c}%
+ \pgf@circ@strut\space}
+ % \typeout{TEXT\space\mytext}
+ \pgfmathloop%
+ \def\wedge{\ctikzvalof{multipoles/flipflop/clock wedge size}\pgf@circ@res@step}
+ \pgf@circ@res@temp=0pt\relax
+ \ifnum\pgf@circ@count@a>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ % \typeout{TEXT Left Q1\space\mytext}
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \pgf@circ@do@wedge@left
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \pgf@circ@do@wedge@right
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@temp}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\pgf@circ@count@a-1\relax%
+ \repeatpgfmathloop
+ % Now the up and down text
+ % up
+ \def\mytext{\ctikzvalof{multipoles/flipflop/fontud}\space\pgf@circ@strut\ctikzvalof{multipoles/flipflop/tu}\space}
+ \pgf@circ@do@wedge@up
+ \ifcase\quadrant % rotation 0
+ \pgftext[top,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ \pgftext[right,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ \pgftext[bottom,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ \pgftext[left,
+ at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \fi
+ % down
+ \def\mytext{\ctikzvalof{multipoles/flipflop/fontud}\space\pgf@circ@strut\ctikzvalof{multipoles/flipflop/td}\space}
+ \pgf@circ@do@wedge@down
+ \ifcase\quadrant % rotation 0
+ \pgftext[bottom,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ \pgftext[left,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ \pgftext[top,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ \pgftext[right,
+ at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
+ rotate=\rot]{\mytext}
+ \fi
+ % external pins
+ \ifdim\pgf@circ@res@other>0pt
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % left side pins
+ \pgf@circ@count@c=\pgf@circ@count@a
+ %% we draw the pin only if it's defined either a text, a clock wedge or a not pin
+ %% Or'ing tests in core TeX is tough
+ \edef\@@or{0}
+ % Just expand the key the minimum needed
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/t\the\pgf@circ@count@c}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfusepath{stroke}
+ \fi
+ % right side pins
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \edef\@@or{0}
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/t\the\pgf@circ@count@c}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ % \typeout{TEST\space\@@tmp\space\@@x}
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfusepath{stroke}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+ % up side
+ \edef\@@or{0}
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/tu}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/cu}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ % \typeout{TEST\space\@@tmp\space\@@x}
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfusepath{stroke}
+ \fi
+ % down side
+ \edef\@@or{0}
+ \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/td}}\edef\@@x{x}
+ \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/cd}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
+ \ifnum\@@tmp>0\edef\@@or{1}\fi
+ % \typeout{TEST\space\@@tmp\space\@@x}
+ \ifnum\@@or>0
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfusepath{stroke}
+ \fi
+ \endpgfscope
+ \fi % external pin width >0
+ %
+ % draw "inverting" circles on outputs, they must be last
+ %
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ \pgf@circ@count@a=\numpins\relax
+ \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % left side pins
+ \pgf@circ@count@c=\pgf@circ@count@a
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfnode{ocirc}{east}{}{\thisshape-N\the\pgf@circ@count@c}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ % right side pins
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfnode{ocirc}{west}{}{\thisshape-N\the\pgf@circ@count@c}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop
+ % up side
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{south}{}{\thisshape-Nu}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ % down side
+ \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nd}}
+ \ifnum\@@tmp>0\pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{north}{}{\thisshape-Nd}{\pgfusepath{stroke}}
+ \endpgfscope\fi
+ \endpgfscope
+ }%
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@flipflop{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\numpins\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@flipflop@pin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@flipflop@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+
+%
+% MUX-DEMUXES
+%
+% Thanks to @marmot
+\tikzset{muxdemux def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/muxdemux}{#1}}
+\tikzset{demux/.style={muxdemux, muxdemux def={Lh=4, Rh=8, NL=1, NB=3, NR=8}}}
+\tikzset{one bit adder/.style={muxdemux,
+ muxdemux def={Lh=4, NL=2, Rh=2, NR=1, NB=1, w=1.5,
+ inset w=0.5, inset Lh=2, inset Rh=1.5}}}
+\tikzset{ALU/.style={muxdemux,
+ muxdemux def={Lh=5, NL=2, Rh=2, NR=1, NB=2, NT=1, w=2,
+ inset w=1, inset Lh=2, inset Rh=0, square pins=1}}}
+%generic mux-demux shape
+\pgfdeclareshape{muxdemux}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{muxdemuxes}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % pins on the four sides
+ % \savedmacro\NL{%
+ % \pgf@circ@count@a=\ctikzvalof{multipoles/muxdemux/NL}%
+ % \def\NL{\the\pgf@circ@count@a}
+ % }
+ \savedmacro\NL{\edef\NL{\ctikzvalof{multipoles/muxdemux/NL}}}
+ \savedmacro\NR{\edef\NR{\ctikzvalof{multipoles/muxdemux/NR}}}
+ \savedmacro\NT{\edef\NT{\ctikzvalof{multipoles/muxdemux/NT}}}
+ \savedmacro\NB{\edef\NB{\ctikzvalof{multipoles/muxdemux/NB}}}
+ \savedmacro\squarepins{\edef\squarepins{\ctikzvalof{multipoles/muxdemux/square pins}}}
+ % topleft and topright sizes
+ \savedanchor{\topleft}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Lh}*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
+ }
+ \savedanchor{\topright}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Rh}*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
+ }
+ \savedanchor{\insetnortheast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Lh}*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*
+ (\ctikzvalof{multipoles/muxdemux/w}-2*\ctikzvalof{multipoles/muxdemux/inset w})*\pgf@circ@scaled@Rlen/2}
+ }
+ \saveddimen{\insethright}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Rh}*\pgf@circ@scaled@Rlen/2}}
+ \saveddimen{\extshift}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
+ \savedanchor{\northwest}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*max(\ctikzvalof{multipoles/muxdemux/Rh},\ctikzvalof{multipoles/muxdemux/Lh})*\pgf@circ@scaled@Rlen/2}
+ \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north west}{\northwest}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{top right}{\topright}
+ \anchor{bottom right}{\topright\pgf@y=-\pgf@y}
+ \anchor{right}{\topright\pgf@y=0pt\relax}
+ \anchor{top left}{\topleft}
+ \anchor{bottom left}{\topleft\pgf@y=-\pgf@y}
+ \anchor{left}{\topleft\pgf@y=0pt\relax}
+ \anchor{top}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2 \pgf@x=0pt\relax}
+ \anchor{bottom}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2 \pgf@y=-\pgf@y \pgf@x=0pt\relax}
+ \anchor{inset top right}{\pgf@ya=\insethright\insetnortheast\advance\pgf@y by -0.5\pgf@ya}
+ \anchor{inset bottom right}{\pgf@ya=\insethright\insetnortheast\advance\pgf@y by -0.5\pgf@ya\pgf@y=-\pgf@y}
+ \anchor{inset right}{\insetnortheast\pgf@y=0pt\relax}
+ \anchor{inset top left}{\insetnortheast\pgf@ya=\pgf@y\topleft\pgf@y=\pgf@ya}
+ \anchor{inset bottom left}{\insetnortheast\pgf@ya=\pgf@y\topleft\pgf@y=-\pgf@ya}
+ \anchor{inset left}{\topleft\pgf@y=0pt\relax}
+ \anchor{inset bottom}{\topleft\pgf@xa=\pgf@x\pgf@ya=\insethright
+ \insetnortheast\pgf@xb=\pgf@x\pgf@yb=\pgf@x
+ \pgfpoint{(\pgf@xa+\pgf@xb)/2}{-\pgf@ya+\pgf@yb/2}}
+ \anchor{inset top}{\topleft\pgf@xa=\pgf@x\pgf@ya=\insethright
+ \insetnortheast\pgf@xb=\pgf@x\pgf@yb=\pgf@x
+ \pgfpoint{(\pgf@xa+\pgf@xb)/2}{\pgf@ya-\pgf@yb/2}}
+ \anchor{inset center}{\topleft\pgf@xa=\pgf@x\insetnortheast
+ \advance\pgf@x by \pgf@xa \divide\pgf@x by 2 \pgf@y=0pt\relax}
+ \anchor{narrow center}{\insetnortheast\pgf@xa=\pgf@x\topright
+ \advance\pgf@x by \pgf@xa \divide\pgf@x by 2\pgf@y=0pt\relax}
+ \anchor{center up}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2
+ \pgf@yb = \insethright \advance\pgf@y by \pgf@yb
+ \divide\pgf@y by 2 \pgf@x=0pt\relax}
+ \anchor{center down}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
+ \divide\pgf@y by 2
+ \pgf@yb = \insethright \advance\pgf@y by \pgf@yb
+ \divide\pgf@y by 2 \pgf@y=-\pgf@y \pgf@x=0pt\relax}
+ \anchor{text}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*
+ \ctikzvalof{multipoles/muxdemux/inset w}*\pgf@circ@scaled@Rlen/2}
+ \advance\pgf@x by -.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \backgroundpath{%
+ \topleft
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@left = \pgf@x
+ \topright
+ \pgf@circ@res@other = \pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \insetnortheast
+ \pgf@circ@res@step = \pgf@x
+ \pgf@circ@res@temp = \pgf@y
+ %
+ % external block
+ %
+ \pgfscope% (for the line width)
+ \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ % inset, starting down
+ \ifdim\pgf@circ@res@temp>0pt % inset
+ % \typeout{INSETw\space\the\pgf@circ@res@right\space x\space\the\pgf@circ@res@step\space y\space\the\pgf@circ@res@temp}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\insethright}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\insethright}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}
+ \fi
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ % now we have to draw the pins, if needed
+ \ifdim\extshift>0pt\ifpgfcirc@draw@leads\pgfscope % let's avoid too much indent
+ % Ok, we have to draw the leads (a.k.a. pins)
+ \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+ % We mimic the anchors here --- probably there is a better way
+ % left pins
+ \ifnum\NL>0\relax % not indented, closed on \repeatpgfmathloop
+ \pgf@circ@count@a=\NL\relax
+ \pgf@circ@count@b=\NL \divide\pgf@circ@count@b by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
+ \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
+ \insetnortheast\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
+ \ifdim\pgf@circ@res@down>0pt % check if we have an inset
+ % we have to check oddity
+ \ifodd\NL
+ \ifnum\NL=1
+ % only centerpin, step should not be used, but anyway...
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/(\NL)}
+ \else
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/(\NL-1)}
+ \fi
+ \else
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/\NL}
+ \fi
+ \else % no inset
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@up/\NL}
+ \fi
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ %%%%%
+ \ifdim\pgf@circ@res@down>0pt % check if we have an inset
+ \ifnum\pgf@circ@count@a>\pgf@circ@count@b\relax
+ % for lower pins we have to shift them down
+ % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
+ \ifodd\NL
+ % odd number of pins
+ \ifnum\pgf@circ@count@a=\numexpr\the\pgf@circ@count@b+1\relax
+ % centerpin!
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \ifnum\squarepins>0
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{0pt}}
+ \else
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\extshift}{0pt}}
+ \fi
+ \else
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a+1)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a+1)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \fi
+ \else
+ % even numer of pins: just go down
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
+ \fi
+ \else
+ % nothing need for #1<=NL/2
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \fi
+ \else
+ % no inset
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \fi
+ %%%%%
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % right pins
+ \ifnum\NR>0\pgf@circ@count@a=\NR\relax
+ \pgfmathloop%
+ \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@up=\pgf@y
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@up/\NR}
+ \ifnum\pgf@circ@count@a>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % bottom pins
+ \ifnum\NB>0\pgf@circ@count@a=\NB\relax %%%
+ \pgfmathloop%
+ \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
+ \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@right/\NB}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@circ@res@down-\pgf@circ@res@up)/(\pgf@circ@res@right-\pgf@circ@res@left)*\pgf@circ@res@step}
+ \ifnum\pgf@circ@count@a>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {-\pgf@circ@res@down+(\NB-\pgf@circ@count@a+0.5)*\pgf@circ@res@other}}
+ \ifnum\squarepins>0
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {-max(\pgf@circ@res@down, \pgf@circ@res@up)-\extshift}}
+ \else
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {-\pgf@circ@res@down+(\NB-\pgf@circ@count@a+0.5)*\pgf@circ@res@other-\extshift}}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % top pins
+ \ifnum\NT>0\pgf@circ@count@a=\NT\relax
+ \pgfmathloop%
+ \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
+ \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@right/\NT}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@circ@res@down-\pgf@circ@res@up)/(\pgf@circ@res@right-\pgf@circ@res@left)*\pgf@circ@res@step}
+ \ifnum\pgf@circ@count@a>0
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {\pgf@circ@res@down-(\NT-\pgf@circ@count@a+0.5)*\pgf@circ@res@other}}
+ \ifnum\squarepins>0
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {max(\pgf@circ@res@down, \pgf@circ@res@up)+\extshift}}
+ \else
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@count@a-0.5)*\pgf@circ@res@step}
+ {\pgf@circ@res@down-(\NT-\pgf@circ@count@a+0.5)*\pgf@circ@res@other+\extshift}}
+ \fi
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop\fi%
+ % end drawing pins; stroke them
+ \pgfusepath{stroke}
+ \endpgfscope\fi\fi
+ }
+ % let's start adding anchors
+ \pgfutil@g@addto@macro\pgf@sh@s@muxdemux{%
+ % left side anchors
+ \pgf@circ@count@a=\NL\relax
+ % \typeout{STARTGENERATINGLEFT\space\the\pgf@circ@count@a\space FOR\space\thisshape\space\NL}
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % \typeout{GENERATINGLEFT\space\the\pgf@circ@count@a\space FOR\space\thisshape\space\NL}
+ % we will create two anchors per pin: the "normal one" like `lpin 1` for the
+ % external leads, and the "border one" like `blpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@lpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@L@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@blpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@L@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % right anchors
+ \pgf@circ@count@a=\NR\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `rpin 1` for the
+ % external leads, and the "border one" like `brpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@rpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@R@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@brpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@R@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % bottom anchors
+ \pgf@circ@count@a=\NB\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `bpin 1` for the
+ % external leads, and the "border one" like `bbpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@bpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@B@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@bbpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@B@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ % top anchors
+ \pgf@circ@count@a=\NT\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ % we will create two anchors per pin: the "normal one" like `tpin 1` for the
+ % external leads, and the "border one" like `btpin 1` for internal ones.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@muxdemux@tpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@T@anchor{\the\pgf@circ@count@a}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@muxdemux@btpin\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@muxdemux@T@anchor{\the\pgf@circ@count@a}{0}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+
+%% left anchors for muxdemux
+
+\def\pgf@circ@muxdemux@L@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topleft
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \insetnortheast
+ \pgf@xb=\pgf@x
+ \pgf@yb=\pgf@y
+ \ifnum#1>\NL
+ \PackageError{circuitikz}{%
+ You requested left pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NL\space left pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \pgf@circ@count@a=\NL \divide\pgf@circ@count@a by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
+ % \typeout{LEFT \the\pgf@xa \space \the\pgf@ya \space \NL}
+ \ifnum\NL>1
+ \ifdim\pgf@yb>0pt % check if we have an inset
+ % we have to check oddity
+ \ifodd\NL
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@ya-\pgf@yb)/(\NL-1)}
+ \else
+ \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@ya-\pgf@yb)/\NL}
+ \fi
+ \else % no inset
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@ya/\NL}
+ \fi
+ \ifdim\pgf@yb>0pt % check if we have an inset
+ \ifnum#1>\pgf@circ@count@a\relax
+ % for lower pins we have to shift them down
+ % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
+ \ifodd\NL
+ % odd number of pins
+ \ifnum#1=\numexpr\the\pgf@circ@count@a+1\relax
+ % centerpin!
+ \ifnum#2=0\relax
+ \pgfpoint{\pgf@xb}{0pt}
+ \else
+ \ifnum\squarepins>0
+ \pgfpoint{\pgf@xa-#2*\extshift}{0pt}
+ \else
+ \pgfpoint{\pgf@xb-#2*\extshift}{0pt}
+ \fi
+ \fi
+ \else
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1+1)*\pgf@circ@res@step-2*\pgf@yb}
+ \fi
+ \else
+ % even numer of pins: just go down
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step-2*\pgf@yb}
+ \fi
+ \else
+ % nothing need for #1<=NL/2
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
+ \fi
+ \else
+ % no inset
+ \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
+ \fi
+ \else
+ \pgfpoint{\pgf@xa-#2*\extshift}{0pt}
+ \fi
+}
+
+% right anchors
+\def\pgf@circ@muxdemux@R@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topright
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \ifnum#1>\NR
+ \PackageError{circuitikz}{%
+ You requested right pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NR\space right pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \ifnum\NR>1
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@ya/\NR}
+ \pgfpoint{\pgf@xa+#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
+ \else
+ \pgfpoint{\pgf@xa+#2*\extshift}{0pt}
+ \fi
+}
+
+% bottom anchors
+\def\pgf@circ@muxdemux@B@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topleft
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \topright
+ \pgf@xb=\pgf@x
+ \pgf@yb=\pgf@y
+ \ifnum#1>\NB
+ \PackageError{circuitikz}{%
+ You requested bottom pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NB\space bottom pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \ifnum\NB>0
+ % \typeout{DEBUGTESTtopleft\space\the\pgf@ya \space topright\space\the\pgf@yb \space\NB}
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@xb/\NB}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@yb-\pgf@ya)/(\pgf@xb-\pgf@xa)*\pgf@circ@res@step}
+ \pgfmathsetlength\pgf@x{\pgf@xa+(#1-0.5)*\pgf@circ@res@step}
+ \ifnum#2=0\relax
+ \pgfmathsetlength\pgf@y{-\pgf@yb+(\NB-#1+0.5)*\pgf@circ@res@other}
+ \else
+ \ifnum\squarepins>0\relax
+ \pgfmathsetlength\pgf@y{-max(\pgf@ya,\pgf@yb)-\extshift}
+ \else
+ \pgfmathsetlength\pgf@y{-\pgf@yb+(\NB-#1+0.5)*\pgf@circ@res@other-\extshift}
+ \fi
+ \fi
+ \else
+ % should not happen, give the same as pin 1 anyway
+ \ifnum#2=0\relax
+ \pgfpoint{0pt}{-\pgf@yb+(\pgf@yb-\pgf@ya)/2}
+ \else
+ \pgfpoint{0pt}{-max(\pgf@ya,\pgf@yb)-\extshift}
+ \fi
+ \fi
+}
+
+% top anchors
+\def\pgf@circ@muxdemux@T@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \topleft
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \topright
+ \pgf@xb=\pgf@x
+ \pgf@yb=\pgf@y
+ \ifnum#1>\NT
+ \PackageError{circuitikz}{%
+ You requested top pin #1 for mux/demux shape \thisshape\space \MessageBreak
+ which has been defined with \NT\space top pins%
+ }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+ \fi
+ \ifnum\NT>0
+ \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@xb/\NT}
+ \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@yb-\pgf@ya)/(\pgf@xb-\pgf@xa)*\pgf@circ@res@step}
+ \pgfmathsetlength\pgf@x{\pgf@xa+(#1-0.5)*\pgf@circ@res@step}
+ \ifnum#2=0\relax
+ \pgfmathsetlength\pgf@y{\pgf@yb-(\NT-#1+0.5)*\pgf@circ@res@other}
+ \else
+ \ifnum\squarepins>0
+ \pgfmathsetlength\pgf@y{max(\pgf@ya,\pgf@yb)+\extshift}
+ \else
+ \pgfmathsetlength\pgf@y{\pgf@yb-(\NT-#1+0.5)*\pgf@circ@res@other+\extshift}
+ \fi
+ \fi
+ \else
+ % should not happen, give the same as pin 1 anyway
+ \ifnum#2=0\relax
+ \pgfpoint{0pt}{\pgf@yb-(\pgf@yb-\pgf@ya)/2}
+ \else
+ \pgfpoint{0pt}{max(\pgf@ya,\pgf@yb)+\extshift}
+ \fi
+ \fi
+}
+%%%---------- close: tex/pgfcircmultipoles
+
+%%%%%%%%%%% Springe nach tex/pgfcirclabel
+%%%---------- open: tex/pgfcirclabel.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bipole label positioning
+
+%% bipole labels and annotation extra style
+
+\ctikzset{bipole label style/.style={}}
+\tikzset{bipole label style/.code={
+ \ctikzset{bipole label style/.style={#1}}
+}}
+\tikzset{bipole label append style/.code={
+ \ctikzset{bipole label style/.append style={#1}}
+}}
+\ctikzset{bipole annotation style/.style={}}
+\tikzset{bipole annotation style/.code={
+ \ctikzset{bipole annotation style/.style={#1}}
+}}
+\tikzset{bipole annotation append style/.code={
+ \ctikzset{bipole annotation style/.append style={#1}}
+}}
+
+%% Options
+\ctikzset{label/.style = { l=#1 } }
+\ctikzset{l/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{l^/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\ctikzset{l_/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\ctikzset{annotation/.style = { a=#1 } }
+\ctikzset{a/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
+ \ctikzsetvalof{bipole/annotation/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{annotation above/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{a^/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{annotation below/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+\ctikzset{a_/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+
+% This is to adjust spacing for the labels so that they are not cramped on components
+\def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
+
+\def\pgf@circ@drawlabels#1{
+ \pgfextra{
+ % This function will be called with argument #1 equal
+ % to "label" or "annotation" form pgfcircpath.tex.
+ % pgf@circ@direction is the direction of the path,
+ % its value is set in pgfcircpath.tex
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \pgfmathround{\pgfmathresult} % avoid precision loss errors
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
+ \ifnum \pgf@circ@temp < 0
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
+ %
+ % normalize the angle values
+ %
+ \pgfmathmod{\pgf@circ@labanc}{360}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ %
+ \ifpgf@circuit@bipole@inverted
+ \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ %
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
+ }
+ %Firstly, place a coordinate directly at the edge of the shape
+ (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
+ %now decide, which labels should be drawn
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{label/align}}
+ \def\pgf@circ@temp{straight}
+ }
+ \ifx\pgf@temp\pgf@circ@temp %straight
+ \pgf@circ@drawreglabels{#1}
+ \else
+ \pgfextra{\def\pgf@circ@temp{rotate}}
+ \ifx\pgf@temp\pgf@circ@temp %rotate
+ \pgf@circ@drawrotlabels{#1}
+ \else% smart
+ \pgf@circ@drawsmartlabels{#1}
+ \fi
+ \fi
+}
+
+
+\def\pgf@circ@drawsmartlabels#1{
+ \pgfextra{
+ \pgfmathmod{\pgf@circ@direction}{90}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \ifnum \pgfcircmathresult > 20
+ \ifnum \pgfcircmathresult < 70
+ \pgf@circ@drawrotlabels{#1}
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+ }
+
+
+\def\pgf@circ@drawrotlabels#1{
+ \pgfextra{
+ % scale the distances in function of zoom, so that they are not
+ % dependent on it but on font size. Thanks to @marmot
+ % https://tex.stackexchange.com/a/476018/38080
+ % the coeffcient is adjusted so that the distance is more or less
+ % the same for rotated labels and straight ones (although it will
+ % depend on the font, so it's not exact).
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
+ \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ %we need some more space for placement below, due to mid-anchor
+ \else % we do not have <= in \ifnum...
+ \pgf@circ@res@temp=1.5\pgf@circ@res@temp
+ \fi
+ %Calculate rotation of the label from direction and strip decimals
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ % rotate the label at second or third quadrant:
+ \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
+ \pgfmathsubtract{\pgf@circ@direction}{180}
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ %invert the space relationships due to rotated strings
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ \pgf@circ@res@temp=1.5\pgf@circ@res@temp
+ \fi
+ \fi\fi
+ \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
+ \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ % reset cm is not working correctly here
+ (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
+ node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style]
+ (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
+}
+
+\def\pgf@circ@drawreglabels#1{
+ %Now calculate all shape positions
+ %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
+ %All points between will be addressed by angled-anchors:
+ \pgfextra{
+ % scale ex-distance to make it independent on scale
+ % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
+ \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
+ \pgfmathadd{\pgf@circ@labanc}{90}
+ \pgfmathround{\pgfmathresult}
+ \def\pgf@circ@labanctext{\pgf@circ@labanc}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ %Values around 90 are at both y-axis
+ \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
+ \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
+ \ifnum \pgf@circ@labpos > 180
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanctext{mid west}}
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{mid east}}
+ \fi
+ \else
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanctext{mid east}}
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{mid west}}
+ \fi
+ \fi
+ \fi\fi
+ %Values between -5 and 5 are at pos /neg x-axis
+ \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
+ \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
+ \ifnum \ctikzvalof{bipole/#1/position} < 0
+ \ifnum \pgf@circ@labanc > 90
+ % using base coordinate instead of south to naturally align
+ % symbols with descendants; but this invalidate the effect of
+ % the inner sep, so recover it by shifting the anchor
+ % reset cm is not working sometime, use @marmot solution
+ % see https://tex.stackexchange.com/a/476018/38080
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{north}}%north
+ \fi
+ \else
+ \ifnum \pgf@circ@labanc < 90
+ % shift, as above
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \ifnum \pgf@circ@labanc > 180
+ % this shouldn't happen, but somehow it does (270 degree anchors)
+ % shift, as above
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{north}}%north
+ \fi
+ \fi
+ \fi
+ \fi\fi
+ (labelcoor) node[anchor=\pgf@circ@labanctext,
+ inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, \circuitikzbasekey/bipole #1 style,
+ ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
+ }
+}
+
+\def\pgf@circ@finallabels#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
+ \fi%
+}
+
+\ctikzset{text/.style={t=#1}}
+\ctikzset{t/.code={%
+ \ctikzsetvalof{bipoles/twoport/text}{#1}%
+}}
+
+%%%% Stacked labels
+%
+% stacked labels by Romano Giannetti romano@rgtti.com
+% heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
+% \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
+%
+% labels are in a tabular, globally aligned:
+% vertically with key l2 valign (default c)
+% c: center t: top b: bottom
+% horizontally with key l2 align (default l)
+% l: left c: centered r: right
+% you can switch sides using l2_=... and l2^=...
+% syntax is l2_ = line1 and line2 (same for l2^)
+%
+\ctikzset{%
+ l2 valign/.store in=\ltwo@valign, l2 valign=c,
+ l2 halign/.store in=\ltwo@halign, l2 halign=l,
+}
+\ctikzset{l2base/.code n args={2}{
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=%
+ \bgroup
+ \setlength{\tabcolsep}{2pt}%
+ \def\ltwo@tabu{\tabular[\ltwo@valign]}%
+ \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
+ #1\\ #2%
+ \endtabular
+ \egroup
+ }%
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#2}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+\ctikzset{l2/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 above/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2^/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 below/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l2_/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+%%%---------- close: tex/pgfcirclabel
+%%%%%%%%%%% Springe nach tex/pgfcircvoltage
+%%%---------- open: tex/pgfcircvoltage.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Voltage management
+
+%% styles
+\ctikzset{bipole voltage style/.style={}}
+\tikzset{bipole voltage style/.code={
+ \ctikzset{bipole voltage style/.style={#1}}
+}}
+\tikzset{bipole voltage append style/.code={
+ \ctikzset{bipole voltage style/.append style={#1}}
+}}
+
+\ctikzset{v^>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v^</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v_>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
+\ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
+\ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
+\ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
+
+% Default position varies whether the component is a voltage source
+% or not
+\ctikzset{v/.code = {
+ \ifpgf@circuit@bipole@isvoltage
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi
+ \fi
+ \ifpgf@circ@oldvoltagedirection
+ \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi\fi
+ \else
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@bipole@current@backward
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \fi\fi\fi
+ \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+ \ctikzsetvalof{bipole/voltage/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }
+}
+
+% american voltage font selection and symbol definition
+% the default font command is {} --- nothing
+\def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
+%
+% plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
+%
+\def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
+\def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
+
+%%
+\def\setscaledRlenforclass{%
+ \csname pgf@sh@ma@\ctikzvalof{bipole/name}\endcsname
+ \ifdefined\ctikzclass
+ \edef\pgf@temp{/tikz/circuitikz/\ctikzclass/scale}
+ \pgfkeysifdefined{\pgf@temp}
+ {\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ {\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}
+ \else
+ \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
+ \fi
+}
+
+%% Output routine for generic bipoles
+
+\def\pgf@circ@drawvoltagegeneric{
+ \pgfextra{
+ % \typeout{NAME:\ctikzvalof{bipole/name}}
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\partheight{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
+ }
+ {
+ \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
+ {
+ \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
+ }
+ {%calculate default value from part height
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\partheight{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen+0.2\pgf@circ@scaled@Rlen)}
+ }
+ {
+ \edef\tmpdistfromline{(.5\pgf@circ@scaled@Rlen)} %fallback to fixed value
+ }
+ }
+ }
+ % \typeout{KIND:\ctikzvalof{bipole/kind}\space RLEN:\the\pgf@circ@Rlen\space SCALED:\the\pgf@circ@scaled@Rlen}
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\tmpdistfromline}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\tmpdistfromline}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\tmpdistfromline}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\tmpdistfromline}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
+ \fi
+ \fi
+ \fi
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@voltage@angle{90}
+ \else
+ \def\pgf@circ@voltage@angle{-90}
+ \fi
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\distancefromnode{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}} }
+ { \edef\distancefromnode{\ctikzvalof{voltage/distance from node}} }
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\bumpb{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}} }
+ { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ % additional per-bipole voltage shift (internal)
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/additional label shift}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\addvshift{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/additional label shift}}
+ }
+ {
+ \edef\addvshift{0}
+ }
+ \newdimen{\absvshift}
+ \pgfmathsetlength{\absvshift}{(1+\shiftv+\addvshift)*(\distfromline)}
+ % put this to true to see the voltage label coordinate anchors
+ \newif\ifpgf@circ@debugv\pgf@circ@debugvfalse
+ }
+ % %\pgf@circ@Rlen/\ctikzvalof{current arrow scale} is equal to the length of the currarrow
+ coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
+ coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorstartnode)$)
+ coordinate (pgfcirc@Vfrom@flat) at (pgfcirc@midtmp)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
+
+ coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
+ coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorendnode)$)
+ coordinate (pgfcirc@Vto@flat) at (pgfcirc@midtmp)
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
+
+ \ifpgf@circuit@bipole@voltage@below
+ \ifpgf@circ@debugv
+ node [ocirc, fill=red] at (anchorstartnode) {}
+ node [ocirc, fill=blue] at (anchorendnode) {}
+ node [ocirc, fill=green] at (pgfcirc@Vto) {}
+ node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
+ \fi
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! \absvshift!90 : (anchorendnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! \absvshift!-90 : (anchorstartnode)$)
+ coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+ coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+ coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! -\absvshift!90 : (pgfcirc@Vcont2t)$)
+ coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! -\absvshift!-90 : (pgfcirc@Vcont1t)$)
+ \ifpgf@circ@debugv
+ node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
+ node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
+ \fi
+ \else
+ \ifpgf@circ@debugv
+ node [ocirc, fill=red] at (anchorstartnode) {}
+ node [ocirc, fill=blue] at (anchorendnode) {}
+ node [ocirc, fill=green] at (pgfcirc@Vto) {}
+ node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
+ \fi
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! -\absvshift!90 : (anchorendnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! -\absvshift!-90 : (anchorstartnode)$)
+ coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+ coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+ coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! \absvshift!90 : (pgfcirc@Vcont2t)$)
+ coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! \absvshift!-90 : (pgfcirc@Vcont1t)$)
+ \ifpgf@circ@debugv
+ node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
+ node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
+ node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
+ node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
+ \fi
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@straight
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
+ \else
+ (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
+ node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
+ (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
+ node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
+ (pgfcirc@Vto)
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ \fi
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine for voltage sources
+\def\pgf@circ@drawvoltagegenerator{
+ % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
+ % it's not perfect, but I can't find the way to do it correctly...
+ \pgfextra{
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ \edef\bumpa{\ctikzvalof{voltage/bump a}}
+ \pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv} % coefficient added "by feel". Sorry.
+ }
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
+ \fi
+ % fix the (unused in this case) Vcont1/2 coords for label placement along the line
+ coordinate (pgfcirc@Vcont1) at (pgfcirc@Vto)
+ coordinate (pgfcirc@Vcont2) at (pgfcirc@Vfrom)
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto)
+ \fi
+ \else% american voltage
+ \ifpgf@circuit@bipole@voltageoutsideofsymbol
+ % if it is a battery, must put + and -
+
+ \ifpgf@circ@fixbatteries
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ \else
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ \else
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine
+\def\pgf@circ@drawvoltage{% node name
+ \pgfextra{ %WARNING: indentation is probably wrong
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \else
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \else
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+
+ % this must be set *before* changing for mirroring and inverting; in that case
+ % the xscale/yscale parameters take it into account
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@voltage@label@where{90}
+ \fi
+
+ % magic to counteract the scale and yscale effects (there should be a better way...)
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ % take into account scaling
+ \setscaledRlenforclass
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\eudist{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}} }
+ { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+ % find the height of the bipole or use a default value
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
+ \pgfkeysifdefined{\pgf@temp}
+ {\pgfmathsetmacro{\partheightf}{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
+ \edef\partheight{\partheightf\pgf@circ@scaled@Rlen}}
+ {\edef\partheight{(.5\pgf@circ@scaled@Rlen)}} %fallback to fixed value
+ \newdimen{\alshift}
+ % this is more or less the same of the legacy code; we shift the american label a bit
+ % outside the (+) -- (-) line
+ \pgfmathsetlength{\alshift}{(\ctikzvalof{voltage/american label distance}-0.6)*\partheight}
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ }%end pgfextra
+
+ \ifpgf@circuit@bipole@isvoltage
+ \pgf@circ@drawvoltagegenerator
+ \else
+ \pgf@circ@drawvoltagegeneric
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@straight
+ coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
+ \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
+ at (Vlab) {\pgf@circ@finallabels{voltage/label}}
+ \else
+ \ifpgf@circuit@europeanvoltage
+ coordinate (Vlab) at ($(pgfcirc@Vcont1)!0.5!(pgfcirc@Vcont2)$)
+ \else
+ coordinate (Vlab) at ($(pgfcirc@Vfrom)!0.5!(pgfcirc@Vto)$)
+ \ifpgf@circuit@bipole@isvoltage\else
+ % add a bit of space for american labels above their symbols in the normal case. You can avoid that
+ % with voltage/american label distance=0.5 (it's measured from the center of the component, in heights)
+ coordinate (Vlab) at ($(Vlab) ! \alshift ! \pgf@circ@bipole@voltage@label@where :(pgfcirc@Vto)$)
+ \fi
+ \fi
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
+ \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
+ at (Vlab) {\pgf@circ@finallabels{voltage/label}}
+ \fi
+}%end drawvoltages
+%%%---------- close: tex/pgfcircvoltage
+%%%%%%%%%%% Springe nach tex/pgfcirccurrent
+%%%---------- open: tex/pgfcirccurrent.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Current handling
+
+%% styles
+\ctikzset{bipole current style/.style={}}
+\tikzset{bipole current style/.code={
+ \ctikzset{bipole current style/.style={#1}}
+}}
+\tikzset{bipole current append style/.code={
+ \ctikzset{bipole current style/.append style={#1}}
+}}
+
+%% Options
+\ctikzset{i^>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i>^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i>_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i^</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i<^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i<_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i/.code = {
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+ \ctikzsetvalof{bipole/current/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ %reverse current direction for voltage sources
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@isvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below }
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \fi\fi\fi
+ }
+}
+
+\ifpgf@circ@oldvoltagedirection
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+\else
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
+\fi
+\ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
+\ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
+\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
+
+%% Output routine
+\def\pgf@circ@drawcurrent{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@bipole@current@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@current@label@where{+90}
+ \fi
+ }
+
+ \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
+ \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
+ (\tikztostart)--(\tikztotarget)
+ \else% normal bipole or source
+ \ifpgf@circuit@bipole@current@before
+ (\tikztostart)--(anchorstartnode)
+ \else
+ (anchorendnode)--(\tikztotarget)
+ \fi
+ \fi
+ \ifpgf@circuit@bipole@current@backward
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@ffffff}{180}
+ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \fi
+ coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff,
+ anchor=center](Iarrow)
+ (Iarrow.\pgf@circ@bipole@current@label@where)
+ node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style]
+ (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}}
+}
+
+%%%---------- close: tex/pgfcirccurrent
+%%%%%%%%%%% Springe nach tex/pgfcircflow
+%%%---------- open: tex/pgfcircflow.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% flow handling
+
+%% styles
+\ctikzset{bipole flow style/.style={}}
+\tikzset{bipole flow style/.code={
+ \ctikzset{bipole flow style/.style={#1}}
+}}
+\tikzset{bipole flow append style/.code={
+ \ctikzset{bipole flow style/.append style={#1}}
+}}
+
+%% Options
+\ctikzset{f^>/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/curflowrent/y position = above
+ }
+}
+
+\ctikzset{f_>/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f>^/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f>_/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f^</.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f_</.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f<^/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f<_/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
+\ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
+\ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
+\ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
+
+\ctikzset{f/.code = {
+ \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
+ \ctikzsetvalof{bipole/flow/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}
+}
+
+%% Output routine
+\def\pgf@circ@drawflow{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@bipole@flow@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@flow@label@where{+90}
+ \fi
+ }
+
+ \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
+ \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
+ (\tikztostart)--(\tikztotarget)
+ \else% normal bipole or source
+ \ifpgf@circuit@bipole@flow@before
+ (\tikztostart)--(anchorstartnode)
+ \else
+ (anchorendnode)--(\tikztotarget)
+ \fi
+ \fi
+ \pgfextra{
+ \ifpgf@circuit@bipole@flow@backward
+ \ifpgf@circuit@bipole@flow@below
+ \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \else
+ \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \fi
+ \pgfmathsubtract{\pgf@circ@ffffff}{180}
+ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \else
+ \ifpgf@circuit@bipole@flow@below
+ \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \else
+ \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \fi
+ \fi
+ }
+ coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset, anchor=center](Farrowpos)
+ (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style]
+ (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}}
+}
+
+%%%---------- close: tex/pgfcircflow
+
+% defaults
+
+\setupmodule
+ [current=european,
+ voltage=european,
+ resistor=american,
+ inductor=cute,
+ logic=american,
+ siunitx=true,
+ arrowmos=false]
+
+\processaction
+ [\currentmoduleparameter{voltage}]
+ [european=>\ctikzset{voltage=european},
+ american=>\ctikzset{voltage=american}]
+
+\processaction
+ [\currentmoduleparameter{current}]
+ [european=>\ctikzset{ current=european},
+ american=>\ctikzset{ current=american}]
+
+\processaction
+ [\currentmoduleparameter{label}]
+ [straight=>\ctikzset{label/align = straight},
+ align=>\ctikzset{label/align = rotate},
+ smart=>\ctikzset{label/align = smart}]
+
+\processaction
+ [\currentmoduleparameter{resistor}]
+ [european=>\ctikzset{ resistor=european},
+ american=>\ctikzset{ resistor=american}]
+
+\processaction
+ [\currentmoduleparameter{inductor}]
+ [european=>\ctikzset{ inductor=european},
+ american=>\ctikzset{ inductor=american},
+ cute=>\ctikzset{ inductor=cute}]
+
+\processaction
+ [\currentmoduleparameter{diode}]
+ [full=>\ctikzset{ diode=full},
+ empty=>\ctikzset{ diode=empty}]
+
+\processaction
+ [\currentmoduleparameter{logic}]
+ [european=>\ctikzset{ logic ports=european},
+ american=>\ctikzset{ logic ports=american}]
+
+\processaction
+ [\currentmoduleparameter{siunitx}]
+ [true=>\def\SI#1#2{#1\,#2}
+ \def\ampere{\rm{A}}
+ \def\volt{\rm{V}}
+ \def\ohm{\Omega}
+ \def\siemens{\rm{S}}
+ \def\farad{\rm{F}}
+ \def\henry{\rm{H}}
+ \def\second{\rm{s}}
+ \def\coulomb{\rm{C}}
+ \def\siemens{\rm{S}}
+ \def\radians{\rm{rad}}
+ \def\milli{\rm{m}}
+ \def\micro{\mu}
+ \def\nano{\rm{n}}
+ \def\pico{\rm{p}}
+ \def\kilo{\rm{k}}
+ \def\mega{\rm{M}}
+ \def\giga{\rm{G}}
+ \def\tera{\rm{T}},
+ false=>]
+% \s!default=>\pgf@circ@siunitxtrue,
+
+\processaction
+ [\currentmoduleparameter{arrowmos}]
+ [true=>\pgf@circuit@mos@arrowstrue,
+ false=>\pgf@circuit@mos@arrowsfalse]
+% \s!default=>\pgf@circuit@mos@arrowstrue,
+
+
+\ifpgf@circ@siunitx
+ % nothing! siunitx and xstrings don't work in context
+\fi
+
+
+% Context specific
+
+\ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]}
+
+%%%%%%%%%%% Springe nach tex/pgfcircpath
+%%%---------- open: tex/pgfcircpath.tex
+% Copyright 2018-2020 by Romano Giannetti
+% Copyright 2015-2020 by Stefan Lindner
+% Copyright 2013-2020 by Stefan Erhardt
+% Copyright 2007-2020 by Massimo Redaelli
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+
+\def\pgf@circ@direction{0.0}
+
+% Names
+\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
+\ctikzset{n/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/name=#1}
+}}
+
+% Reflect the node along
+\ctikzset{mirrored/.is choice}
+\ctikzset{mirror value/.initial=1}
+\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
+\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
+\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
+
+% Invert node along path
+\ctikzset{inverted/.is choice}
+\ctikzset{invert value/.initial=1}
+\ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
+\ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
+\ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
+\newif\ifpgf@circuit@bipole@inverted
+\ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
+
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+
+% Initialize paths
+\def\pgfcircresetpath{
+ \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
+ bipole/inverted=false, bipole/kind=,
+ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
+ bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
+ bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
+ bipole/current/y position=above, bipole/current/direction=forward,
+ mirrored=false
+ }
+}
+
+%% Helper function for path-function to ensure using anchors between nodes
+\def\set@explicit@center@anchor#1{
+ \pgfutil@ifundefined{pgf@sh@ns@#1}
+ {
+ %This coordinate is no node(but a relative position or a coordinate), no further handling needed
+ }{
+ \pgfutil@in@.{#1}
+ \ifpgfutil@in@
+ % Anchor is used, do nothing!
+ \else%
+ \let\tikz@moveto@waiting=\relax
+ \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
+ \edef#1{#1.center}%ensure using center anchor
+ \fi
+}
+}
+
+
+%% Generic bipole path
+%% I am not user what the second argument is needed for
+\def\pgf@circ@bipole@path#1#2{
+
+ \pgfextra{
+ \set@explicit@center@anchor{\tikztostart}
+ \set@explicit@center@anchor{\tikztotarget}
+ \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
+ \ctikzset{bipole/kind = #1}
+ \edef\pgf@temp{\ctikzvalof{bipole/name}}
+ \def\pgf@circ@temp{}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = #1\pgf@circ@rand} % create it (re-usage should not create problem, but...)
+ \fi
+ }
+
+ (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
+ (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
+ \pgfextra{
+ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathround{\pgfmathresult}
+ \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
+ \pgfsyssoftpath@setcurrentpath{\myp@th}
+ }
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
+ \fi
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
+ node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
+ (\ctikzvalof{bipole/name}) {}
+ \ifpgf@circuit@bipole@inverted
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
+ \fi
+ \else
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
+ \fi
+ \fi
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
+ (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+
+ \drawpoles
+ \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
+ \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
+ \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
+ \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
+ \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ (\ctikzvalof{bipole/name}end)%Move to end of path
+ \else
+ ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
+ %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
+
+ \fi
+ % reset
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ \tikztonodes%draw pending nodes an path
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.initial=none}
+\ctikzset{bipole/nodes/right/.initial=none}
+\tikzset{bipole nodes/.style n args={2}{%
+ \circuitikzbasekey/bipole/nodes/left=#1,
+ \circuitikzbasekey/bipole/nodes/right=#2
+ }
+}
+
+%% Easily usable styles
+
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+
+% rectjoinfill workarounds
+
+\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
+ \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
+ \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
+}
+
+%% Path definitions
+\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
+\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
+\def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
+\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
+\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
+\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
+\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
+\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
+\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
+\def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
+\def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
+%% polar capacitor is deprectaed, use curved capacitor instead
+\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
+\def\pgf@circ@ccapacitor@path#1{\pgf@circ@bipole@path{ccapacitor}{#1}}
+\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
+\def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
+\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
+\def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
+\def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
+\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
+\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
+\def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
+\def\pgf@circ@inductor@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductor@path{#1}%
+ \else%
+ \pgf@circ@americaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@vinductor@path#1{
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@veuropeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@vcuteinductor@path{#1}%
+ \else%
+ \pgf@circ@vamericaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@inductivesens@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductivesens@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductivesens@path{#1}%
+ \else%
+ \pgf@circ@americaninductivesens@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
+\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
+\def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
+\def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
+\def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
+\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
+\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
+\def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
+\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
+\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
+\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
+\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
+\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
+\def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
+\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
+\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
+\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
+\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
+\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
+\def\pgf@circ@ecsource@path#1{\pgf@circ@bipole@path{ecsource}{#1}}
+\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
+\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
+\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
+\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
+\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
+\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
+\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
+\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
+\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
+\def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
+\def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
+\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
+\def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
+\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
+\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
+\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
+\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
+\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
+\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
+\def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
+\def\pgf@circ@empty@path#1{}
+\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
+\def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
+\def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
+\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
+\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
+\def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
+\def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
+\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
+\def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
+\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
+\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
+\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
+\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
+
+\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
+\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
+\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
+
+\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
+\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
+\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
+\def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
+\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
+\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
+\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
+\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
+\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
+\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
+\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
+\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
+\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
+\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
+\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
+\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
+\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
+\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
+\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
+
+%%Mechanical
+\def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
+\def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
+\def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
+\def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
+
+%% Styles
+
+\def\comnpatname{\ifpgf@circuit@compat *\else\fi}
+\def\compattikzset#1{\tikzset{\comnpatname#1}}
+
+%\def\ctikzsetbipole#1#2{%
+% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
+%}
+
+\compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
+\compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
+\compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
+\compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
+\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
+\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
+\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
+\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
+\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
+\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
+\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
+\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
+\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
+\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
+\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
+\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
+\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
+\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
+\compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+% polar capacitor is deprecated, use curved capacitor instead
+\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
+\compattikzset{curved capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ccapacitor@path, l=#1}}
+\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
+\compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
+\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
+\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
+\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
+\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
+\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
+\compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
+\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
+\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
+\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
+\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
+\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
+\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
+\compattikzset{transmission line/.style = {tline = #1}}
+\compattikzset{TL/.style = {tline = #1}}
+\compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
+\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{empty controlled source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
+\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
+
+
+\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
+\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
+\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
+\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
+\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
+\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
+
+\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+\compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
+
+\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
+\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
+\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
+\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
+
+\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
+\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
+\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
+\compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
+\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
+\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
+\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
+\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
+\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
+\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
+\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
+\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
+\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
+\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
+\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
+\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
+\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
+\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
+\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
+
+% % % % % %
+% % Begin of Diodes
+% % % % % %
+
+\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
+\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
+\def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
+\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
+\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
+\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
+\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
+\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
+\def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
+\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
+\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
+\def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
+\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
+\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
+\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
+\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
+\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
+\def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
+
+\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
+\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
+\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
+\compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
+\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
+\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
+\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
+\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
+\compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
+\compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
+\compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
+
+\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
+\compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
+\compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
+%\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
+
+\compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
+\compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
+\compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
+\compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
+\compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
+\compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
+\compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
+\compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
+\compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
+\compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
+\compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
+
+%% Define Shortcuts
+\compattikzset{Do/.style = {\comnpatname empty diode}}
+\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
+\compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
+\compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
+\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
+\compattikzset{pDo/.style = {\comnpatname empty photodiode}}
+\compattikzset{leDo/.style = {\comnpatname empty led}}
+\compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
+\compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
+\compattikzset{Tro/.style = {\comnpatname empty triac}}
+
+\compattikzset{D*/.style = {\comnpatname full diode}}
+\compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
+\compattikzset{zD*/.style = {\comnpatname full Zener diode}}
+\compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
+\compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
+\compattikzset{pD*/.style = {\comnpatname full photodiode}}
+\compattikzset{leD*/.style = {\comnpatname full led}}
+\compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
+\compattikzset{Ty*/.style = {\comnpatname full thyristor}}
+\compattikzset{Tr*/.style = {\comnpatname full triac}}
+
+\compattikzset{D/.style = {\comnpatname diode}}
+\compattikzset{tD/.style = {\comnpatname tunnel diode}}
+\compattikzset{zD/.style = {\comnpatname Zener diode}}
+\compattikzset{zzD/.style = {\comnpatname ZZener diode}}
+\compattikzset{sD/.style = {\comnpatname Schottky diode}}
+\compattikzset{pD/.style = {\comnpatname photodiode}}
+\compattikzset{leD/.style = {\comnpatname led}}
+\compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
+\compattikzset{Ty/.style = {\comnpatname thyristor}}
+\compattikzset{Tr/.style = {\comnpatname triac}}
+
+\compattikzset{D-/.style = {\comnpatname stroke diode}}
+\compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
+\compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
+\compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
+\compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
+\compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
+\compattikzset{leD-/.style = {\comnpatname stroke led}}
+\compattikzset{VC-/.style = {\comnpatname stroke varcap}}
+\compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
+\compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+\compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
+
+% % % % % %
+% % End of Diodes
+% % % % % %
+
+
+\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
+\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
+\compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
+\compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
+\compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
+\compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
+\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
+\compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
+\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
+
+\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
+\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
+\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
+\tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
+
+% cute switches
+%% closed cute switch
+\def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
+\compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
+\compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
+
+%% open cute switch
+\def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
+\compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
+\compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
+
+%% closing cute switch
+\def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
+\compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
+\compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
+
+%% opening cute switch
+\def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
+\compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
+\compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
+
+
+% short forms
+\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
+
+\compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
+\compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
+
+\compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
+\compattikzset{isource/.style = {\comnpatname current source = #1}}
+\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{ecsource/.style = {\comnpatname empty controlled source = #1}}
+\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
+\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+
+\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+
+\compattikzset{R/.style= {\comnpatname resistor = #1}}
+\compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
+\compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
+\compattikzset{thR/.style= {\comnpatname thermistor = #1}}
+\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
+\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
+\compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
+\compattikzset{C/.style = {\comnpatname capacitor = #1}}
+\compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
+%% pC is deprecated, use cC instead
+\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
+\compattikzset{cC/.style = {\comnpatname curved capacitor = #1}}
+\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
+\compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
+\compattikzset{L/.style = {\comnpatname inductor = #1}}
+\compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
+\compattikzset{V/.style = {\comnpatname voltage source = #1}}
+\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
+\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
+ \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
+ \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
+ \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+%current sources
+\compattikzset{I/.style = {\comnpatname current source = #1}}
+\compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
+ \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
+ \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
+ \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+% cute sources
+\def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
+\compattikzset{cute european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
+\compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
+
+\def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
+\compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
+\compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
+
+\def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
+\compattikzset{cute european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
+\compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
+
+\def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
+\compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
+\compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
+
+% noise sources
+\def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
+\compattikzset{noise voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceN@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
+\compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
+
+\def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
+\compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
+\compattikzset{nI/.style= {\comnpatname noise current source= #1}}
+
+% resistive sensor american style
+\def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
+\compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
+\compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
+\compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
+
+\compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
+\compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
+
+\compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
+\compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
+\compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
+\compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
+\compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
+
+\compattikzset{Mr/.style = {\comnpatname memristor}}
+
+\compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
+\compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
+\compattikzset{spst/.style = {\comnpatname switch = #1}}
+
+\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
+
+\compattikzset{vdd/.style = {\comnpatname vcc = #1}}
+\compattikzset{vss/.style = {\comnpatname vee = #1}}
+
+% activate the to-style crossing
+\def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
+\compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
+\compattikzset{xing/.style= {\comnpatname crossing= #1}}
+
+%% loudspeaker and microphone
+
+\def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
+\compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
+
+\def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
+\compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
+
+% more instrument
+\def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
+\compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
+\def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
+\compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
+\def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
+\compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
+% current loop probes
+\def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
+\compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
+\def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
+\compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
+% qucs-style probes
+\def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
+\compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
+\def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
+\compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
+\def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
+\compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
+% multiwire(s)
+\def\pgf@circ@bmultiwire@path#1{\pgf@circ@bipole@path{bmultiwire}{#1}}
+\compattikzset{bmultiwire/.style = {\circuitikzbasekey,
+/tikz/to path=\pgf@circ@bmultiwire@path, l=#1}}
+\def\pgf@circ@multiwire@path#1{\pgf@circ@bipole@path{multiwire}{#1}}
+\compattikzset{multiwire/.style = {\circuitikzbasekey,
+/tikz/to path=\pgf@circ@multiwire@path, l=#1}}
+
+% reed switches
+\def\pgf@circ@reed@path#1{\pgf@circ@bipole@path{reed}{#1}}
+\compattikzset{reed/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@reed@path, l=#1}}
+
+% Transistor like bipoles
+
+\def\pgf@circ@trans@path#1#2{
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{bipole/name}}
+ \def\pgf@circ@temp{#2}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
+ \fi
+ }
+ \ifpgf@circuit@bipole@inverted
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathadd{\pgfmathresult}{-90}
+ \pgfmathround{\pgfmathresult}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {}
+ node {\ctikzvalof{bipole/label/name}}
+ \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+ (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \drawpoles
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+\def\pgf@circ@definetranspath#1{
+ \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
+}
+
+\pgf@circ@definetranspath{elmech}
+\pgf@circ@definetranspath{nmos}
+\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{hemt}
+\pgf@circ@definetranspath{npn}
+\pgf@circ@definetranspath{pnp}
+\pgf@circ@definetranspath{nfet}
+\pgf@circ@definetranspath{nigfete}
+\pgf@circ@definetranspath{nigfetd}
+\pgf@circ@definetranspath{nigfetebulk}
+\pgf@circ@definetranspath{pfet}
+\pgf@circ@definetranspath{pigfete}
+\pgf@circ@definetranspath{pigfetd}
+\pgf@circ@definetranspath{pigfetebulk}
+\pgf@circ@definetranspath{njfet}
+\pgf@circ@definetranspath{pjfet}
+\pgf@circ@definetranspath{pigbt}
+\pgf@circ@definetranspath{nigbt}
+\pgf@circ@definetranspath{Lpigbt}
+\pgf@circ@definetranspath{Lnigbt}
+%%%---------- close: tex/pgfcircpath
+
+\catcode`\@=\tikzatcode
+\catcode`\|=\tikzbarcode
+\catcode`\!=\tikzexclaimcode
+
+% define the environment
+\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture}
+
+\protect
+
+\stopmodule
+
+\endinput
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index 03ec7191c5..f3984d02ee 100644
--- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
@@ -10,8 +10,8 @@
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
-\def\pgfcircversion{1.0}
-\def\pgfcircversiondate{2020/02/04}
+\def\pgfcircversion{1.0.1}
+\def\pgfcircversiondate{2020/02/22}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
\usemodule[tikz]
@@ -19,6 +19,7 @@
\startmodule[circuitikz]
\usetikzlibrary[calc]
\usetikzlibrary[arrows.meta, bending]
+\usetikzlibrary[fpu] % may be needed for use fpu reciprocal (v1.0.1)
\unprotect
diff --git a/indexing/upmendex/COPYRIGHT b/indexing/upmendex/COPYRIGHT
index 1cc83b0168..665d9be464 100644
--- a/indexing/upmendex/COPYRIGHT
+++ b/indexing/upmendex/COPYRIGHT
@@ -1,5 +1,5 @@
Copyright (C) 1995 ASCII Corporation, 2009 ASCII MEDIA WORKS,
- 2015-2019 TANAKA Takuji
+ 2015-2020 TANAKA Takuji
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/indexing/upmendex/README.md b/indexing/upmendex/README.md
index 4c55ed7a45..f0f8df4ca5 100644
--- a/indexing/upmendex/README.md
+++ b/indexing/upmendex/README.md
@@ -1,7 +1,7 @@
upmendex --- Multilingual index processor
==========================================
-2019.02.17 Ver0.52
+2020.02.22 Ver0.54
TANAKA, Takuji
<ttk(at)t-lab.opal.ne.jp>
@@ -27,14 +27,14 @@ upmendex is a multilingual index processor with following features:
* source/ :: sources
* doc/ :: documents
* doc/samples/ :: samples for test.
- More samples are distributed at Ref. [2].
+ More samples are distributed at GitHub[2] than at CTAN[5].
* man/ :: manuals
### Building upmendex
-The source files are distributed at GitHub[2] and work with TeX Live svn r50040.
+The source files are distributed at GitHub[2] and work with TeX Live svn r53427.
Ref. [TeX Live and Subversion](http://www.tug.org/texlive/svn/)
-Tested with ICU 63.1 .
+Tested with ICU 65.1 .
### Status
Beta version.
@@ -74,9 +74,10 @@ Follows are available for setting into "icu_locale".
"zh", "zh@collation=unihan", "zh@collation=stroke", "zh@collation=zhuyin" (Chinese)
### References
-1. [ASCII Nihongo TeX (Publishing TeX)](http://ascii.asciimw.jp/pb/ptex/)
- ASCII MEDIA WORKS (dead link)
+1. [ASCII Nihongo TeX (Publishing TeX)](https://asciidwango.github.io/ptex/)
+ ASCII MEDIA WORKS (web site by DWANGO Co., Ltd.)
2. [Source/Document distribution of upmendex --- multilingual index processor @ GitHub](https://github.com/t-tk/upmendex-package)
3. [upTeX, upLaTeX ― unicode version of pTeX, pLaTeX](http://www.t-lab.opal.ne.jp/tex/uptex_en.html)
4. [International Components for Unicode (ICU)](http://site.icu-project.org/)
+5. [upmendex @ CTAN](https://ctan.org/pkg/upmendex/)
diff --git a/indexing/upmendex/doc/samples/Makefile b/indexing/upmendex/doc/samples/Makefile
index 7cd082cbb8..533ddaf743 100644
--- a/indexing/upmendex/doc/samples/Makefile
+++ b/indexing/upmendex/doc/samples/Makefile
@@ -17,3 +17,5 @@ compare:
diff -qs $$ind output/$$ind ; \
done
+clean:
+ rm -f *.ind *.ilg
diff --git a/indexing/upmendex/doc/samples/alphabet/Makefile b/indexing/upmendex/doc/samples/alphabet/Makefile
index a33c0e11b8..5a384ada58 100644
--- a/indexing/upmendex/doc/samples/alphabet/Makefile
+++ b/indexing/upmendex/doc/samples/alphabet/Makefile
@@ -35,3 +35,6 @@ zh:
locx='zhp' ; \
$(UPMENDEX) alpha_$$locx.idx -s mdxsty_$$loc$$num.ist -o alpha_$$locx$$num.ind ; \
done
+
+clean:
+ rm -f *.ind *.ilg
diff --git a/indexing/upmendex/doc/samples/korean.idx b/indexing/upmendex/doc/samples/korean.idx
index 63d4cea62f..f46789ca51 100644
--- a/indexing/upmendex/doc/samples/korean.idx
+++ b/indexing/upmendex/doc/samples/korean.idx
@@ -26,7 +26,7 @@
\indexentry{쌀}{3}
\indexentry{밥}{3}
\indexentry{빵}{3}
-\indexentry{음료}{4}
+\indexentry{음료수}{4}
\indexentry{케키}{4}
\indexentry{차}{4}
\indexentry{우유}{4}
@@ -41,7 +41,7 @@
\indexentry{김치}{5}
\indexentry{나물}{5}
\indexentry{찌개}{5}
-\indexentry{비빈바}{5}
+\indexentry{비빔밥}{5}
\indexentry{불고기}{5}
\indexentry{국밥}{5}
\indexentry{갈비}{5}
diff --git a/indexing/upmendex/doc/samples/option/Makefile b/indexing/upmendex/doc/samples/option/Makefile
index 8e2746d17c..f9157d609c 100644
--- a/indexing/upmendex/doc/samples/option/Makefile
+++ b/indexing/upmendex/doc/samples/option/Makefile
@@ -20,3 +20,6 @@ jp_u:
$(UPMENDEX) japanese.idx -r -s mdxsty_j$$sty.ist -o japanese_r_$$sty-umdx.ind ; \
$(UPMENDEX) japanese.idx -g -s mdxsty_j$$sty.ist -o japanese_g_$$sty-umdx.ind ; \
done
+
+clean:
+ rm -f *.ind *.ilg
diff --git a/indexing/upmendex/source/ChangeLog b/indexing/upmendex/source/ChangeLog
index 6e9e19eaa1..6c0e2aaef7 100644
--- a/indexing/upmendex/source/ChangeLog
+++ b/indexing/upmendex/source/ChangeLog
@@ -1,3 +1,46 @@
+2020-02-22 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * version 0.54 Beta version.
+ * configure.ac, main.c, COPYRIGHT: Bump version
+ and copyright year.
+ * {convert,fwrite,sort}.c:
+ Support Small Kana Extension in Unicode 12.0.
+ Add CJK Unified Ideographs Extension G.
+ Update samples.
+
+2020-01-16 Karl Berry <karl@freefriends.org>
+
+ * configure.ac,
+ * COPYRIGHT,
+ * main.c (VERSION): version 0.53 for TL'20.
+
+2019-12-12 Karl Berry <karl@freefriends.org>
+
+ * configure.ac: look for a pthread library cntaining
+ pthread_create (using KPSE_SEARCH_LIBS) and set PTHREAD_LIB if found.
+ * Makefile.am (LDADD): include $(PTHREAD_LIB).
+
+As of ICU 65.1, upmendex requires -lpthread. Otherwise, it crashes
+at sort.c:82, which merely creates the icu_collator:
+ icu_collator = ucol_open(icu_locale, &status);
+
+About 10 stack frames deep into the ICU initialization, this winds up calling
+(Build/source/libs/icu/icu-src/source/common/umutex.cpp:146):
+ std::call_once(*pInitFlag, umtx_init);
+
+which results in a fatal error from stdc++:
+ terminate called after throwing an instance of 'std::system_error'
+ what(): Unknown error -1
+
+Web searching indicated that that opaque error message is a result of not
+linking with -lpthread. So now we do so. So far our other ICU programs
+(bibtexu, xetex) don't seem to require it.
+
+2019-03-16 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * upmendex.ja.txt: Rename from upmendex.doc,
+ minor update.
+
2019-03-06 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
Fix a bug in multibytelen().
diff --git a/indexing/upmendex/source/Makefile.am b/indexing/upmendex/source/Makefile.am
index 28e452e447..fc188887f4 100644
--- a/indexing/upmendex/source/Makefile.am
+++ b/indexing/upmendex/source/Makefile.am
@@ -1,8 +1,8 @@
-## $Id: Makefile.am 44086 2017-04-27 21:38:29Z karl $
+## $Id$
## Makefile.am for the TeX Live subdirectory texk/upmendex/
##
-## Copyright 2017 Karl Berry <tex-live@tug.org>
-## Copyright 2010-2014 Peter Breitenlohner <tex-live@tug.org>
+## Copyright 2015-2019 Karl Berry <tex-live@tug.org>
+## Copyright 2010-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(ICU_INCLUDES)
@@ -29,15 +29,12 @@ upmendex_SOURCES = \
styfile.c \
var.h
-
-
# Force Automake to use CXXLD for linking
nodist_EXTRA_upmendex_SOURCES = dummy.cxx
-
$(upmendex_OBJECTS): $(KPATHSEA_DEPEND) $(ICU_DEPEND)
-LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(ICU_LIBS_EXTRA)
+LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(PTHREAD_LIB) $(ICU_LIBS_EXTRA)
## Rebuild libkpathsea
@KPATHSEA_RULE@
@@ -51,7 +48,7 @@ EXTRA_DIST = \
##
EXTRA_DIST += \
indexsty \
- upmendex.doc
+ upmendex.ja.txt
## Tests
##
diff --git a/indexing/upmendex/source/Makefile.in b/indexing/upmendex/source/Makefile.in
index 81311dda78..08c9fae74a 100644
--- a/indexing/upmendex/source/Makefile.in
+++ b/indexing/upmendex/source/Makefile.in
@@ -95,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
$(top_srcdir)/../../m4/kpse-cxx-hack.m4 \
$(top_srcdir)/../../m4/kpse-icu-flags.m4 \
$(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-search-libs.m4 \
$(top_srcdir)/../../m4/kpse-warnings.m4 \
$(top_srcdir)/../../m4/libtool.m4 \
$(top_srcdir)/../../m4/ltoptions.m4 \
@@ -121,7 +122,8 @@ am_upmendex_OBJECTS = convert.$(OBJEXT) fread.$(OBJEXT) \
upmendex_OBJECTS = $(am_upmendex_OBJECTS)
upmendex_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
-upmendex_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+upmendex_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -515,6 +517,7 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_LIB = @PTHREAD_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -600,8 +603,8 @@ upmendex_SOURCES = \
# Force Automake to use CXXLD for linking
nodist_EXTRA_upmendex_SOURCES = dummy.cxx
-LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(ICU_LIBS_EXTRA)
-EXTRA_DIST = COPYRIGHT indexsty upmendex.doc $(TESTS) tests/foo.idx \
+LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(PTHREAD_LIB) $(ICU_LIBS_EXTRA)
+EXTRA_DIST = COPYRIGHT indexsty upmendex.ja.txt $(TESTS) tests/foo.idx \
tests/foo.ind tests/uni.idx tests/uni.dict tests/uni.ist \
tests/uni.ind
TESTS = tests/upmendex.test
diff --git a/indexing/upmendex/source/aclocal.m4 b/indexing/upmendex/source/aclocal.m4
index 5dc224d318..5392efefa9 100644
--- a/indexing/upmendex/source/aclocal.m4
+++ b/indexing/upmendex/source/aclocal.m4
@@ -1173,6 +1173,7 @@ m4_include([../../m4/kpse-common.m4])
m4_include([../../m4/kpse-cxx-hack.m4])
m4_include([../../m4/kpse-icu-flags.m4])
m4_include([../../m4/kpse-kpathsea-flags.m4])
+m4_include([../../m4/kpse-search-libs.m4])
m4_include([../../m4/kpse-warnings.m4])
m4_include([../../m4/libtool.m4])
m4_include([../../m4/ltoptions.m4])
diff --git a/indexing/upmendex/source/configure b/indexing/upmendex/source/configure
index f3c0ab6482..55a19d1649 100755
--- a/indexing/upmendex/source/configure
+++ b/indexing/upmendex/source/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for upmendex (TeX Live) 0.52.
+# Generated by GNU Autoconf 2.69 for upmendex (TeX Live) 0.54.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='upmendex (TeX Live)'
PACKAGE_TARNAME='upmendex--tex-live-'
-PACKAGE_VERSION='0.52'
-PACKAGE_STRING='upmendex (TeX Live) 0.52'
+PACKAGE_VERSION='0.54'
+PACKAGE_STRING='upmendex (TeX Live) 0.54'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -638,6 +638,7 @@ ICU_DEPEND
ICU_LIBS
ICU_INCLUDES
ICU_CONFIG
+PTHREAD_LIB
KPATHSEA_RULE
KPATHSEA_DEPEND
KPATHSEA_LIBS
@@ -1344,7 +1345,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures upmendex (TeX Live) 0.52 to adapt to many kinds of systems.
+\`configure' configures upmendex (TeX Live) 0.54 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1415,7 +1416,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of upmendex (TeX Live) 0.52:";;
+ short | recursive ) echo "Configuration of upmendex (TeX Live) 0.54:";;
esac
cat <<\_ACEOF
@@ -1540,7 +1541,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-upmendex (TeX Live) configure 0.52
+upmendex (TeX Live) configure 0.54
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2473,7 +2474,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by upmendex (TeX Live) $as_me 0.52, which was
+It was created by upmendex (TeX Live) $as_me 0.54, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -8672,7 +8673,7 @@ fi
# Define the identity of the package.
PACKAGE='upmendex--tex-live-'
- VERSION='0.52'
+ VERSION='0.54'
# Some tools Automake needs.
@@ -17749,7 +17750,7 @@ ac_config_headers="$ac_config_headers c-auto.h:c-auto.in"
-$as_echo "#define TL_VERSION \"TeX Live 2019\"" >>confdefs.h
+$as_echo "#define TL_VERSION \"TeX Live 2020\"" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99 variadic macros are supported" >&5
@@ -18201,7 +18202,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-upmendex (TeX Live) config.lt 0.52
+upmendex (TeX Live) config.lt 0.54
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -19513,6 +19514,73 @@ if test "x$kpse_cv_kpse_debug" != xyes; then :
KPATHSEA_INCLUDES="$KPATHSEA_INCLUDES -DNO_DEBUG"
fi
+kpse_search_save_LIBS=$LIBS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
+$as_echo_n "checking for library containing pthread_create... " >&6; }
+if ${ac_cv_search_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pthread_create=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_create+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_create+:} false; then :
+
+else
+ ac_cv_search_pthread_create=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5
+$as_echo "$ac_cv_search_pthread_create" >&6; }
+ac_res=$ac_cv_search_pthread_create
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+LIBS=$kpse_search_save_LIBS
+case $ac_cv_search_pthread_create in #(
+ "none required") :
+ ;; #(
+ no) :
+ as_fn_error $? "Sorry, did not find pthread_create()" "$LINENO" 5 ;; #(
+ *) :
+ PTHREAD_LIB=$ac_cv_search_pthread_create ;;
+esac
+
echo 'tldbg:KPSE_ICU_FLAGS called: more-icu-libs=icuio icui18n, icu-config-args=--ldflags-icuio.' >&5
##tldbg _KPSE_LIB_FLAGS: Setup icu (-licuxxx) flags.
echo 'tldbg:_KPSE_LIB_FLAGS called: libdir=icu, libname=icuxxx, options=, tlincl=-DU_STATIC_IMPLEMENTATION -IBLD/libs/icu/include, tllib=BLD/libs/icu/icu-build/lib/libicuio.a BLD/libs/icu/icu-build/lib/libicui18n.a BLD/libs/icu/icu-build/lib/libicuuc.a BLD/libs/icu/icu-build/lib/libicudata.a, tlextra=, rebuildsrcdeps=, rebuildblddeps=${top_builddir}/../../libs/icu/include/unicode/uversion.h.' >&5
@@ -20274,7 +20342,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by upmendex (TeX Live) $as_me 0.52, which was
+This file was extended by upmendex (TeX Live) $as_me 0.54, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20340,7 +20408,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-upmendex (TeX Live) config.status 0.52
+upmendex (TeX Live) config.status 0.54
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/indexing/upmendex/source/configure.ac b/indexing/upmendex/source/configure.ac
index 9a6cbfa555..c95d31520b 100644
--- a/indexing/upmendex/source/configure.ac
+++ b/indexing/upmendex/source/configure.ac
@@ -1,13 +1,14 @@
+dnl $Id$
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Copyright 2016 Karl Berry <tex-live@tug.org>
-dnl Copyright 2010-2014 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright 2015-2020 Karl Berry <tex-live@tug.org>
+dnl Copyright 2010-2015 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
-AC_INIT([upmendex (TeX Live)], [0.52])
+AC_INIT([upmendex (TeX Live)], [0.54])
AC_PREREQ([2.63])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_AUX_DIR([../../build-aux])
@@ -36,7 +37,20 @@ AS_CASE([$kpse_cv_have___VA_ARGS__],
[yes], [AC_DEFINE([HAVE___VA_ARGS__], 1,
[Define to 1 if you have C99 variadic macros.])])
+dnl As of ICU 65.1, ICU requires -lpthread on x86_64-linux and, most
+dnl likely, on other platforms. Otherwise there is a crash in
+dnl std::call_once, as shown in ChangeLog. OpenBSD already has to link
+dnl with -lpthread on all platforms (see m4/kpse-icu-flags.m4), but so
+dnl far it seems only upmendex requires it elsewhere. The double
+dnl inclusion of -lpthread on obsd should be harmless.
+dnl
+dnl The autoconf-archive ax_pthread macro (used in asymptote) goes to
+dnl much greater lengths to find the best thread library and support all
+dnl platforms. We can switch to that if necessary, but hopefully this
+dnl simple test will be enough.
+dnl
KPSE_KPATHSEA_FLAGS
+KPSE_SEARCH_LIBS([PTHREAD_LIB], [pthread_create], [pthread])
KPSE_ICU_FLAGS([icuio icui18n], [--ldflags-icuio])
AC_CONFIG_FILES([Makefile])
diff --git a/indexing/upmendex/source/convert.c b/indexing/upmendex/source/convert.c
index 72e7cb5b78..d02b05bf4d 100644
--- a/indexing/upmendex/source/convert.c
+++ b/indexing/upmendex/source/convert.c
@@ -217,7 +217,8 @@ int convert(UChar *buff1, UChar *buff2)
||is_jpn_kana(buff3)||is_kor_hngl(buff3)||is_zhuyin(buff3)
||is_comb_diacritical_mark(buff3)) {
buff2[j]=buff3[0];
- i++;
+ if (wclen==2) buff2[j+1]=buff3[1];
+ i+=wclen;
j+=wclen;
}
diff --git a/indexing/upmendex/source/fwrite.c b/indexing/upmendex/source/fwrite.c
index 6736f56e5a..380e1cbf37 100644
--- a/indexing/upmendex/source/fwrite.c
+++ b/indexing/upmendex/source/fwrite.c
@@ -649,6 +649,7 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset)
{
int k, len, hi, lo, mi;
UChar ch,src[2],dest[8],strX[4],strY[4],strZ[4];
+ UChar32 c32;
UErrorCode perr;
UCollationResult order;
static int hanzi_mode=0;
@@ -668,8 +669,22 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset)
ini[0]=extkanatable[ch-EXKANATOP];
return;
}
- else if (ch==0x309F) { ini[0]=0x30E8; return; } /* HIRAGANA YORI */
- else if (ch==0x30FF) { ini[0]=0x30B3; return; } /* KATAKANA KOTO */
+ else if (ch==0x309F) { ini[0]=0x30E8; return; } /* HIRAGANA YORI -> ヨ */
+ else if (ch==0x30FF) { ini[0]=0x30B3; return; } /* KATAKANA KOTO -> コ */
+ else if (is_jpn_kana(istr)==2) {
+ c32=U16_GET_SUPPLEMENTARY(istr[0],istr[1]);
+ switch (c32) {
+ case 0x1B150: case 0x1B164:
+ ini[0]=0x30F0; break; /* ヰ */
+ case 0x1B151: case 0x1B165:
+ ini[0]=0x30F1; break; /* ヱ */
+ case 0x1B152: case 0x1B166:
+ ini[0]=0x30F2; break; /* ヲ */
+ case 0x1B167: default:
+ ini[0]=0x30F3; break; /* ン */
+ }
+ return;
+ }
else if (is_kor_hngl(&ch)) {
if ((ch>=0xAC00)&&(ch<=0xD7AF)) { /* Hangul Syllables */
ch=(ch-0xAC00)/(21*28)+CHOSEONG_KIYEOK; /* convert to Hangul Jamo, Initial consonants */
diff --git a/indexing/upmendex/source/main.c b/indexing/upmendex/source/main.c
index e65ac3108d..c7d8106b53 100644
--- a/indexing/upmendex/source/main.c
+++ b/indexing/upmendex/source/main.c
@@ -19,7 +19,7 @@ char *styfile,*idxfile[256],*indfile,*dicfile,*logfile;
#endif
KpathseaSupportInfo kp_ist,kp_dict;
-#define VERSION "version 0.52"
+#define VERSION "version 0.54"
int main(int argc, char **argv)
{
@@ -156,7 +156,7 @@ int main(int argc, char **argv)
u_getVersion(icuVersion);
u_versionToString(icuVersion, icu_version);
fprintf(stderr,"upmendex - index processor, %s (%s).\n",VERSION, TL_VERSION);
- fprintf(stderr," Copyright 2009 ASCII MEDIA WORKS, 2015-2019 TANAKA Takuji\n");
+ fprintf(stderr," Copyright 2009 ASCII MEDIA WORKS, 2015-2020 TANAKA Takuji\n");
fprintf(stderr," using ICU version %s\n",icu_version);
fprintf(stderr,"usage:\n");
fprintf(stderr,"%% upmendex [-ilqrcgf] [-s sty] [-d dic] [-o ind] [-t log] [-p no] [--] [idx0 idx1 ...]\n");
diff --git a/indexing/upmendex/source/sort.c b/indexing/upmendex/source/sort.c
index 5d11a0727c..15272dc859 100644
--- a/indexing/upmendex/source/sort.c
+++ b/indexing/upmendex/source/sort.c
@@ -366,9 +366,18 @@ int is_numeric(UChar *c)
int is_jpn_kana(UChar *c)
{
+ UChar32 c32;
+
if ((*c>=0x3040)&&(*c<=0x30FF)) return 1; /* Hiragana, Katakana */
else if ((*c>=0x31F0)&&(*c<=0x31FF)) return 1; /* Katakana Phonetic Extensions */
- else return 0;
+
+ if (is_surrogate_pair(c)) {
+ c32=U16_GET_SUPPLEMENTARY(*c,*(c+1));
+ if ((c32>=0x1B130) && (c32<=0x1B16F)) return 2; /* Small Kana Extensions */
+ }
+ return 0;
+ /* ICU 65 does not seem to support
+ "Kana Supplement" and "Kana Extended-A" yet. (2020/02/16) */
}
int is_kor_hngl(UChar *c)
@@ -399,7 +408,8 @@ int is_hanzi(UChar *c)
if (is_surrogate_pair(c)) {
c32=U16_GET_SUPPLEMENTARY(*c,*(c+1));
if ((c32>=0x20000) && /* CJK Unified Ideographs Extension B,C,D,E,F */
- (c32<=0x2FA1F)) return 2; /* CJK Compatibility Ideographs Supplement */
+ /* CJK Compatibility Ideographs Supplement */
+ (c32<=0x3134F)) return 2; /* CJK Unified Ideographs Extension G */
}
return 0;
}
diff --git a/indexing/upmendex/source/tests/upmendex.test b/indexing/upmendex/source/tests/upmendex.test
index 5b1f6b7db8..da75821d10 100755
--- a/indexing/upmendex/source/tests/upmendex.test
+++ b/indexing/upmendex/source/tests/upmendex.test
@@ -1,5 +1,5 @@
#! /bin/sh -vx
-# $Id: upmendex.test 45809 2017-11-15 00:36:56Z karl $
+# $Id$
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2013 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
diff --git a/macros/generic/expkv/README.md b/macros/generic/expkv/README.md
index 4401986b55..854846ee33 100644
--- a/macros/generic/expkv/README.md
+++ b/macros/generic/expkv/README.md
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
# expkv -- an expandable key=val implementation
-Version 2020-01-22 v0.3
+Version 2020-02-22 v0.4
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
diff --git a/macros/generic/expkv/expkv.dtx b/macros/generic/expkv/expkv.dtx
index 58f8c192db..fc889e7d42 100644
--- a/macros/generic/expkv/expkv.dtx
+++ b/macros/generic/expkv/expkv.dtx
@@ -67,6 +67,8 @@ and the derived files expkv.pdf
\RequirePackage{xfp} ^^A required for an example
\RequirePackage{listings}
\RequirePackage{booktabs}
+\RequirePackage{array}
+\RequirePackage{collcell}
\RequirePackage{siunitx}
\RequirePackage{xcolor}
\RequirePackage{caption}
@@ -106,6 +108,7 @@ and the derived files expkv.pdf
\mbox
{^^A
\BeginAccSupp{ActualText=expkv}^^A
+ \rmfamily
\bfseries
{\color{expkvgrey}e\kern-.05em x\kern-.05em}^^A
\lower.493ex
@@ -161,6 +164,7 @@ and the derived files expkv.pdf
% \fi
%
% \maketitle
+% \renewcommand*\thefootnote{\arabic{footnote}}
%
% \begin{abstract}
% \noindent\parfillskip=0pt
@@ -282,23 +286,48 @@ and the derived files expkv.pdf
% \end{syntax}
% This macro parses the \kv\ pairs and provides those list elements which are
% only keys as the argument to \meta{cs1}, and those which are a \kv\ pair to
-% \meta{cs2} as two arguments. It expands in exactly two steps of expansion.
+% \meta{cs2} as two arguments. It is fully expandable as well and returns the
+% parsed list in |\unexpanded|, which has no effect outside of an |\expanded|
+% or |\edef| context\footnotemark.
+% If you need control over the necessary steps of expansion you
+% can use |\expanded| around it.
+%
% |\ekvbreak| and |\ekvsneak| and their relatives don't work in |\ekvparse|.
-% It is analogue to \pkg{expl3}'s |\keyval_parse:NNn|.
+% It is analogue to \pkg{expl3}'s |\keyval_parse:NNn|, but not with the same
+% parsing rules -- |\keyval_parse:NNn| throws an error on multiple equal
+% signs per \kv\ pair and on empty \key\ names in a \kv\ pair, both of which
+% |\ekvparse| doesn't deal with.
%
% As a small example:
% \begin{lstlisting}
% \ekvparse\handlekey\handlekeyval{foo = bar, key, baz={zzz}}
% \end{lstlisting}
-% would expand in exactly two steps to
+% would expand to
% \begin{lstlisting}
% \handlekeyval{foo}{bar}\handlekey{key}\handlekeyval{baz}{zzz}
% \end{lstlisting}
% and afterwards |\handlekey| and |\handlekeyval| would have to further handle
% the \key. There are no macros like these two contained in \expkv, you have
% to set them up yourself if you want to use |\ekvparse| (of course the names
-% might differ).
+% might differ). If you need the results of |\ekvparse| as the argument for
+% another macro, you should use |\expanded| as only then the input stream will
+% contain the output above:
+% \begin{lstlisting}
+% \expandafter\handle\expanded{\ekvparse\k\kv{foo = bar, key, baz={zzz}}}
+% \end{lstlisting}
+% would expand to
+% \begin{lstlisting}
+% \handle\kv{foo}{bar}\k{key}\kv{baz}{zzz}
+% \end{lstlisting}
% \end{function}
+% \footnotetext
+% {^^A
+% This is a change in behaviour, previously (v0.3 and before) \cs{ekvparse}
+% would expand in exactly two steps. This isn't always necessary, but makes
+% the parsing considerably slower. If this is necessary for your application
+% you can put an \cs[no-index]{expanded} around it and will still be faster
+% since you need only a single \cs[no-index]{expandafter} this way.^^A
+% }.
%
% \subsection{Miscellaneous}
%
@@ -379,15 +408,16 @@ and the derived files expkv.pdf
% \protected\ekvdef{test}{height}{\def\myheight{#1}}
% \ekvset{test}{ height = 6 }
% \end{lstlisting}
-% and only the usage of the key, not its definition, is benchmarked.
+% and only the usage of the key, not its definition, is benchmarked. For the
+% impatient, the essence of these comparisons regarding speed and buggy
+% behaviour is contained in \autoref{tab:comp}.
%
% As far as I know \expkv\ is the only fully expandable \kv\ parser. I tried to
% compare \expkv\ to every \kv\ package listed on
% \href{https://ctan.org/topic/keyval}{CTAN}, however, one might notice that
% some of those are missing from this list. That's because I didn't get the
% others to work due to bugs, or because they just provide wrappers around other
-% packages in this list. For the impatient, the essence of these comparisons
-% regarding speed and buggy behaviour is contained in \autoref{tab:comp}.
+% packages in this list.
%
% In this subsubsection is no benchmark of |\ekvparse| and |\keyval_parse:NNn|
% contained, as most other packages don't provide equivalent features to my
@@ -395,12 +425,12 @@ and the derived files expkv.pdf
% that it does less. The same is true for |\keyval_parse:NNn| compared to
% |\keys_set:nn| of \pkg{expl3} (where the difference is much bigger).
%
-% \paragraph{\pkg{keyval}} is between two and three times faster and has a
-% comparable feature set just a slightly different way how it handles keys
-% without values. That might be considered a drawback, as it limits the
-% versatility, but also as an advantage, as it might reduce doubled code. Keep
-% in mind that as soon as someone loads \pkg{xkeyval} the performance of
-% \pkg{keyval} gets replaced by \pkg{xkeyval}'s.
+% \paragraph{\pkg{keyval}} is about two times faster and has a comparable
+% feature set just a slightly different way how it handles keys without values.
+% That might be considered a drawback, as it limits the versatility, but also as
+% an advantage, as it might reduce doubled code. Keep in mind that as soon as
+% someone loads \pkg{xkeyval} the performance of \pkg{keyval} gets replaced by
+% \pkg{xkeyval}'s.
%
% Also \pkg{keyval} has a bug, which unfortunately can't really be resolved
% without breaking backwards compatibility for \emph{many} documents, namely it
@@ -415,13 +445,13 @@ and the derived files expkv.pdf
% \setkeys{foo}{bar={{baz}}}
% \end{lstlisting}
%
-% \paragraph{\pkg{xkeyval}} is more than ten times slower, but it provides more
-% functionality, e.g., it has choice keys, boolean keys, and so on. It contains
-% the same bug as \pkg{keyval} as it has to be compatible with it by design (it
-% replaces \pkg{keyval}'s frontend), but also adds even more cases in which
-% braces are stripped that shouldn't be stripped, worsening the situation.
+% \paragraph{\pkg{xkeyval}} is roughly fourteen times slower, but it provides
+% more functionality, e.g., it has choice keys, boolean keys, and so on. It
+% contains the same bug as \pkg{keyval} as it has to be compatible with it by
+% design (it replaces \pkg{keyval}'s frontend), but also adds even more cases in
+% which braces are stripped that shouldn't be stripped, worsening the situation.
%
-% \paragraph{\pkg{ltxkeys}} is over 200 times slower -- which is funny, because
+% \paragraph{\pkg{ltxkeys}} is over 300 times slower -- which is funny, because
% it aims to be ``[\ldots] faster than these earlier packages [referring to
% \pkg{keyval} and \pkg{xkeyval}].'' Since it aims to have a bigger feature set
% than \pkg{xkeyval}, it most definitely also has a bigger feature set than
@@ -431,13 +461,12 @@ and the derived files expkv.pdf
% \pkg{ltxkeys} loads \pkg{catoptions} which is known to introduce bugs (e.g.,
% see \url{https://tex.stackexchange.com/questions/461783}).
%
-% \paragraph{\pkg{l3keys}} is at least three times slower, but has an, imho,
-% great interface to define keys. It strips \emph{all} outer spaces, even if
-% somehow multiple spaces ended up on either end. It offers more features, but
-% is pretty much bound to \pkg{expl3} code. Whether that's a drawback is up to
-% you.
+% \paragraph{\pkg{l3keys}} is almost five times slower, but has an, imho, great
+% interface to define keys. It strips \emph{all} outer spaces, even if somehow
+% multiple spaces ended up on either end. It offers more features, but is pretty
+% much bound to \pkg{expl3} code. Whether that's a drawback is up to you.
%
-% \paragraph{\pkg{pgfkeys}} is about one and a half times slower for one key,
+% \paragraph{\pkg{pgfkeys}} is a bit more than two times slower for one key,
% but has an \emph{enormous} feature set. However, since adding additional keys
% doesn't add as much needed time for \pkg{pgfkeys} compared to \expkv, it gets
% faster than \expkv\ at around eight \kv\ pairs.
@@ -446,21 +475,22 @@ and the derived files expkv.pdf
% was last updated in 2012 and it slows down |\pgfkeys| by factor~$8$. Also I
% don't know whether this might introduce new bugs.
%
-% \paragraph{\pkg{kvsetkeys} with \pkg{kvdefinekeys}} is about two times slower,
-% but it works even if commas and equals have category codes different from 12.
-% Else the features of the keys are equal to those of \pkg{keyval}, the parser
-% has more features, though.
+% \paragraph{\pkg{kvsetkeys} with \pkg{kvdefinekeys}} is about three times
+% slower, but it works even if commas and equals have category codes different
+% from 12 (just as some other packages in this list). Else the features of the
+% keys are equal to those of \pkg{keyval}, the parser has more features, though.
%
-% \paragraph{\pkg{options}} is a bit faster than \expkv\ (almost
-% \SI{10}{\percent}) and has a much bigger feature set. Unfortunately it also
-% suffers from the premature unbracing bug \pkg{keyval} has.
+% \paragraph{\pkg{options}} is a bit slower for only a single value, but gets a
+% tad faster than \expkv\ at around 10 \kv\ pairs. It has a much bigger feature
+% set. Unfortunately it also suffers from the premature unbracing bug
+% \pkg{keyval} has.
%
% \paragraph{\pkg{simplekv}} is hard to compare because I don't speak French (so
% I don't understand the documentation) and from what I can see, there is no
% direct way to define the equivalent test key. Nevertheless, I tested the
% closest possible equivalent of my test key while siding for \pkg{simplekv}'s
% design not forcing something into it it doesn't seem to be designed for. It is
-% more than four times slower and has hard to predict behaviour regarding brace
+% more than five times slower and has hard to predict behaviour regarding brace
% and space stripping, similar to \pkg{keyval}. The tested definition was:
% \begin{lstlisting}[belowskip=0pt]
% \usepackage{simplekv}
@@ -468,7 +498,7 @@ and the derived files expkv.pdf
% \setKV[simplekv]{ height = 6 } % benchmarked
% \end{lstlisting}
%
-% \paragraph{\pkg{yax}} is about 13 times slower. It has a pretty strange
+% \paragraph{\pkg{yax}} is over eighteen times slower. It has a pretty strange
% syntax, imho, and again a direct equivalent is hard to define. It has the
% premature unbracing bug, too. Also somehow loading \pkg{yax} broke
% \pkg{options} for me. The tested definition was:
@@ -479,7 +509,8 @@ and the derived files expkv.pdf
% \end{lstlisting}
%
% \begin{table}
-% \def\fnsym{\textcolor{red!80!black}{*}}
+% \def\fnsym{\textcolor{red!80!black}{*}}%
+% \sisetup{round-precision=1, round-mode=places}%
% \begingroup
% \centering
% \newcommand*\yes{\textcolor{red!80!black} {yes}}^^A
@@ -492,24 +523,29 @@ and the derived files expkv.pdf
% of the \href{https://github.com/Skillmon/tex_expkv}{git repository}.
% The columns $p_i$ are the polynomial coefficients of a linear fit to the
% run-time, $p_0$ can be interpreted as the overhead for initialisation
-% and $p_1$ the cost per key. The column ``Category Fragile'' lists
-% whether the parsing breaks with active commas or equal signs.^^A
+% and $p_1$ the cost per key. The $T_0$ column is the actual mean ops
+% needed for an empty list argument, as the linear fit doesn't match that
+% point well in general. The column ``BB'' lists whether the
+% parsing is affected by some sort of brace bug, ``CF'' stands for
+% category code fragile and lists whether the parsing breaks with active
+% commas or equal signs.^^A
% \label{tab:comp}^^A
% }
-% \begin{tabular}{l*2{S[table-format=4.3]}ccc}
+% \begin{tabular}
+% {>{\collectcell\pkg}l<{\endcollectcell}*3{S[table-format=4.1]}ccc}
% \toprule
-% Package & {$p_1$} & {$p_0$} & Brace-Bug & Category Fragile & Date \\
+% \rmfamily Package & {$p_1$} & {$p_0$} & {$T_0$}& BB & CF & Date \\
% \midrule
-% \pkg{keyval} & 13.415 & 2.229 & \yes & \yes & 2014-10-28 \\
-% \pkg{options} & 25.254 & 12.160 & \yes & \yes & 2015-03-01 \\
-% \expkv & 31.711 & 5.124 & \no & \no & 2020-01-15 \\
-% \pkg{pgfkeys} & 26.215 & 43.141 & \yes & \yes & 2020-01-08 \\
-% \pkg{kvsetkeys} & {\fnsym} & {\fnsym} & \no & \no & 2019-12-15 \\
-% \pkg{l3keys} & 107.434 & 23.372 & \no & \no & 2020-01-12 \\
-% \pkg{simplekv} & 162.046 & 1.014 & \yes & \yes & 2017-08-08 \\
-% \pkg{xkeyval} & 258.505 & 168.761 & \yes & \yes & 2014-12-03 \\
-% \pkg{yax} & 510.662 & 37.961 & \yes & \yes & 2010-01-22 \\
-% \pkg{ltxkeys} & 3937.979 & 4512.835 & \no & \no & 2012-11-17 \\
+% keyval & 13.539 & 1.844 & 6.969 & \yes & \yes & 2014-10-28 \\
+% \expkv & 26.411 & 2.391 & 12.610 & \no & \no & 2020-02-22 \\
+% options & 25.532 & 10.518 & 21.393 & \yes & \yes & 2015-03-01 \\
+% pgfkeys & 26.444 & 40.939 & 55.790 & \yes & \yes & 2020-01-08 \\
+% kvsetkeys & {\fnsym} & {\fnsym} & 41.620 & \no & \no & 2019-12-15 \\
+% l3keys & 114.456 & 35.357 & 52.667 & \no & \no & 2020-02-14 \\
+% simplekv & 160.523 & 10.809 & 8.698 & \yes & \yes & 2017-08-08 \\
+% xkeyval & 260.872 & 180.435 & 164.167 & \yes & \yes & 2014-12-03 \\
+% yax & 507.643 & 62.863 & 123.533 & \yes & \yes & 2010-01-22 \\
+% ltxkeys & 3932.759 & 4737.818 & 5883.000 & \no & \no & 2012-11-17 \\
% \bottomrule
% \end{tabular}
% \par
@@ -518,13 +554,13 @@ and the derived files expkv.pdf
% \fnsym For \pkg{kvsetkeys} the linear model used for the other
% packages is a poor fit, \pkg{kvsetkeys} seems to have approximately
% quadratic run-time, the coefficients of the second degree polynomial fit are
-% $p_2=\num{9.653}$, $p_1=\num{40.896}$, and $p_0=\num{67.268}$. Of course the
+% $p_2=\num{9.911}$, $p_1=\num{40.523}$, and $p_0=\num{61.500}$. Of course the
% other packages might not really have linear run-time, but at least from 1~to
% 20~keys the fits don't seem too bad (the maximum ratio $p_2/p_1$
-% for the other packages is \num{8.987e-3}). If one extrapolates the fits
+% for the other packages is \num{9.697e-3}). If one extrapolates the fits
% for 100 \kv\ pairs one finds that most of them match pretty well, the
% exception being \pkg{ltxkeys}, which behaves quadratic as well with
-% $p_2=\num{29.773}$, $p_1=\num{3312.744}$, and $p_0=\num{6805.363}$.
+% $p_2=\num{31.685}$, $p_1=\num{3267.368}$, and $p_0=\num{7177.582}$.
% \end{table}
%
% \subsection{Examples}
@@ -541,7 +577,7 @@ and the derived files expkv.pdf
% \protected\ekvdef{our}{width}{\ourdim=#1\relax}
% \end{lstlisting}
% as you can see, we use the set |our| here. We want the key to behave different
-% if no value is specified. In that case the key should not use the its initial
+% if no value is specified. In that case the key should not use its initial
% value, but be smart and determine the available space from
% \cs[no-index]{hsize}, so we also define
% \begin{lstlisting}
@@ -830,8 +866,8 @@ and the derived files expkv.pdf
% \begin{macro}{\ekvVersion,\ekvDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvVersion{0.3}
-\def\ekvDate{2020-01-22}
+\def\ekvVersion{0.4}
+\def\ekvDate{2020-02-22}
% \end{macrocode}
% \end{macro}
%
@@ -843,7 +879,7 @@ and the derived files expkv.pdf
% \end{macrocode}
%
% Store the category code of |@| to later be able to reset it and change it to
-% 11.
+% 11 for now.
% \begin{macrocode}
\expandafter\chardef\csname ekv@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -854,7 +890,7 @@ and the derived files expkv.pdf
% restore it at the end of the file, we never care for the actual definition of
% it.
%
-% \begin{macro}
+% \begin{macro}[internal]
% {
% \@gobble,\@firstofone,\@firstoftwo,\@secondoftwo,
% \ekv@gobbletostop,\ekv@fi@gobble,\ekv@fi@secondoftwo
@@ -880,7 +916,7 @@ and the derived files expkv.pdf
% the advantage that if they somehow get expanded -- which should never happen
% if things work out -- they'll throw an error directly.
%
-% \begin{macro}
+% \begin{macro}[internal]
% {
% \ekv@ifempty,\ekv@ifempty@,\ekv@ifempty@true,\ekv@ifempty@false,
% \ekv@ifempty@true@F
@@ -901,7 +937,7 @@ and the derived files expkv.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekv@ifblank@}
+% \begin{macro}[internal]{\ekv@ifblank@}
% The obvious test that can be based on an if-empty is if-blank, meaning a test
% checking whether the argument is empty or consists only of spaces. Our version
% here will be tweaked a bit, as we want to check this, but with one leading
@@ -911,7 +947,7 @@ and the derived files expkv.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekv@ifdefined}
+% \begin{macro}[internal]{\ekv@ifdefined}
% We'll need to check whether something is defined quite frequently, so why not
% define a macro that does this. The following test is expandable, slower than
% the typical expandable test for undefined control sequences, but faster for
@@ -928,7 +964,7 @@ and the derived files expkv.pdf
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}
+ % \begin{macro}[internal]
% {
% \ekv@ifdefined@pair,\ekv@ifdefined@pair@,\ekv@ifdefined@key,
% \ekv@ifdefined@key@
@@ -985,7 +1021,7 @@ and the derived files expkv.pdf
\def\ekv@name@key#1{#1)}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@checkvalid}
+% \begin{macro}[internal]{\ekv@checkvalid}
% We place some restrictions on the allowed names, though, namely sets and
% keys are not allowed to be empty -- blanks are fine (meaning \mbox{set-
% or} key-names consisting of spaces).
@@ -1018,10 +1054,7 @@ and the derived files expkv.pdf
% \end{macro}
%
% \begin{macro}
-% {
-% \ekvdef,\ekvdefNoVal,\ekvlet,\ekvletNoVal,\ekvletkv,\ekvletkvNoVal,
-% \ekv@defset
-% }
+% {\ekvdef,\ekvdefNoVal,\ekvlet,\ekvletNoVal,\ekvletkv,\ekvletkvNoVal}
% Set up the key defining macros |\ekvdef| etc.
% \begin{macrocode}
\protected\long\def\ekvdef#1#2#3%
@@ -1074,6 +1107,13 @@ and the derived files expkv.pdf
\ekv@defset{#1}%
}%
}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[internal]{\ekv@defset}
+% In order to enhance the speed the set name given to |\ekvset| will be turned
+% into a control sequence pretty early, so we have to define that control
+% sequence.
+% \begin{macrocode}
\protected\def\ekv@defset#1%
{%
\expandafter\edef\csname\ekv@name@set{#1}\endcsname##1%
@@ -1099,7 +1139,7 @@ and the derived files expkv.pdf
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@set}
+% \begin{macro}[internal]{\ekv@set}
% |\ekv@set| will split the \kv\ list at active commas. Then it has to check
% whether there were unprotected other commas and resplit there.
% \begin{macrocode}
@@ -1120,7 +1160,7 @@ and the derived files expkv.pdf
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@endset}
+% \begin{macro}[internal]{\ekv@endset}
% |\ekv@endset| is a hungry little macro. It will eat everything that remains
% of |\ekv@set| and unbrace the sneaked stuff.
% \begin{macrocode}
@@ -1130,36 +1170,38 @@ and the derived files expkv.pdf
{##3}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@set@other}
+% \begin{macro}[internal]{\ekv@set@other}
% The macro |\ekv@set@other| is guaranteed to get only single \kv\ pairs.
-% So here we need to split at equal signs. If there is no equal sign, we need to
-% test whether we're done and if not this is a |NoVal| key.
+% First we test whether we're done, if not split at equal signs. It is faster to
+% first split at category 12 equal signs and only after that on actives.
+% If there is no equal sign, we need to test whether we got a blank argument and
+% if not this is a |NoVal| key.
% \begin{macrocode}
\long\def\ekv@set@other##1##2,%
{%
- \ekv@ifblank@##2\ekv@nil\ekv@ifempty@B\ekv@ifempty@true@F
- \ekv@ifempty@A\ekv@ifempty@B\@firstofone
+ \ekv@ifstop##2\ekv@endset@other\ekv@mark\ekv@stop
+ \ekv@ifhas@eq@other##2=\ekv@ifempty@B\ekv@ifempty@false
+ \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
+ {\ekv@set@eq@other##1##2\ekv@stop}%
{%
- \ekv@ifhas@eq@other##2=\ekv@ifempty@B\ekv@ifempty@false
+ \ekv@ifhas@eq@active##2#2\ekv@ifempty@B\ekv@ifempty@false
\ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
- {\ekv@set@eq@other##1##2\ekv@stop}%
+ {\ekv@set@eq@active##1##2\ekv@stop}%
{%
- \ekv@ifhas@eq@active##2#2\ekv@ifempty@B\ekv@ifempty@false
- \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
- {\ekv@set@eq@active##1##2\ekv@stop}%
- {%
- \ekv@ifstop##2\ekv@endset@other\ekv@mark\ekv@stop
- \ekv@strip{##2}\ekv@set@key##1%
- }%
+ \ekv@ifblank@##2\ekv@nil\ekv@ifempty@B\ekv@ifempty@true@F
+ \ekv@ifempty@A\ekv@ifempty@B\@firstofone
+ {\ekv@strip{##2}\ekv@set@key##1}%
}%
}%
\ekv@set@other##1\ekv@mark%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@set@eq@other}
+% \begin{macro}[internal]{\ekv@set@eq@other}
% |\ekv@set@eq@other| might not be the correct break point, there might be an
% active equal sign in the currently parsed key-name. If so, we have to resplit.
+% If the split is correct strip the key-name of outer spaces and braces and feed
+% it to |\ekv@set@pair|.
% \begin{macrocode}
\long\def\ekv@set@eq@other##1##2=%
{%
@@ -1170,7 +1212,7 @@ and the derived files expkv.pdf
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@set@eq@active}
+% \begin{macro}[internal]{\ekv@set@eq@active}
% We need to handle the active equal signs.
% \begin{macrocode}
\long\def\ekv@set@eq@active##1##2#2%
@@ -1179,14 +1221,18 @@ and the derived files expkv.pdf
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@ifhas@eq@other,\ekv@ifhas@eq@active,\ekv@endset@other}
+% \begin{macro}[internal]
+% {\ekv@ifhas@eq@other,\ekv@ifhas@eq@active,\ekv@endset@other}
% And we have to set up the testing macros for our equal signs and
% |\ekv@endset@other|.
% \begin{macrocode}
\long\def\ekv@ifhas@eq@other\ekv@mark##1={\ekv@ifempty@\ekv@ifempty@A}
\long\def\ekv@ifhas@eq@active\ekv@mark##1#2{\ekv@ifempty@\ekv@ifempty@A}
\long\def\ekv@endset@other
- \ekv@mark\ekv@stop\ekv@strip##1\ekv@set@key##2%
+ \ekv@mark\ekv@stop
+ \ekv@ifhas@eq@other##1=\ekv@ifempty@B\ekv@ifempty@false
+ \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
+ ##2%
\ekv@set@other##3\ekv@mark
{}
% \end{macrocode}
@@ -1224,11 +1270,11 @@ and the derived files expkv.pdf
% \begin{macrocode}
\long\def\ekvparse##1##2##3%
{%
- \expanded{\ekv@parse##1##2\ekv@mark##3#1\ekv@stop#1}%
+ \ekv@parse##1##2\ekv@mark##3#1\ekv@stop#1%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@parse}
+% \begin{macro}[internal]{\ekv@parse}
% \begin{macrocode}
\long\def\ekv@parse##1##2##3#1%
{%
@@ -1238,69 +1284,82 @@ and the derived files expkv.pdf
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@endparse}
+% \begin{macro}[internal]{\ekv@endparse}
% \begin{macrocode}
\long\def\ekv@endparse
\ekv@mark\ekv@stop\ekv@parse@other##1,\ekv@stop,\ekv@parse##2\ekv@mark
{}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@parse@other}
+% \begin{macro}[internal]{\ekv@parse@other}
% \begin{macrocode}
\long\def\ekv@parse@other##1##2##3,%
{%
- \ekv@ifblank@##3\ekv@nil\ekv@ifempty@B\ekv@ifempty@true@F
- \ekv@ifempty@A\ekv@ifempty@B\@firstofone
+ \ekv@ifstop##3\ekv@endparse@other\ekv@mark\ekv@stop
+ \ekv@ifhas@eq@other##3=\ekv@ifempty@B\ekv@ifempty@false
+ \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
+ {\ekv@parse@eq@other##3\ekv@stop##2}%
{%
- \ekv@ifhas@eq@other##3=\ekv@ifempty@B\ekv@ifempty@false
+ \ekv@ifhas@eq@active##3#2\ekv@ifempty@B\ekv@ifempty@false
\ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
- {\unexpanded{##2}\ekv@parse@eq@other##3\ekv@stop}%
+ {\ekv@parse@eq@active##3\ekv@stop##2}%
{%
- \ekv@ifhas@eq@active##3#2\ekv@ifempty@B\ekv@ifempty@false
- \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
- {\unexpanded{##2}\ekv@parse@eq@active##3\ekv@stop}%
- {%
- \ekv@ifstop##3\ekv@endparse@other\ekv@mark\ekv@stop
- \unexpanded{##1}{\ekv@strip{##3}\unexpanded}%
- }%
+ \ekv@ifblank@##3\ekv@nil\ekv@ifempty@B\ekv@ifempty@true@F
+ \ekv@ifempty@A\ekv@ifempty@B\@firstofone
+ {\ekv@strip{##3}\ekv@parse@key##1}%
}%
}%
\ekv@parse@other##1##2\ekv@mark
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@parse@eq@other}
+% \begin{macro}[internal]{\ekv@parse@eq@other}
% \begin{macrocode}
\long\def\ekv@parse@eq@other##1=%
{%
\ekv@ifhas@eq@active##1#2\ekv@ifempty@B\ekv@ifempty@false
\ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
{\ekv@parse@eq@active##1=}%
- {{\ekv@strip{##1}\unexpanded}\ekv@parse@pair\ekv@mark}%
+ {\ekv@strip{##1}\ekv@parse@pair\ekv@mark}%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@parse@eq@active}
+% \begin{macro}[internal]{\ekv@parse@eq@active}
% \begin{macrocode}
\long\def\ekv@parse@eq@active##1#2%
{%
- {\ekv@strip{##1}\unexpanded}\ekv@parse@pair\ekv@mark
+ \ekv@strip{##1}\ekv@parse@pair\ekv@mark
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@endparse@other}
+% \begin{macro}[internal]{\ekv@endparse@other}
% \begin{macrocode}
\long\def\ekv@endparse@other
- \ekv@mark\ekv@stop\unexpanded##1%
- \ekv@parse@other##2\ekv@mark
+ \ekv@mark\ekv@stop
+ \ekv@ifhas@eq@other##1=\ekv@ifempty@B\ekv@ifempty@false
+ \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo
+ ##2%
+ \ekv@parse@other##3\ekv@mark
{}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ekv@parse@pair}
+% \begin{macro}[internal]{\ekv@parse@pair,\ekv@parse@pair@}
+% \begin{macrocode}
+\long\def\ekv@parse@pair##1##2\ekv@stop
+ {%
+ \ekv@strip{##2}\ekv@parse@pair@{##1}%
+ }
+\long\def\ekv@parse@pair@##1##2##3%
+ {%
+ \unexpanded{##3{##2}{##1}}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[internal]{\ekv@parse@key}
% \begin{macrocode}
-\long\def\ekv@parse@pair##1\ekv@stop
+\long\def\ekv@parse@key##1##2%
{%
- {\ekv@strip{##1}\unexpanded}%
+ \unexpanded{##2{##1}}%
}
% \end{macrocode}
% \end{macro}
@@ -1314,7 +1373,7 @@ and the derived files expkv.pdf
\ekvset,=
% \end{macrocode}
%
-% \begin{macro}{\ekv@ifstop}
+% \begin{macro}[internal]{\ekv@ifstop}
% The |\ekv@ifstop| test works similar to our if-empty test, but instead of
% using tokens which are used nowhere else (|\ekv@ifempty@A| and
% |\ekv@ifempty@B|) we use |\ekv@mark| and |\ekv@stop|.
@@ -1323,14 +1382,20 @@ and the derived files expkv.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekv@set@pair,\ekv@set@pair@}
-% |\ekv@set@pair| needs to split the argument at the |=| sign and check
-% whether the key is defined.
+% \begin{macro}[internal]{\ekv@set@pair,\ekv@set@pair@}
+% |\ekv@set@pair| gets invoked with the space and brace stripped key-name as its
+% first argument, the set-macro as the second argument, and following that is
+% the key-value right delimited by an |\ekv@stop|.
% \begin{macrocode}
\long\def\ekv@set@pair#1#2%
{%
\ekv@ifdefined@pair#2{#1}%
{%
+% \end{macrocode}
+% This branch will be executed if the key is not defined as an argument grabbing
+% one. If so test whether there is a |NoVal| key of the same name or whether the
+% key is unknown. Throw a meaningful error message and gobble the value.
+% \begin{macrocode}
\ekv@ifdefined{#2{#1}N}%
\ekv@err@noarg
\ekv@err@unknown
@@ -1338,6 +1403,12 @@ and the derived files expkv.pdf
\ekv@gobbletostop
}%
}
+% \end{macrocode}
+% |\ekv@ifdefined@pair| will call |\ekv@set@pair@| if the key is correctly
+% defined. This will then grab the value, strip outer spaces and braces from it
+% and feed it to the key-macro. Afterwards |\ekv@set@other| will take control
+% again.
+% \begin{macrocode}
\long\def\ekv@set@pair@#1#2\ekv@stop
{%
\ekv@strip{#2}#1%
@@ -1345,7 +1416,11 @@ and the derived files expkv.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekv@set@key}
+% \begin{macro}[internal]{\ekv@set@key}
+% Analogous to |\ekv@set@pair|, |\ekv@set@key| lets |\ekv@ifdefined@key| test
+% whether a |NoVal| key is defined, else it'll throw a meaningful error message.
+% Since we don't have to grab any value |\ekv@ifdefined@key| will invoke the
+% key-macro and we're done here, |\ekv@set@other| will take over again.
% \begin{macrocode}
\long\def\ekv@set@key#1#2%
{%
@@ -1360,7 +1435,7 @@ and the derived files expkv.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekv@err,\ekv@err@}
+% \begin{macro}[internal]{\ekv@err,\ekv@err@}
% Since |\ekvset| is fully expandable as long as the code of the keys is (which
% is unlikely) we want to somehow throw expandable errors, in our case via
% undefined control sequences.
@@ -1380,7 +1455,7 @@ and the derived files expkv.pdf
\def\ekv@err@{\expandafter\ekv@gobbletostop}
% \end{macrocode}
% \end{macro}
-% \begin{macro}
+% \begin{macro}[internal]
% {
% \ekv@err@common,\ekv@err@common@,
% \ekv@err@unknown,\ekv@err@noarg,\ekv@err@reqval
@@ -1396,11 +1471,12 @@ and the derived files expkv.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekv@strip,\ekv@strip@a,\ekv@strip@b,\ekv@strip@c}
+% \begin{macro}[internal]{\ekv@strip,\ekv@strip@a,\ekv@strip@b,\ekv@strip@c}
% Finally we borrow some ideas of \pkg{expl3}'s \pkg{l3tl} to strip spaces
% from keys and values. This |\ekv@strip| also strips one level of outer braces
% \emph{after} stripping spaces, so an input of | {abc} | becomes |abc| after
-% stripping. It should be used with |#1| prefixed by |\ekv@mark|.
+% stripping. It should be used with |#1| prefixed by |\ekv@mark|. Also this
+% implementation at most strips \emph{one} space from both sides.
% \begin{macrocode}
\def\ekv@strip#1%
{%
diff --git a/macros/generic/expkv/expkv.pdf b/macros/generic/expkv/expkv.pdf
index d3bf8d0cac..2a26383dff 100644
--- a/macros/generic/expkv/expkv.pdf
+++ b/macros/generic/expkv/expkv.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
index a5dea0b748..b09f8bda78 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{american-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{american-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{american}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
index 276fa50c0e..2e17e6b3f8 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.bbx}[2020/02/01\space v9.5\space APA biblatex references style]
+\ProvidesFile{apa.bbx}[2020/02/22\space v9.6\space APA biblatex references style]
\RequireBiber[3]
\RequireBibliographyStyle{standard}
\urlstyle{rm} % APA examples all have URLs in same font as text
@@ -98,16 +98,16 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multiple related entries, even though there are no
-% examples in APA 7th, should probably be this
+% examples in APA 7th, should probably be this
\renewcommand*{\relateddelim}{\addcomma\addspace}
%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Force roman numerals into arabic using
% etoolbox macros
@@ -133,7 +133,7 @@
\iffieldundef{#1year}{}
{\datecircaprint
\ifboolexpr{ test {\ifstrequal{#1}{url}}
- or test {\ifentrytype{legal}}
+ or test {\ifentrytype{legal}}
or ( test {\ifentrytype{legadminmaterial}} and
test {\ifkeyword{proposed}} ) }
{\printtext{%
@@ -309,9 +309,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Enforce ignoring of PUBSTATE if there is a YEAR or DATE field
-% (APA 10.2:32) Remove PUBLISHER if it is the same as GROUPAUTHOR
+% (APA 10.2:32) Remove PUBLISHER if it is the same as GROUPAUTHOR
% Force @COLLECTION, @REFERENCE->@BOOK and @INCOLLECTION,@INREFERENCE->@INBOOK
-
+
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map{
@@ -452,7 +452,7 @@
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{#1}
-%
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -505,7 +505,7 @@
\ifthenelse{\value{listcount}=\value{listtotal}}%
{\ifmorenames
{\printdelim{andothersdelim}%
- \bibstring{andothers}}
+ \biblcstring{andothers}}
{}%
\let\bibstring\bibcplstring
\usebibmacro{roles}{\addspace}{\mkbibparens}}
@@ -521,13 +521,13 @@
{\namepartgiven}%
{\namepartgiveni}%
{\namepartprefix}%
- {\namepartsuffix}%
+ {\namepartsuffix}%
\let\bibstring\bibcpsstring
\usebibmacro{role}{\addcomma\space}{\@firstofone}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}%
{\ifmorenames
{\printdelim{andothersdelim}%
- \bibstring{andothers}}
+ \biblcstring{andothers}}
{}%
\let\bibstring\bibcplstring
\usebibmacro{roles}{\addspace}{\@firstofone}}
@@ -619,7 +619,7 @@
\value{liststop}=2}
{\addspace\&\space}
{\finalandcomma\addspace\&\space}}}
-
+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -657,7 +657,7 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 9.25) No prefix for pages
\DeclareFieldFormat{pages}{#1}
@@ -673,7 +673,7 @@
\renewbibmacro*{begentry}{%
\ifkeyword{meta}{\textsuperscript{*}}{}}
-%
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -757,13 +757,15 @@
% (APA 10.1 Example 6) eprints (eLocator)
\renewbibmacro*{eprint}{%
- \iffieldundef{eprinttype}
- {}
- {\iffieldbibstring{eprinttype}
- {\bibcplstring{\strfield{eprinttype}}}
- {\strfield{eprinttype}}%
- \setunit{\addspace}}%
- \printfield{eprint}}
+ \iftoggle{bbx:eprint}
+ {\iffieldundef{eprinttype}
+ {}
+ {\iffieldbibstring{eprinttype}
+ {\bibcplstring{\strfield{eprinttype}}}
+ {\strfield{eprinttype}}%
+ \setunit{\addspace}}%
+ \printfield{eprint}}
+ {}}
\DeclareFieldFormat{eprint}{#1}
@@ -800,7 +802,7 @@
% "In" precedes editor/trans list, no colon
% Use a flag to track as it could be inserted in more
% than one potential location
-
+
\newbibmacro*{in}{%
\ifbool{bbx:in}%
{}%
@@ -851,9 +853,9 @@
}
\newcommand*{\apabbx@ifrole@field}{%
- \xifinlist{field@\currentname @role@}%
+ \xifinlist{field@\currentname @role}%
\abx@annotation@defined}
-
+
\newtoggle{apabbx:role:field:punct}
\newcommand*{\apabbx@rolelist@field}{}
@@ -898,7 +900,7 @@
% #3 = given name (initials)
% #4 = name prefix
% #5 = name suffix
-
+
\newbibmacro*{name:delim:apa:family-given}[1]{%
\ifnumgreater{\value{listcount}}{\value{liststart}}
{\ifboolexpr{
@@ -1024,7 +1026,7 @@
\usebibmacro{in}%
\usebibmacro{editorx}}%
\setunit{\addcomma\addspace}}}
-
+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1167,7 +1169,7 @@
\usebibmacro{in}%
\setunit{\addspace}}}
-%
+%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1207,8 +1209,8 @@
\biblstring{byauthor}%
\setunit{\addspace}%
\usebibmacro{author/editor:related}}}}
-
-%
+
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1221,9 +1223,9 @@
\printfield{maintitle}}}
%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 10.12) Audiovisual
\newbibmacro*{mainvideo}{%
@@ -1237,9 +1239,9 @@
\printfield{maintitle}}}
%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Related entries
%
% Have to force capitlisation bibstring variant because the delim
@@ -1250,7 +1252,7 @@
\iffieldequalstr{relatedtype}{reprintfrom}
{\renewcommand*{\finentrypunct}{\relax}}
{}}
-
+
\newcommand*{\begrelateddelimreprintfrom}{\addperiod\addspace}
% Some APA related entries are just after title, some are at the end of
@@ -1326,8 +1328,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 9.51) Annotations
+\newtoggle{bbx:annotation}
+\DeclareBiblatexOption{global,type,entry}[boolean]{annotation}[true]{%
+ \settoggle{bbx:annotation}{#1}}
+\ExecuteBibliographyOptions{annotation=true}
+
\renewbibmacro*{annotation}{%
- \iffieldundef{annotation}
+ \ifboolexpr{ test {\iffieldundef{annotation}}
+ or not togl {bbx:annotation}}
{}
{\begingroup
\togglefalse{blx@bibliography}%
@@ -1335,7 +1343,7 @@
\setunit{}%
\printfield{annotation}%
\endgroup}}
-
+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1358,7 +1366,7 @@
\ifthenelse{\value{listcount}<\value{liststop}}
{\addcomma\addspace}
{}}
-
+
\DeclareFieldFormat{courtdate}{%
% disable normal date printing if it's in the citation info
\iftoggle{apa:courtdate}
@@ -1368,18 +1376,18 @@
\printlist{organization}\space #1}}}
{}}
-%
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 11.5) Statutes
-
+
\newbibmacro*{statdate}{%
\iffieldundef{origyear}
{\printtext[parens]{\printlabeldate}}
{\printtext[parens]{\printorigdate%
\addspace\&\addspace rev\adddot\addspace\printlabeldate}}}
-
+
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1393,7 +1401,7 @@
\DeclareDelimFormat[location]{multilistdelim}{\addcomma\space}
\DeclareDelimFormat[location]{finallistdelim}{\addcomma\space}
-
+
\newbibmacro*{legmattitle}{%
\iffieldundef{title}
{\ifbibxstring{\thefield{source}}{\bibcpsstring{\thefield{source}}}{}%
@@ -1405,10 +1413,10 @@
\setunit*{\addcolon\addspace}\newblock
\printfield{subtitle}}}
-%
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 10.x) General entrytype drivers
% Custom driver to make a cleaner example for 9.44
@@ -1690,7 +1698,7 @@
\printtext[parens]{\ifkeyword{proposed}{\bibstring{proposed}\space}{}\printlabeldate}%
\setunit{\addspace}\newblock
\printfield{note}%
- \newunit\newblock
+ \newunit\newblock
\usebibmacro{doi+url}%
\usebibmacro{pageref}%
\usebibmacro{annotation}%
@@ -1706,7 +1714,7 @@
\printtext[parens]{\printlabeldate}%
\setunit{\addspace}\newblock
\printfield{note}%
- \newunit\newblock
+ \newunit\newblock
\usebibmacro{doi+url}%
\usebibmacro{pageref}%
\usebibmacro{annotation}%
@@ -2049,11 +2057,22 @@
{\bibcpstring{type\thefield{#1type}s}}
{\bibcpstring{type\thefield{#1type}}}}}
+
+
%(APA 9.35) No periods after URLS
+% we'll override a global url option for for @online entries
+\ExecuteBibliographyOptions[online]{url=true}
\newbibmacro*{doi+url}{%
- \iffieldundef{doi}
- {\iffieldundef{url}{\newunit}{\usebibmacro{url+urldate}\setunit{\addspace}}}
- {\printfield{doi}\renewcommand*{\finentrypunct}{\relax}\setunit{\addspace}}}
+ \ifboolexpr{ test {\iffieldundef{doi}}
+ or not togl {bbx:doi}}
+ {\ifboolexpr{ test {\iffieldundef{url}}
+ or not togl {bbx:url}}
+ {\newunit}
+ {\usebibmacro{url+urldate}%
+ \setunit{\addspace}}}
+ {\printfield{doi}%
+ \renewcommand*{\finentrypunct}{\relax}%
+ \setunit{\addspace}}}
\renewbibmacro*{url+urldate}{%
\ifthenelse{\iffieldundef{url}\OR\NOT\iffieldundef{doi}}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
index 40cfadefd9..5402613ff0 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.cbx}[2020/02/01\space v9.5\space APA biblatex citation style]
+\ProvidesFile{apa.cbx}[2020/02/22\space v9.6\space APA biblatex citation style]
\RequireBiber[3]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
index 5687733b51..41b5f27814 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.dbx}[2020/02/01\space v9.5\space APA biblatex style data model]
+\ProvidesFile{apa.dbx}[2020/02/22\space v9.6\space APA biblatex style data model]
\RequireBiber[3]
\DeclareDatamodelEntrytypes{
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
index e98bbb5e17..80f3cebcbe 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{austrian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{austrian-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{austrian}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
index c98168fa60..646740c205 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
index 1688d3a536..e8b00af55a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
index ba07b6c704..b98452893d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
@@ -24,7 +24,7 @@
url={http://mirror.ctan.org/macros/latex/exptl/biblatex-contrib/biblatex-apa/},
author={Philip Kime},
email={Philip@kime.org.uk},
- revision={9.5},
+ revision={9.6},
date={\today}}
\hypersetup{%
@@ -397,6 +397,10 @@ the examples.
\begin{changelog}
+\begin{release}{9.6}{2020-02-22}
+\item Bugfixes
+\end{release}
+
\begin{release}{9.5}{2020-02-01}
\item Bugfixes
\end{release}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
index 2d255a0670..dca61ac583 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{brazilian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{brazilian-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{brazilian}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
index e250ee65a3..e25ea7aa57 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{british-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{british-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{british}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
index e1d31d68a0..4687e1e768 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{danish-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{danish-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{danish}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
index a25af318fd..50df023256 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{dutch-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{dutch-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{dutch}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
index fd325840d3..9beefcdda6 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{english-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{english-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{english}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
index ff34c5bd69..7cf1128920 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{french-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{french-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{french}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
index 7baef5db24..f748b01fc6 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{galician-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{galician-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{galician}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
index 27be3dc3d2..d15e868496 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{german-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{german-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{german}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
index 1741c080a1..05d4e2eee7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{greek-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{greek-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{greek}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
index 73cd0ebdf3..4ca83ae13e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{italian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{italian-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{italian}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
index 13aa253002..c01d9dd092 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{naustrian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{naustrian-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{naustrian}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
index de82a0556c..cf25c6e5d7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{ngerman-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{ngerman-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{ngerman}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
index 15ba2bf677..eaccd6ab9e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norsk-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{norsk-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{norsk}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
index 0fc240f30b..6cf00a509b 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norwegian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{norwegian-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{norwegian}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
index 02d8a1fc9a..e2734bce62 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nswissgerman-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{nswissgerman-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{nswissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
index c3e34ba4d7..d12084810d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nynorsk-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{nynorsk-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{nynorsk}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
index 8ab547b392..8b4e9d6d31 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{portuguese-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{portuguese-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{portuguese}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
index 130f9db214..85a886a8e6 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{russian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{russian-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{russian}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
index 7c6d66f25e..58e628fc8d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{slovene-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{slovene-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{slovene}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
index 60c7c1773a..fb2ef37e30 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{spanish-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{spanish-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{spanish}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
index b6bc5dd15b..e2c9f5a31d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swedish-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{swedish-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{swedish}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
index 283a7aa28c..a6a27faa2a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swissgerman-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation]
+\ProvidesFile{swissgerman-apa.lbx}[2020/02/22\space v9.6\space APA biblatex localisation]
\InheritBibliographyExtras{swissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
diff --git a/macros/latex/contrib/fontsize/README b/macros/latex/contrib/fontsize/README
new file mode 100644
index 0000000000..ea79ff09b0
--- /dev/null
+++ b/macros/latex/contrib/fontsize/README
@@ -0,0 +1,55 @@
+-----------------------------------------------------------------------
+The 'fontsize' package for LaTeX
+Author: Ivan Valbusa
+ ivan dot valbusa at univr dot it
+
+This work has the LPPL maintenance status "author-maintained".
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+-----------------------------------------------------------------------
+
+DESCRIPTION:
+
+The 'fontsize' package allows you to set arbitrary sizes
+for the main font of the document, through the 'fontsize=<size>' option.
+
+This work consists of the following files:
+
+ README (this file)
+ fontsize.dtx
+ fontsize.pdf
+
+and of the derived files:
+
+ fontsize.sty
+
+INSTALLATION:
+
+To install the distribution:
+
+o run "pdflatex fontsize.dtx"
+o move "fontsize.sty" to locations where LaTeX will find
+ it (the FAQ on CTAN in /help/uktug-FAQ gives more
+ information about this magic place)
+
+
+DOCUMENTATION:
+
+To reproduce the complete documentation, follow these steps:
+
+$ pdflatex fontsize.dtx
+$ makeindex -s gind.ist -o fontsize.ind fontsize.idx
+$ makeindex -s gglo.ist -o fontsize.gls fontsize.glo
+$ pdflatex fontsize.dtx
+
+from a shell (or in the preferred method for you system),
+where `$' stands for the shell's prompt.
+
+
+2020/02/20
+Ivan Valbusa
diff --git a/macros/latex/contrib/fontsize/fontsize.dtx b/macros/latex/contrib/fontsize/fontsize.dtx
new file mode 100644
index 0000000000..aba6194a18
--- /dev/null
+++ b/macros/latex/contrib/fontsize/fontsize.dtx
@@ -0,0 +1,489 @@
+% \iffalse meta-comment
+%<*internal>
+\begingroup
+\input docstrip
+\preamble
+
+Copyright 2020 Ivan Valbusa
+
+This program is provided under the terms of the
+LaTeX Project Public License distributed from CTAN
+archives in directory macros/latex/base/lppl.txt.
+
+Author: Ivan Valbusa
+Ivan dot Valbusa at gmail dot com
+
+This work has the LPPL maintenance status "author-maintained".
+
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse
+
+\Msg{*** Generating the package files ***}
+\generate{\file{fontsize.sty}{\from{fontsize.dtx}{package}}%
+}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space fontsize.sty}
+\Msg{*}
+\Msg{*}
+\Msg{* To produce the documentation on fontsize's code run}
+\Msg{* the file ending with `.dtx' through (pdf)LaTeX. See the}
+\Msg{* README file for more details.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+\endgroup
+%</internal>
+%
+% Copyright (C) 2020 by Ivan Valbusa
+% <Ivan dot Valbusa at gmail dot com>
+% -------------------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work consists of all files listed in README
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{fontsize.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+%<package>\ProvidesPackage{fontsize}
+%<*package>
+ [2020/02/20 v0.1 'fontsize' package. Set main font sizes (Ivan Valbusa)]
+%</package>
+%<*driver>
+\PassOptionsToClass{a4paper}{article}
+\documentclass{ltxdoc}
+\let\cmd\relax
+\let\cs\relax
+\usepackage[T1]{fontenc}
+\usepackage{ltxdockit}
+\usepackage[fontsize=10.5]{fontsize}
+
+\makeatletter
+\newcommand{\mysize}[1]{%
+ \bgroup\noindent\csname#1\endcsname The \cmd{#1} size is: \textbf{\csname#1\endcsname\f@size\,pt}.\\The \cmd{baselineskip} is \the\baselineskip\par\vskip2mm\egroup}
+\makeatother
+
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+
+\begin{document}
+ \DocInput{fontsize.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{787}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \changes{v0.1}{2020/02/20}{First public release}
+% \GetFileInfo{fontsize.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment,\def,\begin,\vskip,\ }
+% \DoNotIndex{\DeclareOption,\ExecuteOptions,\RequirePackage}
+% \DoNotIndex{\@@end,\@empty,\@ifclassloaded,\@nameuse,\@nil}
+% \DoNotIndex{\@undefined,\\,\`,\addtocounter,\advance,\bfseries}
+% \DoNotIndex{\centering,\closeout,\define@key,\documentclass}
+% \DoNotIndex{\edef,\else,\end,\endinput,\endtitlepage,\expandafter}
+% \DoNotIndex{\extracolsep,\fi,\fill,\fontsize,\g@addto@macro,\toks}
+% \DoNotIndex{\hrule,\hspace,\if,\if@twoside,\ifcase,\ifdefined}
+% \DoNotIndex{\iffalse,\IfFileExists,\ifnum,\ifx,\immediate,\setcounter}
+% \DoNotIndex{\jobname,\let,\long,\MakeUppercase,\MessageBreak}
+% \DoNotIndex{\newcount,\newif,\newpage,\newtoks,\newwrite,\next}
+% \DoNotIndex{\noexpand,\nofiles,\normalfont,\normalsize,\null}
+% \DoNotIndex{\openout,\or,\Package,\PackageError,\PackageWarning}
+% \DoNotIndex{\PackageWarningNoLine,\paperheight,\paperwidth,\par}
+% \DoNotIndex{\parbox,\parindent,\relax,\scshape,\selectfont,\setkeys}
+% \DoNotIndex{\sffamily,\space,\stretch,\string,\textheight,\textwidth}
+% \DoNotIndex{\the,\thispagestyle,\unexpanded,\unless,\unskip,\upshape}
+% \DoNotIndex{\usepackage,\vbox,\vfill,\vspace,\write,\z@}
+% \DoNotIndex{\CurrentOption,\AtEndDocument,\@ne,\c@page,\m@ne}
+% \DoNotIndex{\@firstofone,\@gobble,\@makeother,\begingroup,\endgroup}
+% \DoNotIndex{\eTeXversion,\hbox,\hsize,\includegraphics,\newlinechar}
+% \DoNotIndex{\titlepage,\vss,\vtop,\xdef,\@gobbletwo,\color,\dimexpr}
+% \DoNotIndex{\huge,\large,\makebox,\ProcessOptions,\renewcommand}
+%
+
+%
+%
+% \title{The \textsf{fontsize} package\\ \normalsize \textit{A small package to change the font size}}
+% \author{Ivan Valbusa \\
+% \texttt{Ivan dot Valbusa at gmail dot com}}
+% \date{\fileversion{} -- \filedate}
+%
+% \maketitle
+%
+%\noindent The \sty{fontsize} package allows you to set arbitrary sizes for the main font of the document, through the \opt{fontsize=\meta{size}} option. The value for the \meta{size} can be given in any unit recognized by TeX (for example: \opt{6mm}, \opt{1ex}, \opt{11.5pt}). If the unit is not declared it defaults to \texttt{pt}. So \opt{fontsize=11} is the same as \opt{fontsize=11pt}. See the example below.
+%
+% \section*{Caveat}
+%
+% Although effective with any value for the \meta{size} (as long as the font is scalable!), the package is meant for small font size changes. For truly optimal results you should not use this package at all. Rather, a \file{.clo} file should be defined for each main size, even if this is pretty hard work. Particularly, you should define \cmd{parindent} accordingly to the used size.
+%
+% \section*{Credits}
+%
+% The code is a a minimal part of the \sty{scrextend}, with few minor changes to make it completely independent of the Koma bundle (see \cite{koma}).
+%
+% \section*{An example}
+%
+% \verb!\usepackage[fontsize=10.5]{fontsize}!\bigskip
+%
+%
+%\mysize{tiny}
+%\mysize{scriptsize}
+%\mysize{footnotesize}
+%\mysize{small}
+%\mysize{normalsize}
+%\mysize{large}
+%\mysize{Large}
+%\mysize{LARGE}
+%\mysize{huge}
+%\mysize{Huge}
+%
+% \begin{thebibliography}{label}
+% \bibitem{koma} Frank Neukam, Markus Kohm, Axel Kielhorn, \textit{KOMA -- Script. A versatile \LaTeXe{} bundle}. \url{https://www.ctan.org/pkg/koma-script}
+% \bibitem{xkeyval} Hendri Adriaens, \textit{The \sty{xkeyval} package}, \url{https://www.ctan.org/pkg/xkeyval}.
+% \bibitem{etoolbox} Philipp Lehman, Joseph Wright, \textit{The \sty{etoolbox} Package. An e-\TeX{} Toolbox for Class and Package Authors}, \url{https://www.ctan.org/pkg/etoolbox}.
+
+% \end{thebibliography}
+%
+% \StopEventually{\PrintChanges\PrintIndex}
+%
+% \section{The Code}
+%
+% \iffalse
+%<*package>
+% \fi
+% \begin{macrocode}
+\@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}}
+\@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}}
+% \end{macrocode}
+% Here begins the \sty{scrextend} code. Only a few names have changed.
+% The value for \cmd{@fontsizefilebase} is set to \texttt{custom} instead of \texttt{scrsize}.
+% \begin{macrocode}
+\providecommand*{\@fontsizefilebase}{custom}
+\DeclareOptionX{fontsize}[10]{%
+ \expandafter\@defaultunits\expandafter\@tempdima#1 pt\relax\@nnil
+ \edef\@tempa{#1}%
+ \setlength{\@tempdimb}{\@tempdima}%
+ \edef\@tempb{\strip@pt\@tempdimb}%
+ \addtolength{\@tempdimb}{-10\p@}%
+ \edef\@ptsize{\strip@pt\@tempdimb}%
+ \edef\@tempa{%
+ \noexpand\makeatletter
+ \noexpand\InputIfFileExists{\@fontsizefilebase\@tempa.clo}{%
+ \noexpand\PackageInfo{fontsize}{%
+ File `\@fontsizefilebase\@tempa.clo' used to setup font sizes}%
+ }{%
+ \noexpand\changefontsize{#1}%
+ }%
+ \noexpand\catcode`\noexpand\@=\the\catcode`\@
+ }%
+ \expandafter\AtEndOfPackage\expandafter{\@tempa}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptionsX*\relax
+% \end{macrocode}
+% The comamnd \cmd{ctm@setlength} has the same definition as \cmd{scr@setlength} of \file{scrextend.sty}.
+% \begin{macrocode}
+\newcommand*\ctm@setlength[4]{%
+ \ifdim #2<\ifdim #2=\z@ \z@ \else \p@\fi
+ \ifdim #3<\ifdim #3=\z@ \z@ \else \p@\fi
+ \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi
+ \setlength{#1}{\p@ \@plus\p@ \@minus\p@}%
+ \else
+ \setlength{#1}{\p@ \@plus\p@ \@minus#4}%
+ \fi
+ \else
+ \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi
+ \setlength{#1}{\p@ \@plus#3 \@minus\p@}%
+ \else
+ \setlength{#1}{\p@ \@plus#3 \@minus#4}%
+ \fi
+ \fi
+ \else
+ \ifdim #3<\ifdim #3=\z@ \z@ \else \p@\fi
+ \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi
+ \setlength{#1}{#2 \@plus\p@ \@minus\p@}%
+ \else
+ \setlength{#1}{#2 \@plus\p@ \@minus#4}%
+ \fi
+ \else
+ \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi
+ \setlength{#1}{#2 \@plus#3 \@minus\p@}%
+ \else
+ \setlength{#1}{#2 \@plus#3 \@minus#4}%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% The comamnd \cmd{changefontsize} has the same definition as \cmd{changefontsizes} of \file{scrextend.sty}.
+% \begin{macrocode}
+\providecommand*{\changefontsize}[2][1.2\@tempdima]{%
+ \@defaultunits\@tempdima#2pt\relax\@nnil
+ \setlength{\@tempdimc}{\@tempdima}%
+ \addtolength{\@tempdimc}{-10\p@}%
+ \edef\@ptsize{\strip@pt\@tempdimc}%
+ \@defaultunits\@tempdimb#1pt\relax\@nnil
+ \setlength{\@tempdimc}{\dimexpr (100\@tempdimb / \@tempdima * \p@)}%
+ \edef\@tempb{\the\@tempdimc}%
+ \setlength{\@tempdimc}{\@tempdima}%
+ \def\@tempa##1##2##3##4##5\@nnil{\def##1{##2.##3##4}}%
+ \expandafter\@tempa\expandafter\@tempb\@tempb\@nnil%
+ \ctm@setlength{\abovedisplayskip}%
+ {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}%
+ \ctm@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}%
+ \ctm@setlength{\belowdisplayshortskip}%
+ {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}%
+ \setlength{\belowdisplayskip}{\abovedisplayskip}%
+ \edef\normalsize{%
+ \noexpand\@setfontsize\noexpand\normalsize
+ {\the\@tempdima}{\the\@tempdimb}%
+ \abovedisplayskip \the\abovedisplayskip
+ \abovedisplayshortskip \the\abovedisplayshortskip
+ \belowdisplayskip \the\belowdisplayskip
+ \belowdisplayshortskip \the\belowdisplayshortskip
+ \let\noexpand\@listi\noexpand\@listI
+ }%
+ \setlength{\@tempdima}{0.9125\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \ctm@setlength{\abovedisplayskip}%
+ {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}%
+ \ctm@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}%
+ \ctm@setlength{\belowdisplayshortskip}%
+ {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}%
+ \setlength{\belowdisplayskip}{\abovedisplayskip}%
+ \edef\small{%
+ \noexpand\@setfontsize\noexpand\small
+ {\the\@tempdima}{\the\@tempdimb}%
+ \abovedisplayskip \the\abovedisplayskip
+ \abovedisplayshortskip \the\abovedisplayshortskip
+ \belowdisplayskip \the\belowdisplayskip
+ \belowdisplayshortskip \the\belowdisplayshortskip
+ \let\noexpand\@listi\noexpand\@listi@small
+ }%
+ \setlength{\@tempdima}{.83334\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \ctm@setlength{\abovedisplayskip}%
+ {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}%
+ \ctm@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}%
+ \ctm@setlength{\belowdisplayshortskip}%
+ {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}%
+ \setlength{\belowdisplayskip}{\abovedisplayskip}%
+ \edef\footnotesize{%
+ \noexpand\@setfontsize\noexpand\footnotesize
+ {\the\@tempdima}{\the\@tempdimb}%
+ \abovedisplayskip \the\abovedisplayskip
+ \abovedisplayshortskip \the\abovedisplayshortskip
+ \belowdisplayskip \the\belowdisplayskip
+ \belowdisplayshortskip \the\belowdisplayshortskip
+ \let\noexpand\@listi\noexpand\@listi@footnotesize
+ }%
+ \setlength{\@tempdima}{.66667\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\scriptsize{%
+ \noexpand\@setfontsize\noexpand\scriptsize
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{.5\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\tiny{%
+ \noexpand\@setfontsize\noexpand\tiny
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{1.2\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\large{%
+ \noexpand\@setfontsize\noexpand\large
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{1.44\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\Large{%
+ \noexpand\@setfontsize\noexpand\Large
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{1.728\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\LARGE{%
+ \noexpand\@setfontsize\noexpand\LARGE
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{2.074\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\huge{%
+ \noexpand\@setfontsize\noexpand\huge
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{2.488\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\Huge{%
+ \noexpand\@setfontsize\noexpand\Huge
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \normalsize
+ \setlength{\@tempdimb}{\f@baselineskip}%
+ \ctm@setlength{\parsep}%
+ {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}%
+ \ctm@setlength{\topsep}%
+ {.6667\@tempdimb}{.1667\@tempdimb}{.3333\@tempdimb}%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listi\endcsname
+ \endgroup
+ \edef\@listi{\leftmargin\leftmargini
+ \topsep \the\topsep
+ \parsep \the\parsep
+ \itemsep \parsep
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \let\@listI\@listi
+ \ctm@setlength{\parsep}%
+ {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}%
+ \ctm@setlength{\topsep}%
+ {.3333\@tempdimb}{.1667\@tempdimb}{.1667\@tempdimb}%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listi\endcsname
+ \endgroup
+ \edef\@listi@small{\leftmargin\leftmargini
+ \topsep \the\topsep
+ \parsep \the\parsep
+ \itemsep \parsep
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \ctm@setlength{\parsep}%
+ {.125\@tempdimb}{.0625\@tempdimb}{.0625\@tempdimb}%
+ \ctm@setlength{\topsep}%
+ {.25\@tempdimb}{.125\@tempdimb}{.125\@tempdimb}%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listi\endcsname
+ \endgroup
+ \edef\@listi@footnotesize{\leftmargin\leftmargini
+ \topsep \the\topsep
+ \parsep \the\parsep
+ \itemsep \parsep
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \ctm@setlength{\parsep}%
+ {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}%
+ \ctm@setlength{\topsep}%
+ {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listii\endcsname
+ \endgroup
+ \edef\@listii{\leftmargin\leftmarginii
+ \labelwidth=\dimexpr \leftmargin-\labelsep
+ \topsep \the\topsep
+ \parsep \the\parsep
+ \itemsep \parsep
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \ctm@setlength{\topsep}%
+ {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}%
+ \setlength{\partopsep}{\z@ \@plus\z@ \@minus\p@}%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listiii\endcsname
+ \endgroup
+ \edef\@listiii{\leftmargin\leftmarginiii
+ \labelwidth=\dimexpr \leftmargin-\labelsep
+ \topsep \the\topsep
+ \parsep \z@
+ \partopsep \the\partopsep
+ \itemsep \topsep
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listiv\endcsname
+ \endgroup
+ \edef\@listiv{\leftmargin\leftmarginiv
+ \labelwidth=\dimexpr \leftmargin-\labelsep\relax
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listv\endcsname
+ \endgroup
+ \edef\@listv{\leftmargin\leftmarginv
+ \labelwidth=\dimexpr \leftmargin-\labelsep\relax
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \@tempswafalse
+ \begingroup
+ \def\@list@extra{\aftergroup\@tempswatrue}%
+ \csname @listvi\endcsname
+ \endgroup
+ \edef\@listvi{\leftmargin\leftmarginvi
+ \labelwidth=\dimexpr \leftmargin-\labelsep\relax
+ \if@tempswa\noexpand\@list@extra\fi
+ }%
+ \@listi
+ \setlength{\@tempdimb}{\f@baselineskip}%
+ \setlength{\footnotesep}{.555\@tempdimb}%
+ \ctm@setlength{\skip\footins}%
+ {.75\@tempdimb}{.3333\@tempdimb}{.1667\@tempdimb}%
+ \ctm@setlength{\floatsep}%
+ {\@tempdimb}{.1667\@tempdimb}{.1667\@tempdimb}%
+ \ctm@setlength{\textfloatsep}%
+ {1.6667\@tempdimb}{.1667\@tempdimb}{.3333\@tempdimb}%
+ \setlength{\intextsep}{\floatsep}%
+ \setlength{\dblfloatsep}{\floatsep}%
+ \setlength{\dbltextfloatsep}{\textfloatsep}%
+ \setlength{\@fptop}{\z@ \@plus 1fil}%
+ \setlength{\@fpsep}{.6667\@tempdimb \@plus 2fil}%
+ \setlength{\@fpbot}{\@fptop}%
+ \setlength{\@dblfptop}{\@fptop}%
+ \setlength{\@dblfpsep}{\@fpsep}%
+ \setlength{\@dblfpbot}{\@fptop}%
+ \ctm@setlength{\partopsep}{.2\@tempdimb}{.1\@tempdimb}{.1\@tempdimb}%
+}
+\endinput
+% \end{macrocode}
+% \iffalse
+%</package>
+% \fi
+% \Finale
diff --git a/macros/latex/contrib/fontsize/fontsize.pdf b/macros/latex/contrib/fontsize/fontsize.pdf
new file mode 100644
index 0000000000..ed08b0c5c6
--- /dev/null
+++ b/macros/latex/contrib/fontsize/fontsize.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/catalog.txt b/macros/latex/contrib/ntgclass/CATALOG
index abe4c3330c..cc1c4b2d2c 100644
--- a/macros/latex/contrib/ntgclass/catalog.txt
+++ b/macros/latex/contrib/ntgclass/CATALOG
@@ -1,7 +1,7 @@
Name: ntgclass
-Problems-To: JLBraams@cistron.nl
+Problems-To: texniek@braams.texniek.nl
Author: J.L. Braams and V. Eijkhout
-Version: 2.2-patch level 3
+Version: 2.2-patch level 4
Description:
@@ -19,7 +19,7 @@ Keywords: latex, document classes
See-Also:
Address:
-J.L. Braams
-Kooienswater 62
-2715 AJ Zoetermeer
+TeXniek
+Kersengaarde 33
+2723 BP Zoetermeer
The Netherlands
diff --git a/macros/latex/contrib/ntgclass/ChangeLog b/macros/latex/contrib/ntgclass/ChangeLog
new file mode 100644
index 0000000000..95fd2dfec4
--- /dev/null
+++ b/macros/latex/contrib/ntgclass/ChangeLog
@@ -0,0 +1,348 @@
+2020-02-22 Johannes Braams <texniek at braams.xs4all.nl>
+
+ * ntgclass.dtx: The mechanism to work around the hyperref code
+ being injected int the tabel of contents lines needed to be
+ changed. There's a fourth token to jump over and the use of
+ \MakeUppercase instead of \uppercase in the toc-lines for parts
+ (rapport and boek classes) needed a different approach, made the
+ hyperref copmmand robust and protected it with \lowercase.
+
+2020-02-18 Johannes Braams <texniek at braams.xs4all.nl>
+
+ * brief.dtx: Update to change copyright notice and address
+ information; synchronised with the standard document classes.
+
+ * a4.dtx: Update to change copyright notice and address
+ information.
+
+2020-02-18 Johannes Braams <texniek at braams.xs4all.nl>
+
+ * ntgclass.dtx: Update to synchronize with classes.dtx
+
+2004-08-17 Johannes Braams <texniek at braams.xs4all.nl>
+
+ * ntgclass.dtx: Various changes involving no longer passing
+ \toc@font and \toc@case settings through the .aux file because
+ they break when the hyperref package is used.
+ Fixed a bug in the toc-entry for \part: the spacing was wrong and
+ the pagenumber was put on a line by itself.
+
+2004-06-07 Johannes Braams <texniek at braams.xs4all.nl>
+
+ * ntgclass.dtx : updated version to 2.1a as 2.0z should be the
+ last, but no major changes, added a missing fix related to pr3285
+
+2004-02-20 Johannes Braams <texniek at braams.xs4all.nl>
+
+ * ntgclass.dtx: various changes to sychronise with classes.dtx,
+ mostly fixes for Problem reports in the bugs database
+
+Tue Sep 9 00:43:15 1997 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx: Repaired a few documentation buglets.
+
+ * brief.dtx : Added a few extra command synonimes, suggested by
+ Wybo Dekker (wybo at servaly.hobby.nl)
+ (subsubsection{The address window}): Put the \textbullet in a
+ group to keep the font change local
+ (subsubsection{The little rules}): Make the rules slightly thinner
+ and modify their position a little
+ (subsubsection{Page breaking control}): Added a \leavevmode in
+ \@afsluiting to make \afsluiting work as documented.
+ (subsection{Footnotes}): The footnotemarker should appear
+ different in the text from in the footnotes themselves, changed
+ definition of \@makefntext and use default \@makefnmark
+
+Tue Apr 1 00:15:34 1997 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{Footnotes}): Mixed the syntac for \def
+ and \newcommand (had #1 instead of [1]).
+ Found by Thorsten Schwander (schwander at ooo.lanl.gov)
+
+Sun Mar 2 00:17:17 1997 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{The title}): Use \textendash instead of
+ -- in label in footnotes on the titlepage.
+ (subsubsection{Itemize}): Now also \textasteriskcentered instead
+ of using math
+ (subsubsection{Equation and eqnarray}): Added test for chapter 0
+ in the definition of \theequation inb rapport and boek classes
+ (following classes.dtx)
+ (subsubsection{Figure}): Added test for chapter 0
+ (subsubsection{tabel}): Added test for chapter 0
+
+Mon Sep 23 23:12:21 1996 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsubsection{Itemize}): Replaced --, $\bullet$
+ and $\cdot$ with \text... commands, following a change in the
+ LaTeX classes.
+
+ * ntgclass.dtx (subsubsection{Itemize}): Replaced --, $\bullet$
+ and $\cdot$ with \text... commands, following a change in the
+ LaTeX classes.
+ (chapter*{...}): Changed \@xsect and \@ssect to follow a change in
+ the june 1996 release fo LaTeX which allows commands with an
+ argument in the last argument of \@sartsection.
+
+Mon Apr 1 19:26:32 1996 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx : use \renewcommand rather than \newcommand to
+ define \newblock
+ (subsection{Font changing}): Removed suerfluous
+ closing braces
+ (subsection{Footnotes}): Repaired definition of \@xmakefntext (it
+ had #1 in a \newcommand
+
+ * brief.dtx (subsubsection{The address window}): Repaired a typo
+ (\parksip instead of \parskip
+
+Sun Mar 31 23:25:10 1996 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx : Added \CodelineIndex to the driver in order
+ to really produce a .idx file for the index.
+
+Wed Mar 27 22:57:57 1996 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dst: Update to make use of the new docstrip
+ possibillity to produce multiple files in one go.
+
+Wed Nov 29 00:19:36 1995 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsubsection{The reference line}): Also set
+ \parindent to zero in \@refveld
+ (subsubsection{The address window}): Set both \parksip and
+ \parindent to zero inside the \adresveld
+
+Thu Oct 5 22:29:06 1995 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{The title}): Disable some more of the
+ commands that are only needed for \maketitle; empty internal
+ storage macros.
+ (subsection{Open bibliography}): openbib option reimplemented
+ Brought in sinc again with classes.dtx
+
+Tue Aug 22 23:57:27 1995 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx : Added missing braces around negative arguments to
+ \addpenalty; make l@part only do something when \c@tocdepthd>-2.
+
+Thu Aug 10 01:04:30 1995 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx : Brought up-to-date with LaTeX's letter.dtx in order
+ to make the classes run with LaTeX <1995/06/01>
+
+ * ntgclass.dtx : Brought up-to-date with LaTeX's classes.dtx in
+ order to make the classes run with LaTeX <1995/06/01>
+
+Sun May 7 23:45:33 1995 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{Chapters and Sections}): Added \erlax
+ to the definition of \@svsec as a result of LaTeX pr/1596
+
+Fri Jan 6 14:09:51 1995 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{Chapters and Sections}): Changed
+ {\baselineskip\@plus... to
+ {1\baselineskip\@plus... in the defintion of \subsection and
+ \subsubsection in artikel2.
+ Found by Dick Snippe (D.M.Snippe at el.utwente.nl)
+ (subsubsection{Building blocks}): Use \protected@edef instead of
+ the juggling with redefining \protect.
+
+Sat Dec 31 16:31:12 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsubsection{Page breaking control}): The printing
+ of the closing text generated an overfull hbox message. Removed
+ the extra \hbox (width \textwidth) inside the \parbox of width
+ .5\textwidth.
+
+Fri Dec 30 14:25:00 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsection{Words}): Repaired a small typo (a bracket
+ was used instead of a brace)
+
+ * ntgclass.dtx: Repaired a number of typos that prevented
+ artikel2.cls from functioning properly.
+
+ * brief.dtx (section{Executing Options}): Added a \relax after
+ \ProcessOptions to prevent the \ifcase to be `eaten' in the search
+ for a *.
+
+Fri Dec 23 21:48:47 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx: Use \newcommand* instead of \newcommand in most
+ places.
+ (subsection{Customizing the labels}): Redefined \mlabel to use the
+ new \parbox syntax instead of using the \setbox primitive.
+ (subsection{Font changing}): Define \cal and \mit using
+ \DeclareRobustCommand
+ (subsection{The generic letter commands}): Use
+ \let\protect\@unexpandable@protect instead of redefining it.
+
+ * ntgclass.dtx: More updates to go with the december 1994 release
+ of LaTeX.
+ - Made the oneside option work for the boek class (LaTeX PR
+ #1195)
+ (section{Initial Code}): Moved the allocation of
+ \if@mainmatter to this section in order to let it be known when
+ the pagestyles are defined. The switch is used there and needs to
+ be known then; otherwise TeX finds the wrong \fi in an
+ \if@twoside...\else...\fi construct.
+
+Tue Dec 20 01:52:12 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx: Updates to go with the december 1994 release of
+ LaTeX.
+ - Use \newcommand* cs.
+ - Set the \@minipage flag in the caption
+ (subsubsection{Margins}): Moved the rounding of \topmargin into
+ native mode only (LaTeX PR #93)
+ (section{Cross Referencing}): Fixed a typo in the documentation of
+ \@tocrmarg. (LaTeX PR #904)
+ (subsection{Single or double sided printing}): removed typo (LaTeX
+ PR #881)
+ (subsubsection{Chapters}): Made chapter titles more robust against
+ pagebreaks in the middle of them. Added an extra \nobreak but not
+ the extra \interlinepenalty\@M lines as that is taken care of by
+ \head@style (LaTeX PR #1016, #1135)
+ (subsection{Font changing}): Define \cal and \mit using
+ \DeclareRobustCommand
+ (the driver): use \newcommand* for shorthands with argument
+ (whole file): Use \newcommand* for commands with arguments
+
+Tue Oct 4 00:12:26 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (section{The documentation driver file}): Added a
+ missing comma in the \DoNotIndex list
+
+Tue Jul 12 22:45:13 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsubsection{Defining the page styles}): Removed the
+ typo in \@othertheadheight
+
+Mon Jul 11 23:25:48 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsubsection{Itemize}): \labelitemiii was
+ mistakenly called \labelitemiiii (LaTeX bug report # 711)
+
+ * ntgclass.dtx (subsection{Paragraphing}): The definition of the
+ dimension \othermargin was erroneously left out of type2 document
+ classes.
+ (subsection{Footnotes}): Moved the `.' that appeared in the
+ definition of \@xmakefntext to the definition of \@makefntext.
+ This should prevent it from appearing in a footnote produced by
+ \thanks.
+
+Wed Jun 15 22:19:45 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (section{The documentation driver file}): Reorder the
+ DoNotIndex list. Removed remnant from letter.dtx, now get the
+ file info from bief.dtx and also typeset brief.dtx instead of
+ trying to typeset letter.dtx.
+
+
+Wed Jun 8 13:16:41 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (section{The documentation driver file}): The
+ documentation didn't run; had to shuffle some entries in
+ \DoNotIndex lines.
+
+ * artdoc.tex (subsection{Fonts in sectiekoppen}): Added a missing
+ brace
+
+ * ntgclass.dtx (subsubsection{Chapters}): Removed yet another
+ carriage return that caused \if@mainmatter to end up in the
+ rapport classes.
+
+Mon Jun 6 00:03:19 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * brief.dtx (subsection{Global Declarations}): Using \newcommand
+ for internal storage macros causes the test against \@empty to
+ fail; a nempty long macro is not the same as an empytt macro. This
+ happened to \fromsig and \@subject.
+
+Fri Jun 3 14:25:27 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsubsection{Chapters}): Removed a carriage
+ return behind %<+boek> which caused \f@mainmatter to end up in the
+ rapport classes.
+
+ * brief.dtx: Finished upgrading for LaTeX2e
+
+ * briefdoc.tex: Updated for latex2e and the use of the babel
+ package. Contents may not be correct with the new version of the
+ code.
+
+ * rapdoc.tex: Updated for latex2e and the use of the babel
+ package. Contents may not be correct with the new version of the
+ code.
+
+ * artdoc.tex: Updated for latex2e and the use of the babel
+ package. Contents may not be correct with the new version of the
+ code.
+
+Fri Jun 3 00:27:27 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (section{Identification}): The size files claimed
+ to have a name that starts with `size'; changed to `ntg'.
+
+ * ntgclass.dst: Added the stripping of brief.
+
+Thu Jun 2 00:30:21 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{The title}): Added check on number of
+ columns in use locally
+ (section{Identification}): Fixed bug that prevented LaTeX from
+ seeing the \ProvideFile command in the driver
+
+Wed Jun 1 14:15:21 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx: Added \Charactertable
+ Moved the identification and driver sections to the start of the
+ file; they no longer print.
+ Added 'v' to changes entries; wrapped some long lines.
+ (subsubsection{Captions}): Use \sbox\@tempboxa instead of
+ \setbox\@tempboxa\hbox to make @makecaption color safe.
+ (subsection{The title}): The boek classes always havve a
+ titlepage, forgot to remove the code for the \else part of
+ \if@titlepage.
+ (section*{\contentsname): Added a missing backslash
+
+Mon Apr 18 12:45:43 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsection{Fonts}): The size changing commands are
+ no longer defined in the kernel. Use \newcommand instead of
+ \renewcommand.
+ (subsection{Font changing}): \@renewfontswitch has gone;
+ \@newfontswitch has become \DeclareOldFontCommand
+ Synchronized with the changes to classes.dtx
+
+Sun Mar 20 00:53:17 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dst: Removed production of the documentation driver.
+
+ * ntgclass.dtx (section{Identification}): Removed the use of
+ \typeout statements as \Provides... does that now.
+ (section{The {\sc docstrip} modules}): This section added.
+ (section{The documentation driver file}): Moved this section to
+ the front in order not to need a searate driver.
+
+Sat Mar 19 17:40:24 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * ntgclass.dtx (subsubsection{Captions}): The \CaptionLabelFont
+ shouldn't influence the font in which the caption text comes out.
+ PUt a group around the label.
+
+ * ntgclass.dst: Removed \TopLevel, a remnant from classes.dst
+
+ * ntgclass.dtx (subsubsection{Abstract}): Treat the abstract like
+ a section and use \SectFont for the title.
+
+Tue Mar 15 11:54:32 1994 Johannes Braams (texniek at braams.xs4all.nl)
+
+ * a4.dtx (subsection{The code}): The name of a package and the
+ name of the file should be the same.
+
+ (subsection{The code}): Added \ProcessOptions and moved it to the
+ end of the package.
+
diff --git a/macros/latex/contrib/ntgclass/manifest.txt b/macros/latex/contrib/ntgclass/MANIFEST
index 43d088f2db..2fa452e3e5 100644
--- a/macros/latex/contrib/ntgclass/manifest.txt
+++ b/macros/latex/contrib/ntgclass/MANIFEST
@@ -10,27 +10,28 @@
% changes.txt -- List of changes in reverse chronological order.
% catalog.txt -- A short description for the macro catalog.
%
-% artdoc.tex -- A description of the artikel classes, in dutch
+% artdoc.tex -- A description of the artikel classes, in dutch
% artdoc.pdf
% briefdoc.tex -- A description of the brief class, in dutch
% briefdoc.pdf
-% rapdoc.tex -- A description of the rapport classes, in dutch
+% rapdoc.tex -- A description of the rapport classes, in dutch
% rapdoc.pdf
% classdoc.tex -- A description of the document classes, in english
% classdoc.pdf
%
+%
% Classes:
% --------
%
% ntgclass.dtx -- NTG document classes artikel1,2,3/boek,boek3/rapport1,3.
% ntgclass.pdf
-% brief.dtx -- NTG document class brief
+% brief.dtx -- NTG document class brief
% brief.pdf
%
% Classes:
% --------
%
-% a4.dtx -- The package a4 from NTG/WG13 (Braams, Poppelier)
+% a4.dtx -- The package a4 from NTG/WG13 (Braams, Poppelier)
% a4.pdf
%
% Installation script for the various parts:
@@ -43,5 +44,7 @@
% Support files:
% --------------
%
-% brief.tex -- A sample file with three letters
+% brief-sample.tex -- A document showing the layout of the NEN-brief
+% implemented by brief.dtx
+% brief-sample.pdf
%
diff --git a/macros/latex/contrib/ntgclass/00readme.txt b/macros/latex/contrib/ntgclass/README
index be1dcc6ad3..914b47d8f7 100644
--- a/macros/latex/contrib/ntgclass/00readme.txt
+++ b/macros/latex/contrib/ntgclass/README
@@ -1,30 +1,28 @@
NTG document classes distribution
- 20 February 2004
+ 22 February 2020
This file contains the distribution guide for the new version
of the NTG document classes and the A4 package.
The classes are maintained by NTG Working Group 13
-This distribution is described in the files ending with .txt.
+ * README is this file.
- * 00readme.txt is this file.
-
- * manifest.txt lists all the files in the distribution.
+ * MANIFEST lists all the files in the distribution.
For more information about the document classes see the file
ntgclass.tex.
These files may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2003/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
Please do not request updates from us. Distribution is done only
through mail servers and TeX organisations.
---- Copyright 1994-2004 NTG. All rights reserved ---
+--- Copyright 1994-2020 NTG. All rights reserved ---
diff --git a/macros/latex/contrib/ntgclass/a4.dtx b/macros/latex/contrib/ntgclass/a4.dtx
index 4b58747e6d..e480bfbde9 100644
--- a/macros/latex/contrib/ntgclass/a4.dtx
+++ b/macros/latex/contrib/ntgclass/a4.dtx
@@ -1,37 +1,34 @@
-% \iffalse meta-comment
+% \iffalse
+%
+% Copyright (C) 1994 -- 2020 by Nederlandstalige TeX Gebruikersgroep.
%
-% Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% All rights reserved.
-%
% This file is part of the NTG document classes distribution
% ----------------------------------------------------------
-%
+%
% It may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
% This work has the LPPL maintenance status "maintained".
-%
+%
% The Current Maintainer of this work is Johannes Braams.
-%
+%
% The list of all files belonging to the NTG document classes
% distribution is given in the file `manifest.txt.
-%
+%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
+%
% \fi
% \CheckSum{153}
%
%\iffalse
-%% Style option `A4' to be used with LaTeX V2.09
-%% Copyright (C) 1990-2004 Johannes Braams, Nico Poppelier.
-%% All rights reserved.
-%%
+%
% We begin by identifying the version of this file on the terminal and
% in the transcript file.
%<*package>
@@ -44,7 +41,7 @@
\ProvidesFile{a4.dtx}
%</dtx>
%<package>\ProvidesPackage{a4}
- [2004/04/15 v1.2g A4 based page layout]
+ [2020/02/18 v1.2g A4 based page layout]
%
% Copying of this file is authorized only if either
% (1) you make absolutely no changes to your copy, including name, or
@@ -55,9 +52,9 @@
%
% Error reports for UNCHANGED versions please to:
% J.L. Braams
-% TeXniek at braams.cistron.nl
+% texniek at braams.xs4all.nl
% or: N.A.F.M. Poppelier
-% N.Poppelier at elsevier.nl
+% N.Poppelier@elsevier.nl
%
%
%\fi
@@ -78,6 +75,7 @@
% end of file}
% \changes{v1.2d}{1995/08/11}{Moved identification part to the top of
% the file}
+% \changes{v1.2g}{2020/02/18}{Updated address info of authors}
%
% \title{A style option to adapt the standard \LaTeX\ document
% styles to A4 paper\thanks{This file
@@ -86,15 +84,13 @@
%
% \author{Nico Poppelier\\
% \TeX nique \\
-% Washingtondreef 153\\
-% 3564 KD Utrecht\\
+% Utrecht\\
% \texttt{Poppelier@elsevier.nl}\\
% \and
% Johannes Braams\\
% \TeX niek\\
-% Kooienswater 62\\
-% 2715 AJ Zoetermeer\\
-% \texttt{JLBraams@cistron.nl}}
+% Zoetermeer\\
+% \texttt{JLBraams@texniek@braams.xs4all.nl}}
%
% \date{Printed \today}
%
@@ -599,20 +595,4 @@
%
% \Finale
%
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}
-%%
-\endinput
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/ntgclass/a4.ins b/macros/latex/contrib/ntgclass/a4.ins
index e512961050..09300056a7 100644
--- a/macros/latex/contrib/ntgclass/a4.ins
+++ b/macros/latex/contrib/ntgclass/a4.ins
@@ -1,52 +1,60 @@
-%%
+%
%% This file will generate fast loadable files and documentation
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1990-1999 Nederlandstalige TeX Gebruikersgroep.
-%%
-%% This file is part of the NTG document classes distribution
-%% ----------------------------------------------------------
-%%
+%% Copyright (C) 1993-2020
+%% The Nederlandstalige TeX Gebruikersgroep and any individual
+%% authors listed elsewhere in this file.
+%%
+%% This file is part of the NTG document classes distribution.
+%% -----------------------------------------------------------
+%%
%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
-%%
-%% This work has the LPPL maintenance status "maintained".
-%%
-%% The Current Maintainer of this work is Johannes Braams.
-%%
-%% The list of all files belonging to the NTG document classes
-%% distribution is given in the file `manifest.txt.
-%%
-%% The list of derived (unpacked) files belonging to the distribution
-%% and covered by LPPL is defined by the unpacking scripts (with
-%% extension .ins) which are part of the distribution.
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+%% As this file contains legal notices, it is NOT PERMITTED to modify
+%% this file in any way that the legal information placed into
+%% generated files is changed (i.e., the files generated when the
+%% original file is executed). This restriction does not apply if
+%% (parts of) the content is reused in a different WORK producing its
+%% own generated files.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.txt'. See also `legal.txt' for additional
+%% information.
+%%
+%%
+%%
%%
%% --------------- start of docstrip commands ------------------
%%
-\input docstrip.tex % ignored in distribution
+
+\input docstrip.tex % ignored in distribution
\preamble
This is a generated file.
-Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
+Copyright (C) 1990-2020 Nederlandstalige TeX Gebruikersgroep.
All rights reserved.
This file was generated from file(s) of the NTG document classes distribution.
------------------------------------------------------------------------------
It may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2003/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
This work has the LPPL maintenance status "maintained".
@@ -81,4 +89,4 @@ extension .ins) which are part of the distribution.
\Msg{* Happy TeXing}
\Msg{***********************************************************}
-\endinput
+\endbatchfile
diff --git a/macros/latex/contrib/ntgclass/a4.pdf b/macros/latex/contrib/ntgclass/a4.pdf
index fb63ff89f6..91bdbe4bcc 100644
--- a/macros/latex/contrib/ntgclass/a4.pdf
+++ b/macros/latex/contrib/ntgclass/a4.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/artdoc.pdf b/macros/latex/contrib/ntgclass/artdoc.pdf
index c52fa417ef..8eb6e01ad3 100644
--- a/macros/latex/contrib/ntgclass/artdoc.pdf
+++ b/macros/latex/contrib/ntgclass/artdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/artdoc.tex b/macros/latex/contrib/ntgclass/artdoc.tex
index b581d23529..346688d39c 100644
--- a/macros/latex/contrib/ntgclass/artdoc.tex
+++ b/macros/latex/contrib/ntgclass/artdoc.tex
@@ -1,33 +1,3 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
\documentclass[a4paper]{artikel1} %ja,ja, onze eigen documentstijl!
\usepackage[dutch]{babel}
diff --git a/macros/latex/contrib/ntgclass/brief-sample.pdf b/macros/latex/contrib/ntgclass/brief-sample.pdf
new file mode 100644
index 0000000000..480f0947b8
--- /dev/null
+++ b/macros/latex/contrib/ntgclass/brief-sample.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/brief.tex b/macros/latex/contrib/ntgclass/brief-sample.tex
index e05f3445a0..aa871b7311 100644
--- a/macros/latex/contrib/ntgclass/brief.tex
+++ b/macros/latex/contrib/ntgclass/brief-sample.tex
@@ -1,33 +1,3 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
\documentclass{brief} %% er is een optie 'adresrechts'
%\maaketiketten %% werkt nog niet naar behoren
diff --git a/macros/latex/contrib/ntgclass/brief.dtx b/macros/latex/contrib/ntgclass/brief.dtx
index 96a1525bf0..fcc32e4e84 100644
--- a/macros/latex/contrib/ntgclass/brief.dtx
+++ b/macros/latex/contrib/ntgclass/brief.dtx
@@ -1,69 +1,44 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
-% \CheckSum{2200}
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}
+% \iffalse
+%
+% Copyright (C) 1994 -- 2020 by Nederlandstalige TeX Gebruikersgroep.
+% Based on letter.dtx version 1.3a
+%
+% Copyright (C) 1994 LaTeX3 project, Frank Mittelbach
+% and Rainer Sch\"opf, all rights reserved.
+%
+% This file is part of the NTG document classes distribution
+% ----------------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
%
+% The list of all files belonging to the NTG document classes
+% distribution is given in the file `manifest.txt.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+%
+% \fi
+% \CheckSum{2213}
% \iffalse
-%% Copyright (C) 1994 -- 1999 by Victor Eijkhout \and Johannes Braams
-%% Based on letter.dtx version 1.2i
-%% Copyright (C) 1994 LaTeX3 project, Frank Mittelbach
-%% and Rainer Sch\"opf, all rights reserved.
-%%
-%% This program can be redistributed and/or modified under the terms
-%% of the LaTeX Project Public License Distributed from CTAN
-%% archives in directory macros/latex/base/lppl.txt; either
-%% version 1 of the License, or any later version.
-%%
-% \section{Identification}
%
+% \section{Identification}
%
% This document class can only be used with \LaTeXe, so we make
% sure that an appropriate message is displayed when another \TeX{}
% format is used.
% \begin{macrocode}
-%<+brief>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<+brief>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
% \end{macrocode}
%
% Announce the Class name and its version.
@@ -72,7 +47,7 @@
%<*driver>
\ProvidesFile{brief.drv}
%</driver>
- [1999/03/03 v2.0r
+ [2020/02/18 v2.0s
%<+brief> NTG LaTeX document class]
% \end{macrocode}
%
@@ -124,6 +99,13 @@
\DoNotIndex{\trivlist,\typeout,\tw@}
\DoNotIndex{\vskip,\vspace,\year,\z@}
% \end{macrocode}
+% We do want an index, using linenumbers.
+% \changes{v2.0s}{2020/02/18}{Added \cs{CodelineIndex} to make sure a
+% \texttt{.idx} file is produced}
+% \begin{macrocode}
+\EnableCrossrefs
+\CodelineIndex
+% \end{macrocode}
% Produce a listing of the changes.
% \begin{macrocode}
\RecordChanges
@@ -142,12 +124,12 @@
% \end{macrocode}
% Some commonly used abbreviations
% \begin{macrocode}
-\newcommand*{\Lopt}[1]{\textsf{#1}}
-\newcommand*{\Lenv}[1]{\textsf{#1}}
-\newcommand*{\file}[1]{\texttt{#1}}
-\newcommand*{\cls}[1]{\texttt{#1}}
-\newcommand*{\Lcount}[1]{\textsl{\small#1}}
-\newcommand*{\pstyle}[1]{\textsl{#1}}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\Lcount[1]{\textsl{\small#1}}
+\newcommand*\pstyle[1]{\textsl{#1}}
% \end{macrocode}
% We also want the full details.
% \changes{v2.0c}{1994/06/15}{Removed another remnant of
@@ -156,6 +138,7 @@
\begin{document}
\DocInput{brief.dtx}
\PrintIndex
+\PrintChanges
\end{document}
%</driver>
% \end{macrocode}
@@ -166,6 +149,8 @@
% \changes{v2.0l}{1995/08/10}{Use \cs{hb@xt@} instead of \cs{hbox}
% \texttt{to}}
% \changes{v2.0q}{1997/09/09}{Added a few more synonimes for commands}
+% \changes{v2.0s}{2020/02/18}{Synchronised with the standard document
+% classes}
%
%
% \author{Victor Eijkhout \and Johannes Braams}
@@ -468,29 +453,41 @@
% \begin{macrocode}
\normalsize
% \end{macrocode}
+% We use |\MakeRobust| instead of |\DeclareRobustCommand| above to
+% avoid a log entry for the redefinition.
+% But if we are running in a rollback situation
+% (prior to 2015) we don't touch it.
+% \changes{v2.0s}{2020/02/18}{Roll back handling (gh/201)}
+% \begin{macrocode}
+\ifx\MakeRobust\@undefined \else
+ \MakeRobust\normalsize
+\fi
+% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\small}
%
% This is similar to |\normalsize|.
+% \changes{v2.0s}{2020/02/18}{Use \cs{DeclareRobustCommand} instead of
+% \cs{newcommand*}}
% \begin{macrocode}
\ifcase\@ptsize
- \newcommand*\small{%
+ \DeclareRobustCommand\small{%
\@setfontsize\small\@ixpt{11}%
\abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus2\p@
\belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
\belowdisplayskip \abovedisplayskip}
\or
- \newcommand*\small{%
+ \DeclareRobustCommand\small{%
\@setfontsize\small\@xpt\@xiipt
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
\belowdisplayskip \abovedisplayskip}
\or
- \newcommand*\small{%
+ \DeclareRobustCommand\small{%
\@setfontsize\small\@xipt{13.6}%
\abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
\abovedisplayshortskip \z@ \@plus3\p@
@@ -505,21 +502,21 @@
% This is similar to |\normalsize|.
% \begin{macrocode}
\ifcase\@ptsize
- \newcommand*\footnotesize{%
+ \DeclareRobustCommand\footnotesize{%
\@setfontsize\footnotesize\@viiipt{9.5}%
\abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus\p@
\belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
\belowdisplayskip \abovedisplayskip}
\or
- \newcommand*\footnotesize{%
+ \DeclareRobustCommand\footnotesize{%
\@setfontsize\footnotesize\@ixpt{11}%
\abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus\p@
\belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
\belowdisplayskip \abovedisplayskip}
\or
- \newcommand*\footnotesize{%
+ \DeclareRobustCommand\footnotesize{%
\@setfontsize\footnotesize\@xpt\@xiipt
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
\abovedisplayshortskip \z@ \@plus3\p@
@@ -541,28 +538,28 @@
% lists alone.
% \begin{macrocode}
\ifcase\@ptsize
- \newcommand*\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
- \newcommand*\tiny{\@setfontsize\tiny\@vpt\@vipt}
- \newcommand*\large{\@setfontsize\large\@xiipt{14}}
- \newcommand*\Large{\@setfontsize\Large\@xivpt{18}}
- \newcommand*\LARGE{\@setfontsize\LARGE\@xviipt{22}}
- \newcommand*\huge{\@setfontsize\huge\@xxpt{25}}
- \newcommand*\Huge{\@setfontsize\Huge\@xxvpt{30}}
+ \DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
+ \DeclareRobustCommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
+ \DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
+ \DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
+ \DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
+ \DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
+ \DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
\or
- \newcommand*\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
- \newcommand*\tiny{\@setfontsize\tiny\@vipt\@viipt}
- \newcommand*\large{\@setfontsize\large\@xiipt{14}}
- \newcommand*\Large{\@setfontsize\Large\@xivpt{18}}
- \newcommand*\LARGE{\@setfontsize\LARGE\@xviipt{22}}
- \newcommand*\huge{\@setfontsize\huge\@xxpt{25}}
- \newcommand*\Huge{\@setfontsize\Huge\@xxvpt{30}}
+ \DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
+ \DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
+ \DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
+ \DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
+ \DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
+ \DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
+ \DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
\or
- \newcommand*\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
- \newcommand*\tiny{\@setfontsize\tiny\@vipt\@viipt}
- \newcommand*\large{\@setfontsize\large\@xivpt{18}}
- \newcommand*\Large{\@setfontsize\Large\@xviipt{22}}
- \newcommand*\LARGE{\@setfontsize\LARGE\@xxpt{25}}
- \newcommand*\huge{\@setfontsize\huge\@xxvpt{30}}
+ \DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
+ \DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
+ \DeclareRobustCommand\large{\@setfontsize\large\@xivpt{18}}
+ \DeclareRobustCommand\Large{\@setfontsize\Large\@xviipt{22}}
+ \DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}
+ \DeclareRobustCommand\huge{\@setfontsize\huge\@xxvpt{30}}
\let\Huge=\huge
\fi
% \end{macrocode}
@@ -1073,7 +1070,7 @@
% \begin{macro}{\name}
% \begin{macro}{\fromname}
% \begin{macrocode}
-\def\name#1{\def\fromname{#1}}
+\newcommand*\name[1]{\def\fromname{#1}}
\def\fromname{}
% \end{macrocode}
% \end{macro}
@@ -1103,7 +1100,7 @@
% \begin{macro}{\location}
% \begin{macro}{\fromlocation}
% \begin{macrocode}
-\newcommand*{\location}[1]{\def\fromlocation{#1}}
+\newcommand*\location[1]{\def\fromlocation{#1}}
\def\fromlocation{}
% \end{macrocode}
% \end{macro}
@@ -1111,7 +1108,7 @@
% \begin{macro}{\telephone}
% \begin{macro}{\telephonenum}
% \begin{macrocode}
-\newcommand*{\telephone}[1]{\def\telephonenum{#1}}
+\newcommand*\telephone[1]{\def\telephonenum{#1}}
\def\telephonenum{}
% \end{macrocode}
% \end{macro}
@@ -1120,7 +1117,7 @@
% \begin{macro}{\makelabels}
% The |\makelabels| declaration causes mailing labels to be made.
% \begin{macrocode}
-\newcommand*{\makelabels}{%
+\newcommand*\makelabels{%
% \end{macrocode}
% At the beginning of the document, we need to activate the
% |\@mlabel| and |\@startlabels| commands, as well as write
@@ -1278,7 +1275,7 @@
% \begin{macro}{\adresveld}
% This command formats the address window.
% \begin{macrocode}
-\newcommand*{\adresveld}{%
+\newcommand*\adresveld{%
\hbox{}\kern-\topskip
\kern\@vensterskip
\begingroup
@@ -1612,20 +1609,28 @@
%
% \begin{macro}{\stopbreaks}
% \begin{macrocode}
-\def\stopbreaks{\interlinepenalty \@M
+\newcommand*\stopbreaks{\interlinepenalty \@M
\def\par{\@@par\nobreak}\let\\=\@nobreakcr
\let\vspace\@nobreakvspace}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\nobreakvspace}
-% \begin{macro}{\nobreakvspacex}
-% \begin{macro}{\nobreakcr}
+% \begin{macro}{\@nobreakvspace}
+% \changes{v2.0s}{2020/02/18}{Made robust (\LaTeX{} pr/2049)}
+% \begin{macro}{\@nobreakvspacex}
+% \begin{macro}{\@nobreakcr}
+% \begin{macrocode}
+\DeclareRobustCommand\@nobreakvspace
+ {\@ifstar{\@nobreakvspacex}{\@nobreakvspacex}}
+% \end{macrocode}
+%
% \begin{macrocode}
-\def\@nobreakvspace{\@ifstar{\@nobreakvspacex}{\@nobreakvspacex}}
-
-\def\@nobreakvspacex#1{\ifvmode\nobreak\vskip #1\relax\else
- \@bsphack\vadjust{\nobreak\vskip #1}\@esphack\fi}
+\def\@nobreakvspacex#1{%
+ \ifvmode
+ \nobreak\vskip #1\relax
+ \else
+ \@bsphack\vadjust{\nobreak\vskip #1}\@esphack
+ \fi}
% \end{macrocode}
%
% \changes{v2.0p}{1997/03/02}{Added setting of \cs{reserved@e} and
@@ -1812,11 +1817,11 @@
% \changes{v2.0l}{1995/08/10}{replace \cs{reset@font} with
% \cs{normalfont}; remove \cs{rm}}
% \begin{macrocode}
-\newcommand*{\bijlage}[1]{%
+\newcommand*\bijlage[1]{%
\par\noindent
\parbox[t]{\textwidth}{\@hangfrom{\normalfont\bijlagetekst\ }%
\ignorespaces #1\strut}\par}
-\newcommand*{\bijlagen}[1]{%
+\newcommand*\bijlagen[1]{%
\par\noindent
\parbox[t]{\textwidth}{\@hangfrom{\normalfont\bijlagentekst\ }%
\ignorespaces #1\strut}\par}
@@ -1830,7 +1835,7 @@
% The only thing |\ps| needs to do is call |\startbreaks|,
% which allows page breaking again.
% \begin{macrocode}
-\def\ps{\par\startbreaks}
+\newcommand*\ps{\par\startbreaks}
% \end{macrocode}
% \end{macro}
%
@@ -1855,7 +1860,7 @@
% |\protect\standardreturnaddress|.
% \end{itemize}
% \begin{macrocode}
-\def\stopletter{}
+\newcommand*\stopletter{}
% \end{macrocode}
% \end{macro}
%
@@ -1877,7 +1882,7 @@
%
% \begin{macro}{\returnaddress}
% \begin{macrocode}
-\def\returnaddress{}
+\newcommand*\returnaddress{}
% \end{macrocode}
% \end{macro}
%
@@ -1894,7 +1899,7 @@
% labels.
% \changes{v2.0l}{1995/08/10}{changed value of \cs{columnsep} by 1pt}
% \begin{macrocode}
-\newcommand*{\startlabels}{\labelcount\z@
+\newcommand*\startlabels{\labelcount\z@
\pagestyle{empty}%
\let\@texttop\relax
\topmargin -50\p@
@@ -1916,7 +1921,7 @@
\lineskip \z@
\boxmaxdepth \z@
\parindent \z@
- \twocolumn\relax}
+ \twocolumn\relax}
% \end{macrocode}
% \end{macro}
%
@@ -1943,7 +1948,7 @@
% \changes{v2.0l}{1995/08/10}{changed width of the labels slightly to
% prevent \LaTeX\ stuffing two on each line}
% \begin{macrocode}
-\newcommand*{\mlabel}[2]{%
+\newcommand*\mlabel[2]{%
\parbox[b][2in][c]{262\p@}{\strut\ignorespaces #2}%
}
% \end{macrocode}
@@ -2136,10 +2141,10 @@
% (\file{ltlists.dtx}), but their representation is changed here.
%
% \begin{macrocode}
-\renewcommand*{\theenumi}{\@arabic\c@enumi}
-\renewcommand*{\theenumii}{\@alph\c@enumii}
-\renewcommand*{\theenumiii}{\@roman\c@enumiii}
-\renewcommand*{\theenumiv}{\@Alph\c@enumiv}
+\renewcommand*\theenumi {\@arabic\c@enumi}
+\renewcommand*\theenumii {\@alph\c@enumii}
+\renewcommand*\theenumiii{\@roman\c@enumiii}
+\renewcommand*\theenumiv {\@Alph\c@enumiv}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2153,10 +2158,10 @@
% The label for each item is generated by the commands
% |\labelenumi| ... |\labelenumiv|.
% \begin{macrocode}
-\newcommand*{\labelenumi}{\theenumi.}
-\newcommand*{\labelenumii}{(\theenumii)}
-\newcommand*{\labelenumiii}{\theenumiii.}
-\newcommand*{\labelenumiv}{\theenumiv.}
+\newcommand*\labelenumi {\theenumi.}
+\newcommand*\labelenumii {(\theenumii)}
+\newcommand*\labelenumiii{\theenumiii.}
+\newcommand*\labelenumiv {\theenumiv.}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2170,9 +2175,9 @@
% |\ref| command when referencing an item of the Nth level of an
% enumerated list.
% \begin{macrocode}
-\renewcommand*{\p@enumii}{\theenumi}
-\renewcommand*{\p@enumiii}{\theenumi(\theenumii)}
-\renewcommand*{\p@enumiv}{\p@enumiii\theenumiii}
+\renewcommand*\p@enumii {\theenumi}
+\renewcommand*\p@enumiii{\theenumi(\theenumii)}
+\renewcommand*\p@enumiv {\p@enumiii\theenumiii}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2197,11 +2202,29 @@
% dot.}
% \changes{v2.0p}{1997/03/02}{Now also \cs{textasteriskcentered}}
% \begin{macrocode}
-\newcommand*{\labelitemi}{\textbullet}
-\newcommand*{\labelitemii}{\normalfont\bfseries \textendash}
-\newcommand*{\labelitemiii}{\textasteriskcentered}
-\newcommand*{\labelitemiv}{\textperiodcentered}
+\newcommand*\labelitemi {\labelitemfont \textbullet}
+\newcommand*\labelitemii {\labelitemfont \bfseries \textendash}
+\newcommand*\labelitemiii{\labelitemfont \textasteriskcentered}
+\newcommand*\labelitemiv {\labelitemfont \textperiodcentered}
% \end{macrocode}
+%
+% \begin{macro}{\labelitemfont}
+% The default definition for \cs{labelitemfont} is to reset the
+% font to \cs{normalfont} so that always the same symbol is
+% produced regardless of surrounding conditions.
+%
+% \changes{v2.0s}{2020/02/18}{Normalize label fonts}
+% A possible alternative would be
+%\begin{verbatim}
+%\renewcommand\labelitemfont{%
+% \fontseries\seriesdefault
+% \fontshape\shapedefault\selectfont}
+%\end{verbatim}
+% which resets series and shape doesn't touch the family.
+% \begin{macrocode}
+\newcommand\labelitemfont{\normalfont}
+% \end{macrocode}
+% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -2376,7 +2399,7 @@
% \begin{macro}{\theequation}
% The equation counter will be typeset using arabic numbers.
% \begin{macrocode}
-\renewcommand*{\theequation}{\@arabic\c@equation}
+\renewcommand*\theequation{\@arabic\c@equation}
% \end{macrocode}
% \end{macro}
%
@@ -2475,7 +2498,7 @@
% a little negative vertical skip, then we put the rule and make
% sure we end up at the same point where we begun this operation.
% \begin{macrocode}
-\renewcommand*{\footnoterule}{%
+\renewcommand*\footnoterule{%
\kern-\p@
\hrule \@width .4\columnwidth
\kern .6\p@}
@@ -2552,7 +2575,7 @@
% \begin{macro}{\dutchbrief}
% This stores dutch strings.
% \begin{macrocode}
-\newcommand*{\dutchbrief}{%
+\newcommand*\dutchbrief{%
\def\uwbrieftekst{Uw brief van}
\def\uwkenmerktekst{Uw kenmerk}
\def\onskenmerktekst{Ons kenmerk}
@@ -2575,7 +2598,7 @@
% This stores English strings.
% \changes{v2.0i}{1994/12/30}{Repaired typo}
% \begin{macrocode}
-\newcommand*{\englishbrief}{%
+\newcommand*\englishbrief{%
\def\uwbrieftekst{Your letter of}
\def\uwkenmerktekst{Your reference}
\def\onskenmerktekst{Our reference}
@@ -2604,7 +2627,7 @@
% \begin{macro}{\americanbrief}
% This stores American english strings
% \begin{macrocode}
-\newcommand*{\americanbrief}{%
+\newcommand*\americanbrief{%
\def\uwbrieftekst{Your letter of}
\def\uwkenmerktekst{Your reference}
\def\onskenmerktekst{Our reference}
@@ -2626,7 +2649,7 @@
% \begin{macro}{\germanbrief}
% This stores the German versions of the strings.
% \begin{macrocode}
-\newcommand*{\germanbrief}{%
+\newcommand*\germanbrief{%
\def\uwbrieftekst{Ihr Brief vom}
\def\uwkenmerktekst{Ihr Zeichen}
\def\onskenmerktekst{Unser Zeichen}
@@ -2648,7 +2671,7 @@
% \begin{macro}{\frenchbrief}
% And finally to store the french strings
% \begin{macrocode}
-\newcommand*{\frenchbrief}{%
+\newcommand*\frenchbrief{%
\def\uwbrieftekst{Votre lettre du}
\def\uwkenmerktekst{Vos r\'ef\'erences:}
\def\onskenmerktekst{Nos r\'ef\'erences:}
diff --git a/macros/latex/contrib/ntgclass/brief.pdf b/macros/latex/contrib/ntgclass/brief.pdf
index 2237d5783a..80590ff0f9 100644
--- a/macros/latex/contrib/ntgclass/brief.pdf
+++ b/macros/latex/contrib/ntgclass/brief.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/briefdoc.pdf b/macros/latex/contrib/ntgclass/briefdoc.pdf
index 558ce17b42..3cf449999d 100644
--- a/macros/latex/contrib/ntgclass/briefdoc.pdf
+++ b/macros/latex/contrib/ntgclass/briefdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/briefdoc.tex b/macros/latex/contrib/ntgclass/briefdoc.tex
index bf1c38be08..79a69113e9 100644
--- a/macros/latex/contrib/ntgclass/briefdoc.tex
+++ b/macros/latex/contrib/ntgclass/briefdoc.tex
@@ -1,33 +1,3 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
\documentclass[a4paper,10pt]{artikel1}
\usepackage[dutch]{babel}
diff --git a/macros/latex/contrib/ntgclass/changes.txt b/macros/latex/contrib/ntgclass/changes.txt
deleted file mode 100644
index afedf7a879..0000000000
--- a/macros/latex/contrib/ntgclass/changes.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-This file lists changes to the NTG files in reverse chronological order.
-========================================================================
-
-
diff --git a/macros/latex/contrib/ntgclass/classdoc.pdf b/macros/latex/contrib/ntgclass/classdoc.pdf
index 8e16c04cc5..d799c88e66 100644
--- a/macros/latex/contrib/ntgclass/classdoc.pdf
+++ b/macros/latex/contrib/ntgclass/classdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/classdoc.tex b/macros/latex/contrib/ntgclass/classdoc.tex
index 94e0cb8665..887d8f6a4d 100644
--- a/macros/latex/contrib/ntgclass/classdoc.tex
+++ b/macros/latex/contrib/ntgclass/classdoc.tex
@@ -1,33 +1,3 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
\documentclass[a4paper,10pt]{artikel1} % or just 'article'
\usepackage{shortvrb}
\newcommand\Lopt[1]{\textsf{#1}}
diff --git a/macros/latex/contrib/ntgclass/ntgclass.dtx b/macros/latex/contrib/ntgclass/ntgclass.dtx
index 53b1064b11..b8322eb68f 100644
--- a/macros/latex/contrib/ntgclass/ntgclass.dtx
+++ b/macros/latex/contrib/ntgclass/ntgclass.dtx
@@ -1,62 +1,41 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
-% \CheckSum{3726}
% \iffalse
-%% Copyright (C) 1994 -- 2004 by Victor Eijkhout and Johannes Braams
-%% Based on classes.dtx
-%% Copyright (C) 1999 LaTeX3 project, all rights reserved.
-%%
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}
%
+% Copyright (C) 1994 -- 2020 by Nederlandstalige TeX Gebruikersgroep.
+% Based on classes.dtx
+% Copyright (C) 1999 LaTeX3 project, all rights reserved.
+%
+% This file is part of the NTG document classes distribution
+% ----------------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the NTG document classes
+% distribution is given in the file `manifest.txt.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+%
+% \fi
+% \CheckSum{3782}
+%\iffalse
% \section{Identification}
%
% These document classes can only be used with \LaTeXe, so we make
% sure that an appropriate message is displayed when another \TeX{}
% format is used.
% \begin{macrocode}
-%<artikel|rapport|boek>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<artikel|rapport|boek>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
% \end{macrocode}
%
% Announce the Class name and its version:
@@ -80,7 +59,7 @@
%<*driver>
\ProvidesFile{ntgclass.drv}
%</driver>
- [2004/06/07 v2.1a
+ [2020/02/22 v2.1c
%<artikel|rapport|boek> NTG LaTeX document class]
%<10pt|11pt|12pt> NTG LaTeX file (size option)]
% \end{macrocode}
@@ -178,8 +157,6 @@
% \end{macrocode}
% \fi
%
-%
-%
% \changes{v2.0b}{1994/02/02}{Removed typos that were found in
% classes.dtx, synced with that file}
% \changes{v2.0d}{1994/02/23}{Fixed some errors in the documentation}
@@ -196,13 +173,15 @@
% \changes{v2.0p}{1995/08/10}{use \cs{hb@xt@} instead of \cs{hbox}
% \texttt{to}}
% \changes{v2.0x}{1997/09/08}{Repaired a few documentation bugs}
+% \changes{v2.1c}{2020/02/18}{Update to synchronize with classes.dtx}
+% \changes{v2.1c}{2020/02/18}{Various commands made robust}
%
% \title{NTG Document Classes for \LaTeX{} version 2e\thanks{This file
% has version number \fileversion, last revised \filedate.}}
%
% \author{%
% Copyright (C) 1992 by Leslie Lamport \and
-% Copyright (C) 1994,1999 by Victor Eijkhout \and Johannes Braams
+% Copyright (C) 1994-2020 by Victor Eijkhout \and Johannes Braams
% }
% \date{\filedate}
%
@@ -659,6 +638,16 @@
% \begin{macrocode}
\normalsize
% \end{macrocode}
+% We use |\MakeRobust| instead of |\DeclareRobustCommand| above to
+% avoid a log entry for the redefinition.
+% But if we are running in a rollback situation
+% (prior to 2015) we don't touch it.
+% \changes{v2.1c}{2020/02/18}{Roll back handling (gh/201)}
+% \begin{macrocode}
+\ifx\MakeRobust\@undefined \else
+ \MakeRobust\normalsize
+\fi
+% \end{macrocode}
% \end{macro}
% \end{macro}
%
@@ -666,8 +655,10 @@
% \changes{v2.0f}{1994/04/18}{Use \cs{newcommand} instead of
% \cs{renewcommand} because of change in the \LaTeX kernel}
% This is similar to |\normalsize|.
+% \changes{v2.1c}{2020/02/18}{Use \cs{DeclareRobustCommand} instead of
+% \cs{newcommand*}}
% \begin{macrocode}
-\newcommand*\small{%
+\DeclareRobustCommand\small{%
%<*10pt>
\@setfontsize\small\@ixpt{11}%
\abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
@@ -696,7 +687,7 @@
% \cs{renewcommand} because of change in the \LaTeX kernel}
% This is similar to |\normalsize|.
% \begin{macrocode}
-\newcommand*\footnotesize{%
+\DeclareRobustCommand\footnotesize{%
%<*10pt>
\@setfontsize\footnotesize\@viiipt{9.5}%
\abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
@@ -734,30 +725,30 @@
% lists alone.
% \begin{macrocode}
%<*10pt>
-\newcommand*\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
-\newcommand*\tiny{\@setfontsize\tiny\@vpt\@vipt}
-\newcommand*\large{\@setfontsize\large\@xiipt{14}}
-\newcommand*\Large{\@setfontsize\Large\@xivpt{18}}
-\newcommand*\LARGE{\@setfontsize\LARGE\@xviipt{22}}
-\newcommand*\huge{\@setfontsize\huge\@xxpt{25}}
-\newcommand*\Huge{\@setfontsize\Huge\@xxvpt{30}}
+\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
+\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
+\DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
+\DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
+\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
+\DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
+\DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%</10pt>
%<*11pt>
-\newcommand*\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
-\newcommand*\tiny{\@setfontsize\tiny\@vipt\@viipt}
-\newcommand*\large{\@setfontsize\large\@xiipt{14}}
-\newcommand*\Large{\@setfontsize\Large\@xivpt{18}}
-\newcommand*\LARGE{\@setfontsize\LARGE\@xviipt{22}}
-\newcommand*\huge{\@setfontsize\huge\@xxpt{25}}
-\newcommand*\Huge{\@setfontsize\Huge\@xxvpt{30}}
+\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
+\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
+\DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
+\DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
+\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
+\DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
+\DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%</11pt>
%<*12pt>
-\newcommand*\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
-\newcommand*\tiny{\@setfontsize\tiny\@vipt\@viipt}
-\newcommand*\large{\@setfontsize\large\@xivpt{18}}
-\newcommand*\Large{\@setfontsize\Large\@xviipt{22}}
-\newcommand*\LARGE{\@setfontsize\LARGE\@xxpt{25}}
-\newcommand*\huge{\@setfontsize\huge\@xxvpt{30}}
+\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
+\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
+\DeclareRobustCommand\large{\@setfontsize\large\@xivpt{18}}
+\DeclareRobustCommand\Large{\@setfontsize\Large\@xviipt{22}}
+\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}
+\DeclareRobustCommand\huge{\@setfontsize\huge\@xxvpt{30}}
\let\Huge=\huge
%</12pt>
%</10pt|11pt|12pt>
@@ -1692,7 +1683,7 @@
% \begin{macrocode}
\renewcommand*\ps@plain{%
% \end{macrocode}
-% The running head are empty in this pagestyle, the page number
+% The running heads are empty in this pagestyle, the page number
% appears in the running foot.
% \begin{macrocode}
\let\@oddhead\@empty\let\@evenhead\@empty
@@ -2361,6 +2352,8 @@
% This |{| used to be after the argument to |\@hangfrom| but was
% moved here to allow commands such as |\MakeUppercase| to be used
% at the end of |#6|.
+% \changes{v2.1b}{2004/08/14}{No longer pass \cs{toc@font} through the
+% \texttt{.aux} file as this upsets pdf\LaTeX}
% \begin{macrocode}
#6{%
%<*type1|type3>
@@ -2377,7 +2370,7 @@
\else
\protect\numberline{\csname the#1\endcsname}%
\fi
- \toc@font#2 #7}%
+ #7}%
\else
\def\@svsechd{#6\hskip #3\relax
\@svsec #8\csname #1mark\endcsname{#7}%
@@ -2386,7 +2379,7 @@
\else
\protect\numberline{\csname the#1\endcsname}%
\fi
- \toc@font#2 #7}}%
+ #7}}%
\fi
\@xsect{#5}}
% \end{macrocode}
@@ -2675,12 +2668,14 @@
% part, otherwise it is unnumbered.
% \changes{v2.0p}{1995/08/10}{replace \cs{reset@font} with
% \cs{normalfont}}
+% \changes{v2.1b}{2004/08/16}{use \cs{numberline} instead of a fixed
+% space of \texttt{1 em}}
% \begin{macrocode}
%<*artikel>
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}%
- \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{toc}{part}{\protect\numberline{\thepart}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
@@ -2718,12 +2713,14 @@
% When \Lcount{secnumdepth} is larger than $-2$ for the
% document class rapport and boek, we have a numbered
% part, otherwise it is unnumbered.
+% \changes{v2.1b}{2004/08/16}{use \cs{numberline} instead of a fixed
+% space of \texttt{1 em}}
% \begin{macrocode}
%<*rapport|boek>
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
- \addcontentsline{toc}{part}{\thepart\hspace{1em}\toc@case{#1}}%
+ \addcontentsline{toc}{part}{\protect\numberline{\thepart}{#1}}%
\else
\addcontentsline{toc}{part}{\toc@case{#1}}%
\fi
@@ -2743,11 +2740,13 @@
% When this is a numbered part we have to print the number. We have
% to expand |\partname| before |\uppercase| is called, therefore we
% use a temporary control sequence that, when called will execute
-% |\uppercase| on the contents of |\partname|.
+% |\MakeUppercase| on the contents of |\partname|.
+% \changes{v2.1c}{2020/02/22}{Use \cs{MakeUppercase} instead of
+% \cs{uppercase}}
% \begin{macrocode}
\ifnum \c@secnumdepth >-2\relax
\Large\PartFont
- \edef\@tempa{\noexpand\uppercase{\partname}}\@tempa
+ \edef\@tempa{\noexpand\MakeUppercase{\partname}}\@tempa
\nobreakspace\thepart
\par
% \end{macrocode}
@@ -2756,7 +2755,7 @@
% \begin{macrocode}
\vskip 20\p@
\fi
- \Large \PartFont \uppercase{#2}\par}%
+ \Large \PartFont \MakeUppercase{#2}\par}%
\@endpart}
%</rapport|boek>
% \end{macrocode}
@@ -2868,6 +2867,8 @@
% inform the user that a new chapter is about to be typeset by
% writing a message to the terminal.
% \changes{v2.0k}{1994/06/08}{Removed carriage return behind +boek}
+% \changes{v2.1b}{2004/08/14}{No longer pass \cs{toc@font} through the
+% \texttt{.aux} file as this upsets pdf\LaTeX}
% \begin{macrocode}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -2875,14 +2876,14 @@
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
- {\protect\numberline{\thechapter}\toc@font0 #1}%
+ {\protect\numberline{\thechapter}#1}%
%<*boek>
\else
- \addcontentsline{toc}{chapter}{\toc@font0 #1}%
+ \addcontentsline{toc}{chapter}{#1}%
\fi
%</boek>
\else
- \addcontentsline{toc}{chapter}{\toc@font0 #1}%
+ \addcontentsline{toc}{chapter}{#1}%
\fi
% \end{macrocode}
% After having written an entry to the table of contents we store
@@ -3417,15 +3418,20 @@
% We want to have different label positioning on different levels of
% list. To acheive this we have to redefine the \Lenv{enumerate}
% environment.
-%
+% \changes{v2.1c}{2020/02/21}{Use \cs{thr@@}}
% \begin{macrocode}
\renewenvironment{enumerate}{%
- \ifnum \@enumdepth >3
+ \ifnum \@enumdepth >\thr@@
\@toodeep
\else
\advance\@enumdepth \@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
- \list{\csname label\@enumctr\endcsname}
+% \end{macrocode}
+% \changes{v2.1c}{2020/02/21}{Use \cs{expandafter}}
+% \begin{macrocode}
+ \expandafter
+ \list
+ \csname label\@enumctr\endcsname
{\usecounter{\@enumctr}%
%<type1> \ifnum \@listdepth=1
%<*type1|type3>
@@ -3464,29 +3470,54 @@
% \changes{v2.0u}{1996/09/23}{Did similar for the bullet and centered
% dot.}
% \changes{v2.0v}{1997/03/02}{Now also \cs{textasteriskcentered}}
+% \changes{v2.1c}{2020/02/18}{Use \cs{labelitemfont}}
+% \begin{macrocode}
+\newcommand\labelitemi {\labelitemfont \textbullet}
+\newcommand\labelitemii {\labelitemfont \bfseries \textendash}
+\newcommand\labelitemiii{\labelitemfont \textasteriskcentered}
+\newcommand\labelitemiv {\labelitemfont \textperiodcentered}
+% \end{macrocode}
+%
+% \begin{macro}{\labelitemfont}
+% The default definition for \cs{labelitemfont} is to reset the
+% font to \cs{normalfont} so that always the same symbol is
+% produced regardless of surrounding conditions.
+%
+% \changes{v2.1c}{2020/02/18}{Normalize label fonts}
+% A possible alternative would be
+%\begin{verbatim}
+%\renewcommand\labelitemfont{%
+% \fontseries\seriesdefault
+% \fontshape\shapedefault\selectfont}
+%\end{verbatim}
+% which resets series and shape doesn't touch the family.
% \begin{macrocode}
-\newcommand*{\labelitemi}{\textbullet}
-\newcommand*{\labelitemii}{\normalfont\bfseries \textendash}
-\newcommand*{\labelitemiii}{\textasteriskcentered}
-\newcommand*{\labelitemiv}{\textperiodcentered}
+\newcommand\labelitemfont{\normalfont}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{environment}{itemize}
% We want to have differen label positioning on different levels of
% list. To acheive this we have to redefine the \Lenv{itemize}
% environment.
+% \changes{v2.1c}{2020/02/21}{Use \cs{thr@@}}
% \begin{macrocode}
\renewenvironment{itemize}{%
- \ifnum \@itemdepth >3
+ \ifnum \@itemdepth >\thr@@
\@toodeep
\else
\advance\@itemdepth \@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
- \list{\csname\@itemitem\endcsname}%
+% \end{macrocode}
+% \changes{v2.1c}{2020/02/21}{Use \cs{expandafter}}
+% \begin{macrocode}
+ \expandafter
+ \list
+ \csname\@itemitem\endcsname
{%
%<type1> \ifnum \@listdepth=1\relax
%<*type1|type3>
@@ -3526,8 +3557,10 @@
% To change the formatting of the label, you must redefine
% |\descriptionlabel|.
%
+% \changes{v2.1c}{2020/02/18}{Inserted \cs{normalfont}}
% \begin{macrocode}
-\newcommand*\descriptionlabel[1]{\hspace\labelsep \bfseries #1}
+\newcommand*\descriptionlabel[1]{\hspace\labelsep
+ \normalfont\bfseries #1}
% \end{macrocode}
% \end{macro}
%
@@ -3607,12 +3640,17 @@
%
% Note that this environment is not defined for boeks.
% \changes{v2.0e}{1994/03/19}{Use \cs{SectFont} for the abstract title}
+% \changes{v2.1c}{2020/02/18}{Added setting of \cs{beginparpenalty}
+% to discourage page break before abstract heading and setting of
+% \cs{@endparpenalty} to avoid page break after abstract heading.}
% \begin{macrocode}
%<!boek>\if@titlepage
\newenvironment{abstract}{%
\titlepage
\null\vfil
- \hbox{\SectFont \abstractname}
+ \@beginparpenalty\@lowpenalty
+ \hbox{\SectFont \abstractname}%
+ \@endparpenalty\@M
\noindent\ignorespaces}
{\par\vfil\null\endtitlepage}
% \end{macrocode}
@@ -4405,10 +4443,22 @@
% information.
% \changes{v2.1a}{2004/06/07}{Moved \cs{@mkboth} out of heading arg
% (\LaTeX{} pr/3285)}
+% \changes{v2.1c}{2020/02/18}{Explain why \cs{@mkboth} is inside the heading
+% arg for \cs{tableofcontents} (\LaTeX{} pr/3285 and pr/3984)}
% \begin{macrocode}
\chapter*{\contentsname}%
%</rapport|boek>
%<artikel> \section*{\contentsname}%
+% \end{macrocode}
+% The code for |\@mkboth| is placed inside the heading to avoid any
+% influence on vertical spacing after the heading (in some cases). For
+% other commands, such as |\listoffigures| below this has been changed from
+% the \LaTeX{}2.09 version as it will produce a serious bug if used in
+% two-column mode (see, \LaTeX{} pr/3285). However
+% |\tableofcontents| is always
+% typeset in one-column mode in these classes, therefore the somewhat
+% inconsistent setting has been retained for compatibility reasons.
+% \begin{macrocode}
\@mkboth{\MakeUppercase{\contentsname}}%
{\MakeUppercase{\contentsname}}%
% \end{macrocode}
@@ -4424,7 +4474,7 @@
%
% \begin{macro}{\@starttoc}
% The internal \LaTeXe macro |\@starttoc| needs to be adapted for
-% the \file{artikel3} and \file{rapport3} document classes,in order
+% the \file{artikel3} and \file{rapport3} document classes, in order
% to deal with a the fact that for these document classes the
% |\parskip| is normally non-zero. We don't want that in the table
% of contents.
@@ -4437,7 +4487,12 @@
\if@filesw
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
- \fi \global\@nobreakfalse \endgroup}
+% \end{macrocode}
+%
+% \changes{v2.1c}{2020/02/21}{Remove \cs{global} before
+% \cs{@nobreakfalse} as was done in \LaTeX}
+% \begin{macrocode}
+ \fi \@nobreakfalse \endgroup}
%</type3>
% \end{macrocode}
% \end{macro}
@@ -4447,6 +4502,10 @@
% contents than the standard classes from which they were
% developped. In order to acheive this different format we defined
% the macro |\@regtocline|.
+% \changes{v2.1b}{2004/08/14}{\cs{toc@font} is no longer passed
+% throughthe \texttt{.aux}-file, we set it here directly}
+% \changes{v2.1b}{2004/08/16}{\cs{toc@case} is no longer passed
+% through the \texttt{.aux} file, set it directly}
% \begin{macrocode}
\newcommand*\@regtocline[3]{%
\ifnum #1>\c@tocdepth
@@ -4460,7 +4519,9 @@
%<type2> \advance\@tempdima by \othermargin
\parindent\z@
\leavevmode
- \hbox{}\hskip -\leftskip\relax#2\nobreak
+ \hbox{}\hskip -\leftskip\relax
+ \ifnum#1<0\toc@case{#2}\else
+ \toc@font#1 #2\fi\nobreak
\hskip 1em \nobreak{\slshape #3}\par
}%
\fi}
@@ -4476,14 +4537,32 @@
% \end{macro}
%
% \begin{macro}{\toc@font}
+% \begin{macro}{\toc@fontsel}
% The changed definition of |\@sect| that we use, selects a
% different font for the table of contents for the various header
% levels. It does this using |\toc@font|.
+% \changes{v2.1b}{2004/08/16}{We want this font change to only affect
+% the section title, \emph{not} the section number, therefor we
+% need to push it behind \cs{numberline} and its argument}
% \begin{macrocode}
\if@oldtoc
\newcommand*\toc@font[1]{\relax}
\else
- \newcommand*\toc@font[1]{%
+% \end{macrocode}
+% A line of the table of contents contains |\numberline| and the
+% section number as its first two elements. We don't want to set
+% the section number using |\toc@font|, therefor we give it two
+% additional arguments and pass them on first, \emph{before}
+% changing the font. Note that we need to re-insert the braces
+% around the second argument.
+% \changes{v2.1b}{2004/08/16}{Introduce a separarte macro
+% \cs{toc@fontsel}}
+% \changes{v2.1c}{2020/02/22}{We need to jump another tolken, so we
+% need 4 arguments to accomplish that}
+% \begin{macrocode}
+ \newcommand*\toc@font[4]{%
+ #2{#3}#4\toc@fontsel#1}
+ \newcommand*\toc@fontsel[1]{%
%<*artikel>
\ifcase#1\relax
%<type2> \Large\bfseries
@@ -4498,9 +4577,39 @@
\or\rmfamily
%</rapport|boek>
\fi}
+% \end{macrocode}
+% \changes{v2.1b}{2004/08/16}{Take \textsf{hyperref} into account}
+% When the user wants to produce a hyper-document using
+% \textsf{hyperref} we need to take special precautions to make it
+% work for the table of contents. We check for the existence of
+% |\hyper@linkstart| to detect this situation at
+% |\begin{document}|.
+%
+% \textsf{Hyperref} injects extra tokens
+% (|\hyper@linkstart{link}{Hy@tocdestname}|)
+% into the stream in front of thde real contentsline. The command
+% |\hyper@linkstart| and its arguments need to be protected from
+% expanding too early or being ``upperccased'' themselves.
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifx\hyper@linkstart\undefined
+ \else
+% \end{macrocode}
+% In the contentslines for chapters, sections etc., the command
+% selection of the appropriate font needs to come after the code
+% that \textsf{hyperref} injects. we do this with some argument
+% shuffling.
+% \changes{v2.1c}{2020/02/21}{removed the space between \#1 and \#5}
+% \begin{macrocode}
+ \let\ORG@hyper@linkstart\hyper@linkstart
+ \protected\def\hyper@linkstart#1#2{%
+ \lowercase{\ORG@hyper@linkstart{#1}{#2}}}
+ \fi}
\fi
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\toc@case}
% In the \file{rapport} and \file{boek} document classes, the
@@ -4558,7 +4667,13 @@
% set flush right.
% \begin{macrocode}
{\leavevmode
- \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
+ \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2%
+% \end{macrocode}
+%
+% \changes{v2.1c}{2020/02/18}{Prevent protrusion
+% (\url{https://tex.stackexchange.com/q/172785/10109})}
+% \begin{macrocode}
+ \kern-\p@\kern\p@}}\par
% \end{macrocode}
% Prevent a pagebreak immediately after this entry, but use
% |\everypar| to reset the |\if@nobreak| switch. Finally we close
@@ -4574,15 +4689,17 @@
\fi}
% \end{macrocode}
% Then we can introduce our new definition.
+% \changes{v2.1b}{2004/08/16}{Use \cs{l@@part} to prevent the \cs{fi}
+% from intervening}
% \begin{macrocode}
\else
\newcommand*\l@part{%
- \ifnum \c@tocdepth >-2\relax
+ \ifnum \c@tocdepth >-2\let\l@@part\relax
%<artikel> \addpenalty\@secpenalty
%<!artikel> \addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus \p@}%
- \@regtocline{0}%
- \fi}
+ \def\l@@part{\@regtocline{-1}}%
+ \fi\l@@part}
\fi
% \end{macrocode}
% \end{macro}
@@ -4626,7 +4743,13 @@
% \begin{macrocode}
\advance\leftskip\@tempdima
\hskip -\leftskip
- #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2%
+% \end{macrocode}
+%
+% \changes{v2.1b}{2020/02/17}{Prevent protrusion
+% (\url{https://tex.stackexchange.com/q/172785/10109})}
+% \begin{macrocode}
+ \kern-\p@\kern\p@}\par
\penalty\@highpenalty
\endgroup}
% \end{macrocode}
@@ -4677,7 +4800,13 @@
% \begin{macrocode}
\advance\leftskip\@tempdima
\hskip -\leftskip
- #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2%
+% \end{macrocode}
+%
+% \changes{v2.1b}{2020/02/18}{Prevent protrusion
+% (\url{https://tex.stackexchange.com/q/172785/10109})}
+% \begin{macrocode}
+ \kern-\p@\kern\p@}}\par
\endgroup}
% \end{macrocode}
% The new definition:
@@ -5270,4 +5399,4 @@
% \Finale
%
\endinput
-%
+% \ No newline at end of file
diff --git a/macros/latex/contrib/ntgclass/ntgclass.ins b/macros/latex/contrib/ntgclass/ntgclass.ins
index c0b15021c9..d14cbbaf64 100644
--- a/macros/latex/contrib/ntgclass/ntgclass.ins
+++ b/macros/latex/contrib/ntgclass/ntgclass.ins
@@ -1,52 +1,63 @@
-%%
+%
%% This file will generate fast loadable files and documentation
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1990-1999 Nederlandstalige TeX Gebruikersgroep.
-%%
-%% This file is part of the NTG document classes distribution
-%% ----------------------------------------------------------
-%%
+%% Copyright (C) 1993-2020
+%% The Nederlandstalige TeX Gebruikersgroep and any individual
+%% authors listed elsewhere in this file.
+%%
+%% This file is part of the NTG document classes distribution.
+%% -----------------------------------------------------------
+%%
%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
-%%
-%% This work has the LPPL maintenance status "maintained".
-%%
-%% The Current Maintainer of this work is Johannes Braams.
-%%
-%% The list of all files belonging to the NTG document classes
-%% distribution is given in the file `manifest.txt.
-%%
-%% The list of derived (unpacked) files belonging to the distribution
-%% and covered by LPPL is defined by the unpacking scripts (with
-%% extension .ins) which are part of the distribution.
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+%% As this file contains legal notices, it is NOT PERMITTED to modify
+%% this file in any way that the legal information placed into
+%% generated files is changed (i.e., the files generated when the
+%% original file is executed). This restriction does not apply if
+%% (parts of) the content is reused in a different WORK producing its
+%% own generated files.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.txt'. See also `legal.txt' for additional
+%% information.
+%%
+%%
+%%
%%
%% --------------- start of docstrip commands ------------------
%%
+
\input docstrip.tex % ignored in distribution
\preamble
This is a generated file.
-Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
+The source is maintained by Johannes Braams and bug
+reports for it can be sent to texniek at braams.xs4all.nl
+
+Copyright (C) 1990-2020 Nederlandstalige TeX Gebruikersgroep.
All rights reserved.
This file was generated from file(s) of the NTG document classes distribution.
------------------------------------------------------------------------------
It may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2003/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
This work has the LPPL maintenance status "maintained".
@@ -80,7 +91,8 @@ extension .ins) which are part of the distribution.
\file{brief.cls}{\from{brief.dtx}{brief}}
\file{ntg10.clo}{\from{ntgclass.dtx}{10pt}}
\file{ntg11.clo}{\from{ntgclass.dtx}{11pt}}
- \file{ntg12.clo}{\from{ntgclass.dtx}{12pt}}}
+ \file{ntg12.clo}{\from{ntgclass.dtx}{12pt}}
+ }
\Msg{***********************************************************}
\Msg{*}
@@ -98,4 +110,4 @@ extension .ins) which are part of the distribution.
\Msg{* Happy TeXing}
\Msg{***********************************************************}
-\endinput
+\endbatchfile
diff --git a/macros/latex/contrib/ntgclass/ntgclass.pdf b/macros/latex/contrib/ntgclass/ntgclass.pdf
index d743d45d68..77fc8016ca 100644
--- a/macros/latex/contrib/ntgclass/ntgclass.pdf
+++ b/macros/latex/contrib/ntgclass/ntgclass.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/ntgstyle.pdf b/macros/latex/contrib/ntgclass/ntgstyle.pdf
new file mode 100644
index 0000000000..9329ad1b60
--- /dev/null
+++ b/macros/latex/contrib/ntgclass/ntgstyle.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/ntgstyle.tex b/macros/latex/contrib/ntgclass/ntgstyle.tex
new file mode 100644
index 0000000000..3dd634ee0e
--- /dev/null
+++ b/macros/latex/contrib/ntgclass/ntgstyle.tex
@@ -0,0 +1,128 @@
+\documentstyle[a4]{artikel1} % or just 'article'
+\begin{document}
+
+\title{An introduction to the Dutch \LaTeX\ styles}
+\author{Victor Eijkhout}
+\date{3 September 1989}
+\maketitle
+
+\section{Background}
+
+The Dutch \LaTeX\ styles are an attempt to provide
+\LaTeX\ users with facilities of the standard distribution
+styles `article' and `report',
+but coupled to typography that is geared towards Dutch usage.
+In order to ensure interchangeability, the new styles
+implemented the commands of the distribution styles.
+In principle, then, no manual for these styles would be needed.
+There are a few points, however, that can't go without
+comment.
+
+Table 1 lists all files connected with the Dutch styles.
+These files can be found on the {\tt tex-nl} fileserver
+on the {\tt hearn} node of Bitnet/Earn.
+Not all of them are necessary, the ones with extension {\tt .tex}
+contain just blah.
+
+Remark: there exists a Dutch version of `letter', which is so
+specifically Dutch that I decided not to include it in this list.
+
+\begin{table}[bp]\begin{center}\begin{tabular}{|@{\tt\hspace{1em}}r|l|}
+ \hline
+ artikel1.sty & article compatible, design 1, straightforward \\
+ artikel2.sty & article compatible, design 2, rather different \\
+ artikel3.sty & article compatible, design 3,
+ parskip instead of indent\\
+ rapport1.sty & report compatible, design 1 \\
+ rapport3.sty & report compatible, design 3 \\
+ book.sty & book compatible, design 1, under development\\
+ ntg10.sty & 10 point option for all styles \\
+ ntg11.sty & 11 point option for all styles \\
+ ntg12.sty & 12 point option for all styles \\
+ voorwerk.sty & Dutch version of titlepage, needed for `rapport$x$' \\
+ a4.sty & page size for European norm A4 paper.\\
+ ntgstyle.tex & this story \\
+ artdoc.tex & the genesis of the `artikel' styles, in Dutch \\
+ rapdoc.tex & the genesis of the `rapport' styles, also in Dutch.\\
+ \hline \end{tabular}\end{center}
+\caption{List of files}
+\end{table}
+
+
+\section{Languages}
+
+These styles have been developed bearing in mind suggestions
+of Hubert Partl for making the language of styles switchable.
+Thus, on their own these styles will produce English captions
+like `chapter' and `table of contents', but specifying
+the options `dutch' or `german', or any language option
+that follows the directions of Partl, will switch these
+to the language of the option.
+
+
+\section{Design}
+
+At the moment there are styles compatible with `article' and
+with `report'. The Dutch names for these are `artikel'
+and `rapport'. In contrast to the standard styles, however,
+the user can now choose from different visual designs.
+Names of the styles are formed by appending their number
+to the name, for instance `rapport3'.
+\begin{enumerate}
+\item Design one is meant to be a universally acceptable style.
+It has been kept as uncontroversial as possible.
+Under heavy protests of the implementer (me) the one
+point that has turned out to be controversial, the table
+of contents, has been made subject to a switch that can
+restore the old \LaTeX\ layout. Explanation of this follows.
+\item Design two will probably never be heavily used. It is
+more something of a heroic attempt to be different. At the
+moment only available in `artikel' form.
+\item Design three meets the wishes of people who like
+a zero \verb.\parindent. and a positive \verb.\parskip..
+As just setting these parameters within for instance `artikel1'
+will give some unwanted side effects, I~decided to repair
+these in a separate style.
+\end{enumerate}
+Credits for the visual design go to one real-life designer
+and a couple of books by designers I consulted.
+The full story can be found elsewhere.
+
+\subsection{User options}
+
+As was mentioned above, the new layout of the table
+of contents has turned out to be somewhat controversial.
+So, in order to ensure wider acceptance of these styles
+I~have incorporated a switch that will restore the
+old layout. Just specify the {\tt oldtoc} option.
+This is available in designs 1 and~3. Number~2 really
+insists on being different.
+
+I~do no page sizing, so kindly use an option like {\tt a4}.
+There is a nice one on the server, which is not the one
+by John Pavel.
+
+\subsection{Option files}
+
+Like in the standard styles there exist option files for
+$10/11/12$ point layout. Until now, however, I~have
+managed to get away with using the same option files
+for both the `artikel' `rapport', and `boek' styles.
+The option files then have to have some neutral
+names. Which are at the moment {\tt ntg10}, {\tt ntg11},
+and~{\tt ntg12}. `NTG', of course, stands for Nederlandse
+\TeX\ Gebruikersgroep, i.e., Dutch \TeX\ Users Group.
+
+When doing the `rapport' styles, I~needed to modify
+the `titlpage' option file. Thus there is a Dutch
+version of that, bearing the name of `voorwerk'
+(literal translation: `frontwork').
+Probably the majority of Dutch \LaTeX\ users
+don't even know that this is the correct term.
+You're never too old to learn.
+
+
+
+
+\end{document}
+
diff --git a/macros/latex/contrib/ntgclass/rapdoc.pdf b/macros/latex/contrib/ntgclass/rapdoc.pdf
index b129c6d24c..cda701838a 100644
--- a/macros/latex/contrib/ntgclass/rapdoc.pdf
+++ b/macros/latex/contrib/ntgclass/rapdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/ntgclass/rapdoc.tex b/macros/latex/contrib/ntgclass/rapdoc.tex
index c241b5f665..7d6308cc5b 100644
--- a/macros/latex/contrib/ntgclass/rapdoc.tex
+++ b/macros/latex/contrib/ntgclass/rapdoc.tex
@@ -1,33 +1,3 @@
-% \iffalse meta-comment
-%
-% % \iffalse meta-comment
-% %
-% % Copyright (C) 1990-2004 Nederlandstalige TeX Gebruikersgroep.
-% % All rights reserved.
-% %
-% % This file is part of the NTG document classes distribution
-% % ----------------------------------------------------------
-% %
-% % It may be distributed and/or modified under the
-% % conditions of the LaTeX Project Public License, either version 1.3
-% % of this license or (at your option) any later version.
-% % The latest version of this license is in
-% % http://www.latex-project.org/lppl.txt
-% % and version 1.3 or later is part of all distributions of LaTeX
-% % version 2003/12/01 or later.
-% %
-% % This work has the LPPL maintenance status "maintained".
-% %
-% % The Current Maintainer of this work is Johannes Braams.
-% %
-% % The list of all files belonging to the NTG document classes
-% % distribution is given in the file `manifest.txt.
-% %
-% % The list of derived (unpacked) files belonging to the distribution
-% % and covered by LPPL is defined by the unpacking scripts (with
-% % extension .ins) which are part of the distribution.
-% % \fi
-% \fi
\documentclass[oldtoc,a4paper,10pt]{rapport3}
\usepackage[dutch]{babel}
diff --git a/macros/latex/contrib/ntgclass/rapport.dtx b/macros/latex/contrib/ntgclass/rapport.dtx
new file mode 100644
index 0000000000..9033f939ac
--- /dev/null
+++ b/macros/latex/contrib/ntgclass/rapport.dtx
@@ -0,0 +1,3560 @@
+% \CheckSum{0}
+%
+%
+% \iffalse
+%<*dtx>
+\Providesfile{wijzer.dtx}
+%</dtx>
+%<class>\NeedsTeXFormat{LaTeX2e}
+%<class>\ProvidesClass{wijzer}
+%<driver>\ProvidesFile{wijzer.drv}
+%\Providesfile{wijzer.dtx}
+ [PTT Research computer handboeken]
+%
+%<*driver>
+\documentclass{ptt-ltxdoc}
+\usepackage[dutch]{babel}
+\CodelineNumbered
+\CodelineIndex
+\EnableCrossrefs
+\DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
+\DoNotIndex{\@centercr,\@cite}
+\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
+\DoNotIndex{\@input,\@ixpt,\@m}
+\DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
+\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
+\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
+\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
+\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
+\DoNotIndex{\advance,\Alph,\alph}
+\DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+\DoNotIndex{\bullet}
+\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
+\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
+\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
+\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
+\DoNotIndex{\fbox}
+\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
+\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
+\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
+\DoNotIndex{\input}
+\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
+\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
+\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
+\DoNotIndex{\NeedsTeXFormat,\newdimen}
+\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
+\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
+\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
+\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
+\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
+\DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
+\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
+\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
+\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
+\DoNotIndex{\viipt,\vipt,\vskip,\vspace}
+\DoNotIndex{\wd,\xiipt,\year,\z@}
+\newcommand{\m}[1]{\mbox{$\langle$\it #1\/$\rangle$}}
+\providecommand{\marg}[1]{{\ttfamiliy\char`\{}\m{#1}{\ttfamiliy\char`\}}}
+\providecommand{\oarg}[1]{{\ttfamiliy[}\m{#1}{\ttfamiliy]}}
+\begin{document}
+\DocInput{wijzer.dtx}
+\clearpage
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{wijzer.dtx}
+% \title{Document Class \texttt{wijzer}}
+% \author{Johannes Braams}
+% \date{Version~\fileversion, dated~\filedate}
+% \maketitle
+% \tableofcontents
+% \clearpage
+%
+% \StopEventually{} ^^A
+%
+% \section{Introduction}
+%
+% \section{The {\sc docstrip} modules}
+%
+% The following modules are used in the implementation to direct
+% {\sc docstrip} in generating the external files:
+% \begin{center}
+% \begin{tabular}{ll}
+% class & produce the document class\\
+% type1 & produce the `1' variants of the classes\\
+% type3 & produce the `3' variants of the classes\\
+% driver & produce a documentation driver file \\
+% \end{tabular}
+% \end{center}
+%
+% \section{Initial Code}
+%
+% In this part we define a few commands that are used later on.
+%
+% \begin{macro}{\@ptsize}
+% This control sequence is used to store the second digit of the
+% pointsize we are typesetting in. So, normally, it's value is one
+% of 0, 1 or 2.
+% \begin{macrocode}
+%<*class>
+\newcommand\@ptsize{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@restonecol}
+% When the document has to printed in two columns, we sometimes
+% have to temporarily switch to one column. This switch is used to
+% remember to switch back.
+% \begin{macrocode}
+\newif\if@restonecol
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@titlepage}
+% A switch to indicate if a titlepage has to be produced.
+% \begin{macrocode}
+\newif\if@titlepage
+\@titlepagetrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@openright}
+% A switch to indicate if chapters must start on a right-hand page.
+% The default for the report class is no; for the book class it's
+% yes.
+% \begin{macrocode}
+\newif\if@openright
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@openbib}
+% A switch to indicate if the bibliography has to be produced in
+% the ``open'' format. The default is to use a ``closed'' format.
+% \begin{macrocode}
+\newif\if@openbib
+\@openbibfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@oldtoc}
+% A switch to indicate if `old' layout of the table of contents
+% should be produced. These document classes normally produce a
+% table of contents that looks quite different from what the
+% standard classes produce.
+% \begin{macrocode}
+\newif\if@oldtoc
+\@oldtocfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@allcaps}
+% By default the text on the titlepage is set in capital letters.
+% This can be disabled by the option \Lopt{mctitle}, which sets the
+% switch |\if@allcaps| to false.
+% \begin{macrocode}
+\newif\if@allcaps
+% \end{macro}
+%
+% \begin{macro}{\if@titlecentered}
+% In the document classes \file{wijzer3} the
+% default placement of the title that is produced by |\maketitle|
+% is flushleft. This can be changed by the switch
+% |\if@titlecentered|.
+% \begin{macrocode}
+%<+type3>\newif\if@titlecentered
+%<+type3>\@titlecenteredfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@revlabel}
+% These document classes need to be able to change the positioning
+% of the label in labeled lists. This switch is used for that
+% purpose.
+% \begin{macrocode}
+\newif\if@revlabel
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaration of Options}
+%
+%
+% \subsection{Setting Paper Sizes}
+%
+% The variables |\paperwidth| and |\paperheight| should reflect the
+% physical paper size after trimming. For desk printer output this
+% is usually the real paper size since there is no post-processing.
+% Classes for real book production will probably add other paper
+% sizes and additionally the production of crop marks for trimming.
+% \begin{macrocode}
+\DeclareOption{a4paper}
+ {\setlength\paperheight {297mm}%
+ \setlength\paperwidth {210mm}}
+\DeclareOption{a5paper}
+ {\setlength\paperheight {210mm}%
+ \setlength\paperwidth {148mm}}
+\DeclareOption{b5paper}
+ {\setlength\paperheight {250mm}%
+ \setlength\paperwidth {176mm}}
+\DeclareOption{letterpaper}
+ {\setlength\paperheight {11in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{legalpaper}
+ {\setlength\paperheight {14in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperheight {10.5in}%
+ \setlength\paperwidth {7.25in}}
+% \end{macrocode}
+%
+% The option \Lopt{landscape} switches the values of |\paperheight|
+% and |\paperwidth|, assuming the dimensions wer given for portrait
+% paper.
+% \begin{macrocode}
+\DeclareOption{landscape}
+ {\setlength\@tempdima {\paperheight}%
+ \setlength\paperheight {\paperwidth}%
+ \setlength\paperwidth {\@tempdima}}
+% \end{macrocode}
+%
+% \subsection{Choosing the type size}
+%
+% The type size options are handled by defining |\@ptsize| to contain
+% the last digit of the size in question and branching on |\ifcase|
+% statements. This is done for historical reasons to stay compatible
+% with other packages that use the |\@ptsize| variable to select
+% special actions. It makes the declarations of size options less
+% than 10pt difficult, although one can probably use \texttt{9}
+% and \texttt{8} assuming that a class won't define both
+% \Lopt{8pt} and \Lopt{18pt} options.
+%
+% \begin{macrocode}
+\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
+\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+% \end{macrocode}
+%
+%
+% \subsection{Two-side or one-side printing}
+%
+% For two-sided printing we use the switch |\if@twoside|. In
+% addition we have to set the |\if@mparswitch| to get any margin
+% paragraphs into the outside margin.
+% \begin{macrocode}
+\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
+\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
+% \end{macrocode}
+%
+%
+% \subsection{Draft option}
+%
+% If the user requests \Lopt{draft} we show any overfull boxes.
+% We could probably add some more interesting stuff to this option.
+% \begin{macrocode}
+\DeclareOption{draft}{\setlength\overfullrule{5pt}}
+\DeclareOption{final}{\setlength\overfullrule{0pt}}
+% \end{macrocode}
+%
+% \subsection{Titlepage option}
+% An article usually has no separate titlepage, but the user can
+% request one.
+% \begin{macrocode}
+\DeclareOption{titlepage}{\@titlepagetrue}
+\DeclareOption{notitlepage}{\@titlepagefalse}
+% \end{macrocode}
+%
+% \subsection{openright option}
+% This option determines whether or not a chapter must start on
+% a right-hand page
+% request one.
+% \begin{macrocode}
+\DeclareOption{openright}{\@openrighttrue}
+\DeclareOption{openany}{\@openrightfalse}
+% \end{macrocode}
+%
+% For these document classes there used to be a file
+% \file{voorwerk.sty} which was a replacement for
+% \file{titlepag.sty}. Therefore we also have the option
+% \Lopt{voorwerk}.
+% \begin{macrocode}
+\DeclareOption{voorwerk}{\@titlepagetrue}
+\DeclareOption{geenvoorwerk}{\@titlepagefalse}
+% \end{macrocode}
+%
+%
+% \subsection{Table of contents formatting}
+%
+% This document class uses a new layout for the table of contents,
+% but in order to maintain compatibility with the standard \LaTeXe
+% document classes we supply an extra option: \Lopt{oldtoc}. If
+% this option is specified the switch |\if@oldtoc| will be set
+% true.
+% \begin{macrocode}
+\DeclareOption{oldtoc}{\@oldtoctrue}
+% \end{macrocode}
+%
+% \subsection{Formatting of the title}
+%
+% The option \Lopt{titlecentered} changes the behaviour of the
+% |\maketitle| command. It then produces a title like it does for
+% the \file{artikel1} document class.
+% \begin{macrocode}
+%<+type3>\DeclareOption{titlecentered}{\@titlecenteredtrue}
+% \end{macrocode}
+%
+% In this document class the titlepage uses all capital
+% letters. The option \Lopt{mctitle} (for `mixed case') prevents
+% this.
+% \begin{macrocode}
+\DeclareOption{mctitle}{\@allcapsfalse}
+\DeclareOption{uctitle}{\@allcapstrue}
+% \end{macrocode}
+%
+% \subsection{Twocolumn printing}
+%
+% Two-column and one-column printing is again realized via a switch.
+% \begin{macrocode}
+\DeclareOption{onecolumn}{\@twocolumnfalse}
+\DeclareOption{twocolumn}{\@twocolumntrue}
+% \end{macrocode}
+%
+% \subsection{Equation numbering on the left}
+%
+% The option \Lopt{leqno} can be used to get the equation numbers
+% on the left side of the equation.
+% \begin{macrocode}
+\DeclareOption{leqno}{\input{leqno.clo}}
+% \end{macrocode}
+%
+% \subsection{Flush left displays}
+%
+% The option \Lopt{fleqn} redefines the displayed math environmens
+% in such a way that they come out flush left, with an indentation
+% of |\mathindent| from the prevailing left margin.
+% \begin{macrocode}
+\DeclareOption{fleqn}{\input{fleqn.clo}}
+% \end{macrocode}
+%
+% \subsection{Open bibliography}
+%
+% The option \Lopt{openbib} produces the ``open'' bibliography
+% style, in which each block starts on a new line, and succeeding
+% lines in a block are indented by |\bibindent|.
+% \begin{macrocode}
+\DeclareOption{openbib}{\@openbibtrue}
+% \end{macrocode}
+%
+%
+% \section{Executing Options}
+%
+% Here we execute the default options to initialize certain
+% variables.
+% \begin{macrocode}
+\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,uctitle,openany}
+% \end{macrocode}
+%
+% The |\ProcessOptions| command causes the execution of the code
+% for every option \Lopt{FOO}
+% which is declared and for which the user typed
+% the \Lopt{FOO} option in his
+% |\documentclass| command. For every option \Lopt{BAR} he typed,
+% which is not declared, the option is assumed to be a global option.
+% All options will be passed as document options to any
+% |\usepackage| command in the document preamble.
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+% Now that all the options have been executed we can load the
+% chosen class option file that contains all size dependent code.
+% \begin{macrocode}
+\input{ntg1\@ptsize.clo}
+% \end{macrocode}
+%
+% \section{Loading Packages}
+%
+% These class files do not load additional packages.
+%
+%
+% \section{Document Layout}
+% \label{sec:maincode}
+%
+% In this section we are finally dealing with the nasty typographical
+% details.
+%
+% \subsection{Paragraphing}
+%
+% \begin{macro}{\lineskip}
+% \begin{macro}{\normallineskip}
+% These parameters control \TeX's behaviour when two lines tend to
+% come too close together.
+% \begin{macrocode}
+\setlength\lineskip{1\p@}
+\setlength\normallineskip{1\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\baselinestretch}
+% This is used as a multiplier for |\baselineskip|. The default is
+% to {\em not\/} stretch the baselines.
+% \begin{macrocode}
+\renewcommand\baselinestretch{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\unitindent}
+% These document classes all use a single dimension for a number of
+% layout parameters:
+% \begin{itemize}
+% \item the label width in section heading,
+% \item the |\parindent|
+% \item the footnote label indent (= half |\unitindent|)
+% \item listindent on the first level
+% \end{itemize}
+% \begin{macrocode}
+\newdimen\unitindent
+% \end{macrocode}
+% The default setting accomodates three levels of single digit
+% section numbering.
+% \begin{macrocode}
+{\setbox0\hbox{\normalsize\rmfamily 2.2.2\hskip.5em}
+ \global\unitindent=\wd0}
+% \end{macrocode}
+%
+% \begin{macro}{\othermargin}
+% Other indentations are maximal label width plus white space.
+% \begin{macrocode}
+\newdimen\othermargin
+{\setbox0\hbox{\normalsize (m)\hskip.6em}\global\othermargin=\wd0}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{if@needwriteindent}
+% If this is not enough, a new width is calculated, set, and the
+% file{.aux} file contains an instruction that will set
+% |\unitindent| on the next run.
+%
+% For this we need a switch
+% \begin{macrocode}
+\newif\if@needwriteindent
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@indentset}
+% And a command that sets the various parameters.
+% \begin{macrocode}
+\newcommand\@indentset{%
+%<-type3> \global\parindent=\unitindent
+ \global\leftmargini=\unitindent
+ \global\@needwriteindenttrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@writeindent}
+% The |\end{document}| command will call |\@writeindent| to write
+% the final width of |\unitindent| on the \file{.aux} file. Also a
+% command is written to set |\unitindent|. To be compatible with
+% other document classes a check is written to the \file{.aux} file
+% for the existence of |\unitindent|. This prevents nasty errors
+% when another document class is used.
+% \begin{macrocode}
+\newcommand\@writeindent[1]{\immediate\write\@mainaux
+ {\string\@ifundefined{unitindent}{\string\newdimen\string\unitindent
+ \let\string\@indentset\relax}{}}
+ \immediate\write\@mainaux{\global\string\unitindent=#1\string\relax
+ \string\@indentset \string\relax}}
+% \end{macrocode}
+% \end{macro}
+%
+% We need to use the hook into |\end{document}| to write the final
+% value of |\unitindent| om the file{.aux} file for the next run.
+% \begin{macrocode}
+\AtEndDocument{%
+ \if@filesw
+ \if@needwriteindent
+ \@writeindent{\the\unitindent}
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parskip}
+% \begin{macro}{\parindent}
+% |\parskip| gives extra vertical space between paragraphs and
+% |\parindent| is the width of the paragraph indentation. The value
+% of |\parindent| depends on whether we are in two column mode.
+% \begin{macrocode}
+%<*type1>
+\setlength\parskip{0\p@}
+\setlength\parindent{\unitindent}
+%</type1>
+%<*type3>
+\setlength\parskip{.5\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip}
+\setlength\parindent{\z@}
+%</type3>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@lowpenalty}
+% \begin{macro}{\@medpenalty}
+% \begin{macro}{\@highpenalty}%
+% The commands |\nopagebreak| and |\nolinebreak| put in penalties
+% to discourage these breaks at the point they are put in.
+% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|,
+% dependent on their argument.
+% \begin{macrocode}
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\clubpenalty}
+% \begin{macro}{\widowpenalty}
+% These penalties are use to discourrage club and widow lines.
+% Because we use their default values we only show them here,
+% commented out.
+% \begin{macrocode}
+% \clubpenalty 150
+% \widowpenalty 150
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\displaywidowpenalty}
+% \begin{macro}{\predisplaypenalty}
+% \begin{macro}{\postdisplaypenalty}
+% Discourrage (but not so much) widows in front of a math display
+% and forbid breaking directly in front of a display. Allow break
+% after a display without a penalty. Again the default values are
+% used, therefore we only show them here.
+% \begin{macrocode}
+% \displaywidowpenalty 50
+% \predisplaypenalty 10000
+% \postdisplaypenalty 0
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\interlinepenalty}
+% Allow the breaking of a page in the middle of a paragraph.
+% \begin{macrocode}
+% \interlinepenalty 0
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\brokenpenalty}
+% We allow the breaking of a page after a hyphenated line.
+% \begin{macrocode}
+% \brokenpenalty 0
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Float placement parameters}
+%
+% All float parameters are given default values in the \LaTeXe{}
+% kernel. For this reason counters only need to be set with
+% |\setcounter| and other parameters are set using |\renewcommand|.
+%
+% \paragraph{Limits for the placement of floating objects}
+%
+% \begin{macro}{\c@topnumber}
+% The \Lcount{topnumber} counter holds the maximum number of
+% floats that can appear on the top of a text page.
+% \begin{macrocode}
+\setcounter{topnumber}{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\topfraction}
+% This indicates the maximum part of a text page that can be
+% occupied by floats at the top.
+% \begin{macrocode}
+\renewcommand\topfraction{.7}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@bottomnumber}
+% The \Lcount{bottomnumber} counter holds the maximum number of
+% floats that can appear on the bottom of a text page.
+% \begin{macrocode}
+\setcounter{bottomnumber}{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bottomfraction}
+% This indicates the maximum part of a text page that can be
+% occupied by floats at the bottom.
+% \begin{macrocode}
+\renewcommand\bottomfraction{.3}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@totalnumber}
+% This indicates the maximum number of floats that can appear on
+% any text page.
+% \begin{macrocode}
+\setcounter{totalnumber}{3}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textfraction}
+% This indicates the minimum part of a text page that has to be
+% occupied by text.
+% \begin{macrocode}
+\renewcommand\textfraction{.2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatpagefraction}
+% This indicates the minimum part of a page that has to be
+% occupied by floating objects before a `float page' is produced.
+% \begin{macrocode}
+\renewcommand\floatpagefraction{.5}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@dbltopnumber}
+% The \Lcount{dbltopnumber} counter holds the maximum number of
+% two column floats that can appear on the top of a two column text
+% page.
+% \begin{macrocode}
+\setcounter{dbltopnumber}{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dbltopfraction}
+% This indicates the maximum part of a two column text page that
+% can be occupied by two column floats at the top.
+% \begin{macrocode}
+\renewcommand\dbltopfraction{.7}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dblfloatpagefraction}
+% This indicates the minimum part of a page that has to be
+% occupied by two column wide floating objects before a `float
+% page' is produced.
+% \begin{macrocode}
+\renewcommand\dblfloatpagefraction{.5}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Page Styles}
+%
+% The page style \pstyle{foo} is defined by defining the command
+% |\ps@foo|. This command should make only local definitions.
+% There should be no stray spaces in the definition, since they
+% could lead to mysterious extra spaces in the output (well, that's
+% something that should be always avoided).
+%
+% \begin{macro}{\@evenhead}
+% \begin{macro}{\@oddhead}
+% \begin{macro}{\@evenfoot}
+% \begin{macro}{\@oddfoot}
+% The |\ps@...| command defines the macros |\@oddhead|,
+% |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running
+% heads and feet---e.g., |\@oddhead| is the macro to produce the
+% contents of the heading box for odd-numbered pages. It is called
+% inside an |\hbox| of width |\textwidth|.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\thispagestyle}
+% Several commands (|\index|, |\maketitle|) give a
+% |\thispagestyle{plain}| command, which will overrule a
+% |\pagestyle{empty}| command. This situation is almost always
+% unwanted. Therefore we provide a more careful definition.
+%
+% First save the original definition.
+% \begin{macrocode}
+\let\Thispagestyle\thispagestyle
+% \end{macrocode}
+% Then we provide the new definition, for which we must also adapt
+% |\pagestyle| a little.
+% \begin{macrocode}
+\newcommand\@emptypagestyle{empty}
+\renewcommand\pagestyle[1]{\@nameuse{ps@#1}\def\@currentpagestyle{#1}}
+\renewcommand\thispagestyle[1]{%
+ \ifx\@currentpagestyle\@emptypagestyle
+ \else
+ \global\@specialpagetrue
+ \gdef\@specialstyle{#1}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Marking conventions}
+%
+% To make headings determined by the sectioning commands, the page
+% style defines the commands |\chaptermark|, |\sectionmark|,
+% \ldots,\\
+% where |\chaptermark{|\meta{TEXT}|}| is called by
+% |\chapter| to set a mark, and so on.
+%
+% The |\...mark| commands and the |\...head| macros are defined
+% with the help of the following macros. (All the |\...mark|
+% commands should be initialized to no-ops.)
+%
+% \LaTeX{} extends \TeX's |\mark| facility by producing two kinds
+% of marks, a `left' and a `right' mark, using the following
+% commands:
+% \begin{flushleft}
+% |\markboth{|\meta{LEFT}|}{|\meta{RIGHT}|}|: Adds both marks.
+%
+% |\markright{|\meta{RIGHT}|}|: Adds a `right' mark.
+%
+% |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
+% or |\@evenfoot| macros, it gets the current `left'
+% mark. |\leftmark| works like \TeX's |\botmark|
+% command.
+%
+% |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
+% or |\@evenfoot| macros, it gets the current
+% `right' mark. |\rightmark| works like \TeX's
+% |\firstmark| command.
+% \end{flushleft}
+%
+% The marking commands work reasonably well for right marks
+% `numbered within' left marks--e.g., the left mark is changed by a
+% |\chapter| command and the right mark is changed by a |\section|
+% command. However, it does produce somewhat anomalous results if
+% two |\markboth|'s occur on the same page.
+%
+%
+% Commands like |\tableofcontents| that should set the marks in some
+% page styles use a |\@mkboth| command, which is |\let| by the
+% pagestyle command (|\ps@...|) to |\markboth| for setting the
+% heading or to |\@gobbletwo| to do nothing.
+%
+%
+% \begin{macrocode}
+% %%%\mark{{}{}} % Initializes TeX's marks <--- can vanish
+% \end{macrocode}
+%
+% \subsubsection{Defining the page styles}
+% \label{sec:pagestyle}
+%
+% The pagestyle \pstyle{empty} is defined in \file{latex.dtx}, but
+% the pagestyle \pstyle{plain} is slightly altered here. The
+% difference is that the page numbers are set flush right in
+% onesided and flush left and right in the twosided style.
+%
+% \begin{macro}{\ps@plain}
+%
+% \begin{macrocode}
+\renewcommand\ps@plain{%
+% \end{macrocode}
+% The running head are empty in this pagestyle, the page number
+% appears in the running foot.
+% \begin{macrocode}
+ \let\@oddhead\@empty\let\@evenhead\@empty
+ \def\@oddfoot{\hfil\PageFont\thepage}%
+ \if@twoside
+ \def\@evenfoot{\PageFont\thepage\hfil}%
+ \else
+ \let\@evenfoot\@oddfoot
+ \fi
+% \end{macrocode}
+% Because the running heads should be empty we |let| |\@mkboth| to
+% |\@gobbletwo|, thus disabling the mark commands.
+% \begin{macrocode}
+ \let\@mkboth\@gobbletwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@headings}
+% The definition of the page style \pstyle{headings} has to be
+% different for two sided printing than it is for one sided
+% printing.
+%
+% \begin{macrocode}
+\if@twoside
+ \def\ps@headings{%
+% \end{macrocode}
+% The running feet are empty in this page style, the running head
+% contains the page number and one of the marks.
+% \begin{macrocode}
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{{\PageFont\thepage}\hfil\MarkFont\leftmark}%
+ \def\@oddhead{{\MarkFont\rightmark}\hfil\PageFont\thepage}%
+% \end{macrocode}
+%
+% When using this page style, the contents of the running head is
+% determined by the chapter and section titles. So we |\let|
+% |\@mkboth| to |\markboth|.
+% \begin{macrocode}
+ \let\@mkboth\markboth
+% \end{macrocode}
+%
+% In thisdocument class we use the |\chaptermark|
+% and |\sectionmark| macros to fill the running heads.
+%
+% Note the use of |##1| for the parameter of the |\chaptermark|
+% command, which will be defined when |\ps@headings| is executed.
+%
+% \begin{macrocode}
+ \def\chaptermark##1{%
+ \markboth {\uppercase{\ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\uppercase{\ifnum \c@secnumdepth >\z@
+ \thesection. \ \fi
+ ##1}}}}
+% \end{macrocode}
+%
+% The definition of |\ps@headings| for one sided printing can be
+% much simpler, because we treat even and odd pages the same.
+% Therefore we don't need to define |\@even...|.
+% \begin{macrocode}
+\else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{{\MarkFont\rightmark}\hfil\PageFont\thepage}%
+ \let\@mkboth\markboth
+% \end{macrocode}
+% We use |\markright| now instead of |\markboth| as we did for two
+% sided printing.
+% \begin{macrocode}
+ \def\chaptermark##1{%
+ \markright {\uppercase{\ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ \fi
+ ##1}}}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@myheadings}
+% The definition of the page style \pstyle{myheadings} is fairly
+% simple because the user determines the contents of the running
+% head himself by using the |\markboth| and |\markright| commands.
+%
+% \begin{macrocode}
+\def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{{\PageFont\thepage}\hfil\MarkFont\leftmark}%
+ \def\@oddhead{{\MarkFont\rightmark}\hfil\PageFont\thepage}%
+% \end{macrocode}
+%
+% We have to make sure that the marking commands that are used by
+% the chapter and section headings are disabled. We do this
+% |\let|ting them to a macro that gobbles its argument(s).
+% \begin{macrocode}
+ \let\@mkboth\@gobbletwo
+ \let\chaptermark\@gobble
+ \let\sectionmark\@gobble
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PageFont}
+% \begin{macro}{\MarkFont}
+% These macros are use to store the fonts that are used to typeset
+% the pagenumber (|\PageFont|) and the marks (|\MarkFont|) in the
+% running head and feet.
+% \begin{macrocode}
+\newcommand\PageFont{\rmfamily}
+\newcommand\MarkFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\RunningFonts}
+% Use this macro to change the fonts that are used in the running
+% heads.
+% \begin{macrocode}
+\newcommand\RunningFonts[2]{%
+ \renewcommand\PageFont{#1}\renewcommand\MarkFont{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Document Markup}
+%
+% \subsection{The title}
+%
+% \begin{macro}{\title}
+% \begin{macro}{\author}
+% \begin{macro}{\date}
+% These three macros are provided by \file{latex.dtx} to provide
+% information about the title, author(s) and date of the document.
+% The information is stored away in internal control sequences.
+% It is the task of the |\maketitle| command to use the
+% information provided. The definitions of these macros are shown
+% here for information.
+% \begin{macrocode}
+% \newcommand\title[1]{\gdef\@title{#1}}
+% \newcommand\author[1]{\gdef\@author{#1}}
+% \newcommand\date[1]{\gdef\@date{#1}}
+% \end{macrocode}
+% The |\date| macro gets today's date by default.
+% \begin{macrocode}
+% \gdef\@date{\today}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\TitleFont}
+% This selects the font to use in the title of the document.
+% \begin{macrocode}
+\newcommand\TitleFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\maketitle}
+% The definition of |\maketitle| depends on whether a seperate
+% title page is made. This is the default for this document class.
+% Note that the title, author and date information is printed in
+% capital letters by default. This can be changed by the option
+% \Lopt{mctitle}.
+%
+% When we are making a title page, we locally redefine
+% |\footnotesize| and |\footnoterule| to change the appearance of
+% the footnotes that are produced by the |\thanks| command.
+% \begin{macrocode}
+\renewcommand\TitleFont{\rmfamily}
+\newcommand\maketitle{%
+ \begin{titlepage}%
+ \let\footnotesize\small
+ \let\footnoterule\relax
+% \end{macrocode}
+% Footnotes on the titlepage, generated by the use of |\thanks|,
+% use symbols in these document classes.
+% \begin{macrocode}
+ \long\def\@makefntext##1{\parindent\z@
+ \def\labelitemi{--}\@revlabeltrue
+ \leavevmode$\m@th^{\@thefnmark}$\kern1em\relax ##1}
+ \renewcommand\thefootnote{\fnsymbol{footnote}}%
+% \end{macrocode}
+% We center the entire title vertically; the centering is set off a
+% little by adding a |\vskip|. In compatibility mode the pagenumber
+% is set to 0 to keep the behaviour of \LaTeX\ 2.09 style files
+% \begin{macrocode}
+ \if@compatibility\setcounter{page}{0}\fi
+ \null\vfil
+ \vskip 60\p@
+% \end{macrocode}
+% Then we set the title, in a |\LARGE| font; leave a little space
+% and set the author(s) in a |\large| font. We do this inside a
+% tabular environment to get them in a single column.
+% Before the date we leave a little whitespace again.
+% \begin{macrocode}
+ \begin{center}%
+ \TitleFont
+ {\LARGE \def\\{\penalty -\@M}
+ \if@allcaps
+ \expandafter\uc@nothanks\@title\thanks\relax
+ \else
+ \@title
+ \fi\par}%
+ \vskip 3em%
+ {\large
+ \lineskip .75em \parindent\z@
+ \begin{tabular}[t]{c}%
+ \if@allcaps
+ \expandafter\uc@authornothanks\@author\and\relax
+ \else
+ \@author
+ \fi
+ \end{tabular}\par}%
+ \vskip 1.5em%
+ {\large
+ \if@allcaps
+ \uppercase\expandafter{\@date}%
+ \else
+ \@date
+ \fi\par}%
+ \end{center}\par
+% \end{macrocode}
+% Then we call |\@thanks| to print the information that goes into
+% the footnote and finish the page.
+% \begin{macrocode}
+ \@thanks
+ \vfil\null
+ \end{titlepage}%
+% \end{macrocode}
+% We reset the \Lcount{footnote} counter, disable |\thanks| and
+% |\maketitle| and save some storage space by emptying the internal
+% information macros.
+% \begin{macrocode}
+ \setcounter{footnote}{0}%
+ \let\thanks\relax\let\maketitle\relax
+ \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
+% \end{macrocode}
+%
+% We want to have the title, author and date information in
+% uppercase, but we have to be very carefull not to put too much
+% text in uppercase. The macros that perform the filtering of texts
+% that shouldn't be in uppercase were developped with th help of
+% Howard Trickey.
+%
+% \begin{macro}{\uc@nothanks}
+% This macro takes all the text up to the first use of |\thanks|
+% and passes it to |\uppercase|. The use of |\futurelet| will store
+% the token \emph{after} the |\thanks| in |\@tempa|. The macro
+% |\u@tx| uses that information to determine what to do next.
+% \begin{macrocode}
+\def\uc@nothanks#1\thanks{\uppercase{#1}\futurelet\@tempa\uc@tx}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@authornothanks}
+% A document can have more than one author. Usually they are
+% seperated with |\and|. For each author a footnote --using
+% |\thanks| can be present. Therefore this macro takes all the text
+% up to the first use of |\and|, thus picking up all the
+% information for one author. This is than passsed to
+% |\uc@nothanks|, which checks for the presence of |\thanks|. For
+% this to work the argument of |\uc@nothanks| has to be delimited
+% by |\thanks\relax|.
+% \begin{macrocode}
+\def\uc@authornothanks#1\and{\uc@nothanks#1\thanks\relax
+% \end{macrocode}
+% Then we have to check whether the |\and| we ound earlier was put
+% in by the user, in which case information for another user will
+% follow, or by the call from another macro, in which case the
+% |\and| will be followed by a |\relax| token. The |\futurelet|
+% contstruct stores the first token \emph{after} the |\and| in
+% |\@tempa| to be inspected by |\u@ax|.
+% \begin{macrocode}
+ \futurelet\@tempa\uc@ax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@ax}
+% When |\@tempa| contains a |\relax| token nothing needs to be
+% done, when it doesn't we put in a linebreak |\\| the word `and'
+% (stored in |\andname| so that this control sequence can be
+% redeined for other languages), another linebreak and we call
+% |\uc@authornothanks| to continue processing. The |\expandafter|
+% lets \TeX\ see the |\fi| first.
+% \begin{macrocode}
+\def\uc@ax{%
+ \ifx\@tempa\relax
+ \else
+ \\ \andname \\ \expandafter\uc@authornothanks
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@tx}
+% This macro simply checks whether |\@tempa| contains a |\relax|
+% token. When it doesn't further processing is performed by
+% |\u@ty|.
+% \begin{macrocode}
+\def\uc@tx{\ifx\@tempa\relax
+ \else \expandafter\uc@ty \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@ty}
+% The macro |\uc@ty| gets executed when the |\thanks| that
+% delimited text earlier on in the processing had a real argument.
+% In that case it was a |\thanks| put in by the user, \emph{not} by
+% these macros. Therefore the argument is now passed to |\thanks|
+% and processing continues by calling |\uc@nothanks|.
+% \begin{macrocode}
+\def\uc@ty#1{\thanks{#1}\uc@nothanks}
+% \end{macrocode}
+% \end{macro}
+%
+% When the title is not on a page of its own, the layout of the
+% title is a little different. We use symbols to mark the footnotes
+% and we have to deal with two column documents.
+%
+% Therefore we first start a new group to keep changes local. Then
+% we redefine |\thefootnote| to use |\fnsymbol|; and change
+% |\@makefnmark| so that footnotemarks have zero width (to make the
+% centering of the author names look better). We also want raised
+% footnotemarkers in the footnotes here.
+% \begin{macrocode}
+\else
+\newcommand\maketitle{\par
+ \begingroup
+ \renewcommand\thefootnote{\fnsymbol{footnote}}%
+ \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
+ \def\@makefntext{\@xmakefntext{$\m@th^{\@thefnmark}$}}%
+% \end{macrocode}
+% If this is a twocolumn document we start a new page in twocolumn
+% mode, with the title set to the full width of the text. The
+% actual printing of the title information is left to
+% |\@maketitle|.
+% \begin{macrocode}
+ \if@twocolumn
+ \ifnum \col@number=\@ne
+ \@maketitle
+ \else
+ \twocolumn[\@maketitle]%
+ \fi
+ \else
+% \end{macrocode}
+% When this is not a twocolumn document we just start a new page,
+% prevent floating objects from appearing on the top of this page
+% and print the title information.
+% \begin{macrocode}
+ \newpage
+ \global\@topnum\z@
+ \@maketitle
+ \fi
+% \end{macrocode}
+% This page gets a \pstyle{plain} layout. We call |\@thanks| to
+% produce the footnotes.
+% \begin{macrocode}
+ \thispagestyle{plain}\@thanks
+% \end{macrocode}
+% Now we can close the group, reset the \Lcount{footnote} counter,
+% disable |\thanks|, |\maketitle| and |\@maketitle| and save some
+% storage space by emptying the internal information macros.
+% \begin{macrocode}
+ \endgroup
+ \setcounter{footnote}{0}%
+ \let\thanks\relax
+ \let\maketitle\relax\let\@maketitle\relax
+ \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
+% \end{macrocode}
+%
+% \begin{macro}{\@maketitle}
+% This macro takes care of formatting the title information when we
+% have no seperate title page.
+%
+% We always start a new page, leave some white space and center the
+% information. The title is set in a |\LARGE| font, the author
+% names and the in a |\large| font.
+% \begin{macrocode}
+\def\@maketitle{%
+ \newpage
+ \null
+ \vskip 2em%
+%<+type3>\if@titlecentered
+ \begin{center}%
+ {\LARGE \TitleFont \@title \par}%
+ \vskip 1.5em%
+ {\large \TitleFont
+ \lineskip .5em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1em%
+ {\large \TitleFont \@date}%
+ \end{center}%
+%<*type3>
+ \else
+ {\LARGE \TitleFont \head@style \@title \par} \vskip 1.5em
+ {\large \TitleFont \lineskip .5em \tabcolsep\z@
+ \def\and{%%% \begin{tabular} has already started
+ \end{tabular}\hskip 1em plus .17fil
+ \begin{tabular}[t]{l}}%% \end{tabular} will come
+ \begin{tabular}[t]{l}\@author\end{tabular}\par}
+ \vskip 1em {\large \TitleFont \@date}
+ \fi
+%</type3>
+ \par
+ \vskip 1.5em}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Chapters and Sections}
+%
+% \subsubsection{Building blocks}
+% The definitions in this part of the class file make use of two
+% macros, |\@startsection| and |\secdef|, which are defined by
+% \file{latex.dtx}. To understand what is going on here, we
+% describe their syntax.
+%
+% The macro |\@startsection| has 6 required arguments, optionally
+% followed by a $*$, an optional argument and a required argument:
+%
+% |\@startsection|\meta{name}\meta{level}\meta{indent}^^A
+% \meta{beforeskip}\meta{afterskip}\meta{style}
+% optional *\\
+% \null\hphantom{\bslash @startsection}^^A
+% |[|\meta{altheading}|]|\meta{heading}
+%
+% It is a generic command to start a section, the arguments have
+% the following meaning:
+%
+% \begin{description}
+% \item[\meta{name}] The name of the user level command, e.g.,
+% `section'.
+% \item[\meta{level}] A number, denoting the depth of the section
+% -- e.g., chapter=1, section = 2, etc. A section number
+% will be printed if and only if \meta{level} $<=$ the value
+% of the \Lcount{secnumdepth} counter.
+% \item[\meta{indent}] The indentation of the heading from the left
+% margin
+% \item[\meta{beforeskip}] The absolute value of this argument
+% gives the skip to leave above the heading. If it is
+% negative, then the paragraph indent of the text following
+% the heading is suppressed.
+% \item[\meta{afterskip}] If positive, this gives the skip to leave
+% below the heading, else it gives the skip to leave to the
+% right of a run-in heading.
+% \item[\meta{style}] Commands to set the style of the heading.
+% \item[$*$] When this is missing the heading is numbered and the
+% corresponding counter is incremented.
+% \item[\meta{altheading}] Gives an alternative heading to use in
+% the table of contents and in the running heads. This should
+% be present when the $*$ form is used.
+% \item[\meta{heading}] The heading of the new section.
+% \end{description}
+% A sectioning command is normally defined to |\@startsection| and
+% its first six arguments.
+%
+% The macro |\secdef| can be used when a sectioning command is
+% defined without using |\@startsection|. It has two arguments:
+%
+% |\secdef|\meta{unstarcmds}\meta{starcmds}
+%
+% \begin{description}
+% \item[\meta{unstarcmds}] Used for the normal form of the
+% sectioning command.
+% \item[\meta{starcmds}] Used for the $*$-form of the
+% sectioning command.
+% \end{description}
+%
+% You can use |\secdef| as follows:
+% \begin{verbatim}
+% \def\chapter { ... \secdef \CMDA \CMDB }
+% \def\CMDA [#1]#2{ ... } % Command to define
+% % \chapter[...]{...}
+% \def\CMDB #1{ ... } % Command to define
+% % \chapter*{...}
+% \end{verbatim}
+%
+% \begin{macro}{\head@style}
+% In the definition of chapter and section commands a number of
+% settings frequently occur. Therefore we store them in a control
+% sequence.
+%
+% Section headings are to be set extremely raggedright, with no
+% hyphenations, not even at explicit hyphens.
+%
+% \begin{macrocode}
+\newcommand\head@style{%
+ \interlinepenalty \@M
+ \hyphenpenalty=\@M \exhyphenpenalty=\@M
+ \rightskip=0cm plus .7\hsize\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect}
+% The definition of this macro from \file{latex.dtx} needs to be
+% repeated here because we want to modify its behaviour with
+% respect to:
+% \begin{enumerate}
+% \item the width of the number, which is fixed;
+% \item checking the value of |\unitindent|;
+% \item formatting the section title ragged right;
+% \item changing the argument of |\contentsline|.
+% \end{enumerate}
+% \begin{macrocode}
+\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty\else
+ \refstepcounter{#1}%
+% \end{macrocode}
+% The following code (within the group) checks the value of
+% |\unitindent|. If the sectionnumber is wider than |\unitindent|
+% its value is adapted and a flag is set to rememeber to store the
+% new value in the \file{.aux}-file.
+% \begin{macrocode}
+ \begingroup
+ \setbox\@tempboxa=\hbox{#6\relax
+ \csname the#1\endcsname
+ \hskip.5em}
+ \ifdim\wd\@tempboxa>\unitindent
+ \global\unitindent=\wd\@tempboxa
+ \@indentset
+ \fi
+ \endgroup
+ \let\@@protect\protect
+ \def\protect{\noexpand\protect\noexpand}%
+ \edef\@svsec{\@seccntformat{#1}}%
+ \let\protect\@@protect\fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup #6\relax
+ \@hangfrom{\hskip #3\relax\@svsec}{\head@style #8\par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth
+ \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ \toc@font#2 #7}%
+ \else
+ \def\@svsechd{#6\hskip #3\relax
+ \@svsec #8\csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth
+ \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ \toc@font#2 #7}}%
+ \fi
+ \@xsect{#5}}
+% \end{macrocode}
+% This macro was introduced in \LaTeXe, its definition is changed
+% here to get the fixed with of the section number.
+% \begin{macrocode}
+\def\@seccntformat#1{%
+ \hbox to \unitindent{\csname the#1\endcsname \hfil}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ssect}
+% Similar changes need to be made to the definition of |\@ssect|,
+% which is used in `starred' sections.
+% \begin{macrocode}
+\def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup #4\relax
+ \@hangfrom{\hskip #1}{\head@style #5\par}\endgroup
+ \else \def\@svsechd{#4\hskip #1\relax #5}\fi
+ \@xsect{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Mark commands}
+%
+% \begin{macro}{\chaptermark}
+% \begin{macro}{\sectionmark}
+% \begin{macro}{\subsectionmark}
+% \begin{macro}{\subsubsectionmark}
+% \begin{macro}{\paragraphmark}
+% \begin{macro}{\subparagraphmark}
+% Default initializations of |\...mark| commands. These commands
+% are used in the definition of the page styles (see
+% section~\ref{sec:pagestyle}) Most of them are already defined by
+% \file{latex.ltx}, so they are only shown here.
+%
+% \begin{macrocode}
+\newcommand\chaptermark[1]{}
+% \newcommand\sectionmark[1]{}
+% \newcommand\subsectionmark[1]{}
+% \newcommand\subsubsectionmark[1]{}
+% \newcommand\paragraphmark[1]{}
+% \newcommand\subparagraphmark[1]{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Define Counters}
+%
+% \begin{macro}{\c@secnumdepth}
+% The value of the counter \Lcount{secnumdepth} gives the depth of
+% the highest-level sectioning command that is to produce section
+% numbers.
+% \begin{macrocode}
+\setcounter{secnumdepth}{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@part}
+% \begin{macro}{\c@chapter}
+% \begin{macro}{\c@section}
+% \begin{macro}{\c@subsection}
+% \begin{macro}{\c@subsubsection}
+% \begin{macro}{\c@paragraph}
+% \begin{macro}{\c@subparagraph}
+% These counters are used for the section numbers. The macro\\
+% |\newcounter{|\meta{newctr}|}[|\meta{oldctr}|]|\\
+% defines \meta{newctr} to be a counter, which is reset to zero when
+% counter \meta{oldctr} is stepped. Counter \meta{oldctr} must
+% already be defined.
+%
+% \begin{macrocode}
+\newcounter {part}
+\newcounter {chapter}
+\newcounter {section}[chapter]
+\newcounter {subsection}[section]
+\newcounter {subsubsection}[subsection]
+\newcounter {paragraph}[subsubsection]
+\newcounter {subparagraph}[paragraph]
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\thepart}
+% \begin{macro}{\thechapter}
+% \begin{macro}{\thesection}
+% \begin{macro}{\thesubsection}
+% \begin{macro}{\thesubsubsection}
+% \begin{macro}{\theparagraph}
+% \begin{macro}{\thesubparagraph}
+% For any counter \Lcount{CTR}, |\theCTR| is a macro that defines
+% the printed version of counter \Lcount{CTR}. It is defined in
+% terms of the following macros:
+%
+% |\arabic{|\Lcount{COUNTER}|}| prints the value of
+% \Lcount{COUNTER} as an arabic numeral.
+%
+% |\roman{|\Lcount{COUNTER}|}| prints the value of
+% \Lcount{COUNTER} as a lowercase roman numberal.
+%
+% |\Roman{|\Lcount{COUNTER}|}| prints the value of
+% \Lcount{COUNTER} as an uppercase roman numberal.
+%
+% |\alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
+% as a lowercase letter: $1 =$~a, $2 =$~ b, etc.
+%
+% |\Alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
+% as an uppercase letter: $1 =$~A, $2 =$~B, etc.
+%
+% \begin{macrocode}
+\renewcommand\thepart {\Roman{part}}
+\renewcommand\thechapter {\arabic{chapter}}
+\renewcommand\thesection {\thechapter.\arabic{section}}
+\renewcommand\thesubsection {\thesection.\arabic{subsection}}
+\renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
+\renewcommand\theparagraph {\thesubsubsection.\arabic{paragraph}}
+\renewcommand\thesubparagraph {\theparagraph.\arabic{subparagraph}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@chapapp}
+% |\@chapapp| is initially defined to be `|\chaptername|'. The
+% |\appendix| command redefines it to be `|\appendixname|'.
+%
+% \begin{macrocode}
+\newcommand\@chapapp{\chaptername}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Parts}
+%
+% \begin{macro}{\part}
+% The command to start a new part of our document.
+%
+% We start a new (righthand) page and use the \pstyle{empty}.
+% \begin{macrocode}
+\newcommand\part{\cleardoublepage
+ \thispagestyle{empty}%
+% \end{macrocode}
+% When we are making a two column document, this will be a one
+% column page. We use |@tempswa| to remember to switch back to two
+% columns.
+% \begin{macrocode}
+ \if@twocolumn
+ \onecolumn
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+% \end{macrocode}
+% We need an empty box to prevent the fil glue from disappearing.
+% \begin{macrocode}
+ \hbox{}\vfil
+% \end{macrocode}
+% Here we use |\secdef| to indicate wwhich commands to use to make
+% the actual heading.
+% \begin{macrocode}
+ \secdef\@part\@spart}
+% \end{macrocode}
+%
+% \begin{macro}{\@part}
+% This macro does the actual formatting of the title of the part.
+%
+% \begin{macro}{\PartFont}
+% The font used to typeset the part is stored in this maro.
+% \begin{macrocode}
+\newcommand\PartFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% When \Lcount{secnumdepth} is larger than $-2$ for this document
+% class, we have a numbered part, otherwise it is unnumbered.
+% \begin{macrocode}
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}\toc@case{#1}}%
+ \else
+ \addcontentsline{toc}{part}{\toc@case{#1}}%
+ \fi
+% \end{macrocode}
+% We empty the mark registers and center the title on the page.
+% Also we prevent breaking between lines and reset the font.
+% \begin{macrocode}
+ \markboth{}{}
+ {\centering
+ \interlinepenalty \@M
+ \reset@font
+% \end{macrocode}
+% When this is a numbered part we have to print the number. We have
+% to expand |\partname| before |\uppercase| is called, therefore we
+% use a temporary control sequence that, when called will execute
+% |\uppercase| on the contents of |\partname|.
+% \begin{macrocode}
+ \ifnum \c@secnumdepth >-2\relax
+ \Large\PartFont
+ \edef\@tempa{\noexpand\uppercase{\partname}}\@tempa~\thepart
+ \par
+% \end{macrocode}
+% We leave some space before we print the title and leave the
+% finishing up to |\@endpart|.
+% \begin{macrocode}
+ \vskip 20\p@
+ \fi
+ \Large \PartFont \uppercase{#2}\par}%
+ \@endpart}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@spart}
+% This macro does the actual formatting of the title of the part
+% when the star form of the user command was used. In this case we
+% {\em never} print a number. Otherwise the formatting is the same.
+%
+% \begin{macrocode}
+\def\@spart#1{%
+ {\centering
+ \interlinepenalty \@M
+ \reset@font
+ \Large \PartFont #1\par}%
+ \@endpart}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@endpart}
+% This macro finishes the part page, for both |\@part| and
+% |\@spart|.
+%
+% First we fill the current page.
+% \begin{macrocode}
+\def\@endpart{\vfil\newpage
+% \end{macrocode}
+% Then, when we are in twosided mode, we produce a completely blank
+% page.
+% \begin{macrocode}
+ \if@twoside
+ \hbox{}%
+ \thispagestyle{empty}%
+ \newpage
+ \fi
+% \end{macrocode}
+% When this was a two column document we have to switch back to two
+% column mode.
+% \begin{macrocode}
+ \if@tempswa
+ \twocolumn
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Chapters}
+%
+% \begin{macro}{\chapter}
+% A chapter should always start on a new page therefore we start by
+% calling |\clearpage| and setting the pagestyle for this page to
+% \pstyle{plain}.
+% \begin{macrocode}
+\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
+ \thispagestyle{plain}%
+% \end{macrocode}
+% Then we prevent floats from appearing at the top of this page
+% because it looks weird to see a floating object above a chapter
+% title.
+% \begin{macrocode}
+ \global\@topnum\z@
+% \end{macrocode}
+% Then we suppress the indentation of the first paragraph by
+% setting the switch |\@afterindent| to |false|. We use |\secdef|
+% to specify the macros to use for actually setting the chapter
+% title.
+% \begin{macrocode}
+ \@afterindentfalse
+ \secdef\@chapter\@schapter}
+% \end{macrocode}
+%
+% \begin{macro}{\@chapter}
+% This macro is called when we have a numbered chapter. When
+% \Lcount{secnumdepth} is larger than $-1$ we display the chapter
+% number. We also inform the user that a new chapter is about to be
+% typeset by writing a message to the terminal.
+% \begin{macrocode}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}\toc@font0 #1}%
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 #1}%
+ \fi
+% \end{macrocode}
+% After having written an entry to the table of contents we store
+% the (alternative) title of this chapter with |\chaptermark| and
+% add some white space to the lists of figures and tables.
+% \begin{macrocode}
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+% \end{macrocode}
+% Then we call upon |\@makechapterhead| to format the actual
+% chapter title. We have to do this in a special way when we are in
+% twocolumn mode in order to have the chapter title use the entire
+% |\textwidth|. In one column mode we call |\@afterheading| which
+% takes care of suppressing the indentation.
+% \begin{macrocode}
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\ChapFont}
+% The font used to typeset the chapters is stored in this maro.
+% \begin{macrocode}
+\newcommand\ChapFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makechapterhead}
+% The macro above uses |\@makechapterhead|\meta{text} to format the
+% heading of the chapter.
+%
+% We begin by leaving some white space. The we open a group in
+% which we have a paragraph indent of 0pt, and in which we have the
+% text set ragged right. We also reset the font.
+% \begin{macrocode}
+\def\@makechapterhead#1{%
+ \vspace*{50\p@ \@plus 5\p@}%
+ {\setlength\parindent{\z@}%
+ \setlength\parskip {\z@}%
+ \head@style \reset@font
+% \end{macrocode}
+% Then we check whether the number of the chapter has to be printed.
+% If so we leave some whitespace between the chapternumber and its
+% title.
+% \begin{macrocode}
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\ChapFont \@chapapp{} \thechapter
+ \par
+ \vskip 20\p@
+ \fi
+% \end{macrocode}
+% Now we set the title in a large bold font. We prevent a pagebreak
+% at this point and leave some whitespace before the text begins.
+% \begin{macrocode}
+ \Large \ChapFont #1\par
+ \nobreak
+ \vskip 40\p@
+ }}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@schapter}
+% This macro is called when we have an unnumbered chapter. It is
+% much simpler than |\@chapter| because it only needs to typeset
+% the chapter title.
+% \begin{macrocode}
+\def\@schapter#1{\if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\@makeschapterhead}
+% The macro above uses |\@makeschapterhead|\meta{text}to format
+% the heading of the chapter. It is similar to |\@makechapterhead|
+% except that it never has to print a chapter number.
+%
+% \begin{macrocode}
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@\@plus 5\p@}%
+ {\setlength\parindent{\z@}%
+ \setlength\parskip{\z@}%
+ \head@style
+ \reset@font
+ \Large \ChapFont #1\par
+ \nobreak
+ \vskip 40\p@
+ }}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Lower level headings}
+%
+% These commands all make use of |\@startsection|.
+% \begin{macro}{\section}
+% This gives a normal heading with white space above the heading
+% (the whitespace below the heading will be generated by the
+% |\parskip| that is inserted at the start of the first paragraph),
+% the title set in |\large\bfseries|, and no indentation on the
+% first paragraph.
+% \begin{macrocode}
+\newcommand\section{%
+ \@startsection {section}{1}{\z@}%
+ {-2\baselineskip\@plus -1\baselineskip \@minus -.5\baselineskip}%
+%<+type1> {.5\baselineskip}%
+%<+type3> {.01\baselineskip}%
+ {\reset@font\large\SectFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SectFont}
+% The font used to typeset the sections is stored in this maro.
+% \begin{macrocode}
+\newcommand\SectFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subsection}
+% This gives a normal heading with white space above the heading,
+% the title set in |\normalsize\bfseries|, and no indentation on
+% the first paragraph.
+% \begin{macrocode}
+\newcommand\subsection{%
+ \@startsection{subsection}{2}{\z@}%
+ {-1\baselineskip\@plus -.5\baselineskip \@minus -.25\baselineskip}%
+%<+type1> {.25\baselineskip}%
+%<+type3> {.01\baselineskip}%
+ {\reset@font\normalsize\SSectFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SSectFont}
+% The font used to typeset the subsections is stored in this maro.
+% \begin{macrocode}
+\newcommand\SSectFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subsubsection}
+% This gives a normal heading with white space above the heading,
+% the title set in |\normalsize\tm|, and no indentation on the
+% first paragraph.
+% \begin{macrocode}
+\newcommand\subsubsection{%
+ \@startsection{subsubsection}{3}{\z@}%
+ {-1\baselineskip plus -.5\baselineskip minus -.25\baselineskip}%
+%<+type1> {.25\baselineskip}%
+%<+type3> {.01\baselineskip}%
+ {\reset@font\normalsize\SSSectFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SSSectFont}
+% The font used to typeset the subsubsections is stored in this maro.
+% \begin{macrocode}
+\newcommand\SSSectFont{\rmfamily}
+\newcommand\SSSectFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\paragraph}
+% This gives a run-in heading with white space above and to the
+% right of the heading, the title set in |\normalsize\slshape|.
+% \begin{macrocode}
+\newcommand\paragraph{%
+ \@startsection{paragraph}{4}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\reset@font\normalsize\ParaFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\ParaFont}
+% The font used to typeset the paragraphs is stored in this maro.
+% \begin{macrocode}
+\newcommand\ParaFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subparagraph}
+% This gives an indented run-in heading with white space above and
+% to the right of the heading, the title set in
+% |\normalsize\slshape|.
+% \begin{macrocode}
+\newcommand\subparagraph{%
+ \@startsection{subparagraph}{5}{\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\reset@font\normalsize\SParaFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SParaFont}
+% The font used to typeset the subparagraphs is stored in this maro.
+% \begin{macrocode}
+\newcommand\SParaFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Headingfonts}
+% To change the fonts that are used to typeset the title,part,
+% chapter and section headings this macro can be used.
+% \begin{macrocode}
+\newcommand\HeadingFonts[8]{%
+ \renewcommand\TitleFont{#1}%
+ \renewcommand\PartFont{#2}%
+ \renewcommand\ChapFont{#3}%
+ \renewcommand\SectFont{#4}%
+ \renewcommand\SSectFont{#5}%
+ \renewcommand\SSSectFont{#6}%
+ \renewcommand\ParaFont{#7}%
+ \renewcommand\SParaFont{#8}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Lists}
+%
+% \subsubsection{General List Parameters}
+%
+% The following commands are used to set the default values for the list
+% environment's parameters. See the \LaTeX{} manual for an explanation
+% of the meanings of the parameters. Defaults for the list
+% environment are set as follows. First, |\rightmargin|,
+% |\listparindent| and |\itemindent| are set to 0pt. Then, for a Kth
+% level list, the command |\@listK| is called, where `K' denotes `i',
+% '`i', ... , `vi'. (I.e., |\@listiii| is called for a third-level
+% list.) By convention, |\@listK| should set |\leftmargin| to
+% |\leftmarginK|.
+%
+% \begin{macro}{\leftmargin}
+% \begin{macro}{\leftmargini}
+% \begin{macro}{\leftmarginii}
+% \begin{macro}{\leftmarginiii}
+% \begin{macro}{\leftmarginiv}
+% \begin{macro}{\leftmarginv}
+% \begin{macro}{\leftmarginvi}
+% For efficiency, level-one list's values are defined at top level, and
+% |\@listi| is defined to set only |\leftmargin|.
+%
+% \begin{macrocode}
+\setlength\leftmargini {\unitindent}
+\setlength\leftmarginii {\othermargin}
+\setlength\leftmarginiii{\othermargin}
+\setlength\leftmarginiv {\othermargin}
+\setlength\leftmarginv {\othermargin}
+\setlength\leftmarginvi {1em}
+% \end{macrocode}
+% Here we set the top level leftmargin.
+% \begin{macrocode}
+\setlength\leftmargin {\leftmargini}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\labelsep}
+% \begin{macro}{\labelwidth}
+% |\labelsep| is the distance between the label and the text of an
+% item; |\labelwidth| is the width of the label.
+% \begin{macrocode}
+\setlength \labelsep {5\p@}
+\setlength \labelwidth{\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\partopsep}
+% When the user leaves a blank line before the environment an extra
+% vertical space of |\partopsep| is inserted, in addition to
+% |\parskip| and |\topsep|.
+% \begin{macrocode}
+\setlength\partopsep{\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\topsep}
+% Extra vertical space, in addition to |\parskip|, added above and
+% below list and paragraphing environments.
+% \begin{macrocode}
+\setlength\topsep{\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@beginparpenalty}
+% \begin{macro}{\@endparpenalty}
+% These penalties are inserted before and after a list or paragraph
+% environment. They are set to a bonus value to encourage page
+% breaking at these points.
+% \begin{macro}{\@itempenalty}
+% This penalty is inserted between list items.
+% \begin{macrocode}
+\@beginparpenalty -\@lowpenalty
+\@endparpenalty -\@lowpenalty
+\@itempenalty -\@lowpenalty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@listI}
+% \begin{macro}{\@listi}
+% |\@listI| defines top level and |\@listi| values of
+% |\leftmargin|, |\parsep|, |\topsep|, and |\itemsep|
+%
+% \begin{macrocode}
+\def\@listI{%
+ \leftmargin\unitindent
+ \labelsep.5em%
+ \labelwidth\leftmargin
+ \advance\labelwidth-\labelsep
+ \parsep \z@
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip \@plus\p@
+ \itemsep 0\p@ \@plus1\p@}
+\let\@listi\@listI
+% \end{macrocode}
+% We have to initialise these parameters.
+% \begin{macrocode}
+\@listi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@listii}
+% \begin{macro}{\@listiii}
+% \begin{macro}{\@listiv}
+% \begin{macro}{\@listv}
+% \begin{macro}{\@listvi}
+% Here are the same macros for the higher level lists.
+% \begin{macrocode}
+\def\@listii {\leftmargin\leftmarginii
+ \labelsep .5em%
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+\def\@listiii{\leftmargin\leftmarginiii
+ \labelsep .5em%
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \partopsep \z@ \@plus\p@
+ \itemsep \z@ \@plus\p@}
+\def\@listiv {\leftmargin\leftmarginiv
+ \labelsep .5em%
+ \labelwidth\leftmarginiv%
+ \advance\labelwidth-\labelsep
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+\def\@listv {\leftmargin\leftmarginv
+ \labelsep .5em%
+ \labelwidth\leftmarginv
+ \advance\labelwidth-\labelsep%
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+\def\@listvi {\leftmargin\leftmarginvi
+ \labelsep .5em
+ \labelwidth\leftmarginvi
+ \advance\labelwidth{-\labelsep}%
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Enumerate}
+%
+% The enumerate environment uses four counters: \Lcount{enumi},
+% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where
+% \Lcount{enumN} controls the numbering of the Nth level
+% enumeration.
+%
+% \begin{macro}{\theenumi}
+% \begin{macro}{\theenumii}
+% \begin{macro}{\theenumiii}
+% \begin{macro}{\theenumiv}
+% The counters are already defined in \file{latex.dtx}, but their
+% representation is changed here.
+%
+% \begin{macrocode}
+\renewcommand\theenumi{\arabic{enumi}}
+\renewcommand\theenumii{\alph{enumii}}
+\renewcommand\theenumiii{\roman{enumiii}}
+\renewcommand\theenumiv{\Alph{enumiv}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\labelenumi}
+% \begin{macro}{\labelenumii}
+% \begin{macro}{\labelenumiii}
+% \begin{macro}{\labelenumiv}
+% The label for each item is generated by the commands\\
+% |\labelenumi| ... |\labelenumiv|.
+% \begin{macrocode}
+\newcommand\labelenumi{\theenumi.}
+\newcommand\labelenumii{(\theenumii)}
+\newcommand\labelenumiii{\theenumiii.}
+\newcommand\labelenumiv{\theenumiv.}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\p@enumii}
+% \begin{macro}{\p@enumiii}
+% \begin{macro}{\p@enumiv}
+% The expansion of |\p@enumN||\theenumN| defines the output of a
+% |\ref| command when referencing an item of the Nth level of an
+% enumerated list.
+% \begin{macrocode}
+\renewcommand\p@enumii{\theenumi}
+\renewcommand\p@enumiii{\theenumi(\theenumii)}
+\renewcommand\p@enumiv{\p@enumiii\theenumiii}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{environment}{enumerate}
+% We want to have different label positioning on different levels of
+% list. To acheive this we have to redefine the \Lenv{enumerate}
+% environment.
+%
+% \begin{macrocode}
+\renewenvironment{enumerate}{%
+ \ifnum \@enumdepth >3
+ \@toodeep
+ \else
+ \advance\@enumdepth \@ne
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+ \list{\csname label\@enumctr\endcsname}
+ {\usecounter{\@enumctr}%
+%<+type1> \ifnum \@listdepth=1
+ \if@revlabel
+ \def\makelabel##1{\hskip .5\unitindent{##1\hfil}}%
+ \else
+%<-type3> \def\makelabel##1{\hfil##1}
+%<+type3> \def\makelabel##1{##1\hfil}
+ \fi
+%<*type1>
+ \else
+ \def\makelabel##1{##1\hfil}%
+%</type1>
+ \fi
+ }%
+ \fi}
+% \end{macrocode}
+% We try to suppress spaces after these list constructs.
+% \begin{macrocode}
+ {\global\@ignoretrue \endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Itemize}
+%
+% \begin{macro}{\labelitemi}
+% \begin{macro}{\labelitemii}
+% \begin{macro}{\labelitemiii}
+% \begin{macro}{\labelitemiv}
+% Itemization is controlled by four commands: |\labelitemi|,
+% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define
+% the labels of thevarious itemization levels: the symbols used are
+% bullet, bold en-dash, asterisk and centred dot.
+%
+% \begin{macrocode}
+\newcommand\labelitemi{$\m@th\bullet$}
+\newcommand\labelitemii{\bfseries --}
+\newcommand\labelitemiii{$\m@th\ast$}
+\newcommand\labelitemiv{$\m@th\cdot$}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{itemize}
+% We want to have differen label positioning on different levels of
+% list. To acheive this we have to redefine the \Lenv{itemize}
+% environment.
+% \begin{macrocode}
+\renewenvironment{itemize}{%
+ \ifnum \@itemdepth >3
+ \@toodeep
+ \else
+ \advance\@itemdepth \@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \list{\csname\@itemitem\endcsname}%
+ {%
+%<+type1> \ifnum \@listdepth=1\relax
+ \if@revlabel
+ \def\makelabel##1{\hskip .5\unitindent{##1\hfil}}\else
+%<+type1> \def\makelabel##1{\hfil##1}
+%<+type3> \def\makelabel##1{##1\hfil}
+ \fi
+%<*type1>
+ \else
+ \def\makelabel##1{##1\hfil}
+ \fi
+%</type1>
+ }%
+ \fi}
+% \end{macrocode}
+% We try to suppress spaces after these list constructs.
+% \begin{macrocode}
+ {\global\@ignoretrue \endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Description}
+%
+% \begin{environment}{description}
+% The description environment is defined here -- while the itemize
+% and enumerate environments are defined in \file{latex.dtx}.
+%
+% \begin{macrocode}
+\newenvironment{description}
+ {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+ \let\makelabel\descriptionlabel}}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\descriptionlabel}
+% To change the formatting of the label, you must redefine
+% |\descriptionlabel|.
+%
+% \begin{macrocode}
+\newcommand\descriptionlabel[1]{\hspace\labelsep \bfseries #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Adapting existing environments}
+%
+% Because we globally set |\topsep| to zero, we need to modify the
+% definitions of a number of environments slightly to get a litle
+% whitespace around them.
+%
+% \begin{environment}{center}
+% Add a litle surrounding whitespace.
+% \begin{macrocode}
+%<*type1>
+\def\center
+ {\topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \trivlist \centering\item[]}
+\let\endcenter\endtrivlist
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{flushleft}
+% Add a litle surrounding whitespace.
+% \begin{macrocode}
+\def\flushleft
+ {\topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \trivlist \raggedright\item[]}
+\let\endflushleft=\endtrivlist
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{flushright}
+% Add a litle surrounding whitespace.
+% \begin{macrocode}
+\def\flushright
+ {\topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \trivlist \raggedleft\item[]}
+\let\endflushright=\endtrivlist
+%</type1>
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{verbatim}
+% In \Lenv{verbatim} we add a little surrounding whitespace,
+% --which for \file{rapport3} is negative to
+% compensate for the positive |\parskip|-- but also an indent for
+% the \file{rapport1} document class.
+% \begin{macrocode}
+\def\verbatim{%
+%<*type1>
+ \topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \@verbatim
+ \leftskip\unitindent
+%</type1>
+%<*type3>
+ \topsep=-.5\parskip
+ \@verbatim
+%</type3>
+ \frenchspacing\@vobeyspaces \@xverbatim}
+%<+type1>\def\endverbatim{\if@newlist \leavevmode\fi\endtrivlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsection{Defining new environments}
+%
+% \subsubsection{Abstract}
+%
+% \begin{environment}{abstract}
+% When we are producing a separate titlepage we also put the
+% abstract on a page of its own. It will be centred vertically on
+% the page.
+%
+% \begin{macrocode}
+\if@titlepage
+ \newenvironment{abstract}{%
+ \titlepage
+ \null\vfil
+ \hbox{\SectFont \abstractname}
+ \noindent\ignorespaces}
+ {\par\vfil\null\endtitlepage}
+% \end{macrocode}
+% When we are not making a seperate titlepagewe have to check if we
+% are in twocolumn mode. In that case the abstract is set as a
+% |\section*|, otherwise the abstract is typeset flushleft, an
+% amount |\unitindent| smaller as the normal text.
+% \begin{macrocode}
+\else
+ \newenvironment{abstract}{%
+ \if@twocolumn
+ \section*{\abstractname}%
+ \else
+ \small
+ \bgroup\rightskip=\unitindent
+ \hbox{\SectFont \abstractname}%
+ \noindent\ignorespaces
+% \end{macrocode}
+ \fi}
+% \end{macrocode}
+% Which implies that the definition of |\end{abstract}| is also
+% different.
+% \begin{macrocode}
+ {\if@twocolumn\else\par\egroup\fi}
+\fi
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Verse}
+%
+% \begin{environment}{verse}
+% The verse environment is defined by making clever use of the
+% list environment's parameters. The user types |\\| to end a line.
+% This is implemented by |\let|'ing |\\| equal |\@centercr|.
+%
+% \begin{macrocode}
+\newenvironment{verse}
+ {\let\\=\@centercr
+ \list{}{\itemsep\z@
+ \itemindent-1.5em%
+ \listparindent\itemindent
+ \rightmargin\leftmargin
+ \advance\leftmargin1.5em}%
+ \item[]}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Quotation}
+%
+% \begin{environment}{quotation}
+% The quotation environment is also defined by making clever use of
+% the list environment's parameters. The lines in the environment
+% are set smaller than |\textwidth|. The first line of a paragraph
+% inside this environment is indented.
+%
+% \begin{macrocode}
+\newenvironment{quotation}
+ {\list{}{%
+ \listparindent\z@
+ \itemindent\listparindent
+ \rightmargin\leftmargin
+ \parsep\z@ \@plus\p@}%
+ \item[]}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Quote}
+%
+% \begin{environment}{quote}
+% The quote environment is like the quotation environment except
+% that paragraphs are not indented.
+%
+% \begin{macrocode}
+\newenvironment{quote}
+ {\list{}{\rightmargin\leftmargin}%
+ \item[]}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Theorem}
+%
+% \begin{macro}{\@begintheorem}
+% \begin{macro}{\@opargbegintheorem}
+% \begin{macro}{\@endtheorem}
+% These document classes have a slightly modified \Lenv{theorem}
+% environment style. Surrounding whitespace is added and an
+% initialisation of |\labelsep|. Finally a slanted font instead of
+% an italic font is used.
+% \begin{macrocode}
+\def\@begintheorem#1#2{%
+ \vskip\baselineskip \labelsep=.5em%
+ \trivlist
+ \item[\hskip \labelsep{\bfseries #1\ #2}]\slshape}
+\def\@opargbegintheorem#1#2#3{%
+ \vskip\baselineskip \labelsep=.5em%
+ \trivlist
+ \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\slshape}
+\def\@endtheorem{\endtrivlist \vskip\baselineskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Titlepage}
+%
+% \begin{environment}{titlepage}
+% In the normal environments, the titlepage environment does nothing
+% but start and end a page, and inhibit page numbers. It also resets
+% the page number to zero. In two-column style, it still makes a
+% one-column page.
+%
+% \begin{macrocode}
+\newenvironment{titlepage}
+ {
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse\newpage
+ \fi
+ \thispagestyle{empty}%
+ \if@compatibility
+ \setcounter{page}{0}
+ \else
+ \setcounter{page}{1}%
+ \fi}
+ {\if@restonecol\twocolumn \else \newpage \fi
+ \setcounter{page}{1}%
+ }
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Appendix}
+%
+% \begin{macro}{\appendix}
+%
+% The |\appendix| command is not really an environment, it is a
+% macro that makes some changes in the way things are done.
+%
+% In this document class the |\appendix| command must do the
+% following:
+% \begin{itemize}
+% \item reset the chapter and section counters to zero,
+% \item set |\@chapapp| to |\appendixname| (for messages),
+% \item redefine the chapter counter to produce appendix numbers,
+% \item possibly redefine the |\chapter| command if appendix titles
+% and headings are to look different from chapter titles and
+% headings.
+% \end{itemize}
+%
+% \begin{macrocode}
+\newcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \renewcommand\@chapapp{\appendixname}%
+ \renewcommand\thechapter{\Alph{chapter}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Setting parameters for existing environments}
+%
+% \subsubsection{Array and tabular}
+%
+% \begin{macro}{\arraycolsep}
+% The columns in an array environment are separated by
+% 2|\arraycolsep|.
+% \begin{macrocode}
+\setlength\arraycolsep{5\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tabcolsep}
+% The columns in an tabular environment are separated by
+% 2|\tabcolsep|.
+% \begin{macrocode}
+\setlength\tabcolsep{6\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\arrayrulewidth}
+% The width of rules in the array and tabular environments is given
+% by |\arrayrulewidth|.
+% \begin{macrocode}
+\setlength\arrayrulewidth{.4\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doublerulesep}
+% The space between adjacent rules in the array and tabular
+% environments is given by |\doublerulesep|.
+% \begin{macrocode}
+\setlength\doublerulesep{2\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Tabbing}
+%
+% \begin{macro}{\tabbingsep}
+% This controls the space that the |\'| command puts in. (See
+% \LaTeX{} manual for an explanation.)
+% \begin{macrocode}
+\setlength\tabbingsep{\labelsep}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Minipage}
+%
+% \begin{macro}{\@minipagerestore}
+% The macro |\@minipagerestore| is called upon entry to a minipage
+% environment to set up things that are to be handled differently
+% inside a minipage environment.
+%
+% \begin{macrocode}
+%<+type1>\def\@minipagerestore{\parindent\unitindent}
+%<*type3>
+\def\@minipagerestore{%
+ \parskip=.5\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip}
+%</type3>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mpfootins}
+% Minipages have their own footnotes; |\skip||\@mpfootins| plays
+% same r\^ole for footnotes in a minipage as |\skip||\footins| does
+% for ordinary footnotes.
+%
+% \begin{macrocode}
+\skip\@mpfootins = \skip\footins
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Framed boxes}
+%
+% \begin{macro}{\fboxsep}
+% The space left by |\fbox| and |\framebox| between the box and the
+% text in it.
+% \begin{macro}{\fboxrule}
+% The width of the rules in the box made by |\fbox| and |\framebox|.
+% \begin{macrocode}
+\setlength\fboxsep{3\p@}
+\setlength\fboxrule{.4\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Equation and eqnarray}
+%
+% \begin{macro}{\theequation}
+% The equation counter will be reset at beginning of a new chapter
+% and the equation number will be prefixed by the chapter number.
+%
+% This code must follow the |\chapter| definition, or more exactly
+% the definition of the chapter counter.
+% \begin{macrocode}
+\@addtoreset{equation}{chapter}
+\renewcommand\theequation{\thechapter.\arabic{equation}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\jot}
+% |\jot| is the extra space added between lines of an eqnarray
+% environment. The default value is used.
+% \begin{macrocode}
+% \setlength\jot{3pt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@eqnnum}
+% The macro |\@eqnnum| defines how equation numbers are to appear in
+% equations. Again the default is used.
+%
+% \begin{macrocode}
+% \def\@eqnnum{(\theequation)}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Floating objects}
+%
+% The file \file{latex.dtx} only defines a number of tools with
+% which floating objects can be defined. This is done in the
+% document class. It needs to define the following macros for each
+% floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} =
+% figure).
+%
+% \begin{description}
+% \item[\texttt{\bslash fps@TYPE}]
+% The default placement specifier for floats of type
+% \texttt{TYPE}.
+%
+% \item[\texttt{\bslash ftype@TYPE}]
+% The type number for floats of type \texttt{TYPE}. Each
+% \texttt{TYPE} has associated a unique positive {\texttt
+% TYPE} number, which is a power of two. E.g., figures might
+% have type number 1, tables type number 2, programs type
+% number 4, etc.
+%
+% \item[\texttt{\bslash ext@TYPE}]
+% The file extension indicating the file on which the contents
+% list for float type \texttt{TYPE} is stored. For example,
+% |\ext@figure| = `lof'.
+%
+% \item[\texttt{\bslash fnum@TYPE}]
+% A macro to generate the figure number for a caption. For
+% example, |\fnum@TYPE| == `Figure |\thefigure|'.
+%
+% \item[\texttt{\bslash @makecaption{\meta{num}}{\meta{text}}}]
+% A macro to make a caption, with \meta{num} the value produced
+% by |\fnum@...| and \meta{text} the text of the caption. It
+% can assume it's in a |\parbox| of the appropriate width.
+% This will be used for {\em all} floating objects.
+%
+% \end{description}
+%
+% The actual environment that implements a floating object such as
+% a figure is defined using the macros |\@float| and |\end@float|,
+% which are defined in \file{latex.dtx}.
+%
+% An environment that implements a single column floating object is
+% started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type
+% \texttt{TYPE} with \meta{placement} as the placement specifier.
+% The default value of \meta{PLACEMENT} is defined by |\fps@TYPE|.
+%
+% The environment is ended by |\end@float|. E.g., |\figure| ==
+% |\@float|{figure}, |\endfigure| == |\end@float|.
+%
+% \subsubsection{Figure}
+%
+% Here is the implementation of the figure environment.
+%
+% \begin{macro}{\c@figure}
+% First we have to allocate a counter to number the figures. In
+% this document class the figures are numbered per chapter.
+% \begin{macrocode}
+\newcounter{figure}[chapter]
+\renewcommand\thefigure{\thechapter.\@arabic\c@figure}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fps@figure}
+% \begin{macro}{\ftype@figure}
+% \begin{macro}{\ext@figure}
+% \begin{macro}{\num@figure}
+% Here are the parameters for the floating objects of type `figure'.
+% \begin{macrocode}
+\def\fps@figure{tbp}
+\def\ftype@figure{1}
+\def\ext@figure{lof}
+\def\fnum@figure{\figurename~\thefigure}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{figure}
+% \begin{environment}{figure*}
+% And the definition of the actual environment. The form with the
+% |*| is used for double column figures.
+% \begin{macrocode}
+\newenvironment{figure}
+ {\@float{figure}}
+ {\end@float}
+\newenvironment{figure*}
+ {\@dblfloat{figure}}
+ {\end@dblfloat}
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
+% \subsubsection{Table}
+%
+% Here is the implementation of the table environment. It is very
+% much the same as the figure environment.
+%
+% \begin{macro}{\c@table}
+% First we have to allocate a counter to number the tables. In this
+% document class the tables are numbered per chapter.
+% \begin{macrocode}
+\newcounter{table}[chapter]
+\renewcommand\thetable{\thechapter.\@arabic\c@table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fps@table}
+% \begin{macro}{\ftype@table}
+% \begin{macro}{\ext@table}
+% \begin{macro}{\num@table}
+% Here are the parameters for the floating objects of type `table'.
+% \begin{macrocode}
+\def\fps@table{tbp}
+\def\ftype@table{2}
+\def\ext@table{lot}
+\def\fnum@table{\tablename~\thetable}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{table}
+% \begin{environment}{table*}
+% And the definition of the actual environment. The form with the
+% |*| is used for double column tables.
+% \begin{macrocode}
+\newenvironment{table}
+ {\@float{table}}
+ {\end@float}
+\newenvironment{table*}
+ {\@dblfloat{table}}
+ {\end@dblfloat}
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
+% \subsubsection{Captions}
+%
+% \begin{macro}{\@makecaption}
+% The |\caption| command calls |\@makecaption| to format the
+% caption of floating objects. It gets two arguments,
+% \meta{number}, the number of the floating object and \meta{text},
+% the text of the caption. Usually \meta{number} contains a string
+% such as `Figure 3.2'. The macro can assume it is called inside a
+% |\parbox| of right width, with |\normalsize|.
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% These lengths contain the amount of white space to leave above
+% and below the caption.
+% \begin{macrocode}
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+\setlength\abovecaptionskip{10\p@}
+\setlength\belowcaptionskip{0\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The definition of this macro is |\long| in order to allow more
+% then one paragraph in a caption.
+% \begin{macrocode}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+% \end{macrocode}
+% We want to see if the caption fits on one line on the page,
+% therefore we first typeset it in a temporary box.
+% \begin{macrocode}
+ \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}%
+% \end{macrocode}
+% We can the measure its width. It that is larger than the current
+% |\hsize| we typeset the caption as an ordinary paragraph.
+% \begin{macrocode}
+ \ifdim \wd\@tempboxa >\hsize
+ {\CaptionLabelFont#1:} \CaptionTextFont#2\par
+% \end{macrocode}
+% If the caption fits, we center it.
+% \begin{macrocode}
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CaptionLabelFont}
+% \begin{macro}{\CaptionTextFont}
+% These macros can contain the fonts used for typesetting captions.
+% By default they do nothing.
+% \begin{macrocode}
+\newcommand\CaptionLabelFont{\relax}
+\newcommand\CaptionTextFont{\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\CaptionFonts}
+% To change the fonts that are used to typeset captions
+% this macro can be used.
+% \begin{macrocode}
+\newcommand\CaptionFonts[2]{%
+ \renewcommand\CaptionLabelFont{#1}%
+ \renewcommand\CaptionTextFont{#2}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Font changing}
+%
+% Here we supply the declarative font changing commands that were
+% common in \LaTeX\ version 2.09 and earlier. These commands work
+% in text mode \emph{and} in math mode. They are provided for
+% compatibility, but one should start using the |\text...| and
+% |\math...| commands instead. These commands are defined using
+% |\DeclareOldFontCommand|, a command with three arguments: the user
+% command to be defined; \LaTeX\ commands to execute in text mode
+% and \LaTeX\ commands to execute in math mode.
+%
+% \begin{macro}{\rm}
+% \begin{macro}{\tt}
+% \begin{macro}{\sf}
+%
+% The commands to change the family. When in compatibility mode we
+% select the `default' font first, to get \LaTeX2.09 behviour.
+% \begin{macrocode}
+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bf}
+% The command to change to the bold series. One should use
+% |\mdseries| to explicitly switch back to medium series.
+% \begin{macrocode}
+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sl}
+% \begin{macro}{\it}
+% \begin{macro}{\sc}
+%
+% And the commands to change the shape of the font. The slanted and
+% small caps shapes are not available by default as math alphabets,
+% so those changes do nothing in math mode. One should use
+% |\upshape| to explicitly change back to the upright shape.
+% \begin{macrocode}
+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax}
+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cal}
+% \begin{macro}{\mit}
+%
+% The commands |\cal| and |\mit| should only be used in math mode,
+% outside math mode they have no effect. Currently the New Font
+% Selection Scheme defines these commands to generate warning
+% messages. Therefore we have to define them `by hand'.
+% \begin{macrocode}
+\renewcommand{\cal}{\protect\pcal}
+\newcommand{\pcal}{\@fontswitch{\relax}{\mathcal}}
+\renewcommand{\mit}{\protect\pmit}
+\newcommand{\pmit}{\@fontswitch{\relax}{\mathnormal}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pem}
+% The definition of |\pem| is changed here to have slanted instead
+% of italic fonts.
+% \begin{macrocode}
+\def\pem{\@nomath\em \ifdim \fontdimen\@ne\font >\z@
+ \upshape \else \slshape \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Cross Referencing}
+% \subsection{Table of Contents, etc.}
+%
+% A |\section| command writes a
+% |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| command
+% on the \file{.toc} file, where \meta{title} contains the
+% contents of the entry and \meta{page} is the page number. If
+% sections are being numbered, then \meta{title} will be of the
+% form |\numberline{|\meta{num}|}{|\meta{heading}|}| where
+% \meta{num} is the number produced by |\thesection|. Other
+% sectioning commands work similarly.
+%
+% A |\caption| command in a `figure' environment writes
+%
+% |\contentsline{figure}{\numberline{|\meta{num}|}{|%
+% \meta{caption}|}}{|\meta{page}|}|
+%
+% on the .\file{lof} file, where \meta{num} is the number produced
+% by |\thefigure| and \meta{caption} is the figure caption. It
+% works similarly for a `table' environment.
+%
+% The command |\contentsline{|\meta{name}|}| expands to
+% |\l@|\meta{name}. So, to specify the table of contents, we must
+% define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to
+% specify the list of figures, we must define |\l@figure|; and so
+% on. Most of these can be defined with either the
+% |\@dottedtocline| or the |\@regtocline| command, which work as
+% follows.
+%
+% |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|^^A
+% \meta{numwidth}|}{|^^A
+% \meta{title}|}{|\meta{page}|}|
+%
+% |\@regtocline{|\meta{level}|}{|\meta{title}|}{|\meta{page}|}|
+%
+% \begin{description}
+% \item[\meta{level}] An entry is produced only if\meta{ level}
+% $<=$ value of the \Lcount{tocdepth} counter. Note,
+% |\chapter| is level 0, |\section| is level 1, etc.
+% \item[\meta{indent}] The indentation from the outer left margin
+% of the start of the contents line.
+% \item[\meta{numwidth}] The width of a box in which the section
+% number is to go, if \meta{title} includes a |\numberline|
+% command.
+% \end{description}
+%
+% \begin{macro}{\@pnumwidth}
+% \begin{macro}{\@tocrmarg}
+% \begin{macro}{\@dotsep}
+% This command uses the following three parameters, which are set
+% with a |\newcommand| (so em's can be used to make them depend upon
+% the font).
+% \begin{description}
+% \item[\texttt{\bslash @pnumwidth}] The width of a box in which the
+% page number is put.
+% \item[\texttt{\bslash @tocrmarg}] The right margin for multiple
+% line entries. One wants |\@tocrmarg| > or = |\@pnumwidth|
+% \item[\texttt{\bslash @dotsep}] Separation between dots, in mu
+% units. Should be defined as a number like 2 or 1.7
+% \end{description}
+%
+% \begin{macrocode}
+\newcommand\@pnumwidth{1.55em}
+\newcommand\@tocrmarg {2.55em}
+\newcommand\@dotsep{4.5}
+\setcounter{tocdepth}{2}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Table of Contents}
+%
+% \begin{macro}{\tableofcontents}
+% This macro is used to request that \LaTeX{} produces a table of
+% contents. The tables of contents, figures etc. are always set in
+% single-column style.
+%
+% \begin{macrocode}
+\newcommand\tableofcontents{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+% \end{macrocode}
+% The title is set using the |\chapter*| command, making sure that
+% the running head --if one is required-- contains the right
+% information.
+% \begin{macrocode}
+ \chapter*{\contentsname
+ \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
+% \end{macrocode}
+% The the actual table of contents is made by calling
+% |\@starttoc{toc}|. After that we restore twocolumn mode if
+% necessary.
+% \begin{macrocode}
+ \@starttoc{toc}%
+ \if@restonecol\twocolumn\fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@starttoc}
+% The internal \LaTeXe macro |\@starttoc| needs to be adapted for
+% the \file{rapport3} document classes,in order to deal with a the
+% fact that for these document classes the |\parskip| is normally
+% non-zero. We don't want that in the table of contents.
+% \begin{macrocode}
+%<*type3>
+\def\@starttoc#1{\begingroup
+ \makeatletter
+ \parskip\z@
+ \@input{\jobname.#1}%
+ \if@filesw
+ \expandafter\newwrite\csname tf@#1\endcsname
+ \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+ \fi \global\@nobreakfalse \endgroup}
+%</type3>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@regtocline}
+% These document classes use a different format for the table of
+% contents than the standard classes from which they were
+% developped. In order to acheive this different format we defined
+% the macro |\@regtocline|.
+% \begin{macrocode}
+\newcommand\@regtocline[3]{%
+ \ifnum #1>\c@tocdepth
+ \else
+ \vskip \z@ plus .2pt
+ {\hangindent\z@ \@afterindenttrue \interlinepenalty\@M
+ \leftskip\unitindent
+ \rightskip=\unitindent plus 1fil
+ \parfillskip=0cm
+ \@tempdima=\unitindent
+ \parindent\z@
+ \leavevmode
+ \hbox{}\hskip -\leftskip\relax#2\nobreak
+ \hskip 1em \nobreak{\slshape #3}\par
+ }%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@font}
+% The changed definition of |\@sect| that we use, selects a
+% different font for the table of contents for the various header
+% levels. It does this using |\toc@font|.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\toc@font[1]{\relax}
+\else
+ \newcommand\toc@font[1]{%
+ \ifcase#1\relax
+ \bfseries
+ \or\slshape
+ \or\rmfamily
+ \fi}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@case}
+% The entries for parts are typeset in capital letters in the new
+% style of the table of contents. In the old style this isn't
+% done. The macro |\toc@case| is used to switch this.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\toc@case{\relax}
+\else
+ \newcommand\toc@case{\uppercase}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@part}
+% Each sectioning command needs an additional macro to format its
+% entry in the table of contents, as described above. The macro for
+% the entry for parts is defined in a special way.
+%
+% First we make sure that if a pagebreak should occur, it occurs
+% {\em before} this entry. Also a little whitespace is added and a
+% group begun to keep changes local.
+%
+% First we have the definition from the standard classes.
+% \begin{macrocode}
+\if@oldtoc
+\newcommand\l@part[2]{%
+ \addpenalty{-\@highpenalty}%
+ \addvspace{2.25em \@plus\p@}%
+ \begingroup
+% \end{macrocode}
+% The macro |\numberline| requires that the width of the box that
+% holds the part number is stored in \LaTeX's scratch register
+% |\@tempdima|. Therefore we put it there.
+% \begin{macrocode}
+ \setlength\@tempdima{3em}%
+% \end{macrocode}
+% The we set |\parindent| to 0pt and use |\rightskip| to leave
+% enough room for the pagenumbers. To prevent overfull box messages
+% the |\parfillskip| is set to a negative value.
+% \begin{macrocode}
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+% \end{macrocode}
+% Now we can set the entry, in a large bold font. We make sure to
+% leave vertical mode, set the part title and add the pagenumber,
+% set flush right.
+% \begin{macrocode}
+ {\leavevmode
+ \large \bfseries #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
+% \end{macrocode}
+% Prevent a pagebreak immediately after this entry, but use
+% |\everypar| to reset the |\if@nobreak| switch. Finally we close
+% the group.
+% \begin{macrocode}
+ \nobreak
+ \global\@nobreaktrue
+ \everypar{\global\@nobreakfalse\everypar{}}
+ \endgroup}
+% \end{macrocode}
+% Then we can introduce our new definition.
+% \begin{macrocode}
+\else
+ \newcommand\l@part{\addpenalty{-\@highpenalty}
+ \addvspace{2.25em \@plus \p@}\@regtocline{0}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@chapter}
+% This macro formats the entries in the table of contents for
+% chapters. It is very similar to |\l@part|
+%
+% First we make sure that if a pagebreak should occur, it occurs
+% {\em before} this entry. Also a little whitespace is added and a
+% group begun to keep changes local.
+%
+% Again we first present the `standard' definition
+% \begin{macrocode}
+\if@oldtoc
+\newcommand\l@chapter[2]{%
+ \addpenalty{-\@highpenalty}%
+ \vskip 1.0em \@plus\p@
+% \end{macrocode}
+%
+% The macro |\numberline| requires that the width of the box that
+% holds the part number is stored in \LaTeX's scratch register
+% |\@tempdima|. Therefore we put it there. We begin a group, and
+% change some of the paragraph parameters.
+% \begin{macrocode}
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+% \end{macrocode}
+% Then we leave vertical mode and switch to a bold font.
+% \begin{macrocode}
+ \leavevmode \bfseries
+% \end{macrocode}
+% Because we do not use |\numberline| here, we have do some fine
+% tuning `by hand', before we can set the entry. We discourage but
+% not disallow a pagebreak immediately after a chapter entry.
+% \begin{macrocode}
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
+ \penalty\@highpenalty
+ \endgroup}
+% \end{macrocode}
+% Then we present our new definition.
+% \begin{macrocode}
+\else
+ \newcommand\l@chapter{\@regtocline{0}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@section}
+% In this document class the definition for
+% |\l@section| is very simple.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\l@section {\@dottedtocline{1}{1.5em}{2.3em}}
+\else
+ \newcommand\l@section {\@regtocline{1}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@subsection}
+% \begin{macro}{\l@subsubsection}
+% \begin{macro}{\l@paragraph}
+% \begin{macro}{\l@subparagraph}
+% All lower level entries are defined using the macro
+% |\@dottedtocline| or |\@regtocline| (see above).
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\l@subsection {\@dottedtocline{2}{3.8em}{3.2em}}
+ \newcommand\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
+ \newcommand\l@paragraph {\@dottedtocline{4}{10em}{5em}}
+ \newcommand\l@subparagraph {\@dottedtocline{5}{12em}{6em}}
+\else
+ \newcommand\l@subsection {\@regtocline{2}}
+ \newcommand\l@subsubsection{\@regtocline{3}}
+ \newcommand\l@paragraph {\@regtocline{4}}
+ \newcommand\l@subparagraph {\@regtocline{5}}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{List of figures}
+%
+% \begin{macro}{\listoffigures}
+% This macro is used to request that \LaTeX{} produces a list of
+% figures. It is very similar to |\tableofcontents|.
+%
+% \begin{macrocode}
+\newcommand\listoffigures{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\listfigurename
+ \@mkboth{\uppercase{\listfigurename}}%
+ {\uppercase{\listfigurename}}}%
+ \@starttoc{lof}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@figure}
+% This macro produces an entry in the list of figures.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
+\else
+ \newcommand\l@figure{\@regtocline{1}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{List of tables}
+%
+% \begin{macro}{\listoftables}
+% This macro is used to request that \LaTeX{} produces a list of
+% tables. It is very similar to |\tableofcontents|.
+%
+% \begin{macrocode}
+\newcommand\listoftables{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\listtablename
+ \@mkboth{\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
+ \@starttoc{lot}%
+ \if@restonecol\twocolumn\fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@table}
+% This macro produces an entry in the list of tables.
+% \begin{macrocode}
+\let\l@table\l@figure
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Bibliography}
+%
+% \begin{macro}{\bibindent}
+% The ``open'' bibliography format uses an indentation of
+% |\bibindent|.
+% \begin{macrocode}
+\newdimen\bibindent
+\bibindent=1.5em
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newblock}
+% This is a dummy definition for this macro which is used in the
+% \textsf{thebibliography} environment.
+% \begin{macrocode}
+\newcommand\newblock{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{thebibliography}
+% The `thebibliography' environment executes the following
+% commands:
+%
+% |\renewcommand\newblock{\hskip .11em \@plus .33em \@minus .07em}|
+% -- Defines the ``closed'' format, where the blocks (major units
+% of information) of an entry run together.
+%
+% |\sloppy| -- Used because it's rather hard to do line breaks in
+% bibliographies,
+%
+% |\sfcode`\.=1000\relax| --
+% Causes a `.' (period) not to produce an end-of-sentence space.
+%
+% The implementation of this environment is based on the generic
+% list environment. It uses the \Lcount{enumiv} counter internally
+% to generate the labels of the list.
+%
+% When an empty `thebibliography' environment is found, a warning
+% is issued.
+%
+% \begin{macrocode}
+\newenvironment{thebibliography}[1]
+ {\chapter*{\bibname
+ \@mkboth{\uppercase{\bibname}}%
+ {\uppercase{\bibname}}}%
+ \list{\@biblabel{\arabic{enumiv}}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \if@openbib
+ \advance\leftmargin\bibindent
+ \itemindent -\bibindent
+ \listparindent \itemindent
+ \parsep \z@
+ \fi
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\arabic{enumiv}}}%
+ \if@openbib
+ \renewcommand\newblock{\par}
+ \else
+ \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
+ \fi
+ \sloppy\clubpenalty4000\widowpenalty4000%
+ \sfcode`\.=\@m}
+ {\def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
+ \endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@biblabel}
+% The label for a |\bibitem[...]| command is produced by this
+% macro. The default from \file{latex.dtx} is used.
+% \begin{macrocode}
+% \renewcommand\@biblabel[1]{[#1]\hfill}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@cite}
+% The output of the |\cite| command is produced by this macro. The
+% default from \file{latex.dtx} is used.
+% \begin{macrocode}
+% \renewcommand\@cite[1]{[#1]}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The index}
+%
+% \begin{environment}{theindex}
+% The environment `theindex' can be used for indices. It makes an
+% index with two columns, with each entry a seperate paragraph. At
+% the user level the commands |\item|, |\subitem| and |\subsubitem|
+% are used to produce index entries of various levels. When a new
+% letter of the alphabet is encountered an amount of |\indexspace|
+% white space can be added.
+%
+% \begin{macrocode}
+\newenvironment{theindex}
+ {\if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \columnseprule \z@
+ \columnsep 35\p@
+ \twocolumn[\@makeschapterhead{\indexname}]%
+ \@mkboth{\uppercase{\indexname}}%
+ {\uppercase{\indexname}}%
+ \thispagestyle{plain}\parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \let\item\@idxitem}
+% \end{macrocode}
+% When the document continues after the index and it was a one
+% column document we have to switch back to one column after the
+% index.
+% \begin{macrocode}
+ {\if@restonecol\onecolumn\else\clearpage\fi}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@idxitem}
+% \begin{macro}{\subitem}
+% \begin{macro}{\subsubitem}
+% Thsee macros are used to format the entries in the index. ^^AA ???
+% \begin{macrocode}
+\newcommand\@idxitem {\par\hangindent 40\p@}
+\newcommand\subitem {\par\hangindent 40\p@ \hspace*{20\p@}}
+\newcommand\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\indexspace}
+% The amount of white space that is inserted between `letter
+% blocks' in the index.
+% \begin{macrocode}
+\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Footnotes}
+%
+% \begin{macro}{\footnoterule}
+% Usually, footnotes are separated from the main body of the text
+% by a small rule. This rule is drawn by the macro |\footnoterule|.
+% We have to make sure that the rule takes no vertical space (see
+% \file{plain.tex}) so we compensate for the natural heigth of the
+% rule of 0.4pt by adding the right amount of vertical skip.
+%
+% To prevent the rule from colliding with the footnote we first add
+% a little negative vertical skip, then we put the rule and add
+% some positive vertical skip.
+% \begin{macrocode}
+\renewcommand\footnoterule{%
+ \kern-3\p@
+ \kern.5\baselineskip
+ \hrule\@width\unitindent
+ \kern.4\baselineskip
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@footnote}
+% Footnotes are numbered within chapters.
+% \begin{macrocode}
+% \newcounter{footnote}
+\@addtoreset{footnote}{chapter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makefntext}
+% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext|
+% to produce the actual footnote. The macro gets the text of the
+% footnote as its argument and should use |\@thefnmark| as the mark
+% of the footnote. The macro |\@makefntext|is called when
+% effectively inside a |\parbox| of width |\columnwidth| (i.e.,
+% with |\hsize| = |\columnwidth|).
+%
+% An example of what can be achieved is given by the following piece
+% of \TeX\ code.
+% \begin{verbatim}
+% \long\def\@xmakefntext#1#2{%
+% %<-type3> \parindent=.5\unitindent
+% %<+type3> \parindent=\z@\parskip=.5\baselineskip
+% \def\labelitemi{--}\@revlabeltrue
+% {\setbox0=\hbox {#1\hskip.5em plus 1fil}%
+% \dimen0=2\wd0
+% \ifdim\dimen0>\unitindent
+% \global\unitindent=\dimen0
+% \@indentset
+% \fi}%
+% \@setpar{\@@par
+% \@tempdima \hsize
+% \advance\@tempdima-.5\unitindent
+% \parshape \@ne .5\unitindent \@tempdima}%
+% \par
+% \noindent\llap{\hbox to .5\unitindent{#1\hfil}}#2}
+% \end{verbatim}
+% The effect of this definition is that all lines of the footnote
+% are indented by 10pt, while the first line of a new paragraph is
+% indented by 1em. To change these dimensions, just substitute the
+% desired value for `10pt' (in both places) or `1em'. The mark is
+% flushright against the footnote.
+%
+% In these document classes we use a simpler macro, in which the
+% footnote text is set like an ordinary text paragraph, with no
+% indentation except on the first line of the footnote. Thus, all
+% the macro must do is set |\parindent| to the appropriate value
+% for succeeding paragraphs and put the proper indentation before
+% the mark. We change the label of itemized lists inside footnotes
+% and need to check that the |\unitindent| is large enough for our
+% purposes.
+%
+% For most of the document classes produced from this file we need
+% a slightly modified |\@makefntext| on the title page, so we
+% introduce an extra macro, |\@xmakefntext|.
+% \begin{macrocode}
+\def\@makefntext{\@xmakefntext{$\m@th\@thefnmark$.}}
+\long\def\@xmakefntext#1{%
+ \parindent\z@
+ \def\labelitemi{--}\@revlabeltrue
+ {\setbox0=\hbox {#1\hskip.5em plus 1fil}
+ \dimen0=2\wd0\relax
+ \ifdim\dimen0>\unitindent
+ \global\unitindent=\dimen0\relax
+ \@indentset
+ \fi}
+ \leavevmode\hbox to .5\unitindent{#1\hfil}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makefnmark}
+% The footnote markers that are printed in the text to point to the
+% footnotes should be produced by the macro |\@makefnmark|. We use
+% the default definition for it.
+% \begin{macrocode}
+%\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Initialization}
+%
+% \subsection{Words}
+%
+% \begin{macro}{\contentsname}
+% \begin{macro}{\listfigurename}
+% \begin{macro}{\listtablename}
+% \begin{macro}{\refname}
+% \begin{macro}{\bibname}
+% \begin{macro}{\indexname}
+% \begin{macro}{\figurename}
+% \begin{macro}{\tablename}
+% \begin{macro}{\partname}
+% \begin{macro}{\chaptername}
+% \begin{macro}{\appendixname}
+% \begin{macro}{\abstractname}
+% \begin{macro}{\seename}
+% \begin{macro}{\andname}
+% This document class is for documents prepared in the English language.
+% To prepare a version for another language, various English words must
+% be replaced. All the English words that require replacement are
+% defined below in command names.
+%
+% \begin{macrocode}
+\newcommand\contentsname{Contents}
+\newcommand\listfigurename{List of Figures}
+\newcommand\listtablename{List of Tables}
+\newcommand\bibname{Bibliography}
+\newcommand\indexname{Index}
+\newcommand\figurename{Figure}
+\newcommand\tablename{Table}
+\newcommand\partname{Part}
+\newcommand\chaptername{Chapter}
+\newcommand\appendixname{Appendix}
+\newcommand\abstractname{Abstract}
+\newcommand\seename{see}
+\newcommand\andname{and}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Date}
+%
+% \begin{macro}{\today}
+% This macro uses the \TeX\ primitives |\month|, |\day| and |\year|
+% to provide the date of the \LaTeX-run.
+% \begin{macrocode}
+\newcommand\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Two column mode}
+%
+% \begin{macro}{\columnsep}
+% This gives the distance between two columns in two column mode.
+% \begin{macrocode}
+\setlength\columnsep{10\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\columnseprule}
+% This gives the width of the rule between two columns in two
+% column mode. We have no visible rule.
+% \begin{macrocode}
+\setlength\columnseprule{0\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The page style}
+%
+% We have \pstyle{plain} pages unless the user specified
+% otherwise. We use arabic pagenumbers.
+% \begin{macrocode}
+\pagestyle{plain}
+\pagenumbering{arabic} % Arabic page numbers
+% \end{macrocode}
+%
+% When the \Lopt{twocolumn} option was specified we call
+% |\twocolumn| to activate this mode. We try to make each column as
+% long as the others, but call |sloppy| to make our life easier.
+% \begin{macrocode}
+\if@twocolumn
+ \twocolumn
+ \sloppy
+ \flushbottom
+% \end{macrocode}
+% Normally we call |\onecolumn| to initiate typesetting in one
+% column.
+% \begin{macrocode}
+\else
+ \onecolumn
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\frenchspacing}
+% Controls the amount of space after a punctuation mark.
+% \begin{macrocode}
+\frenchspacing
+%</class>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+\endinput
+%
diff --git a/macros/latex/contrib/ntgclass/wijzer.dtx b/macros/latex/contrib/ntgclass/wijzer.dtx
new file mode 100644
index 0000000000..9033f939ac
--- /dev/null
+++ b/macros/latex/contrib/ntgclass/wijzer.dtx
@@ -0,0 +1,3560 @@
+% \CheckSum{0}
+%
+%
+% \iffalse
+%<*dtx>
+\Providesfile{wijzer.dtx}
+%</dtx>
+%<class>\NeedsTeXFormat{LaTeX2e}
+%<class>\ProvidesClass{wijzer}
+%<driver>\ProvidesFile{wijzer.drv}
+%\Providesfile{wijzer.dtx}
+ [PTT Research computer handboeken]
+%
+%<*driver>
+\documentclass{ptt-ltxdoc}
+\usepackage[dutch]{babel}
+\CodelineNumbered
+\CodelineIndex
+\EnableCrossrefs
+\DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
+\DoNotIndex{\@centercr,\@cite}
+\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
+\DoNotIndex{\@input,\@ixpt,\@m}
+\DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
+\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
+\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
+\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
+\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
+\DoNotIndex{\advance,\Alph,\alph}
+\DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+\DoNotIndex{\bullet}
+\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
+\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
+\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
+\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
+\DoNotIndex{\fbox}
+\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
+\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
+\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
+\DoNotIndex{\input}
+\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
+\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
+\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
+\DoNotIndex{\NeedsTeXFormat,\newdimen}
+\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
+\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
+\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
+\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
+\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
+\DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
+\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
+\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
+\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
+\DoNotIndex{\viipt,\vipt,\vskip,\vspace}
+\DoNotIndex{\wd,\xiipt,\year,\z@}
+\newcommand{\m}[1]{\mbox{$\langle$\it #1\/$\rangle$}}
+\providecommand{\marg}[1]{{\ttfamiliy\char`\{}\m{#1}{\ttfamiliy\char`\}}}
+\providecommand{\oarg}[1]{{\ttfamiliy[}\m{#1}{\ttfamiliy]}}
+\begin{document}
+\DocInput{wijzer.dtx}
+\clearpage
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{wijzer.dtx}
+% \title{Document Class \texttt{wijzer}}
+% \author{Johannes Braams}
+% \date{Version~\fileversion, dated~\filedate}
+% \maketitle
+% \tableofcontents
+% \clearpage
+%
+% \StopEventually{} ^^A
+%
+% \section{Introduction}
+%
+% \section{The {\sc docstrip} modules}
+%
+% The following modules are used in the implementation to direct
+% {\sc docstrip} in generating the external files:
+% \begin{center}
+% \begin{tabular}{ll}
+% class & produce the document class\\
+% type1 & produce the `1' variants of the classes\\
+% type3 & produce the `3' variants of the classes\\
+% driver & produce a documentation driver file \\
+% \end{tabular}
+% \end{center}
+%
+% \section{Initial Code}
+%
+% In this part we define a few commands that are used later on.
+%
+% \begin{macro}{\@ptsize}
+% This control sequence is used to store the second digit of the
+% pointsize we are typesetting in. So, normally, it's value is one
+% of 0, 1 or 2.
+% \begin{macrocode}
+%<*class>
+\newcommand\@ptsize{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@restonecol}
+% When the document has to printed in two columns, we sometimes
+% have to temporarily switch to one column. This switch is used to
+% remember to switch back.
+% \begin{macrocode}
+\newif\if@restonecol
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@titlepage}
+% A switch to indicate if a titlepage has to be produced.
+% \begin{macrocode}
+\newif\if@titlepage
+\@titlepagetrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@openright}
+% A switch to indicate if chapters must start on a right-hand page.
+% The default for the report class is no; for the book class it's
+% yes.
+% \begin{macrocode}
+\newif\if@openright
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@openbib}
+% A switch to indicate if the bibliography has to be produced in
+% the ``open'' format. The default is to use a ``closed'' format.
+% \begin{macrocode}
+\newif\if@openbib
+\@openbibfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@oldtoc}
+% A switch to indicate if `old' layout of the table of contents
+% should be produced. These document classes normally produce a
+% table of contents that looks quite different from what the
+% standard classes produce.
+% \begin{macrocode}
+\newif\if@oldtoc
+\@oldtocfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@allcaps}
+% By default the text on the titlepage is set in capital letters.
+% This can be disabled by the option \Lopt{mctitle}, which sets the
+% switch |\if@allcaps| to false.
+% \begin{macrocode}
+\newif\if@allcaps
+% \end{macro}
+%
+% \begin{macro}{\if@titlecentered}
+% In the document classes \file{wijzer3} the
+% default placement of the title that is produced by |\maketitle|
+% is flushleft. This can be changed by the switch
+% |\if@titlecentered|.
+% \begin{macrocode}
+%<+type3>\newif\if@titlecentered
+%<+type3>\@titlecenteredfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@revlabel}
+% These document classes need to be able to change the positioning
+% of the label in labeled lists. This switch is used for that
+% purpose.
+% \begin{macrocode}
+\newif\if@revlabel
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Declaration of Options}
+%
+%
+% \subsection{Setting Paper Sizes}
+%
+% The variables |\paperwidth| and |\paperheight| should reflect the
+% physical paper size after trimming. For desk printer output this
+% is usually the real paper size since there is no post-processing.
+% Classes for real book production will probably add other paper
+% sizes and additionally the production of crop marks for trimming.
+% \begin{macrocode}
+\DeclareOption{a4paper}
+ {\setlength\paperheight {297mm}%
+ \setlength\paperwidth {210mm}}
+\DeclareOption{a5paper}
+ {\setlength\paperheight {210mm}%
+ \setlength\paperwidth {148mm}}
+\DeclareOption{b5paper}
+ {\setlength\paperheight {250mm}%
+ \setlength\paperwidth {176mm}}
+\DeclareOption{letterpaper}
+ {\setlength\paperheight {11in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{legalpaper}
+ {\setlength\paperheight {14in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperheight {10.5in}%
+ \setlength\paperwidth {7.25in}}
+% \end{macrocode}
+%
+% The option \Lopt{landscape} switches the values of |\paperheight|
+% and |\paperwidth|, assuming the dimensions wer given for portrait
+% paper.
+% \begin{macrocode}
+\DeclareOption{landscape}
+ {\setlength\@tempdima {\paperheight}%
+ \setlength\paperheight {\paperwidth}%
+ \setlength\paperwidth {\@tempdima}}
+% \end{macrocode}
+%
+% \subsection{Choosing the type size}
+%
+% The type size options are handled by defining |\@ptsize| to contain
+% the last digit of the size in question and branching on |\ifcase|
+% statements. This is done for historical reasons to stay compatible
+% with other packages that use the |\@ptsize| variable to select
+% special actions. It makes the declarations of size options less
+% than 10pt difficult, although one can probably use \texttt{9}
+% and \texttt{8} assuming that a class won't define both
+% \Lopt{8pt} and \Lopt{18pt} options.
+%
+% \begin{macrocode}
+\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
+\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+% \end{macrocode}
+%
+%
+% \subsection{Two-side or one-side printing}
+%
+% For two-sided printing we use the switch |\if@twoside|. In
+% addition we have to set the |\if@mparswitch| to get any margin
+% paragraphs into the outside margin.
+% \begin{macrocode}
+\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
+\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
+% \end{macrocode}
+%
+%
+% \subsection{Draft option}
+%
+% If the user requests \Lopt{draft} we show any overfull boxes.
+% We could probably add some more interesting stuff to this option.
+% \begin{macrocode}
+\DeclareOption{draft}{\setlength\overfullrule{5pt}}
+\DeclareOption{final}{\setlength\overfullrule{0pt}}
+% \end{macrocode}
+%
+% \subsection{Titlepage option}
+% An article usually has no separate titlepage, but the user can
+% request one.
+% \begin{macrocode}
+\DeclareOption{titlepage}{\@titlepagetrue}
+\DeclareOption{notitlepage}{\@titlepagefalse}
+% \end{macrocode}
+%
+% \subsection{openright option}
+% This option determines whether or not a chapter must start on
+% a right-hand page
+% request one.
+% \begin{macrocode}
+\DeclareOption{openright}{\@openrighttrue}
+\DeclareOption{openany}{\@openrightfalse}
+% \end{macrocode}
+%
+% For these document classes there used to be a file
+% \file{voorwerk.sty} which was a replacement for
+% \file{titlepag.sty}. Therefore we also have the option
+% \Lopt{voorwerk}.
+% \begin{macrocode}
+\DeclareOption{voorwerk}{\@titlepagetrue}
+\DeclareOption{geenvoorwerk}{\@titlepagefalse}
+% \end{macrocode}
+%
+%
+% \subsection{Table of contents formatting}
+%
+% This document class uses a new layout for the table of contents,
+% but in order to maintain compatibility with the standard \LaTeXe
+% document classes we supply an extra option: \Lopt{oldtoc}. If
+% this option is specified the switch |\if@oldtoc| will be set
+% true.
+% \begin{macrocode}
+\DeclareOption{oldtoc}{\@oldtoctrue}
+% \end{macrocode}
+%
+% \subsection{Formatting of the title}
+%
+% The option \Lopt{titlecentered} changes the behaviour of the
+% |\maketitle| command. It then produces a title like it does for
+% the \file{artikel1} document class.
+% \begin{macrocode}
+%<+type3>\DeclareOption{titlecentered}{\@titlecenteredtrue}
+% \end{macrocode}
+%
+% In this document class the titlepage uses all capital
+% letters. The option \Lopt{mctitle} (for `mixed case') prevents
+% this.
+% \begin{macrocode}
+\DeclareOption{mctitle}{\@allcapsfalse}
+\DeclareOption{uctitle}{\@allcapstrue}
+% \end{macrocode}
+%
+% \subsection{Twocolumn printing}
+%
+% Two-column and one-column printing is again realized via a switch.
+% \begin{macrocode}
+\DeclareOption{onecolumn}{\@twocolumnfalse}
+\DeclareOption{twocolumn}{\@twocolumntrue}
+% \end{macrocode}
+%
+% \subsection{Equation numbering on the left}
+%
+% The option \Lopt{leqno} can be used to get the equation numbers
+% on the left side of the equation.
+% \begin{macrocode}
+\DeclareOption{leqno}{\input{leqno.clo}}
+% \end{macrocode}
+%
+% \subsection{Flush left displays}
+%
+% The option \Lopt{fleqn} redefines the displayed math environmens
+% in such a way that they come out flush left, with an indentation
+% of |\mathindent| from the prevailing left margin.
+% \begin{macrocode}
+\DeclareOption{fleqn}{\input{fleqn.clo}}
+% \end{macrocode}
+%
+% \subsection{Open bibliography}
+%
+% The option \Lopt{openbib} produces the ``open'' bibliography
+% style, in which each block starts on a new line, and succeeding
+% lines in a block are indented by |\bibindent|.
+% \begin{macrocode}
+\DeclareOption{openbib}{\@openbibtrue}
+% \end{macrocode}
+%
+%
+% \section{Executing Options}
+%
+% Here we execute the default options to initialize certain
+% variables.
+% \begin{macrocode}
+\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,uctitle,openany}
+% \end{macrocode}
+%
+% The |\ProcessOptions| command causes the execution of the code
+% for every option \Lopt{FOO}
+% which is declared and for which the user typed
+% the \Lopt{FOO} option in his
+% |\documentclass| command. For every option \Lopt{BAR} he typed,
+% which is not declared, the option is assumed to be a global option.
+% All options will be passed as document options to any
+% |\usepackage| command in the document preamble.
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+% Now that all the options have been executed we can load the
+% chosen class option file that contains all size dependent code.
+% \begin{macrocode}
+\input{ntg1\@ptsize.clo}
+% \end{macrocode}
+%
+% \section{Loading Packages}
+%
+% These class files do not load additional packages.
+%
+%
+% \section{Document Layout}
+% \label{sec:maincode}
+%
+% In this section we are finally dealing with the nasty typographical
+% details.
+%
+% \subsection{Paragraphing}
+%
+% \begin{macro}{\lineskip}
+% \begin{macro}{\normallineskip}
+% These parameters control \TeX's behaviour when two lines tend to
+% come too close together.
+% \begin{macrocode}
+\setlength\lineskip{1\p@}
+\setlength\normallineskip{1\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\baselinestretch}
+% This is used as a multiplier for |\baselineskip|. The default is
+% to {\em not\/} stretch the baselines.
+% \begin{macrocode}
+\renewcommand\baselinestretch{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\unitindent}
+% These document classes all use a single dimension for a number of
+% layout parameters:
+% \begin{itemize}
+% \item the label width in section heading,
+% \item the |\parindent|
+% \item the footnote label indent (= half |\unitindent|)
+% \item listindent on the first level
+% \end{itemize}
+% \begin{macrocode}
+\newdimen\unitindent
+% \end{macrocode}
+% The default setting accomodates three levels of single digit
+% section numbering.
+% \begin{macrocode}
+{\setbox0\hbox{\normalsize\rmfamily 2.2.2\hskip.5em}
+ \global\unitindent=\wd0}
+% \end{macrocode}
+%
+% \begin{macro}{\othermargin}
+% Other indentations are maximal label width plus white space.
+% \begin{macrocode}
+\newdimen\othermargin
+{\setbox0\hbox{\normalsize (m)\hskip.6em}\global\othermargin=\wd0}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{if@needwriteindent}
+% If this is not enough, a new width is calculated, set, and the
+% file{.aux} file contains an instruction that will set
+% |\unitindent| on the next run.
+%
+% For this we need a switch
+% \begin{macrocode}
+\newif\if@needwriteindent
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@indentset}
+% And a command that sets the various parameters.
+% \begin{macrocode}
+\newcommand\@indentset{%
+%<-type3> \global\parindent=\unitindent
+ \global\leftmargini=\unitindent
+ \global\@needwriteindenttrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@writeindent}
+% The |\end{document}| command will call |\@writeindent| to write
+% the final width of |\unitindent| on the \file{.aux} file. Also a
+% command is written to set |\unitindent|. To be compatible with
+% other document classes a check is written to the \file{.aux} file
+% for the existence of |\unitindent|. This prevents nasty errors
+% when another document class is used.
+% \begin{macrocode}
+\newcommand\@writeindent[1]{\immediate\write\@mainaux
+ {\string\@ifundefined{unitindent}{\string\newdimen\string\unitindent
+ \let\string\@indentset\relax}{}}
+ \immediate\write\@mainaux{\global\string\unitindent=#1\string\relax
+ \string\@indentset \string\relax}}
+% \end{macrocode}
+% \end{macro}
+%
+% We need to use the hook into |\end{document}| to write the final
+% value of |\unitindent| om the file{.aux} file for the next run.
+% \begin{macrocode}
+\AtEndDocument{%
+ \if@filesw
+ \if@needwriteindent
+ \@writeindent{\the\unitindent}
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parskip}
+% \begin{macro}{\parindent}
+% |\parskip| gives extra vertical space between paragraphs and
+% |\parindent| is the width of the paragraph indentation. The value
+% of |\parindent| depends on whether we are in two column mode.
+% \begin{macrocode}
+%<*type1>
+\setlength\parskip{0\p@}
+\setlength\parindent{\unitindent}
+%</type1>
+%<*type3>
+\setlength\parskip{.5\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip}
+\setlength\parindent{\z@}
+%</type3>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@lowpenalty}
+% \begin{macro}{\@medpenalty}
+% \begin{macro}{\@highpenalty}%
+% The commands |\nopagebreak| and |\nolinebreak| put in penalties
+% to discourage these breaks at the point they are put in.
+% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|,
+% dependent on their argument.
+% \begin{macrocode}
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\clubpenalty}
+% \begin{macro}{\widowpenalty}
+% These penalties are use to discourrage club and widow lines.
+% Because we use their default values we only show them here,
+% commented out.
+% \begin{macrocode}
+% \clubpenalty 150
+% \widowpenalty 150
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\displaywidowpenalty}
+% \begin{macro}{\predisplaypenalty}
+% \begin{macro}{\postdisplaypenalty}
+% Discourrage (but not so much) widows in front of a math display
+% and forbid breaking directly in front of a display. Allow break
+% after a display without a penalty. Again the default values are
+% used, therefore we only show them here.
+% \begin{macrocode}
+% \displaywidowpenalty 50
+% \predisplaypenalty 10000
+% \postdisplaypenalty 0
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\interlinepenalty}
+% Allow the breaking of a page in the middle of a paragraph.
+% \begin{macrocode}
+% \interlinepenalty 0
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\brokenpenalty}
+% We allow the breaking of a page after a hyphenated line.
+% \begin{macrocode}
+% \brokenpenalty 0
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Float placement parameters}
+%
+% All float parameters are given default values in the \LaTeXe{}
+% kernel. For this reason counters only need to be set with
+% |\setcounter| and other parameters are set using |\renewcommand|.
+%
+% \paragraph{Limits for the placement of floating objects}
+%
+% \begin{macro}{\c@topnumber}
+% The \Lcount{topnumber} counter holds the maximum number of
+% floats that can appear on the top of a text page.
+% \begin{macrocode}
+\setcounter{topnumber}{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\topfraction}
+% This indicates the maximum part of a text page that can be
+% occupied by floats at the top.
+% \begin{macrocode}
+\renewcommand\topfraction{.7}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@bottomnumber}
+% The \Lcount{bottomnumber} counter holds the maximum number of
+% floats that can appear on the bottom of a text page.
+% \begin{macrocode}
+\setcounter{bottomnumber}{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bottomfraction}
+% This indicates the maximum part of a text page that can be
+% occupied by floats at the bottom.
+% \begin{macrocode}
+\renewcommand\bottomfraction{.3}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@totalnumber}
+% This indicates the maximum number of floats that can appear on
+% any text page.
+% \begin{macrocode}
+\setcounter{totalnumber}{3}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textfraction}
+% This indicates the minimum part of a text page that has to be
+% occupied by text.
+% \begin{macrocode}
+\renewcommand\textfraction{.2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatpagefraction}
+% This indicates the minimum part of a page that has to be
+% occupied by floating objects before a `float page' is produced.
+% \begin{macrocode}
+\renewcommand\floatpagefraction{.5}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@dbltopnumber}
+% The \Lcount{dbltopnumber} counter holds the maximum number of
+% two column floats that can appear on the top of a two column text
+% page.
+% \begin{macrocode}
+\setcounter{dbltopnumber}{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dbltopfraction}
+% This indicates the maximum part of a two column text page that
+% can be occupied by two column floats at the top.
+% \begin{macrocode}
+\renewcommand\dbltopfraction{.7}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dblfloatpagefraction}
+% This indicates the minimum part of a page that has to be
+% occupied by two column wide floating objects before a `float
+% page' is produced.
+% \begin{macrocode}
+\renewcommand\dblfloatpagefraction{.5}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Page Styles}
+%
+% The page style \pstyle{foo} is defined by defining the command
+% |\ps@foo|. This command should make only local definitions.
+% There should be no stray spaces in the definition, since they
+% could lead to mysterious extra spaces in the output (well, that's
+% something that should be always avoided).
+%
+% \begin{macro}{\@evenhead}
+% \begin{macro}{\@oddhead}
+% \begin{macro}{\@evenfoot}
+% \begin{macro}{\@oddfoot}
+% The |\ps@...| command defines the macros |\@oddhead|,
+% |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running
+% heads and feet---e.g., |\@oddhead| is the macro to produce the
+% contents of the heading box for odd-numbered pages. It is called
+% inside an |\hbox| of width |\textwidth|.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\thispagestyle}
+% Several commands (|\index|, |\maketitle|) give a
+% |\thispagestyle{plain}| command, which will overrule a
+% |\pagestyle{empty}| command. This situation is almost always
+% unwanted. Therefore we provide a more careful definition.
+%
+% First save the original definition.
+% \begin{macrocode}
+\let\Thispagestyle\thispagestyle
+% \end{macrocode}
+% Then we provide the new definition, for which we must also adapt
+% |\pagestyle| a little.
+% \begin{macrocode}
+\newcommand\@emptypagestyle{empty}
+\renewcommand\pagestyle[1]{\@nameuse{ps@#1}\def\@currentpagestyle{#1}}
+\renewcommand\thispagestyle[1]{%
+ \ifx\@currentpagestyle\@emptypagestyle
+ \else
+ \global\@specialpagetrue
+ \gdef\@specialstyle{#1}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Marking conventions}
+%
+% To make headings determined by the sectioning commands, the page
+% style defines the commands |\chaptermark|, |\sectionmark|,
+% \ldots,\\
+% where |\chaptermark{|\meta{TEXT}|}| is called by
+% |\chapter| to set a mark, and so on.
+%
+% The |\...mark| commands and the |\...head| macros are defined
+% with the help of the following macros. (All the |\...mark|
+% commands should be initialized to no-ops.)
+%
+% \LaTeX{} extends \TeX's |\mark| facility by producing two kinds
+% of marks, a `left' and a `right' mark, using the following
+% commands:
+% \begin{flushleft}
+% |\markboth{|\meta{LEFT}|}{|\meta{RIGHT}|}|: Adds both marks.
+%
+% |\markright{|\meta{RIGHT}|}|: Adds a `right' mark.
+%
+% |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
+% or |\@evenfoot| macros, it gets the current `left'
+% mark. |\leftmark| works like \TeX's |\botmark|
+% command.
+%
+% |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
+% or |\@evenfoot| macros, it gets the current
+% `right' mark. |\rightmark| works like \TeX's
+% |\firstmark| command.
+% \end{flushleft}
+%
+% The marking commands work reasonably well for right marks
+% `numbered within' left marks--e.g., the left mark is changed by a
+% |\chapter| command and the right mark is changed by a |\section|
+% command. However, it does produce somewhat anomalous results if
+% two |\markboth|'s occur on the same page.
+%
+%
+% Commands like |\tableofcontents| that should set the marks in some
+% page styles use a |\@mkboth| command, which is |\let| by the
+% pagestyle command (|\ps@...|) to |\markboth| for setting the
+% heading or to |\@gobbletwo| to do nothing.
+%
+%
+% \begin{macrocode}
+% %%%\mark{{}{}} % Initializes TeX's marks <--- can vanish
+% \end{macrocode}
+%
+% \subsubsection{Defining the page styles}
+% \label{sec:pagestyle}
+%
+% The pagestyle \pstyle{empty} is defined in \file{latex.dtx}, but
+% the pagestyle \pstyle{plain} is slightly altered here. The
+% difference is that the page numbers are set flush right in
+% onesided and flush left and right in the twosided style.
+%
+% \begin{macro}{\ps@plain}
+%
+% \begin{macrocode}
+\renewcommand\ps@plain{%
+% \end{macrocode}
+% The running head are empty in this pagestyle, the page number
+% appears in the running foot.
+% \begin{macrocode}
+ \let\@oddhead\@empty\let\@evenhead\@empty
+ \def\@oddfoot{\hfil\PageFont\thepage}%
+ \if@twoside
+ \def\@evenfoot{\PageFont\thepage\hfil}%
+ \else
+ \let\@evenfoot\@oddfoot
+ \fi
+% \end{macrocode}
+% Because the running heads should be empty we |let| |\@mkboth| to
+% |\@gobbletwo|, thus disabling the mark commands.
+% \begin{macrocode}
+ \let\@mkboth\@gobbletwo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@headings}
+% The definition of the page style \pstyle{headings} has to be
+% different for two sided printing than it is for one sided
+% printing.
+%
+% \begin{macrocode}
+\if@twoside
+ \def\ps@headings{%
+% \end{macrocode}
+% The running feet are empty in this page style, the running head
+% contains the page number and one of the marks.
+% \begin{macrocode}
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{{\PageFont\thepage}\hfil\MarkFont\leftmark}%
+ \def\@oddhead{{\MarkFont\rightmark}\hfil\PageFont\thepage}%
+% \end{macrocode}
+%
+% When using this page style, the contents of the running head is
+% determined by the chapter and section titles. So we |\let|
+% |\@mkboth| to |\markboth|.
+% \begin{macrocode}
+ \let\@mkboth\markboth
+% \end{macrocode}
+%
+% In thisdocument class we use the |\chaptermark|
+% and |\sectionmark| macros to fill the running heads.
+%
+% Note the use of |##1| for the parameter of the |\chaptermark|
+% command, which will be defined when |\ps@headings| is executed.
+%
+% \begin{macrocode}
+ \def\chaptermark##1{%
+ \markboth {\uppercase{\ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\uppercase{\ifnum \c@secnumdepth >\z@
+ \thesection. \ \fi
+ ##1}}}}
+% \end{macrocode}
+%
+% The definition of |\ps@headings| for one sided printing can be
+% much simpler, because we treat even and odd pages the same.
+% Therefore we don't need to define |\@even...|.
+% \begin{macrocode}
+\else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{{\MarkFont\rightmark}\hfil\PageFont\thepage}%
+ \let\@mkboth\markboth
+% \end{macrocode}
+% We use |\markright| now instead of |\markboth| as we did for two
+% sided printing.
+% \begin{macrocode}
+ \def\chaptermark##1{%
+ \markright {\uppercase{\ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ \fi
+ ##1}}}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@myheadings}
+% The definition of the page style \pstyle{myheadings} is fairly
+% simple because the user determines the contents of the running
+% head himself by using the |\markboth| and |\markright| commands.
+%
+% \begin{macrocode}
+\def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{{\PageFont\thepage}\hfil\MarkFont\leftmark}%
+ \def\@oddhead{{\MarkFont\rightmark}\hfil\PageFont\thepage}%
+% \end{macrocode}
+%
+% We have to make sure that the marking commands that are used by
+% the chapter and section headings are disabled. We do this
+% |\let|ting them to a macro that gobbles its argument(s).
+% \begin{macrocode}
+ \let\@mkboth\@gobbletwo
+ \let\chaptermark\@gobble
+ \let\sectionmark\@gobble
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PageFont}
+% \begin{macro}{\MarkFont}
+% These macros are use to store the fonts that are used to typeset
+% the pagenumber (|\PageFont|) and the marks (|\MarkFont|) in the
+% running head and feet.
+% \begin{macrocode}
+\newcommand\PageFont{\rmfamily}
+\newcommand\MarkFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\RunningFonts}
+% Use this macro to change the fonts that are used in the running
+% heads.
+% \begin{macrocode}
+\newcommand\RunningFonts[2]{%
+ \renewcommand\PageFont{#1}\renewcommand\MarkFont{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Document Markup}
+%
+% \subsection{The title}
+%
+% \begin{macro}{\title}
+% \begin{macro}{\author}
+% \begin{macro}{\date}
+% These three macros are provided by \file{latex.dtx} to provide
+% information about the title, author(s) and date of the document.
+% The information is stored away in internal control sequences.
+% It is the task of the |\maketitle| command to use the
+% information provided. The definitions of these macros are shown
+% here for information.
+% \begin{macrocode}
+% \newcommand\title[1]{\gdef\@title{#1}}
+% \newcommand\author[1]{\gdef\@author{#1}}
+% \newcommand\date[1]{\gdef\@date{#1}}
+% \end{macrocode}
+% The |\date| macro gets today's date by default.
+% \begin{macrocode}
+% \gdef\@date{\today}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\TitleFont}
+% This selects the font to use in the title of the document.
+% \begin{macrocode}
+\newcommand\TitleFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\maketitle}
+% The definition of |\maketitle| depends on whether a seperate
+% title page is made. This is the default for this document class.
+% Note that the title, author and date information is printed in
+% capital letters by default. This can be changed by the option
+% \Lopt{mctitle}.
+%
+% When we are making a title page, we locally redefine
+% |\footnotesize| and |\footnoterule| to change the appearance of
+% the footnotes that are produced by the |\thanks| command.
+% \begin{macrocode}
+\renewcommand\TitleFont{\rmfamily}
+\newcommand\maketitle{%
+ \begin{titlepage}%
+ \let\footnotesize\small
+ \let\footnoterule\relax
+% \end{macrocode}
+% Footnotes on the titlepage, generated by the use of |\thanks|,
+% use symbols in these document classes.
+% \begin{macrocode}
+ \long\def\@makefntext##1{\parindent\z@
+ \def\labelitemi{--}\@revlabeltrue
+ \leavevmode$\m@th^{\@thefnmark}$\kern1em\relax ##1}
+ \renewcommand\thefootnote{\fnsymbol{footnote}}%
+% \end{macrocode}
+% We center the entire title vertically; the centering is set off a
+% little by adding a |\vskip|. In compatibility mode the pagenumber
+% is set to 0 to keep the behaviour of \LaTeX\ 2.09 style files
+% \begin{macrocode}
+ \if@compatibility\setcounter{page}{0}\fi
+ \null\vfil
+ \vskip 60\p@
+% \end{macrocode}
+% Then we set the title, in a |\LARGE| font; leave a little space
+% and set the author(s) in a |\large| font. We do this inside a
+% tabular environment to get them in a single column.
+% Before the date we leave a little whitespace again.
+% \begin{macrocode}
+ \begin{center}%
+ \TitleFont
+ {\LARGE \def\\{\penalty -\@M}
+ \if@allcaps
+ \expandafter\uc@nothanks\@title\thanks\relax
+ \else
+ \@title
+ \fi\par}%
+ \vskip 3em%
+ {\large
+ \lineskip .75em \parindent\z@
+ \begin{tabular}[t]{c}%
+ \if@allcaps
+ \expandafter\uc@authornothanks\@author\and\relax
+ \else
+ \@author
+ \fi
+ \end{tabular}\par}%
+ \vskip 1.5em%
+ {\large
+ \if@allcaps
+ \uppercase\expandafter{\@date}%
+ \else
+ \@date
+ \fi\par}%
+ \end{center}\par
+% \end{macrocode}
+% Then we call |\@thanks| to print the information that goes into
+% the footnote and finish the page.
+% \begin{macrocode}
+ \@thanks
+ \vfil\null
+ \end{titlepage}%
+% \end{macrocode}
+% We reset the \Lcount{footnote} counter, disable |\thanks| and
+% |\maketitle| and save some storage space by emptying the internal
+% information macros.
+% \begin{macrocode}
+ \setcounter{footnote}{0}%
+ \let\thanks\relax\let\maketitle\relax
+ \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
+% \end{macrocode}
+%
+% We want to have the title, author and date information in
+% uppercase, but we have to be very carefull not to put too much
+% text in uppercase. The macros that perform the filtering of texts
+% that shouldn't be in uppercase were developped with th help of
+% Howard Trickey.
+%
+% \begin{macro}{\uc@nothanks}
+% This macro takes all the text up to the first use of |\thanks|
+% and passes it to |\uppercase|. The use of |\futurelet| will store
+% the token \emph{after} the |\thanks| in |\@tempa|. The macro
+% |\u@tx| uses that information to determine what to do next.
+% \begin{macrocode}
+\def\uc@nothanks#1\thanks{\uppercase{#1}\futurelet\@tempa\uc@tx}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@authornothanks}
+% A document can have more than one author. Usually they are
+% seperated with |\and|. For each author a footnote --using
+% |\thanks| can be present. Therefore this macro takes all the text
+% up to the first use of |\and|, thus picking up all the
+% information for one author. This is than passsed to
+% |\uc@nothanks|, which checks for the presence of |\thanks|. For
+% this to work the argument of |\uc@nothanks| has to be delimited
+% by |\thanks\relax|.
+% \begin{macrocode}
+\def\uc@authornothanks#1\and{\uc@nothanks#1\thanks\relax
+% \end{macrocode}
+% Then we have to check whether the |\and| we ound earlier was put
+% in by the user, in which case information for another user will
+% follow, or by the call from another macro, in which case the
+% |\and| will be followed by a |\relax| token. The |\futurelet|
+% contstruct stores the first token \emph{after} the |\and| in
+% |\@tempa| to be inspected by |\u@ax|.
+% \begin{macrocode}
+ \futurelet\@tempa\uc@ax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@ax}
+% When |\@tempa| contains a |\relax| token nothing needs to be
+% done, when it doesn't we put in a linebreak |\\| the word `and'
+% (stored in |\andname| so that this control sequence can be
+% redeined for other languages), another linebreak and we call
+% |\uc@authornothanks| to continue processing. The |\expandafter|
+% lets \TeX\ see the |\fi| first.
+% \begin{macrocode}
+\def\uc@ax{%
+ \ifx\@tempa\relax
+ \else
+ \\ \andname \\ \expandafter\uc@authornothanks
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@tx}
+% This macro simply checks whether |\@tempa| contains a |\relax|
+% token. When it doesn't further processing is performed by
+% |\u@ty|.
+% \begin{macrocode}
+\def\uc@tx{\ifx\@tempa\relax
+ \else \expandafter\uc@ty \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uc@ty}
+% The macro |\uc@ty| gets executed when the |\thanks| that
+% delimited text earlier on in the processing had a real argument.
+% In that case it was a |\thanks| put in by the user, \emph{not} by
+% these macros. Therefore the argument is now passed to |\thanks|
+% and processing continues by calling |\uc@nothanks|.
+% \begin{macrocode}
+\def\uc@ty#1{\thanks{#1}\uc@nothanks}
+% \end{macrocode}
+% \end{macro}
+%
+% When the title is not on a page of its own, the layout of the
+% title is a little different. We use symbols to mark the footnotes
+% and we have to deal with two column documents.
+%
+% Therefore we first start a new group to keep changes local. Then
+% we redefine |\thefootnote| to use |\fnsymbol|; and change
+% |\@makefnmark| so that footnotemarks have zero width (to make the
+% centering of the author names look better). We also want raised
+% footnotemarkers in the footnotes here.
+% \begin{macrocode}
+\else
+\newcommand\maketitle{\par
+ \begingroup
+ \renewcommand\thefootnote{\fnsymbol{footnote}}%
+ \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
+ \def\@makefntext{\@xmakefntext{$\m@th^{\@thefnmark}$}}%
+% \end{macrocode}
+% If this is a twocolumn document we start a new page in twocolumn
+% mode, with the title set to the full width of the text. The
+% actual printing of the title information is left to
+% |\@maketitle|.
+% \begin{macrocode}
+ \if@twocolumn
+ \ifnum \col@number=\@ne
+ \@maketitle
+ \else
+ \twocolumn[\@maketitle]%
+ \fi
+ \else
+% \end{macrocode}
+% When this is not a twocolumn document we just start a new page,
+% prevent floating objects from appearing on the top of this page
+% and print the title information.
+% \begin{macrocode}
+ \newpage
+ \global\@topnum\z@
+ \@maketitle
+ \fi
+% \end{macrocode}
+% This page gets a \pstyle{plain} layout. We call |\@thanks| to
+% produce the footnotes.
+% \begin{macrocode}
+ \thispagestyle{plain}\@thanks
+% \end{macrocode}
+% Now we can close the group, reset the \Lcount{footnote} counter,
+% disable |\thanks|, |\maketitle| and |\@maketitle| and save some
+% storage space by emptying the internal information macros.
+% \begin{macrocode}
+ \endgroup
+ \setcounter{footnote}{0}%
+ \let\thanks\relax
+ \let\maketitle\relax\let\@maketitle\relax
+ \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
+% \end{macrocode}
+%
+% \begin{macro}{\@maketitle}
+% This macro takes care of formatting the title information when we
+% have no seperate title page.
+%
+% We always start a new page, leave some white space and center the
+% information. The title is set in a |\LARGE| font, the author
+% names and the in a |\large| font.
+% \begin{macrocode}
+\def\@maketitle{%
+ \newpage
+ \null
+ \vskip 2em%
+%<+type3>\if@titlecentered
+ \begin{center}%
+ {\LARGE \TitleFont \@title \par}%
+ \vskip 1.5em%
+ {\large \TitleFont
+ \lineskip .5em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1em%
+ {\large \TitleFont \@date}%
+ \end{center}%
+%<*type3>
+ \else
+ {\LARGE \TitleFont \head@style \@title \par} \vskip 1.5em
+ {\large \TitleFont \lineskip .5em \tabcolsep\z@
+ \def\and{%%% \begin{tabular} has already started
+ \end{tabular}\hskip 1em plus .17fil
+ \begin{tabular}[t]{l}}%% \end{tabular} will come
+ \begin{tabular}[t]{l}\@author\end{tabular}\par}
+ \vskip 1em {\large \TitleFont \@date}
+ \fi
+%</type3>
+ \par
+ \vskip 1.5em}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Chapters and Sections}
+%
+% \subsubsection{Building blocks}
+% The definitions in this part of the class file make use of two
+% macros, |\@startsection| and |\secdef|, which are defined by
+% \file{latex.dtx}. To understand what is going on here, we
+% describe their syntax.
+%
+% The macro |\@startsection| has 6 required arguments, optionally
+% followed by a $*$, an optional argument and a required argument:
+%
+% |\@startsection|\meta{name}\meta{level}\meta{indent}^^A
+% \meta{beforeskip}\meta{afterskip}\meta{style}
+% optional *\\
+% \null\hphantom{\bslash @startsection}^^A
+% |[|\meta{altheading}|]|\meta{heading}
+%
+% It is a generic command to start a section, the arguments have
+% the following meaning:
+%
+% \begin{description}
+% \item[\meta{name}] The name of the user level command, e.g.,
+% `section'.
+% \item[\meta{level}] A number, denoting the depth of the section
+% -- e.g., chapter=1, section = 2, etc. A section number
+% will be printed if and only if \meta{level} $<=$ the value
+% of the \Lcount{secnumdepth} counter.
+% \item[\meta{indent}] The indentation of the heading from the left
+% margin
+% \item[\meta{beforeskip}] The absolute value of this argument
+% gives the skip to leave above the heading. If it is
+% negative, then the paragraph indent of the text following
+% the heading is suppressed.
+% \item[\meta{afterskip}] If positive, this gives the skip to leave
+% below the heading, else it gives the skip to leave to the
+% right of a run-in heading.
+% \item[\meta{style}] Commands to set the style of the heading.
+% \item[$*$] When this is missing the heading is numbered and the
+% corresponding counter is incremented.
+% \item[\meta{altheading}] Gives an alternative heading to use in
+% the table of contents and in the running heads. This should
+% be present when the $*$ form is used.
+% \item[\meta{heading}] The heading of the new section.
+% \end{description}
+% A sectioning command is normally defined to |\@startsection| and
+% its first six arguments.
+%
+% The macro |\secdef| can be used when a sectioning command is
+% defined without using |\@startsection|. It has two arguments:
+%
+% |\secdef|\meta{unstarcmds}\meta{starcmds}
+%
+% \begin{description}
+% \item[\meta{unstarcmds}] Used for the normal form of the
+% sectioning command.
+% \item[\meta{starcmds}] Used for the $*$-form of the
+% sectioning command.
+% \end{description}
+%
+% You can use |\secdef| as follows:
+% \begin{verbatim}
+% \def\chapter { ... \secdef \CMDA \CMDB }
+% \def\CMDA [#1]#2{ ... } % Command to define
+% % \chapter[...]{...}
+% \def\CMDB #1{ ... } % Command to define
+% % \chapter*{...}
+% \end{verbatim}
+%
+% \begin{macro}{\head@style}
+% In the definition of chapter and section commands a number of
+% settings frequently occur. Therefore we store them in a control
+% sequence.
+%
+% Section headings are to be set extremely raggedright, with no
+% hyphenations, not even at explicit hyphens.
+%
+% \begin{macrocode}
+\newcommand\head@style{%
+ \interlinepenalty \@M
+ \hyphenpenalty=\@M \exhyphenpenalty=\@M
+ \rightskip=0cm plus .7\hsize\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect}
+% The definition of this macro from \file{latex.dtx} needs to be
+% repeated here because we want to modify its behaviour with
+% respect to:
+% \begin{enumerate}
+% \item the width of the number, which is fixed;
+% \item checking the value of |\unitindent|;
+% \item formatting the section title ragged right;
+% \item changing the argument of |\contentsline|.
+% \end{enumerate}
+% \begin{macrocode}
+\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty\else
+ \refstepcounter{#1}%
+% \end{macrocode}
+% The following code (within the group) checks the value of
+% |\unitindent|. If the sectionnumber is wider than |\unitindent|
+% its value is adapted and a flag is set to rememeber to store the
+% new value in the \file{.aux}-file.
+% \begin{macrocode}
+ \begingroup
+ \setbox\@tempboxa=\hbox{#6\relax
+ \csname the#1\endcsname
+ \hskip.5em}
+ \ifdim\wd\@tempboxa>\unitindent
+ \global\unitindent=\wd\@tempboxa
+ \@indentset
+ \fi
+ \endgroup
+ \let\@@protect\protect
+ \def\protect{\noexpand\protect\noexpand}%
+ \edef\@svsec{\@seccntformat{#1}}%
+ \let\protect\@@protect\fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup #6\relax
+ \@hangfrom{\hskip #3\relax\@svsec}{\head@style #8\par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth
+ \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ \toc@font#2 #7}%
+ \else
+ \def\@svsechd{#6\hskip #3\relax
+ \@svsec #8\csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth
+ \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ \toc@font#2 #7}}%
+ \fi
+ \@xsect{#5}}
+% \end{macrocode}
+% This macro was introduced in \LaTeXe, its definition is changed
+% here to get the fixed with of the section number.
+% \begin{macrocode}
+\def\@seccntformat#1{%
+ \hbox to \unitindent{\csname the#1\endcsname \hfil}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ssect}
+% Similar changes need to be made to the definition of |\@ssect|,
+% which is used in `starred' sections.
+% \begin{macrocode}
+\def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup #4\relax
+ \@hangfrom{\hskip #1}{\head@style #5\par}\endgroup
+ \else \def\@svsechd{#4\hskip #1\relax #5}\fi
+ \@xsect{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Mark commands}
+%
+% \begin{macro}{\chaptermark}
+% \begin{macro}{\sectionmark}
+% \begin{macro}{\subsectionmark}
+% \begin{macro}{\subsubsectionmark}
+% \begin{macro}{\paragraphmark}
+% \begin{macro}{\subparagraphmark}
+% Default initializations of |\...mark| commands. These commands
+% are used in the definition of the page styles (see
+% section~\ref{sec:pagestyle}) Most of them are already defined by
+% \file{latex.ltx}, so they are only shown here.
+%
+% \begin{macrocode}
+\newcommand\chaptermark[1]{}
+% \newcommand\sectionmark[1]{}
+% \newcommand\subsectionmark[1]{}
+% \newcommand\subsubsectionmark[1]{}
+% \newcommand\paragraphmark[1]{}
+% \newcommand\subparagraphmark[1]{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Define Counters}
+%
+% \begin{macro}{\c@secnumdepth}
+% The value of the counter \Lcount{secnumdepth} gives the depth of
+% the highest-level sectioning command that is to produce section
+% numbers.
+% \begin{macrocode}
+\setcounter{secnumdepth}{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@part}
+% \begin{macro}{\c@chapter}
+% \begin{macro}{\c@section}
+% \begin{macro}{\c@subsection}
+% \begin{macro}{\c@subsubsection}
+% \begin{macro}{\c@paragraph}
+% \begin{macro}{\c@subparagraph}
+% These counters are used for the section numbers. The macro\\
+% |\newcounter{|\meta{newctr}|}[|\meta{oldctr}|]|\\
+% defines \meta{newctr} to be a counter, which is reset to zero when
+% counter \meta{oldctr} is stepped. Counter \meta{oldctr} must
+% already be defined.
+%
+% \begin{macrocode}
+\newcounter {part}
+\newcounter {chapter}
+\newcounter {section}[chapter]
+\newcounter {subsection}[section]
+\newcounter {subsubsection}[subsection]
+\newcounter {paragraph}[subsubsection]
+\newcounter {subparagraph}[paragraph]
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\thepart}
+% \begin{macro}{\thechapter}
+% \begin{macro}{\thesection}
+% \begin{macro}{\thesubsection}
+% \begin{macro}{\thesubsubsection}
+% \begin{macro}{\theparagraph}
+% \begin{macro}{\thesubparagraph}
+% For any counter \Lcount{CTR}, |\theCTR| is a macro that defines
+% the printed version of counter \Lcount{CTR}. It is defined in
+% terms of the following macros:
+%
+% |\arabic{|\Lcount{COUNTER}|}| prints the value of
+% \Lcount{COUNTER} as an arabic numeral.
+%
+% |\roman{|\Lcount{COUNTER}|}| prints the value of
+% \Lcount{COUNTER} as a lowercase roman numberal.
+%
+% |\Roman{|\Lcount{COUNTER}|}| prints the value of
+% \Lcount{COUNTER} as an uppercase roman numberal.
+%
+% |\alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
+% as a lowercase letter: $1 =$~a, $2 =$~ b, etc.
+%
+% |\Alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
+% as an uppercase letter: $1 =$~A, $2 =$~B, etc.
+%
+% \begin{macrocode}
+\renewcommand\thepart {\Roman{part}}
+\renewcommand\thechapter {\arabic{chapter}}
+\renewcommand\thesection {\thechapter.\arabic{section}}
+\renewcommand\thesubsection {\thesection.\arabic{subsection}}
+\renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
+\renewcommand\theparagraph {\thesubsubsection.\arabic{paragraph}}
+\renewcommand\thesubparagraph {\theparagraph.\arabic{subparagraph}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@chapapp}
+% |\@chapapp| is initially defined to be `|\chaptername|'. The
+% |\appendix| command redefines it to be `|\appendixname|'.
+%
+% \begin{macrocode}
+\newcommand\@chapapp{\chaptername}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Parts}
+%
+% \begin{macro}{\part}
+% The command to start a new part of our document.
+%
+% We start a new (righthand) page and use the \pstyle{empty}.
+% \begin{macrocode}
+\newcommand\part{\cleardoublepage
+ \thispagestyle{empty}%
+% \end{macrocode}
+% When we are making a two column document, this will be a one
+% column page. We use |@tempswa| to remember to switch back to two
+% columns.
+% \begin{macrocode}
+ \if@twocolumn
+ \onecolumn
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+% \end{macrocode}
+% We need an empty box to prevent the fil glue from disappearing.
+% \begin{macrocode}
+ \hbox{}\vfil
+% \end{macrocode}
+% Here we use |\secdef| to indicate wwhich commands to use to make
+% the actual heading.
+% \begin{macrocode}
+ \secdef\@part\@spart}
+% \end{macrocode}
+%
+% \begin{macro}{\@part}
+% This macro does the actual formatting of the title of the part.
+%
+% \begin{macro}{\PartFont}
+% The font used to typeset the part is stored in this maro.
+% \begin{macrocode}
+\newcommand\PartFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% When \Lcount{secnumdepth} is larger than $-2$ for this document
+% class, we have a numbered part, otherwise it is unnumbered.
+% \begin{macrocode}
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}\toc@case{#1}}%
+ \else
+ \addcontentsline{toc}{part}{\toc@case{#1}}%
+ \fi
+% \end{macrocode}
+% We empty the mark registers and center the title on the page.
+% Also we prevent breaking between lines and reset the font.
+% \begin{macrocode}
+ \markboth{}{}
+ {\centering
+ \interlinepenalty \@M
+ \reset@font
+% \end{macrocode}
+% When this is a numbered part we have to print the number. We have
+% to expand |\partname| before |\uppercase| is called, therefore we
+% use a temporary control sequence that, when called will execute
+% |\uppercase| on the contents of |\partname|.
+% \begin{macrocode}
+ \ifnum \c@secnumdepth >-2\relax
+ \Large\PartFont
+ \edef\@tempa{\noexpand\uppercase{\partname}}\@tempa~\thepart
+ \par
+% \end{macrocode}
+% We leave some space before we print the title and leave the
+% finishing up to |\@endpart|.
+% \begin{macrocode}
+ \vskip 20\p@
+ \fi
+ \Large \PartFont \uppercase{#2}\par}%
+ \@endpart}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@spart}
+% This macro does the actual formatting of the title of the part
+% when the star form of the user command was used. In this case we
+% {\em never} print a number. Otherwise the formatting is the same.
+%
+% \begin{macrocode}
+\def\@spart#1{%
+ {\centering
+ \interlinepenalty \@M
+ \reset@font
+ \Large \PartFont #1\par}%
+ \@endpart}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@endpart}
+% This macro finishes the part page, for both |\@part| and
+% |\@spart|.
+%
+% First we fill the current page.
+% \begin{macrocode}
+\def\@endpart{\vfil\newpage
+% \end{macrocode}
+% Then, when we are in twosided mode, we produce a completely blank
+% page.
+% \begin{macrocode}
+ \if@twoside
+ \hbox{}%
+ \thispagestyle{empty}%
+ \newpage
+ \fi
+% \end{macrocode}
+% When this was a two column document we have to switch back to two
+% column mode.
+% \begin{macrocode}
+ \if@tempswa
+ \twocolumn
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Chapters}
+%
+% \begin{macro}{\chapter}
+% A chapter should always start on a new page therefore we start by
+% calling |\clearpage| and setting the pagestyle for this page to
+% \pstyle{plain}.
+% \begin{macrocode}
+\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
+ \thispagestyle{plain}%
+% \end{macrocode}
+% Then we prevent floats from appearing at the top of this page
+% because it looks weird to see a floating object above a chapter
+% title.
+% \begin{macrocode}
+ \global\@topnum\z@
+% \end{macrocode}
+% Then we suppress the indentation of the first paragraph by
+% setting the switch |\@afterindent| to |false|. We use |\secdef|
+% to specify the macros to use for actually setting the chapter
+% title.
+% \begin{macrocode}
+ \@afterindentfalse
+ \secdef\@chapter\@schapter}
+% \end{macrocode}
+%
+% \begin{macro}{\@chapter}
+% This macro is called when we have a numbered chapter. When
+% \Lcount{secnumdepth} is larger than $-1$ we display the chapter
+% number. We also inform the user that a new chapter is about to be
+% typeset by writing a message to the terminal.
+% \begin{macrocode}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}\toc@font0 #1}%
+ \else
+ \addcontentsline{toc}{chapter}{\toc@font0 #1}%
+ \fi
+% \end{macrocode}
+% After having written an entry to the table of contents we store
+% the (alternative) title of this chapter with |\chaptermark| and
+% add some white space to the lists of figures and tables.
+% \begin{macrocode}
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+% \end{macrocode}
+% Then we call upon |\@makechapterhead| to format the actual
+% chapter title. We have to do this in a special way when we are in
+% twocolumn mode in order to have the chapter title use the entire
+% |\textwidth|. In one column mode we call |\@afterheading| which
+% takes care of suppressing the indentation.
+% \begin{macrocode}
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\ChapFont}
+% The font used to typeset the chapters is stored in this maro.
+% \begin{macrocode}
+\newcommand\ChapFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makechapterhead}
+% The macro above uses |\@makechapterhead|\meta{text} to format the
+% heading of the chapter.
+%
+% We begin by leaving some white space. The we open a group in
+% which we have a paragraph indent of 0pt, and in which we have the
+% text set ragged right. We also reset the font.
+% \begin{macrocode}
+\def\@makechapterhead#1{%
+ \vspace*{50\p@ \@plus 5\p@}%
+ {\setlength\parindent{\z@}%
+ \setlength\parskip {\z@}%
+ \head@style \reset@font
+% \end{macrocode}
+% Then we check whether the number of the chapter has to be printed.
+% If so we leave some whitespace between the chapternumber and its
+% title.
+% \begin{macrocode}
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\ChapFont \@chapapp{} \thechapter
+ \par
+ \vskip 20\p@
+ \fi
+% \end{macrocode}
+% Now we set the title in a large bold font. We prevent a pagebreak
+% at this point and leave some whitespace before the text begins.
+% \begin{macrocode}
+ \Large \ChapFont #1\par
+ \nobreak
+ \vskip 40\p@
+ }}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@schapter}
+% This macro is called when we have an unnumbered chapter. It is
+% much simpler than |\@chapter| because it only needs to typeset
+% the chapter title.
+% \begin{macrocode}
+\def\@schapter#1{\if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\@makeschapterhead}
+% The macro above uses |\@makeschapterhead|\meta{text}to format
+% the heading of the chapter. It is similar to |\@makechapterhead|
+% except that it never has to print a chapter number.
+%
+% \begin{macrocode}
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@\@plus 5\p@}%
+ {\setlength\parindent{\z@}%
+ \setlength\parskip{\z@}%
+ \head@style
+ \reset@font
+ \Large \ChapFont #1\par
+ \nobreak
+ \vskip 40\p@
+ }}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Lower level headings}
+%
+% These commands all make use of |\@startsection|.
+% \begin{macro}{\section}
+% This gives a normal heading with white space above the heading
+% (the whitespace below the heading will be generated by the
+% |\parskip| that is inserted at the start of the first paragraph),
+% the title set in |\large\bfseries|, and no indentation on the
+% first paragraph.
+% \begin{macrocode}
+\newcommand\section{%
+ \@startsection {section}{1}{\z@}%
+ {-2\baselineskip\@plus -1\baselineskip \@minus -.5\baselineskip}%
+%<+type1> {.5\baselineskip}%
+%<+type3> {.01\baselineskip}%
+ {\reset@font\large\SectFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SectFont}
+% The font used to typeset the sections is stored in this maro.
+% \begin{macrocode}
+\newcommand\SectFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subsection}
+% This gives a normal heading with white space above the heading,
+% the title set in |\normalsize\bfseries|, and no indentation on
+% the first paragraph.
+% \begin{macrocode}
+\newcommand\subsection{%
+ \@startsection{subsection}{2}{\z@}%
+ {-1\baselineskip\@plus -.5\baselineskip \@minus -.25\baselineskip}%
+%<+type1> {.25\baselineskip}%
+%<+type3> {.01\baselineskip}%
+ {\reset@font\normalsize\SSectFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SSectFont}
+% The font used to typeset the subsections is stored in this maro.
+% \begin{macrocode}
+\newcommand\SSectFont{\bfseries}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subsubsection}
+% This gives a normal heading with white space above the heading,
+% the title set in |\normalsize\tm|, and no indentation on the
+% first paragraph.
+% \begin{macrocode}
+\newcommand\subsubsection{%
+ \@startsection{subsubsection}{3}{\z@}%
+ {-1\baselineskip plus -.5\baselineskip minus -.25\baselineskip}%
+%<+type1> {.25\baselineskip}%
+%<+type3> {.01\baselineskip}%
+ {\reset@font\normalsize\SSSectFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SSSectFont}
+% The font used to typeset the subsubsections is stored in this maro.
+% \begin{macrocode}
+\newcommand\SSSectFont{\rmfamily}
+\newcommand\SSSectFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\paragraph}
+% This gives a run-in heading with white space above and to the
+% right of the heading, the title set in |\normalsize\slshape|.
+% \begin{macrocode}
+\newcommand\paragraph{%
+ \@startsection{paragraph}{4}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\reset@font\normalsize\ParaFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\ParaFont}
+% The font used to typeset the paragraphs is stored in this maro.
+% \begin{macrocode}
+\newcommand\ParaFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\subparagraph}
+% This gives an indented run-in heading with white space above and
+% to the right of the heading, the title set in
+% |\normalsize\slshape|.
+% \begin{macrocode}
+\newcommand\subparagraph{%
+ \@startsection{subparagraph}{5}{\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\reset@font\normalsize\SParaFont}}
+% \end{macrocode}
+%
+% \begin{macro}{\SParaFont}
+% The font used to typeset the subparagraphs is stored in this maro.
+% \begin{macrocode}
+\newcommand\SParaFont{\slshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Headingfonts}
+% To change the fonts that are used to typeset the title,part,
+% chapter and section headings this macro can be used.
+% \begin{macrocode}
+\newcommand\HeadingFonts[8]{%
+ \renewcommand\TitleFont{#1}%
+ \renewcommand\PartFont{#2}%
+ \renewcommand\ChapFont{#3}%
+ \renewcommand\SectFont{#4}%
+ \renewcommand\SSectFont{#5}%
+ \renewcommand\SSSectFont{#6}%
+ \renewcommand\ParaFont{#7}%
+ \renewcommand\SParaFont{#8}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Lists}
+%
+% \subsubsection{General List Parameters}
+%
+% The following commands are used to set the default values for the list
+% environment's parameters. See the \LaTeX{} manual for an explanation
+% of the meanings of the parameters. Defaults for the list
+% environment are set as follows. First, |\rightmargin|,
+% |\listparindent| and |\itemindent| are set to 0pt. Then, for a Kth
+% level list, the command |\@listK| is called, where `K' denotes `i',
+% '`i', ... , `vi'. (I.e., |\@listiii| is called for a third-level
+% list.) By convention, |\@listK| should set |\leftmargin| to
+% |\leftmarginK|.
+%
+% \begin{macro}{\leftmargin}
+% \begin{macro}{\leftmargini}
+% \begin{macro}{\leftmarginii}
+% \begin{macro}{\leftmarginiii}
+% \begin{macro}{\leftmarginiv}
+% \begin{macro}{\leftmarginv}
+% \begin{macro}{\leftmarginvi}
+% For efficiency, level-one list's values are defined at top level, and
+% |\@listi| is defined to set only |\leftmargin|.
+%
+% \begin{macrocode}
+\setlength\leftmargini {\unitindent}
+\setlength\leftmarginii {\othermargin}
+\setlength\leftmarginiii{\othermargin}
+\setlength\leftmarginiv {\othermargin}
+\setlength\leftmarginv {\othermargin}
+\setlength\leftmarginvi {1em}
+% \end{macrocode}
+% Here we set the top level leftmargin.
+% \begin{macrocode}
+\setlength\leftmargin {\leftmargini}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\labelsep}
+% \begin{macro}{\labelwidth}
+% |\labelsep| is the distance between the label and the text of an
+% item; |\labelwidth| is the width of the label.
+% \begin{macrocode}
+\setlength \labelsep {5\p@}
+\setlength \labelwidth{\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\partopsep}
+% When the user leaves a blank line before the environment an extra
+% vertical space of |\partopsep| is inserted, in addition to
+% |\parskip| and |\topsep|.
+% \begin{macrocode}
+\setlength\partopsep{\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\topsep}
+% Extra vertical space, in addition to |\parskip|, added above and
+% below list and paragraphing environments.
+% \begin{macrocode}
+\setlength\topsep{\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@beginparpenalty}
+% \begin{macro}{\@endparpenalty}
+% These penalties are inserted before and after a list or paragraph
+% environment. They are set to a bonus value to encourage page
+% breaking at these points.
+% \begin{macro}{\@itempenalty}
+% This penalty is inserted between list items.
+% \begin{macrocode}
+\@beginparpenalty -\@lowpenalty
+\@endparpenalty -\@lowpenalty
+\@itempenalty -\@lowpenalty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@listI}
+% \begin{macro}{\@listi}
+% |\@listI| defines top level and |\@listi| values of
+% |\leftmargin|, |\parsep|, |\topsep|, and |\itemsep|
+%
+% \begin{macrocode}
+\def\@listI{%
+ \leftmargin\unitindent
+ \labelsep.5em%
+ \labelwidth\leftmargin
+ \advance\labelwidth-\labelsep
+ \parsep \z@
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip \@plus\p@
+ \itemsep 0\p@ \@plus1\p@}
+\let\@listi\@listI
+% \end{macrocode}
+% We have to initialise these parameters.
+% \begin{macrocode}
+\@listi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@listii}
+% \begin{macro}{\@listiii}
+% \begin{macro}{\@listiv}
+% \begin{macro}{\@listv}
+% \begin{macro}{\@listvi}
+% Here are the same macros for the higher level lists.
+% \begin{macrocode}
+\def\@listii {\leftmargin\leftmarginii
+ \labelsep .5em%
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+\def\@listiii{\leftmargin\leftmarginiii
+ \labelsep .5em%
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \partopsep \z@ \@plus\p@
+ \itemsep \z@ \@plus\p@}
+\def\@listiv {\leftmargin\leftmarginiv
+ \labelsep .5em%
+ \labelwidth\leftmarginiv%
+ \advance\labelwidth-\labelsep
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+\def\@listv {\leftmargin\leftmarginv
+ \labelsep .5em%
+ \labelwidth\leftmarginv
+ \advance\labelwidth-\labelsep%
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+\def\@listvi {\leftmargin\leftmarginvi
+ \labelsep .5em
+ \labelwidth\leftmarginvi
+ \advance\labelwidth{-\labelsep}%
+%<-type3> \topsep 0\p@ \@plus\p@
+%<+type3> \topsep -.5\parskip\@plus\p@
+ \parsep \z@
+ \itemsep \z@ \@plus\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Enumerate}
+%
+% The enumerate environment uses four counters: \Lcount{enumi},
+% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where
+% \Lcount{enumN} controls the numbering of the Nth level
+% enumeration.
+%
+% \begin{macro}{\theenumi}
+% \begin{macro}{\theenumii}
+% \begin{macro}{\theenumiii}
+% \begin{macro}{\theenumiv}
+% The counters are already defined in \file{latex.dtx}, but their
+% representation is changed here.
+%
+% \begin{macrocode}
+\renewcommand\theenumi{\arabic{enumi}}
+\renewcommand\theenumii{\alph{enumii}}
+\renewcommand\theenumiii{\roman{enumiii}}
+\renewcommand\theenumiv{\Alph{enumiv}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\labelenumi}
+% \begin{macro}{\labelenumii}
+% \begin{macro}{\labelenumiii}
+% \begin{macro}{\labelenumiv}
+% The label for each item is generated by the commands\\
+% |\labelenumi| ... |\labelenumiv|.
+% \begin{macrocode}
+\newcommand\labelenumi{\theenumi.}
+\newcommand\labelenumii{(\theenumii)}
+\newcommand\labelenumiii{\theenumiii.}
+\newcommand\labelenumiv{\theenumiv.}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\p@enumii}
+% \begin{macro}{\p@enumiii}
+% \begin{macro}{\p@enumiv}
+% The expansion of |\p@enumN||\theenumN| defines the output of a
+% |\ref| command when referencing an item of the Nth level of an
+% enumerated list.
+% \begin{macrocode}
+\renewcommand\p@enumii{\theenumi}
+\renewcommand\p@enumiii{\theenumi(\theenumii)}
+\renewcommand\p@enumiv{\p@enumiii\theenumiii}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{environment}{enumerate}
+% We want to have different label positioning on different levels of
+% list. To acheive this we have to redefine the \Lenv{enumerate}
+% environment.
+%
+% \begin{macrocode}
+\renewenvironment{enumerate}{%
+ \ifnum \@enumdepth >3
+ \@toodeep
+ \else
+ \advance\@enumdepth \@ne
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+ \list{\csname label\@enumctr\endcsname}
+ {\usecounter{\@enumctr}%
+%<+type1> \ifnum \@listdepth=1
+ \if@revlabel
+ \def\makelabel##1{\hskip .5\unitindent{##1\hfil}}%
+ \else
+%<-type3> \def\makelabel##1{\hfil##1}
+%<+type3> \def\makelabel##1{##1\hfil}
+ \fi
+%<*type1>
+ \else
+ \def\makelabel##1{##1\hfil}%
+%</type1>
+ \fi
+ }%
+ \fi}
+% \end{macrocode}
+% We try to suppress spaces after these list constructs.
+% \begin{macrocode}
+ {\global\@ignoretrue \endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Itemize}
+%
+% \begin{macro}{\labelitemi}
+% \begin{macro}{\labelitemii}
+% \begin{macro}{\labelitemiii}
+% \begin{macro}{\labelitemiv}
+% Itemization is controlled by four commands: |\labelitemi|,
+% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define
+% the labels of thevarious itemization levels: the symbols used are
+% bullet, bold en-dash, asterisk and centred dot.
+%
+% \begin{macrocode}
+\newcommand\labelitemi{$\m@th\bullet$}
+\newcommand\labelitemii{\bfseries --}
+\newcommand\labelitemiii{$\m@th\ast$}
+\newcommand\labelitemiv{$\m@th\cdot$}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{itemize}
+% We want to have differen label positioning on different levels of
+% list. To acheive this we have to redefine the \Lenv{itemize}
+% environment.
+% \begin{macrocode}
+\renewenvironment{itemize}{%
+ \ifnum \@itemdepth >3
+ \@toodeep
+ \else
+ \advance\@itemdepth \@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \list{\csname\@itemitem\endcsname}%
+ {%
+%<+type1> \ifnum \@listdepth=1\relax
+ \if@revlabel
+ \def\makelabel##1{\hskip .5\unitindent{##1\hfil}}\else
+%<+type1> \def\makelabel##1{\hfil##1}
+%<+type3> \def\makelabel##1{##1\hfil}
+ \fi
+%<*type1>
+ \else
+ \def\makelabel##1{##1\hfil}
+ \fi
+%</type1>
+ }%
+ \fi}
+% \end{macrocode}
+% We try to suppress spaces after these list constructs.
+% \begin{macrocode}
+ {\global\@ignoretrue \endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Description}
+%
+% \begin{environment}{description}
+% The description environment is defined here -- while the itemize
+% and enumerate environments are defined in \file{latex.dtx}.
+%
+% \begin{macrocode}
+\newenvironment{description}
+ {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+ \let\makelabel\descriptionlabel}}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\descriptionlabel}
+% To change the formatting of the label, you must redefine
+% |\descriptionlabel|.
+%
+% \begin{macrocode}
+\newcommand\descriptionlabel[1]{\hspace\labelsep \bfseries #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Adapting existing environments}
+%
+% Because we globally set |\topsep| to zero, we need to modify the
+% definitions of a number of environments slightly to get a litle
+% whitespace around them.
+%
+% \begin{environment}{center}
+% Add a litle surrounding whitespace.
+% \begin{macrocode}
+%<*type1>
+\def\center
+ {\topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \trivlist \centering\item[]}
+\let\endcenter\endtrivlist
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{flushleft}
+% Add a litle surrounding whitespace.
+% \begin{macrocode}
+\def\flushleft
+ {\topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \trivlist \raggedright\item[]}
+\let\endflushleft=\endtrivlist
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{flushright}
+% Add a litle surrounding whitespace.
+% \begin{macrocode}
+\def\flushright
+ {\topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \trivlist \raggedleft\item[]}
+\let\endflushright=\endtrivlist
+%</type1>
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{verbatim}
+% In \Lenv{verbatim} we add a little surrounding whitespace,
+% --which for \file{rapport3} is negative to
+% compensate for the positive |\parskip|-- but also an indent for
+% the \file{rapport1} document class.
+% \begin{macrocode}
+\def\verbatim{%
+%<*type1>
+ \topsep=.25\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip
+ \@verbatim
+ \leftskip\unitindent
+%</type1>
+%<*type3>
+ \topsep=-.5\parskip
+ \@verbatim
+%</type3>
+ \frenchspacing\@vobeyspaces \@xverbatim}
+%<+type1>\def\endverbatim{\if@newlist \leavevmode\fi\endtrivlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsection{Defining new environments}
+%
+% \subsubsection{Abstract}
+%
+% \begin{environment}{abstract}
+% When we are producing a separate titlepage we also put the
+% abstract on a page of its own. It will be centred vertically on
+% the page.
+%
+% \begin{macrocode}
+\if@titlepage
+ \newenvironment{abstract}{%
+ \titlepage
+ \null\vfil
+ \hbox{\SectFont \abstractname}
+ \noindent\ignorespaces}
+ {\par\vfil\null\endtitlepage}
+% \end{macrocode}
+% When we are not making a seperate titlepagewe have to check if we
+% are in twocolumn mode. In that case the abstract is set as a
+% |\section*|, otherwise the abstract is typeset flushleft, an
+% amount |\unitindent| smaller as the normal text.
+% \begin{macrocode}
+\else
+ \newenvironment{abstract}{%
+ \if@twocolumn
+ \section*{\abstractname}%
+ \else
+ \small
+ \bgroup\rightskip=\unitindent
+ \hbox{\SectFont \abstractname}%
+ \noindent\ignorespaces
+% \end{macrocode}
+ \fi}
+% \end{macrocode}
+% Which implies that the definition of |\end{abstract}| is also
+% different.
+% \begin{macrocode}
+ {\if@twocolumn\else\par\egroup\fi}
+\fi
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Verse}
+%
+% \begin{environment}{verse}
+% The verse environment is defined by making clever use of the
+% list environment's parameters. The user types |\\| to end a line.
+% This is implemented by |\let|'ing |\\| equal |\@centercr|.
+%
+% \begin{macrocode}
+\newenvironment{verse}
+ {\let\\=\@centercr
+ \list{}{\itemsep\z@
+ \itemindent-1.5em%
+ \listparindent\itemindent
+ \rightmargin\leftmargin
+ \advance\leftmargin1.5em}%
+ \item[]}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Quotation}
+%
+% \begin{environment}{quotation}
+% The quotation environment is also defined by making clever use of
+% the list environment's parameters. The lines in the environment
+% are set smaller than |\textwidth|. The first line of a paragraph
+% inside this environment is indented.
+%
+% \begin{macrocode}
+\newenvironment{quotation}
+ {\list{}{%
+ \listparindent\z@
+ \itemindent\listparindent
+ \rightmargin\leftmargin
+ \parsep\z@ \@plus\p@}%
+ \item[]}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Quote}
+%
+% \begin{environment}{quote}
+% The quote environment is like the quotation environment except
+% that paragraphs are not indented.
+%
+% \begin{macrocode}
+\newenvironment{quote}
+ {\list{}{\rightmargin\leftmargin}%
+ \item[]}
+ {\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Theorem}
+%
+% \begin{macro}{\@begintheorem}
+% \begin{macro}{\@opargbegintheorem}
+% \begin{macro}{\@endtheorem}
+% These document classes have a slightly modified \Lenv{theorem}
+% environment style. Surrounding whitespace is added and an
+% initialisation of |\labelsep|. Finally a slanted font instead of
+% an italic font is used.
+% \begin{macrocode}
+\def\@begintheorem#1#2{%
+ \vskip\baselineskip \labelsep=.5em%
+ \trivlist
+ \item[\hskip \labelsep{\bfseries #1\ #2}]\slshape}
+\def\@opargbegintheorem#1#2#3{%
+ \vskip\baselineskip \labelsep=.5em%
+ \trivlist
+ \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\slshape}
+\def\@endtheorem{\endtrivlist \vskip\baselineskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Titlepage}
+%
+% \begin{environment}{titlepage}
+% In the normal environments, the titlepage environment does nothing
+% but start and end a page, and inhibit page numbers. It also resets
+% the page number to zero. In two-column style, it still makes a
+% one-column page.
+%
+% \begin{macrocode}
+\newenvironment{titlepage}
+ {
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse\newpage
+ \fi
+ \thispagestyle{empty}%
+ \if@compatibility
+ \setcounter{page}{0}
+ \else
+ \setcounter{page}{1}%
+ \fi}
+ {\if@restonecol\twocolumn \else \newpage \fi
+ \setcounter{page}{1}%
+ }
+% \end{macrocode}
+% \end{environment}
+%
+% \subsubsection{Appendix}
+%
+% \begin{macro}{\appendix}
+%
+% The |\appendix| command is not really an environment, it is a
+% macro that makes some changes in the way things are done.
+%
+% In this document class the |\appendix| command must do the
+% following:
+% \begin{itemize}
+% \item reset the chapter and section counters to zero,
+% \item set |\@chapapp| to |\appendixname| (for messages),
+% \item redefine the chapter counter to produce appendix numbers,
+% \item possibly redefine the |\chapter| command if appendix titles
+% and headings are to look different from chapter titles and
+% headings.
+% \end{itemize}
+%
+% \begin{macrocode}
+\newcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \renewcommand\@chapapp{\appendixname}%
+ \renewcommand\thechapter{\Alph{chapter}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Setting parameters for existing environments}
+%
+% \subsubsection{Array and tabular}
+%
+% \begin{macro}{\arraycolsep}
+% The columns in an array environment are separated by
+% 2|\arraycolsep|.
+% \begin{macrocode}
+\setlength\arraycolsep{5\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tabcolsep}
+% The columns in an tabular environment are separated by
+% 2|\tabcolsep|.
+% \begin{macrocode}
+\setlength\tabcolsep{6\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\arrayrulewidth}
+% The width of rules in the array and tabular environments is given
+% by |\arrayrulewidth|.
+% \begin{macrocode}
+\setlength\arrayrulewidth{.4\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doublerulesep}
+% The space between adjacent rules in the array and tabular
+% environments is given by |\doublerulesep|.
+% \begin{macrocode}
+\setlength\doublerulesep{2\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Tabbing}
+%
+% \begin{macro}{\tabbingsep}
+% This controls the space that the |\'| command puts in. (See
+% \LaTeX{} manual for an explanation.)
+% \begin{macrocode}
+\setlength\tabbingsep{\labelsep}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Minipage}
+%
+% \begin{macro}{\@minipagerestore}
+% The macro |\@minipagerestore| is called upon entry to a minipage
+% environment to set up things that are to be handled differently
+% inside a minipage environment.
+%
+% \begin{macrocode}
+%<+type1>\def\@minipagerestore{\parindent\unitindent}
+%<*type3>
+\def\@minipagerestore{%
+ \parskip=.5\baselineskip \@plus .1\baselineskip
+ \@minus .1\baselineskip}
+%</type3>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mpfootins}
+% Minipages have their own footnotes; |\skip||\@mpfootins| plays
+% same r\^ole for footnotes in a minipage as |\skip||\footins| does
+% for ordinary footnotes.
+%
+% \begin{macrocode}
+\skip\@mpfootins = \skip\footins
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Framed boxes}
+%
+% \begin{macro}{\fboxsep}
+% The space left by |\fbox| and |\framebox| between the box and the
+% text in it.
+% \begin{macro}{\fboxrule}
+% The width of the rules in the box made by |\fbox| and |\framebox|.
+% \begin{macrocode}
+\setlength\fboxsep{3\p@}
+\setlength\fboxrule{.4\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Equation and eqnarray}
+%
+% \begin{macro}{\theequation}
+% The equation counter will be reset at beginning of a new chapter
+% and the equation number will be prefixed by the chapter number.
+%
+% This code must follow the |\chapter| definition, or more exactly
+% the definition of the chapter counter.
+% \begin{macrocode}
+\@addtoreset{equation}{chapter}
+\renewcommand\theequation{\thechapter.\arabic{equation}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\jot}
+% |\jot| is the extra space added between lines of an eqnarray
+% environment. The default value is used.
+% \begin{macrocode}
+% \setlength\jot{3pt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@eqnnum}
+% The macro |\@eqnnum| defines how equation numbers are to appear in
+% equations. Again the default is used.
+%
+% \begin{macrocode}
+% \def\@eqnnum{(\theequation)}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Floating objects}
+%
+% The file \file{latex.dtx} only defines a number of tools with
+% which floating objects can be defined. This is done in the
+% document class. It needs to define the following macros for each
+% floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} =
+% figure).
+%
+% \begin{description}
+% \item[\texttt{\bslash fps@TYPE}]
+% The default placement specifier for floats of type
+% \texttt{TYPE}.
+%
+% \item[\texttt{\bslash ftype@TYPE}]
+% The type number for floats of type \texttt{TYPE}. Each
+% \texttt{TYPE} has associated a unique positive {\texttt
+% TYPE} number, which is a power of two. E.g., figures might
+% have type number 1, tables type number 2, programs type
+% number 4, etc.
+%
+% \item[\texttt{\bslash ext@TYPE}]
+% The file extension indicating the file on which the contents
+% list for float type \texttt{TYPE} is stored. For example,
+% |\ext@figure| = `lof'.
+%
+% \item[\texttt{\bslash fnum@TYPE}]
+% A macro to generate the figure number for a caption. For
+% example, |\fnum@TYPE| == `Figure |\thefigure|'.
+%
+% \item[\texttt{\bslash @makecaption{\meta{num}}{\meta{text}}}]
+% A macro to make a caption, with \meta{num} the value produced
+% by |\fnum@...| and \meta{text} the text of the caption. It
+% can assume it's in a |\parbox| of the appropriate width.
+% This will be used for {\em all} floating objects.
+%
+% \end{description}
+%
+% The actual environment that implements a floating object such as
+% a figure is defined using the macros |\@float| and |\end@float|,
+% which are defined in \file{latex.dtx}.
+%
+% An environment that implements a single column floating object is
+% started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type
+% \texttt{TYPE} with \meta{placement} as the placement specifier.
+% The default value of \meta{PLACEMENT} is defined by |\fps@TYPE|.
+%
+% The environment is ended by |\end@float|. E.g., |\figure| ==
+% |\@float|{figure}, |\endfigure| == |\end@float|.
+%
+% \subsubsection{Figure}
+%
+% Here is the implementation of the figure environment.
+%
+% \begin{macro}{\c@figure}
+% First we have to allocate a counter to number the figures. In
+% this document class the figures are numbered per chapter.
+% \begin{macrocode}
+\newcounter{figure}[chapter]
+\renewcommand\thefigure{\thechapter.\@arabic\c@figure}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fps@figure}
+% \begin{macro}{\ftype@figure}
+% \begin{macro}{\ext@figure}
+% \begin{macro}{\num@figure}
+% Here are the parameters for the floating objects of type `figure'.
+% \begin{macrocode}
+\def\fps@figure{tbp}
+\def\ftype@figure{1}
+\def\ext@figure{lof}
+\def\fnum@figure{\figurename~\thefigure}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{figure}
+% \begin{environment}{figure*}
+% And the definition of the actual environment. The form with the
+% |*| is used for double column figures.
+% \begin{macrocode}
+\newenvironment{figure}
+ {\@float{figure}}
+ {\end@float}
+\newenvironment{figure*}
+ {\@dblfloat{figure}}
+ {\end@dblfloat}
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
+% \subsubsection{Table}
+%
+% Here is the implementation of the table environment. It is very
+% much the same as the figure environment.
+%
+% \begin{macro}{\c@table}
+% First we have to allocate a counter to number the tables. In this
+% document class the tables are numbered per chapter.
+% \begin{macrocode}
+\newcounter{table}[chapter]
+\renewcommand\thetable{\thechapter.\@arabic\c@table}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fps@table}
+% \begin{macro}{\ftype@table}
+% \begin{macro}{\ext@table}
+% \begin{macro}{\num@table}
+% Here are the parameters for the floating objects of type `table'.
+% \begin{macrocode}
+\def\fps@table{tbp}
+\def\ftype@table{2}
+\def\ext@table{lot}
+\def\fnum@table{\tablename~\thetable}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{table}
+% \begin{environment}{table*}
+% And the definition of the actual environment. The form with the
+% |*| is used for double column tables.
+% \begin{macrocode}
+\newenvironment{table}
+ {\@float{table}}
+ {\end@float}
+\newenvironment{table*}
+ {\@dblfloat{table}}
+ {\end@dblfloat}
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
+% \subsubsection{Captions}
+%
+% \begin{macro}{\@makecaption}
+% The |\caption| command calls |\@makecaption| to format the
+% caption of floating objects. It gets two arguments,
+% \meta{number}, the number of the floating object and \meta{text},
+% the text of the caption. Usually \meta{number} contains a string
+% such as `Figure 3.2'. The macro can assume it is called inside a
+% |\parbox| of right width, with |\normalsize|.
+%
+% \begin{macro}{\abovecaptionskip}
+% \begin{macro}{\belowcaptionskip}
+% These lengths contain the amount of white space to leave above
+% and below the caption.
+% \begin{macrocode}
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+\setlength\abovecaptionskip{10\p@}
+\setlength\belowcaptionskip{0\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The definition of this macro is |\long| in order to allow more
+% then one paragraph in a caption.
+% \begin{macrocode}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+% \end{macrocode}
+% We want to see if the caption fits on one line on the page,
+% therefore we first typeset it in a temporary box.
+% \begin{macrocode}
+ \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}%
+% \end{macrocode}
+% We can the measure its width. It that is larger than the current
+% |\hsize| we typeset the caption as an ordinary paragraph.
+% \begin{macrocode}
+ \ifdim \wd\@tempboxa >\hsize
+ {\CaptionLabelFont#1:} \CaptionTextFont#2\par
+% \end{macrocode}
+% If the caption fits, we center it.
+% \begin{macrocode}
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CaptionLabelFont}
+% \begin{macro}{\CaptionTextFont}
+% These macros can contain the fonts used for typesetting captions.
+% By default they do nothing.
+% \begin{macrocode}
+\newcommand\CaptionLabelFont{\relax}
+\newcommand\CaptionTextFont{\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\CaptionFonts}
+% To change the fonts that are used to typeset captions
+% this macro can be used.
+% \begin{macrocode}
+\newcommand\CaptionFonts[2]{%
+ \renewcommand\CaptionLabelFont{#1}%
+ \renewcommand\CaptionTextFont{#2}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Font changing}
+%
+% Here we supply the declarative font changing commands that were
+% common in \LaTeX\ version 2.09 and earlier. These commands work
+% in text mode \emph{and} in math mode. They are provided for
+% compatibility, but one should start using the |\text...| and
+% |\math...| commands instead. These commands are defined using
+% |\DeclareOldFontCommand|, a command with three arguments: the user
+% command to be defined; \LaTeX\ commands to execute in text mode
+% and \LaTeX\ commands to execute in math mode.
+%
+% \begin{macro}{\rm}
+% \begin{macro}{\tt}
+% \begin{macro}{\sf}
+%
+% The commands to change the family. When in compatibility mode we
+% select the `default' font first, to get \LaTeX2.09 behviour.
+% \begin{macrocode}
+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bf}
+% The command to change to the bold series. One should use
+% |\mdseries| to explicitly switch back to medium series.
+% \begin{macrocode}
+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sl}
+% \begin{macro}{\it}
+% \begin{macro}{\sc}
+%
+% And the commands to change the shape of the font. The slanted and
+% small caps shapes are not available by default as math alphabets,
+% so those changes do nothing in math mode. One should use
+% |\upshape| to explicitly change back to the upright shape.
+% \begin{macrocode}
+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax}
+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cal}
+% \begin{macro}{\mit}
+%
+% The commands |\cal| and |\mit| should only be used in math mode,
+% outside math mode they have no effect. Currently the New Font
+% Selection Scheme defines these commands to generate warning
+% messages. Therefore we have to define them `by hand'.
+% \begin{macrocode}
+\renewcommand{\cal}{\protect\pcal}
+\newcommand{\pcal}{\@fontswitch{\relax}{\mathcal}}
+\renewcommand{\mit}{\protect\pmit}
+\newcommand{\pmit}{\@fontswitch{\relax}{\mathnormal}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pem}
+% The definition of |\pem| is changed here to have slanted instead
+% of italic fonts.
+% \begin{macrocode}
+\def\pem{\@nomath\em \ifdim \fontdimen\@ne\font >\z@
+ \upshape \else \slshape \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Cross Referencing}
+% \subsection{Table of Contents, etc.}
+%
+% A |\section| command writes a
+% |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| command
+% on the \file{.toc} file, where \meta{title} contains the
+% contents of the entry and \meta{page} is the page number. If
+% sections are being numbered, then \meta{title} will be of the
+% form |\numberline{|\meta{num}|}{|\meta{heading}|}| where
+% \meta{num} is the number produced by |\thesection|. Other
+% sectioning commands work similarly.
+%
+% A |\caption| command in a `figure' environment writes
+%
+% |\contentsline{figure}{\numberline{|\meta{num}|}{|%
+% \meta{caption}|}}{|\meta{page}|}|
+%
+% on the .\file{lof} file, where \meta{num} is the number produced
+% by |\thefigure| and \meta{caption} is the figure caption. It
+% works similarly for a `table' environment.
+%
+% The command |\contentsline{|\meta{name}|}| expands to
+% |\l@|\meta{name}. So, to specify the table of contents, we must
+% define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to
+% specify the list of figures, we must define |\l@figure|; and so
+% on. Most of these can be defined with either the
+% |\@dottedtocline| or the |\@regtocline| command, which work as
+% follows.
+%
+% |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|^^A
+% \meta{numwidth}|}{|^^A
+% \meta{title}|}{|\meta{page}|}|
+%
+% |\@regtocline{|\meta{level}|}{|\meta{title}|}{|\meta{page}|}|
+%
+% \begin{description}
+% \item[\meta{level}] An entry is produced only if\meta{ level}
+% $<=$ value of the \Lcount{tocdepth} counter. Note,
+% |\chapter| is level 0, |\section| is level 1, etc.
+% \item[\meta{indent}] The indentation from the outer left margin
+% of the start of the contents line.
+% \item[\meta{numwidth}] The width of a box in which the section
+% number is to go, if \meta{title} includes a |\numberline|
+% command.
+% \end{description}
+%
+% \begin{macro}{\@pnumwidth}
+% \begin{macro}{\@tocrmarg}
+% \begin{macro}{\@dotsep}
+% This command uses the following three parameters, which are set
+% with a |\newcommand| (so em's can be used to make them depend upon
+% the font).
+% \begin{description}
+% \item[\texttt{\bslash @pnumwidth}] The width of a box in which the
+% page number is put.
+% \item[\texttt{\bslash @tocrmarg}] The right margin for multiple
+% line entries. One wants |\@tocrmarg| > or = |\@pnumwidth|
+% \item[\texttt{\bslash @dotsep}] Separation between dots, in mu
+% units. Should be defined as a number like 2 or 1.7
+% \end{description}
+%
+% \begin{macrocode}
+\newcommand\@pnumwidth{1.55em}
+\newcommand\@tocrmarg {2.55em}
+\newcommand\@dotsep{4.5}
+\setcounter{tocdepth}{2}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Table of Contents}
+%
+% \begin{macro}{\tableofcontents}
+% This macro is used to request that \LaTeX{} produces a table of
+% contents. The tables of contents, figures etc. are always set in
+% single-column style.
+%
+% \begin{macrocode}
+\newcommand\tableofcontents{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+% \end{macrocode}
+% The title is set using the |\chapter*| command, making sure that
+% the running head --if one is required-- contains the right
+% information.
+% \begin{macrocode}
+ \chapter*{\contentsname
+ \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
+% \end{macrocode}
+% The the actual table of contents is made by calling
+% |\@starttoc{toc}|. After that we restore twocolumn mode if
+% necessary.
+% \begin{macrocode}
+ \@starttoc{toc}%
+ \if@restonecol\twocolumn\fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@starttoc}
+% The internal \LaTeXe macro |\@starttoc| needs to be adapted for
+% the \file{rapport3} document classes,in order to deal with a the
+% fact that for these document classes the |\parskip| is normally
+% non-zero. We don't want that in the table of contents.
+% \begin{macrocode}
+%<*type3>
+\def\@starttoc#1{\begingroup
+ \makeatletter
+ \parskip\z@
+ \@input{\jobname.#1}%
+ \if@filesw
+ \expandafter\newwrite\csname tf@#1\endcsname
+ \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+ \fi \global\@nobreakfalse \endgroup}
+%</type3>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@regtocline}
+% These document classes use a different format for the table of
+% contents than the standard classes from which they were
+% developped. In order to acheive this different format we defined
+% the macro |\@regtocline|.
+% \begin{macrocode}
+\newcommand\@regtocline[3]{%
+ \ifnum #1>\c@tocdepth
+ \else
+ \vskip \z@ plus .2pt
+ {\hangindent\z@ \@afterindenttrue \interlinepenalty\@M
+ \leftskip\unitindent
+ \rightskip=\unitindent plus 1fil
+ \parfillskip=0cm
+ \@tempdima=\unitindent
+ \parindent\z@
+ \leavevmode
+ \hbox{}\hskip -\leftskip\relax#2\nobreak
+ \hskip 1em \nobreak{\slshape #3}\par
+ }%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@font}
+% The changed definition of |\@sect| that we use, selects a
+% different font for the table of contents for the various header
+% levels. It does this using |\toc@font|.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\toc@font[1]{\relax}
+\else
+ \newcommand\toc@font[1]{%
+ \ifcase#1\relax
+ \bfseries
+ \or\slshape
+ \or\rmfamily
+ \fi}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@case}
+% The entries for parts are typeset in capital letters in the new
+% style of the table of contents. In the old style this isn't
+% done. The macro |\toc@case| is used to switch this.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\toc@case{\relax}
+\else
+ \newcommand\toc@case{\uppercase}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@part}
+% Each sectioning command needs an additional macro to format its
+% entry in the table of contents, as described above. The macro for
+% the entry for parts is defined in a special way.
+%
+% First we make sure that if a pagebreak should occur, it occurs
+% {\em before} this entry. Also a little whitespace is added and a
+% group begun to keep changes local.
+%
+% First we have the definition from the standard classes.
+% \begin{macrocode}
+\if@oldtoc
+\newcommand\l@part[2]{%
+ \addpenalty{-\@highpenalty}%
+ \addvspace{2.25em \@plus\p@}%
+ \begingroup
+% \end{macrocode}
+% The macro |\numberline| requires that the width of the box that
+% holds the part number is stored in \LaTeX's scratch register
+% |\@tempdima|. Therefore we put it there.
+% \begin{macrocode}
+ \setlength\@tempdima{3em}%
+% \end{macrocode}
+% The we set |\parindent| to 0pt and use |\rightskip| to leave
+% enough room for the pagenumbers. To prevent overfull box messages
+% the |\parfillskip| is set to a negative value.
+% \begin{macrocode}
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+% \end{macrocode}
+% Now we can set the entry, in a large bold font. We make sure to
+% leave vertical mode, set the part title and add the pagenumber,
+% set flush right.
+% \begin{macrocode}
+ {\leavevmode
+ \large \bfseries #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
+% \end{macrocode}
+% Prevent a pagebreak immediately after this entry, but use
+% |\everypar| to reset the |\if@nobreak| switch. Finally we close
+% the group.
+% \begin{macrocode}
+ \nobreak
+ \global\@nobreaktrue
+ \everypar{\global\@nobreakfalse\everypar{}}
+ \endgroup}
+% \end{macrocode}
+% Then we can introduce our new definition.
+% \begin{macrocode}
+\else
+ \newcommand\l@part{\addpenalty{-\@highpenalty}
+ \addvspace{2.25em \@plus \p@}\@regtocline{0}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@chapter}
+% This macro formats the entries in the table of contents for
+% chapters. It is very similar to |\l@part|
+%
+% First we make sure that if a pagebreak should occur, it occurs
+% {\em before} this entry. Also a little whitespace is added and a
+% group begun to keep changes local.
+%
+% Again we first present the `standard' definition
+% \begin{macrocode}
+\if@oldtoc
+\newcommand\l@chapter[2]{%
+ \addpenalty{-\@highpenalty}%
+ \vskip 1.0em \@plus\p@
+% \end{macrocode}
+%
+% The macro |\numberline| requires that the width of the box that
+% holds the part number is stored in \LaTeX's scratch register
+% |\@tempdima|. Therefore we put it there. We begin a group, and
+% change some of the paragraph parameters.
+% \begin{macrocode}
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+% \end{macrocode}
+% Then we leave vertical mode and switch to a bold font.
+% \begin{macrocode}
+ \leavevmode \bfseries
+% \end{macrocode}
+% Because we do not use |\numberline| here, we have do some fine
+% tuning `by hand', before we can set the entry. We discourage but
+% not disallow a pagebreak immediately after a chapter entry.
+% \begin{macrocode}
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
+ \penalty\@highpenalty
+ \endgroup}
+% \end{macrocode}
+% Then we present our new definition.
+% \begin{macrocode}
+\else
+ \newcommand\l@chapter{\@regtocline{0}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@section}
+% In this document class the definition for
+% |\l@section| is very simple.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\l@section {\@dottedtocline{1}{1.5em}{2.3em}}
+\else
+ \newcommand\l@section {\@regtocline{1}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@subsection}
+% \begin{macro}{\l@subsubsection}
+% \begin{macro}{\l@paragraph}
+% \begin{macro}{\l@subparagraph}
+% All lower level entries are defined using the macro
+% |\@dottedtocline| or |\@regtocline| (see above).
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\l@subsection {\@dottedtocline{2}{3.8em}{3.2em}}
+ \newcommand\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
+ \newcommand\l@paragraph {\@dottedtocline{4}{10em}{5em}}
+ \newcommand\l@subparagraph {\@dottedtocline{5}{12em}{6em}}
+\else
+ \newcommand\l@subsection {\@regtocline{2}}
+ \newcommand\l@subsubsection{\@regtocline{3}}
+ \newcommand\l@paragraph {\@regtocline{4}}
+ \newcommand\l@subparagraph {\@regtocline{5}}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{List of figures}
+%
+% \begin{macro}{\listoffigures}
+% This macro is used to request that \LaTeX{} produces a list of
+% figures. It is very similar to |\tableofcontents|.
+%
+% \begin{macrocode}
+\newcommand\listoffigures{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\listfigurename
+ \@mkboth{\uppercase{\listfigurename}}%
+ {\uppercase{\listfigurename}}}%
+ \@starttoc{lof}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@figure}
+% This macro produces an entry in the list of figures.
+% \begin{macrocode}
+\if@oldtoc
+ \newcommand\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
+\else
+ \newcommand\l@figure{\@regtocline{1}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{List of tables}
+%
+% \begin{macro}{\listoftables}
+% This macro is used to request that \LaTeX{} produces a list of
+% tables. It is very similar to |\tableofcontents|.
+%
+% \begin{macrocode}
+\newcommand\listoftables{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\listtablename
+ \@mkboth{\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
+ \@starttoc{lot}%
+ \if@restonecol\twocolumn\fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@table}
+% This macro produces an entry in the list of tables.
+% \begin{macrocode}
+\let\l@table\l@figure
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Bibliography}
+%
+% \begin{macro}{\bibindent}
+% The ``open'' bibliography format uses an indentation of
+% |\bibindent|.
+% \begin{macrocode}
+\newdimen\bibindent
+\bibindent=1.5em
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newblock}
+% This is a dummy definition for this macro which is used in the
+% \textsf{thebibliography} environment.
+% \begin{macrocode}
+\newcommand\newblock{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{thebibliography}
+% The `thebibliography' environment executes the following
+% commands:
+%
+% |\renewcommand\newblock{\hskip .11em \@plus .33em \@minus .07em}|
+% -- Defines the ``closed'' format, where the blocks (major units
+% of information) of an entry run together.
+%
+% |\sloppy| -- Used because it's rather hard to do line breaks in
+% bibliographies,
+%
+% |\sfcode`\.=1000\relax| --
+% Causes a `.' (period) not to produce an end-of-sentence space.
+%
+% The implementation of this environment is based on the generic
+% list environment. It uses the \Lcount{enumiv} counter internally
+% to generate the labels of the list.
+%
+% When an empty `thebibliography' environment is found, a warning
+% is issued.
+%
+% \begin{macrocode}
+\newenvironment{thebibliography}[1]
+ {\chapter*{\bibname
+ \@mkboth{\uppercase{\bibname}}%
+ {\uppercase{\bibname}}}%
+ \list{\@biblabel{\arabic{enumiv}}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \if@openbib
+ \advance\leftmargin\bibindent
+ \itemindent -\bibindent
+ \listparindent \itemindent
+ \parsep \z@
+ \fi
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\arabic{enumiv}}}%
+ \if@openbib
+ \renewcommand\newblock{\par}
+ \else
+ \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
+ \fi
+ \sloppy\clubpenalty4000\widowpenalty4000%
+ \sfcode`\.=\@m}
+ {\def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
+ \endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@biblabel}
+% The label for a |\bibitem[...]| command is produced by this
+% macro. The default from \file{latex.dtx} is used.
+% \begin{macrocode}
+% \renewcommand\@biblabel[1]{[#1]\hfill}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@cite}
+% The output of the |\cite| command is produced by this macro. The
+% default from \file{latex.dtx} is used.
+% \begin{macrocode}
+% \renewcommand\@cite[1]{[#1]}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The index}
+%
+% \begin{environment}{theindex}
+% The environment `theindex' can be used for indices. It makes an
+% index with two columns, with each entry a seperate paragraph. At
+% the user level the commands |\item|, |\subitem| and |\subsubitem|
+% are used to produce index entries of various levels. When a new
+% letter of the alphabet is encountered an amount of |\indexspace|
+% white space can be added.
+%
+% \begin{macrocode}
+\newenvironment{theindex}
+ {\if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \columnseprule \z@
+ \columnsep 35\p@
+ \twocolumn[\@makeschapterhead{\indexname}]%
+ \@mkboth{\uppercase{\indexname}}%
+ {\uppercase{\indexname}}%
+ \thispagestyle{plain}\parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \let\item\@idxitem}
+% \end{macrocode}
+% When the document continues after the index and it was a one
+% column document we have to switch back to one column after the
+% index.
+% \begin{macrocode}
+ {\if@restonecol\onecolumn\else\clearpage\fi}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@idxitem}
+% \begin{macro}{\subitem}
+% \begin{macro}{\subsubitem}
+% Thsee macros are used to format the entries in the index. ^^AA ???
+% \begin{macrocode}
+\newcommand\@idxitem {\par\hangindent 40\p@}
+\newcommand\subitem {\par\hangindent 40\p@ \hspace*{20\p@}}
+\newcommand\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\indexspace}
+% The amount of white space that is inserted between `letter
+% blocks' in the index.
+% \begin{macrocode}
+\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Footnotes}
+%
+% \begin{macro}{\footnoterule}
+% Usually, footnotes are separated from the main body of the text
+% by a small rule. This rule is drawn by the macro |\footnoterule|.
+% We have to make sure that the rule takes no vertical space (see
+% \file{plain.tex}) so we compensate for the natural heigth of the
+% rule of 0.4pt by adding the right amount of vertical skip.
+%
+% To prevent the rule from colliding with the footnote we first add
+% a little negative vertical skip, then we put the rule and add
+% some positive vertical skip.
+% \begin{macrocode}
+\renewcommand\footnoterule{%
+ \kern-3\p@
+ \kern.5\baselineskip
+ \hrule\@width\unitindent
+ \kern.4\baselineskip
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@footnote}
+% Footnotes are numbered within chapters.
+% \begin{macrocode}
+% \newcounter{footnote}
+\@addtoreset{footnote}{chapter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makefntext}
+% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext|
+% to produce the actual footnote. The macro gets the text of the
+% footnote as its argument and should use |\@thefnmark| as the mark
+% of the footnote. The macro |\@makefntext|is called when
+% effectively inside a |\parbox| of width |\columnwidth| (i.e.,
+% with |\hsize| = |\columnwidth|).
+%
+% An example of what can be achieved is given by the following piece
+% of \TeX\ code.
+% \begin{verbatim}
+% \long\def\@xmakefntext#1#2{%
+% %<-type3> \parindent=.5\unitindent
+% %<+type3> \parindent=\z@\parskip=.5\baselineskip
+% \def\labelitemi{--}\@revlabeltrue
+% {\setbox0=\hbox {#1\hskip.5em plus 1fil}%
+% \dimen0=2\wd0
+% \ifdim\dimen0>\unitindent
+% \global\unitindent=\dimen0
+% \@indentset
+% \fi}%
+% \@setpar{\@@par
+% \@tempdima \hsize
+% \advance\@tempdima-.5\unitindent
+% \parshape \@ne .5\unitindent \@tempdima}%
+% \par
+% \noindent\llap{\hbox to .5\unitindent{#1\hfil}}#2}
+% \end{verbatim}
+% The effect of this definition is that all lines of the footnote
+% are indented by 10pt, while the first line of a new paragraph is
+% indented by 1em. To change these dimensions, just substitute the
+% desired value for `10pt' (in both places) or `1em'. The mark is
+% flushright against the footnote.
+%
+% In these document classes we use a simpler macro, in which the
+% footnote text is set like an ordinary text paragraph, with no
+% indentation except on the first line of the footnote. Thus, all
+% the macro must do is set |\parindent| to the appropriate value
+% for succeeding paragraphs and put the proper indentation before
+% the mark. We change the label of itemized lists inside footnotes
+% and need to check that the |\unitindent| is large enough for our
+% purposes.
+%
+% For most of the document classes produced from this file we need
+% a slightly modified |\@makefntext| on the title page, so we
+% introduce an extra macro, |\@xmakefntext|.
+% \begin{macrocode}
+\def\@makefntext{\@xmakefntext{$\m@th\@thefnmark$.}}
+\long\def\@xmakefntext#1{%
+ \parindent\z@
+ \def\labelitemi{--}\@revlabeltrue
+ {\setbox0=\hbox {#1\hskip.5em plus 1fil}
+ \dimen0=2\wd0\relax
+ \ifdim\dimen0>\unitindent
+ \global\unitindent=\dimen0\relax
+ \@indentset
+ \fi}
+ \leavevmode\hbox to .5\unitindent{#1\hfil}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makefnmark}
+% The footnote markers that are printed in the text to point to the
+% footnotes should be produced by the macro |\@makefnmark|. We use
+% the default definition for it.
+% \begin{macrocode}
+%\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Initialization}
+%
+% \subsection{Words}
+%
+% \begin{macro}{\contentsname}
+% \begin{macro}{\listfigurename}
+% \begin{macro}{\listtablename}
+% \begin{macro}{\refname}
+% \begin{macro}{\bibname}
+% \begin{macro}{\indexname}
+% \begin{macro}{\figurename}
+% \begin{macro}{\tablename}
+% \begin{macro}{\partname}
+% \begin{macro}{\chaptername}
+% \begin{macro}{\appendixname}
+% \begin{macro}{\abstractname}
+% \begin{macro}{\seename}
+% \begin{macro}{\andname}
+% This document class is for documents prepared in the English language.
+% To prepare a version for another language, various English words must
+% be replaced. All the English words that require replacement are
+% defined below in command names.
+%
+% \begin{macrocode}
+\newcommand\contentsname{Contents}
+\newcommand\listfigurename{List of Figures}
+\newcommand\listtablename{List of Tables}
+\newcommand\bibname{Bibliography}
+\newcommand\indexname{Index}
+\newcommand\figurename{Figure}
+\newcommand\tablename{Table}
+\newcommand\partname{Part}
+\newcommand\chaptername{Chapter}
+\newcommand\appendixname{Appendix}
+\newcommand\abstractname{Abstract}
+\newcommand\seename{see}
+\newcommand\andname{and}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Date}
+%
+% \begin{macro}{\today}
+% This macro uses the \TeX\ primitives |\month|, |\day| and |\year|
+% to provide the date of the \LaTeX-run.
+% \begin{macrocode}
+\newcommand\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Two column mode}
+%
+% \begin{macro}{\columnsep}
+% This gives the distance between two columns in two column mode.
+% \begin{macrocode}
+\setlength\columnsep{10\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\columnseprule}
+% This gives the width of the rule between two columns in two
+% column mode. We have no visible rule.
+% \begin{macrocode}
+\setlength\columnseprule{0\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The page style}
+%
+% We have \pstyle{plain} pages unless the user specified
+% otherwise. We use arabic pagenumbers.
+% \begin{macrocode}
+\pagestyle{plain}
+\pagenumbering{arabic} % Arabic page numbers
+% \end{macrocode}
+%
+% When the \Lopt{twocolumn} option was specified we call
+% |\twocolumn| to activate this mode. We try to make each column as
+% long as the others, but call |sloppy| to make our life easier.
+% \begin{macrocode}
+\if@twocolumn
+ \twocolumn
+ \sloppy
+ \flushbottom
+% \end{macrocode}
+% Normally we call |\onecolumn| to initiate typesetting in one
+% column.
+% \begin{macrocode}
+\else
+ \onecolumn
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\frenchspacing}
+% Controls the amount of space after a punctuation mark.
+% \begin{macrocode}
+\frenchspacing
+%</class>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+\endinput
+%
diff --git a/macros/latex/contrib/overpic/overpic.dtx b/macros/latex/contrib/overpic/overpic.dtx
index 72bb795dbe..ee3ba5cc16 100644
--- a/macros/latex/contrib/overpic/overpic.dtx
+++ b/macros/latex/contrib/overpic/overpic.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2017 by Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
+% Copyright (C) 1997-... by Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -19,7 +19,7 @@
%
%<*package>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{overpic}[2018/09/02 1.2 picture overlays (RN)]
+\ProvidesPackage{overpic}[2020/02/22 1.3 picture overlays (RN)]
%</package>
%
%<*driver>
@@ -58,7 +58,7 @@
%</driver>
% \fi
%
-% \CheckSum{176}
+% \CheckSum{180}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -202,6 +202,7 @@
%
% \begin{lstlisting}
% \begin{Overpic}[abs,unit=1mm,grid=true,tics=5]{%
+% \bfseries\sffamily
% \begin{tabular}{*{8}{p{8mm}}}
% H & & & & & & & He\\
% Li & Be & B & C & N & O & F & Ne\\
@@ -211,13 +212,14 @@
% Cs & Ba & Tl & Pb & Bi & Po & At & Rn\\
% Fr & Ra & 112& & 114& & &\\
% \end{tabular}}%
-% \linethickness{0.5mm} \color{blue}%
-% \put(0,0){\polygon(0,30)(10,30)(10,21.5)(44,21.5)(44,13.5)%
-% (22,13.5)(22,4.5)(0,4.5)}
+% \put(0,0){\color{blue}\linethickness{0.5mm}
+% \polygon(0,30)(10,30)(10,21.5)(45,21.5)(45,13)(22,13)%
+% (22,4.5)(0,4.5)}
% \end{Overpic}
% \end{lstlisting}
% \par\medskip\pagebreak[3]
% \begin{Overpic}[abs,unit=1mm,grid=true,tics=5]{%
+% \bfseries\sffamily
% \begin{tabular}{*{8}{p{8mm}}}
% H & & & & & & & He\\
% Li & Be & B & C & N & O & F & Ne\\
@@ -227,10 +229,10 @@
% Cs & Ba & Tl & Pb & Bi & Po & At & Rn\\
% Fr & Ra & 112& & 114& & &\\
% \end{tabular}}%
-% \linethickness{0.5mm} \color{blue}%
-% \put(0,0){\polygon(0,30)(10,30)(10,21.5)(44,21.5)(44,13.5)%
-% (22,13.5)(22,4.5)(0,4.5)}
-% \end{Overpic}
+% \put(0,0){\color{blue}\linethickness{0.5mm}
+% \polygon(0,30)(10,30)(10,21.5)(45,21.5)(45,13)(22,13)%
+% (22,4.5)(0,4.5)}
+% \end{Overpic}
%
% \StopEventually{}
%
@@ -345,10 +347,13 @@
% \end{environment}
% \begin{environment}{Overpic}
% \changes{1.0}{2017/10/06}{Suggested by \mbox{Herbert Vo\ss}}
+% \changes{1.3}{2020/02/22}{Added missing \cmd\setkeys}
% Box 0 gets any \TeX\ code.
% \begin{macrocode}
\newenvironment{Overpic}[2][]{%
\sbox\OVP@box{#2}%
+ \count@=\z@ \Gin@gridfalse
+ \setkeys{Gin}{#1}%
\OVP@picture{#1}%
}{\endpicture}
% \end{macrocode}
diff --git a/macros/latex/contrib/overpic/overpic.ins b/macros/latex/contrib/overpic/overpic.ins
index 30fdda1081..3d8dbf6ecf 100644
--- a/macros/latex/contrib/overpic/overpic.ins
+++ b/macros/latex/contrib/overpic/overpic.ins
@@ -25,7 +25,7 @@
This is a generated file.
-Copyright (C) 1997-2016 by Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
+Copyright (C) 1997-... by Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
--------------------------------------------------------------------------
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/overpic/overpic.pdf b/macros/latex/contrib/overpic/overpic.pdf
index 312a4f5482..8537ae6883 100644
--- a/macros/latex/contrib/overpic/overpic.pdf
+++ b/macros/latex/contrib/overpic/overpic.pdf
Binary files differ
diff --git a/macros/latex/contrib/suftesi/suftesi.dtx b/macros/latex/contrib/suftesi/suftesi.dtx
index 618a3c3e47..6f35771eab 100644
--- a/macros/latex/contrib/suftesi/suftesi.dtx
+++ b/macros/latex/contrib/suftesi/suftesi.dtx
@@ -67,30 +67,58 @@
%<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<class>\ProvidesClass{suftesi}
%<*class>
- [2020/02/11 v2.9.6a A class for typesetting theses, books and articles]
+ [2020/02/22 v2.9.7 A class for typesetting theses, books and articles]
%</class>
%<*driver>
-\documentclass{ltxdoc}
-
+\documentclass[10pt]{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek.ancient,english]{babel}
+% fonts and colors
+\usepackage{cochineal}
+\usepackage[varqu,varl,var0]{inconsolata}
+\usepackage{biolinum}
+\usepackage{amsthm}
+\usepackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath}
+\usepackage[cal=boondoxo]{mathalfa}
+\usepackage[svgnames]{xcolor}
+\definecolor{philA}{named}{DarkRed}
+\definecolor{philB}{named}{NavyBlue}
+ \definecolor{sufred}{rgb}{0.5,0,0}
+\definecolor{sufgray}{rgb}{0.5,0.5,0.5}
+\usepackage{metalogo}
+\usepackage{guit}
\usepackage[final]{microtype}
+% doc facilities
+\let\cs\relax
+\let\cmd\relax
+\usepackage{ltxdockit}
\usepackage{siunitx}
% To use the cochineal inside the document we have to define the family
% because the .fd files of the font refer to conditionals
% defined in 'cochineal.sty’:
\DeclareFontFamily{T1}{Cochineal-LF}{}
\DeclareFontShape{T1}{Cochineal-LF}{m}{n}{
- <-> s*[1.0] Cochineal-Roman-osf-t1}{}
-% Doc facilities
-\let\cs\relax
-\let\cmd\relax
-\usepackage{ltxdockit}
+ <-> s*[1.0] Cochineal-Roman-osf-t1}{}
+% layout
+\setcounter{tocdepth}{3}
+\usepackage{geometry}
+\geometry{a4paper,
+ margin=3cm,
+ headheight=15pt,
+ ignoreall,
+ heightrounded}
+\usepackage{sectsty}
+\allsectionsfont{\sffamily}
+\usepackage{fancyhdr}
+\fancyhf{}
+\fancyhead[L]{© 2009--\the\year\quad Ivan Valbusa}
+\fancyfoot[L]{\textsf{suftesi}
+ \fileversion{} -- \filedate}
+\renewcommand{\footrulewidth}{0.4pt}
+\fancyhead[R]{\thepage}
+\pagestyle{fancy}
% Graphics
-\usepackage[svgnames]{xcolor}
- \definecolor{sufred}{rgb}{0.5,0,0}
- \definecolor{sufgray}{rgb}{0.5,0.5,0.5}
\usepackage[framemethod=TikZ]{mdframed}
\mdfsetup{roundcorner=3pt,linecolor=white,backgroundcolor=gray!10}
\usepackage{tikz}
@@ -100,12 +128,6 @@
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
-%
-\usepackage{fancyhdr}
-\fancyhf{}
-\fancyfoot[C]{\iffloatpage{}{\thepage}}
-\renewcommand\headrulewidth{0pt}
-\pagestyle{fancy}
% Bibliography
\usepackage[autostyle]{csquotes}
\usepackage[style=philosophy-classic,backend=biber]{biblatex}
@@ -125,6 +147,7 @@
{ \fontfamily{#2}\fontsize{#4}{13}\selectfont%
\textgreek{\greektxt}} {\fontfamily{#1}\selectfont\latintxtb}}
% New commands
+\newcommand{\new}{\marginpar{\textcolor{red}{\textbf{NEW!}}}}
\newcommand{\argstyle}{\itshape}
\DeclareRobustCommand*{\ar}[1]{\texttt{\char`\{}\textrm{\argstyle#1}\texttt{\char`\}}}
\DeclareRobustCommand*{\oar}[1]{\texttt{[}\textrm{\argstyle#1}\texttt{]}}
@@ -136,11 +159,9 @@
\newenvironment{ttquote}
{\begin{mdframed}[default]
\ttfamily\microtypesetup{activate=false}}
- {\end{mdframed}
- }
+ {\end{mdframed}}
\newenvironment{latexcode}
- {\begin{mdframed}[default]
- }
+ {\begin{mdframed}[default]}
{\end{mdframed}}
% Correct (?) \optitem to use \meta inside #2
\makeatletter
@@ -149,20 +170,75 @@
{\ltd@option{}{#2}{#3}{}}
{\ltd@option{}{#2}{#3}{\ltd@textverb{#1}}}}%
\makeatother
+\makeatletter
+
+\def\ltd@textverb#1{\,#1\,}
+
+\renewenvironment*{optionlist}
+{\list{}{%
+ \setlength{\labelwidth}{2.5cm}%
+ \setlength{\labelsep}{\z@}%
+ \setlength{\leftmargin}{2.5cm}%
+ \renewcommand*{\makelabel}[1]{\hss\optionlistfont##1}}%
+ \ltd@optionlist}
+{\endlist}
+\renewenvironment*{ltxsyntax}[1][3cm]
+{\list{}{%
+ \setlength{\labelwidth}{3cm}%
+ \setlength{\labelsep}{0pt}%
+ \setlength{\leftmargin}{#1}%
+ \renewcommand*{\makelabel}[1]{%
+ \hss\ltxsyntaxfont\ltxsyntaxlabelfont##1}}%
+ \let\csitem\ltd@csitem
+ \let\cmditem\ltd@cmditem
+ \let\envitem\ltd@envitem
+ \let\lenitem\ltd@csitem
+ \let\boolitem\ltd@boolitem
+ \let\cntitem\ltd@item
+ \let\optitem\ltd@item}
+{\endlist}
+{\endlist}
+\renewenvironment*{valuelist}[1][]
+{\list{}{%
+ \ifblank{#1}
+ {\setlength{\labelwidth}{5em}}
+ {\setlength{\labelwidth}{#1}}%
+ \setlength{\labelsep}{1em}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \addtolength{\leftmargin}{\labelsep}%
+ \setlength{\itemsep}{0pt}%
+ \renewcommand*{\makelabel}[1]{\valuelistfont##1\hss}}}
+{\endlist}
+\newcommand*{\valuelistfont}{%
+ \color{olive}\sffamily\displayverbfont}
+\renewcommand*{\optionlistfont}{%
+ \color{philA}\sffamily\displayverbfont}
+\renewcommand*{\ltxsyntaxlabelfont}{%
+ \color{philA}\sffamily\displayverbfont}
+\renewcommand*{\marglistfont}{%
+ \color{philA}\sffamily\displayverbfont}
+% Table of contents
+\renewcommand\tableofcontents{%
+ \setlength{\columnsep}{1cm}
+ {\centering
+ \section*{\contentsname}%
+ \@mkboth{\contentsname}{\contentsname}}
+ \thispagestyle{empty}
+ \begin{multicols}{2}
+ \@starttoc{toc}%
+\end{multicols}}
+\makeatother
+
% hyperref setup
\usepackage{hyperref}
\hypersetup{%
+ hidelinks,
pdftitle={User's Guide to \textsf{suftesi}},
pdfsubject={A document class for typesetting theses,
books and articles},
pdfauthor={Ivan Valbusa},
pdfkeywords={thesis, humanities, books}}
-% Informations
-\author{Ivan Valbusa\thanks{Dipartimento di Scienze Umane, Università degli Studi di Verona ---
- \texttt{ivan dot valbusa at univr dot it}}}
-\title{\vspace*{-\baselineskip}User's Guide to \textsf{suftesi}\\
- \large A document class for typesetting\\ theses, books and articles}
-\date{\fileversion{} -- \filedate}
+
\EnableCrossrefs
\CodelineIndex
@@ -175,7 +251,7 @@
%</driver>
% \fi
%
-% \CheckSum{5283}
+% \CheckSum{5286}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -193,6 +269,7 @@
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
+% \changes{v2.9.7}{2020/02/22}{New option \opt{fontisize}. The \opt{parindent} options now accepts arbitrary values. Updated documentation.}
% \changes{v2.9.6a}{2020/02/11}{Maintenance release}
% \changes{v2.9.6}{2020/02/10}{New option \opt{compacttoc}. The appendix page title is printed in the font of the chapters by default. Removed \cmd{apepndicesname} command.}
% \changes{v2.9.5}{2020/02/04}{Restored \texttt{templates} folder. New template \texttt{book-customize}. New mechanism for the appendices through the \sty{appendix} package.}
@@ -284,8 +361,19 @@
% \DoNotIndex{\titlepage,\vss,\vtop,\xdef,\@gobbletwo,\color,\dimexpr}
% \DoNotIndex{\huge,\large,\makebox,\ProcessOptions,\renewcommand}
%
-%\maketitle
-%
+% \begin{center}
+ % {\color{philA}\bfseries
+ % \Huge User's Guide to \textsf{suftesi}\\[3mm]}
+ % {\large\itshape A document class for typesetting theses, books and articles}
+ %\vspace{.8cm}
+ %
+ % \normalsize\fileversion{} -- \filedate
+ % \vspace{.7cm}
+ %
+ % Ivan Valbusa\\[2mm]
+ % \footnotesize\texttt{ivan dot valbusa at univr dot it}
+ % \vspace{1cm}
+ % \end{center}
% \begin{abstract}
% The standard document classes allow you to typeset beautiful
% documents but their layout is quite far from the stylistic requests
@@ -298,9 +386,8 @@
% \citetitle{Bringhurst:1992} by Robert \textcite{Bringhurst:1992}, \citetitle{Tschichold:1975} by Jan \textcite{Tschichold:1975} and
% \citetitle{Morison:1111} by Stanley \textcite{Morison:1111}.
% \end{abstract}
-%\begin{multicols}{2}
+%
% \tableofcontents
-%\end{multicols}
%
% \section*{Legalese}
%
@@ -320,7 +407,7 @@
% the layout redefinitions.
%
%
-% \section*{A brief history}\thispagestyle{empty}
+% \section*{A brief history}
%
% The \sty{suftesi} class was born as a result of the course \emph{Introduzione a \LaTeX{} per le scienze umane} (\emph{Introduction to \LaTeX{} for the human sciences}) which I held at the Graduate School of Human Sciences and Philosophy (\textcolor{magenta}{\textbf{S}}cienze \textcolor{magenta}{\textbf{U}}mane e \textcolor{magenta}{\textbf{F}}ilosofia) of Verona University (Italy) in June 2010. Originally thought as a class to typeset theses, during these years it has developed many new features and styles. Finally it has become the referential class of the Joint Project \emph{Formal Style for PhD Theses with LaTeX} of the University of Verona.
%
@@ -344,27 +431,18 @@
% \cmd{documentclass}\oarm{options}\{suftesi\}
% \end{ttquote}
% All the options defined by the class are in the \meta{key}=\meta{value} format.
-% ^^A \begin{verbatim}
-% ^^A \cmd{documentclass}[\\
-% ^^A \opt{pagelayout=periodical},\\
-% ^^A \opt{chapfont=roman},\\
-% ^^A \opt{tocstyle=ragged},\\
-% ^^A \opt{marginpar=false},\\
-% ^^A ...\\
-% ^^A ]\ar{suftesi}
-% ^^A \end{verbatim}
+%
% In addition to these you can also use the options defined by the standard \sty{book} class (on which \sty{suftesi} is based) except those modifying
% the page dimensions (\opt{a4paper}, \opt{a5paper}, \opt{b5paper}, \opt{legalpaper}, \opt{executivepaper} and \opt{landscape}), which are automatically disabled. The class loads the packages listed in table \ref{tab:pkgloaded}.
-%
+% \subsection*{Using with Xe\LaTeX and Lua\LaTeX}
% For using the class with the \XeTeX{} and \LuaTeX{} engines you need to load the \sty{fontspec} package (\sty{mathspec} is an alternative only for \XeTeX) and to select a main font.
%
%
%\begin{table}[h]
%\centering
-%\fontsize{9.5}{11.5}\selectfont
-%\begin{tabular}{>{\sffamily}r@{}>{\sffamily}l>{\raggedright\arraybackslash}>{\sffamily}p{7.6cm}}
+%\begin{tabular}{>{\sffamily}r@{}>{\sffamily}l>{\raggedright\arraybackslash}>{\sffamily}p{9.6cm}}
%\toprule
-%&\textrm{Global}& appendix, {caption}, {color}, {crop}, {enumitem}, {emptypage}, {extramarks},
+%&\textrm{Global}& appendix, {caption}, {color}, {crop}, {enumitem}, {emptypage},
%{fancyhdr}, {fixltxhyph}, {fontenc}, {geometry}, {iftex},
%{microtype}, {multicol}, {titlesec}, {titletoc}, {xkeyval}, (cclicenses)\\\midrule
%&\textrm{pdf\LaTeX{} only}&fontenc, substitutefont\\\midrule
@@ -396,8 +474,8 @@
%
%\begin{ttquote}
%\cmd{documentclass}[structure=\meta{value},\meta{options}]\{suftesi\}
-%^^A\cmd{documentclass}[structure=article,\meta{options}]\{suftesi\}\\
-%^^A\cmd{documentclass}[structure=collection,\meta{options}]\{suftesi\}
+% ^^A\cmd{documentclass}[structure=article,\meta{options}]\{suftesi\}\\
+% ^^A\cmd{documentclass}[structure=collection,\meta{options}]\{suftesi\}
%\end{ttquote}
%
% \changes{v0.9b}{2012/09/23}{The \sty{mparhack} package is no longer loaded. It is not compatible with \sty{crop}.}
@@ -408,37 +486,56 @@
%
% \begin{table}[h]
%\centering
-%\makebox[\textwidth][c]{\begin{tabular}{@{}lcccccccc@{}}
+%\begin{tabular}{lcccccccl}
%\toprule
%&\multicolumn{4}{c}{Dimensions (mm)}&\multicolumn{4}{c}{Proportions}\\\cmidrule(lr){2-5}\cmidrule(lr){6-9}
%&\multicolumn{2}{c}{Typeblock}&\multicolumn{2}{c}{Page}& \multicolumn{2}{c}{Margins}&\multicolumn{2}{c}{Stock}\\\cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}\cmidrule(l){8-9}
%Layout &w & h& w& h&t\,/\,b&i\,/\,o&Typeblock& Page\\\cmidrule(r){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}\cmidrule(l){8-9}\cmidrule(r){1-1}
-%\opt{standard} & 110& 220& 210& 297&$1:2$&$1:2$&$1:2$&$1:\kern-3pt\sqrt{2}$\\
-%\opt{standardaureo} & 136& 220& 210& 297&$2:3$&$2:3$&$5:8$\makebox[0pt]{\ \textsuperscript{*}}&$1:\kern-3pt\sqrt{2}$\\
+%\opt{standard} & 110& 220& 210& 297&$1:2$&$1:2$&$1:2$&$1:\sqrt{2}$\\
+%\opt{standardaureo} & 136& 220& 210& 297&$2:3$&$2:3$&$5:8$\makebox[0pt]{\ \textsuperscript{*}}&$1:\sqrt{2}$\\
%\opt{compact}& 110& 165& 160& 240&$2:3$&$2:3$&$2:3$&$2:3$\\
%\opt{compactaureo}& 118& 191& 160& 240&$2:3$&$2:3$&$5:8$\makebox[0pt]{\ \textsuperscript{*}}&$2:3$\\
%\opt{supercompact}& 100 &150& 140& 210&$2:3$&$2:3$&$2:3$&$2:3$\\
%\opt{supercompactaureo}& 108 &175& 140& 210&$1:1$&$1:1$&$5:8$\makebox[0pt]{\ \textsuperscript{*}}&$2:3$\\
-%\opt{periodical} &110& 165& 170& 240&$2:3$&$2:3$&$2:3$&$1:\kern-3pt\sqrt{2}$\\
-%\opt{periodicalaureo}& 120& 194& 170& 240&$2:3$&$2:3$&$5:8$\makebox[0pt]{\ \textsuperscript{*}}&$1:\kern-3pt\sqrt{2}$\\
+%\opt{periodical} &110& 165& 170& 240&$2:3$&$2:3$&$2:3$&$1:\sqrt{2}$\\
+%\opt{periodicalaureo}& 120& 194& 170& 240&$2:3$&$2:3$&$5:8$\makebox[0pt]{\ \textsuperscript{*}}&$1:\sqrt{2}$\\
%
% \bottomrule\\[-2ex]
% \multicolumn{9}{r}{\footnotesize\textsuperscript{*} $5:8\approx 1:1,618$}
-%\end{tabular}}\\[-3ex]
+%\end{tabular}\\[-3ex]
% \caption{The layouts of \sty{suftesi}}\label{tab:layouts}
% \end{table}
%
-%^^A The form of the book has been changing through the centuries and every content requires a particular shape. Nowdays the most widespread form for literary essays is a compact one. So, if you are interested in such a topic, you should consider the compact layouts. The one I prefer is shown on figure \ref{fig:periodicalaureo}.
-%
-%^^A\begin{figure}[h!]\centering
-%^^A\noindent\begin{tikzpicture}[scale=0.3]
-%^^A\draw (0,0) rectangle (17,24);
-%^^A\draw[draw=none,fill=gray!50,xshift=3cm,yshift=2.6cm] (0,0) rectangle (12,19.4);
-%^^A\draw[xshift=17cm] (0,0) rectangle ++(17,24);
-%^^A\draw[xshift=17cm,draw=none,fill=gray!50,xshift=2cm,yshift=2.6cm] (0,0) rectangle ++(12,19.4);
-%^^A\end{tikzpicture}
-%^^A\caption{The \opt{periodicalaureo} layout}\label{fig:periodicalaureo}
-%^^A\end{figure}
+%
+%You can define your own layouts through the \cmd{geometry} command and you can change the value of \cmd{baselineskip} too. For example you can resize the typeblock of the \texttt{supercompactaureo} layout to fit your particular needs. In this case remember to declare \cmd{normalsize} like in the following example:
+%\begin{latexcode}
+%\begin{verbatim}
+%\linespread{0.95}
+%\normalsize
+%\geometry{
+%textheight= 162mm,
+%textwidth= 100mm,
+%paperwidth= 140mm,
+%paperheight= 210mm,
+%hmarginratio= 2:3,
+%vmarginratio= 1:1,
+%marginparwidth= 11mm,
+%marginparsep= 7pt,
+%ignoreall,
+%heightrounded}
+%\end{verbatim}
+%\end{latexcode}%
+% ^^A The form of the book has been changing through the centuries and every content requires a particular shape. Nowdays the most widespread form for literary essays is a compact one. So, if you are interested in such a topic, you should consider the compact layouts. The one I prefer is shown on figure \ref{fig:periodicalaureo}.
+%
+% ^^A\begin{figure}[h!]\centering
+% ^^A\noindent\begin{tikzpicture}[scale=0.3]
+% ^^A\draw (0,0) rectangle (17,24);
+% ^^A\draw[draw=none,fill=gray!50,xshift=3cm,yshift=2.6cm] (0,0) rectangle (12,19.4);
+% ^^A\draw[xshift=17cm] (0,0) rectangle ++(17,24);
+% ^^A\draw[xshift=17cm,draw=none,fill=gray!50,xshift=2cm,yshift=2.6cm] (0,0) rectangle ++(12,19.4);
+% ^^A\end{tikzpicture}
+% ^^A\caption{The \opt{periodicalaureo} layout}\label{fig:periodicalaureo}
+% ^^A\end{figure}
%
% \subsection{Fonts}
%
@@ -449,7 +546,9 @@
%The \opt{defaultfont} option allows you to can change the default roman font to New PX (Palatino-like), Linux Libertine O, or Latin modern.
%You can use other fonts as well, but in this case remember to load the \opt{defaultfont=none} option which turns off the default font settings (see section \ref{sec:options} for details).
%
-%Another beautiful Garamond-like font, complete of real small caps, bold weight and mathematical support, is made available by the \sty{garamondx} package by Michael Sharpe, which provides an extension of the \sty{ugm} fonts, (URW)++ GaramondNo8. They are not distributed as part of \TeX Live, but they may be downloaded using the \texttt{getnonfreefonts} script. See the instructions for installation at
+%Today there are several Garamond-like fonts in TeX Live distribution. See, for example \textit{Garamond Libre} (Open Type only) and \textit{Cormorant Garamond}. The Bembo-like fonts \textit{Etbb} and \textit{fbb} should also be considered if you appreciate humanist fonts. In any case, before using a font, read the license carefully.
+
+%Another beautiful Garamond-like font, complete of real small caps, bold weight and mathematical support, is made available by the \sty{garamondx} package by Michael Sharpe, which provides an extension of the \sty{ugm} fonts, (URW)++ GaramondNo8 (see the License note in the package documentation at the web page \url{https://www.ctan.org/pkg/garamondx}. They are not distributed as part of \TeX Live, but they may be downloaded using the \texttt{getnonfreefonts} script. See the instructions for installation at
%\url{http://tug.org/fonts/getnonfreefonts/}.
%
%
@@ -458,56 +557,56 @@
% The class loads by default a ‘minimal’ mathematical support for Cochineal (default), Linux Libertine O or New PX via the \sty{newtxmath} or \sty{newpxmath} packages by Michael Sharpe. Moreover the \opt{mathfont} option is provided to extend or disable the support for mathematics when using these fonts. These non-standard fonts have a very good mathematical support but if you aim at typesetting high mathematics the Latin Modern font family remains, of course, the better choice: \opt{defaultfont=standard}. See section \ref{sec:fonts} for details.
%
% If some of the loaded packages conflict or if you simply want to change some of the default font settings you should first reset the font default with \opt{defaultfont=none} option and then load the packages in the right order and with your favorite options.
-%^^AFor example, these are the codes loaded for the three non-standard fonts:
-%^^A
-%^^A\paragraph{defaultfont=cochineal}
-%^^A
-%^^A\begin{latexcode}
-%^^A\begin{verbatim}
-%^^A\documentclass[defaultfont=none]{suftesi}
-%^^A...
-%^^A\usepackage{textcomp}
-%^^A\usepackage{cochineal}
-%^^A\usepackage[varqu,varl,var0]{inconsolata}
-%^^A\usepackage{biolinum}
-%^^A\usepackage{cochineal}
-%^^A\usepackage{amsthm}
-%^^A\usepackge[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath}
-%^^A\usepackge[cal=boondoxo]{mathalfa}
-%^^A\useosf
-%^^A\useproportional
-%^^A\end{verbatim}
-%^^A\end{latexcode}
-%^^A
-%^^A\paragraph{defaultfont=palatino}
-%^^A
-%^^A\begin{latexcode}
-%^^A\begin{verbatim}
-%^^A\usepackage[full]{textcomp}
-%^^A\usepackage{newpxtext}
-%^^A\usepackage[scaled=1.06]{biolinum}
-%^^A\usepackage[varqu,varl]{inconsolata}
-%^^A\usepackage{amsthm}
-%^^A\usepackage[bigdelims,vvarbb]{newpxmath}
-%^^A\usepackage[cal=boondoxo]{mathalfa}
-%^^A\useosf
-%^^A\useproportional
-%^^A\end{verbatim}
-%^^A\end{latexcode}
-%^^A
-%^^A\paragraph{defaultfont=libertine}
-%^^A
-%^^A\begin{latexcode}
-%^^A\begin{verbatim}
-%^^A\usepackage{textcomp}
-%^^A\usepackage[sb]{libertine}
-%^^A\usepackage[varqu,varl,scaled=0.94]{inconsolata}
-%^^A\usepackage{amsthm}
-%^^A\usepackage[libertine,bigdelims,vvarbb]{newtxmath}
-%^^A\usepackage[cal=boondoxo]{mathalfa}
-%^^A\useosf
-%^^A\end{verbatim}
-%^^A\end{latexcode}
+% ^^AFor example, these are the codes loaded for the three non-standard fonts:
+% ^^A
+% ^^A\paragraph{defaultfont=cochineal}
+% ^^A
+% ^^A\begin{latexcode}
+% ^^A\begin{verbatim}
+% ^^A\documentclass[defaultfont=none]{suftesi}
+% ^^A...
+% ^^A\usepackage{textcomp}
+% ^^A\usepackage{cochineal}
+% ^^A\usepackage[varqu,varl,var0]{inconsolata}
+% ^^A\usepackage{biolinum}
+% ^^A\usepackage{cochineal}
+% ^^A\usepackage{amsthm}
+% ^^A\usepackge[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath}
+% ^^A\usepackge[cal=boondoxo]{mathalfa}
+% ^^A\useosf
+% ^^A\useproportional
+% ^^A\end{verbatim}
+% ^^A\end{latexcode}
+% ^^A
+% ^^A\paragraph{defaultfont=palatino}
+% ^^A
+% ^^A\begin{latexcode}
+% ^^A\begin{verbatim}
+% ^^A\usepackage[full]{textcomp}
+% ^^A\usepackage{newpxtext}
+% ^^A\usepackage[scaled=1.06]{biolinum}
+% ^^A\usepackage[varqu,varl]{inconsolata}
+% ^^A\usepackage{amsthm}
+% ^^A\usepackage[bigdelims,vvarbb]{newpxmath}
+% ^^A\usepackage[cal=boondoxo]{mathalfa}
+% ^^A\useosf
+% ^^A\useproportional
+% ^^A\end{verbatim}
+% ^^A\end{latexcode}
+% ^^A
+% ^^A\paragraph{defaultfont=libertine}
+% ^^A
+% ^^A\begin{latexcode}
+% ^^A\begin{verbatim}
+% ^^A\usepackage{textcomp}
+% ^^A\usepackage[sb]{libertine}
+% ^^A\usepackage[varqu,varl,scaled=0.94]{inconsolata}
+% ^^A\usepackage{amsthm}
+% ^^A\usepackage[libertine,bigdelims,vvarbb]{newtxmath}
+% ^^A\usepackage[cal=boondoxo]{mathalfa}
+% ^^A\useosf
+% ^^A\end{verbatim}
+% ^^A\end{latexcode}
%
%
%
@@ -538,7 +637,7 @@
%\begin{figure}
% \centering
%\begin{tikzpicture}
-% \draw[draw=gray,fill=white,drop shadow] (-.5\textwidth,0) rectangle (.5\textwidth,\textheight);
+% \draw[draw=gray,fill=white,drop shadow] (-.5\textwidth,0) rectangle (.5\textwidth,.9\textheight);
%\draw[line width=.5mm,fill=white,text=black,draw=black!60] (-4.2,17.1) circle (9mm) node {\parbox{12mm}{\centering\tiny * * * \\ St. Anford\\ University\\[1mm] * * * }};
%\node[anchor=north west] at (-2.5cm,18cm) {%
% \parbox{8cm}{%
@@ -579,8 +678,8 @@
%\begin{figure}
% \centering
%\begin{tikzpicture}
-% \draw[draw=gray,fill=gray!5,drop shadow] (-.5\textwidth,0) rectangle (.5\textwidth,\textheight);
-% \node at (0,.7\textheight) (c) {};
+% \draw[draw=gray,fill=gray!5,drop shadow] (-.5\textwidth,0) rectangle (.5\textwidth,.9\textheight);
+% \node at (0,.65\textheight) (c) {};
% \draw[ball color=DarkBlue,draw=none] (c) circle (4.5cm);
% \node[anchor=center,text=white] at (c) {\parbox{6cm}{%
% \centering
@@ -601,19 +700,19 @@
% \subsection{The cover page}
% Since version 2.6 \sty{suftesi} provides a command to print a simple cover page (figure \ref{fig:cover}), inspired by the Italian designer Bruno \textcite[85-89]{munari:arte-come-mestiere}. The color used for the text and the circle as well as other graphical elements are partially customizable (see section \ref{sec:options} for details). The cover shown in figure \ref{fig:cover} is obtained with the following code:
%\begin{latexcode}
- %\begin{verbatim}
- %\Cauthor{Bruce Lee}
- %\Ctitle{The Art of Kicking}
- %\Csubtitle{How to survive in the modern societies}
- %\Ceditor{edited by\\ Walker Texas Ranger}
- %\Cfoot{Punch Press\\\fbox{\bfseries P\&P}}
- %\Cpagecolor{white!90!black}
- %\Ctextcolor{white}
- %\Cfootcolor{black}
- %
- %\makecover[ball color=DarkBlue,draw=none]
- %\end{verbatim}
- %\end{latexcode}
+%\begin{verbatim}
+%\Cauthor{Bruce Lee}
+%\Ctitle{The Art of Kicking}
+%\Csubtitle{How to survive in the modern societies}
+%\Ceditor{edited by\\ Walker Texas Ranger}
+%\Cfoot{Punch Press\\\fbox{\bfseries P\&P}}
+%\Cpagecolor{white!90!black}
+%\Ctextcolor{white}
+%\Cfootcolor{black}
+%
+%\makecover[ball color=DarkBlue,draw=none]
+%\end{verbatim}
+%\end{latexcode}
%
%To produce a complete book cover, with spine and dust jacket, you should take a look at the \sty{bookcover} package by Tibor Tómács.
%
@@ -652,9 +751,9 @@
%
%
%
-%^^A\subsection{Title page}
+% ^^A\subsection{Title page}
%
-%^^A The class provides a very simple title page through the \cmd{maketitle} command. A large collection of stylish title pages is provided by the \sty{titlepages} package by Peter Wilson. This package is part of the \sty{memoir} documentation but you can copy the code examples and adapt them to work with \sty{suftesi} with quite simple changes.
+% ^^A The class provides a very simple title page through the \cmd{maketitle} command. A large collection of stylish title pages is provided by the \sty{titlepages} package by Peter Wilson. This package is part of the \sty{memoir} documentation but you can copy the code examples and adapt them to work with \sty{suftesi} with quite simple changes.
%
% \subsection{The appendices}
% Since version 2.9.5 the class relies on \sty{appendix} package to manage the appendices. To get the correct label in titles, headings and table of contents, you should use the \env{appendices} environment.
@@ -738,7 +837,17 @@
%
%\subsection{Font}\label{sec:fonts}
%
-% The first three options are available only with \LaTeX.
+%\begin{optionlist}
+% \optitem[10]{fontsize}{10, 10.1, 10.2...,11, 11.1, 11.2...}
+% Sets the main font sizes for the document, changing the \cmd{baselineskip} accordingly. It is based on the \sty{fontsize} package. Remember that using \XeLaTeX{} or \LuaLaTeX{} you can change the default font size also with the option \opt{SizeFeatures} of \sty{fontspec}. For example:
+%\begin{latexcode}
+%\begin{verbatim}
+%\setmainfont[SizeFeatures={Size=11.5}]{Garamond Libre}
+%\end{verbatim}
+%\end{latexcode}
+%
+%\end{optionlist}
+% The first three options below are available only with \LaTeX.
% Using \XeLaTeX{} or \LuaLaTeX{}
% the default font is the Computer Modern but you can change it through
% the \sty{fontspec} or \sty{mathspec} (\XeLaTeX{} only) packages. If you do not need to typeset mathematics, with these engines I do suggest the EB Garamond font family by Georg Duffner.
@@ -751,7 +860,7 @@
% \item[cochineal] Loads the Cochineal serif, the Linux Biolinum O sans serif and the Inconsolata typewriter.
% \item[libertine] Loads the Linux Libertine O serif, the Linux Biolinum O sans serif and the Inconsolata typewriter.
% \item[palatino] Loads the New PX serif, the Linux Biolinum O sans serif and the Inconsolata typewriter. Note that the New PX font does not provide support for Greek. The \opt{greekfont=artemisa} option offers a very good solution.
-%^^A and {\fontfamily{artemisia}\selectfont Artemisia} by the {\fontfamily{artemisia}\selectfont Greek Font Society} for the greek text.
+% ^^A and {\fontfamily{artemisia}\selectfont Artemisia} by the {\fontfamily{artemisia}\selectfont Greek Font Society} for the greek text.
% \item[standard] Loads the \sty{lmodern} package: Latin Modern font family and CB Greek.
% \end{valuelist}
% \optitem[none]{greekfont}{\opt{none}, \opt{artemisia}, \opt{porson}, \opt{bodoni}, \opt{cbgreek}}
@@ -981,14 +1090,10 @@
% \subsection{Miscellaneous}\label{sec:miscellaneous}
%
%\begin{optionlist}
-% \optitem[compact]{parindent}{\opt{compact}, \opt{wide}}
+% \optitem[\cmd{baselineskip}]{parindent}{\opt{1em}, \opt{1cm}, \opt{17pt}, \ldots}
% \changes{v0.9b}{2012/09/23}{New option \opt{parindent}}
% \begin{valuelist}
-% Sets the indentation of the first line of each paragraph except those following a section title.
-% \item[compact]
-% Sets indentation to 1\,em.
-% \item[wide]
-% Sets indentation to 1.5\,em.
+% Sets the indentation of the first line of each paragraph except those following a section title. For backward compatibility you should use \opt{parindet=1em} or \opt{parindet=1.5} in place of \opt{parindet=compact} and \opt{parindet=wide} respectively.
% \end{valuelist}
%\boolitem[true]{marginpar}
% \begin{valuelist}
@@ -1216,7 +1321,7 @@
%
% \end{ltxsyntax}
%
-% \subsection[Breaking titles]{Breaking titles}
+% \subsection[Breaking titles]{Breaking titles in header and table of contents}
%
% \begin{ltxsyntax}
% \cmditem{headbreak}
@@ -1242,7 +1347,7 @@
% \end{ltxsyntax}
%
% \changes{v0.5}{2011/10/21}{New command \opt{chapnumfont}}
-% \subsection{Section titles}\label{sec:secfont}
+% \subsection{Customizing titles}\label{sec:secfont}
% \changes{v2.9.3}{2020/001/29}{New commands to change the font of the section titles and numbers.}
%
% The commands in this section are experimental. They provide a fast way to customize the format of section titles and numbers. Note that in some cases you will have to manually adjust the spacing accordingly, using \cmd{titlespacing}, \cmd{hskip}/\cmd{hspace}, \cmd{vskip}/\cmd{vspace}, and so on.
@@ -1278,9 +1383,6 @@
%\chapfont{\bfseries\sffamily\scshape\LARGE}
%\secfont{\sffamily\fontsize{14.5}{15.5}\selectfont}
%
-%\chapnumfont{\hskip1cm\bfseries\fontsize{100}{100}\selectfont%
-%\color{gray}\arabic{chapter}}
-%\secnumfont{\bfseries---\,\arabic{chapter}.\arabic{section}}
%\chapnumfont{\hskip1cm\hbox{\bfseries\fontsize{100}{100}\selectfont%
%\color{gray}\arabic{chapter}}\hskip-1cm}
%\secnumfont{\bfseries---\,\arabic{chapter}.\arabic{section}}
@@ -1357,9 +1459,9 @@
% \renewcommand{\appendixpagename}{Appendices}
%\end{verbatim}
%\end{latexcode}%
-%^^A \cmditem{appendicesname}{name}\hfill(default=\texttt{Appendici})
-%^^A
-%^^A Changes in \meta{name} the title printed by the \cmd{appendixpage} command.
+% ^^A \cmditem{appendicesname}{name}\hfill(default=\texttt{Appendici})
+% ^^A
+% ^^A Changes in \meta{name} the title printed by the \cmd{appendixpage} command.
%
%\end{ltxsyntax}
%
@@ -1796,13 +1898,17 @@
\ProcessOptions
\relax
\LoadClass{book}
+\@ifpackageloaded{fontsize}{}{\RequirePackage{fontsize}}
+\DeclareOptionX{parindent}{\setlength{\parindent}{#1}}
+\ExecuteOptionsX{parindent=\baselineskip}
+\ProcessOptionsX*\relax
% \end{macrocode}
% \subsection*{Document structure}
% \begin{macrocode}
\define@choicekey{}{structure}[\val\nr]
{book,article,collection}[book]{%
\ifcase\nr\relax
-%^^A\disable@keys{}{secnumstyle}
+% \disable@keys{}{secnumstyle}
\def\SUF@chapswitch{\thechapter.}
\or
\suftesi@articletrue
@@ -2110,14 +2216,14 @@
% \end{macrocode}
% \subsection*{TOC font}
% \begin{macrocode}
-%^^A\define@choicekey{}{tocpartfont}[\val\nr]{roman,italic,smallcaps}[roman]{%
-%^^A\ifcase\nr\relax
-%^^A\def\SUF@tocPART@font{\relax}
-%^^A\or
-%^^A\def\SUF@tocPART@font{\itshape}
-%^^A\or
-%^^A\def\SUF@tocPART@font{\expandafter\SUF@TOCtitlesmallcaps}
-%^^A\fi}
+% \define@choicekey{}{tocpartfont}[\val\nr]{roman,italic,smallcaps}[roman]{%
+% \ifcase\nr\relax
+% \def\SUF@tocPART@font{\relax}
+% \or
+% \def\SUF@tocPART@font{\itshape}
+% \or
+% \def\SUF@tocPART@font{\expandafter\SUF@TOCtitlesmallcaps}
+% \fi}
\define@choicekey{}{tocchapfont}[\val\nr]{roman,italic,smallcaps}[roman]{%
\ifcase\nr\relax
\def\SUF@tocCHAP@font{\relax}
@@ -2175,27 +2281,27 @@
\ifcase\nr\relax
\def\SUF@thepart{\arabic{part}}
\def\SUF@dotpart{}
-%^^A \def\SUF@PART@thecontentslabel{\thecontentslabel}
+% \def\SUF@PART@thecontentslabel{\thecontentslabel}
\or
\def\SUF@thepart{\textsc{\roman{part}}}
\def\SUF@dotpart{}
-%^^A \def\SUF@PART@thecontentslabel{\@roman{\thecontentslabel}}
+% \def\SUF@PART@thecontentslabel{\@roman{\thecontentslabel}}
\or
\def\SUF@thepart{\Roman{part}}
\def\SUF@dotpart{}
-%^^A \def\SUF@PART@thecontentslabel{\@Roman{\thecontentslabel}}
+% \def\SUF@PART@thecontentslabel{\@Roman{\thecontentslabel}}
\or
\def\SUF@thepart{\arabic{part}}
\def\SUF@dotpart{.}
-%^^A \def\SUF@PART@thecontentslabel{\thecontentslabel}
+% \def\SUF@PART@thecontentslabel{\thecontentslabel}
\or
\def\SUF@thepart{\textsc{\roman{part}}}
\def\SUF@dotpart{.}
-%^^A \def\SUF@PART@thecontentslabel{\@roman{\thecontentslabel}}
+% \def\SUF@PART@thecontentslabel{\@roman{\thecontentslabel}}
\or
\def\SUF@thepart{\Roman{part}}
\def\SUF@dotpart{.}
-%^^A \def\SUF@PART@thecontentslabel{\@Roman{\thecontentslabel}}
+% \def\SUF@PART@thecontentslabel{\@Roman{\thecontentslabel}}
\fi}
% \end{macrocode}
% \subsubsection*{Chapter number style}
@@ -2354,17 +2460,16 @@ dotarabic,dotroman,dotRoman}[arabic]{%
\newcommand{\secnumfont}[1]{\def\SUF@thesection{#1}}
\newcommand{\subsecnumfont}[1]{\def\SUF@thesubsection{#1}}
\newcommand{\subsubsecnumfont}[1]{\def\SUF@thesubsubsection{#1}}
-%
\newcommand{\titlefont}[1]{\def\SUF@titlefont@Switch{#1}}
\newcommand{\authorfont}[1]{\def\SUF@authorfont@Switch{#1}}
%
-%^^A\newcommand{\tocpartfont}[1]{\def\SUF@tocPART@font{#1}}
+% \newcommand{\tocpartfont}[1]{\def\SUF@tocPART@font{#1}}
\newcommand{\tocchapfont}[1]{\def\SUF@tocCHAP@font{#1}}
\newcommand{\tocsecfont}[1]{\def\SUF@tocSEC@font{#1}}
\newcommand{\tocsubsecfont}[1]{\def\SUF@tocSUBSEC@font{#1}}
\newcommand{\tocsubsubsecfont}[1]{\def\SUF@tocSUBSUBSEC@font{#1}}
-%^^A\newcommand{\tocpartnumfont}[1]{\def\SUF@PART@thecontentslabel{#1\thecontentslabel}}
+% \newcommand{\tocpartnumfont}[1]{\def\SUF@PART@thecontentslabel{#1\thecontentslabel}}
\newcommand{\tocchapnumfont}[1]{\def\SUF@CHAP@thecontentslabel{#1\thecontentslabel}}
\newcommand{\tocsecnumfont}[1]{\def\SUF@SEC@thecontentslabel{#1\thecontentslabel}}
\newcommand{\tocsubsecnumfont}[1]{\def\SUF@SUBSEC@thecontentslabel{#1\thecontentslabel}}
@@ -2636,16 +2741,6 @@ dotarabic,dotroman,dotRoman}[arabic]{%
\fi}
% \end{macrocode}
% \subsection*{Other options}
-% \subsubsection*{Indentation}
-% \begin{macrocode}
-\define@choicekey{}{parindent}[\val\nr]
- {compact,wide}[compact]{%
-\ifcase\nr\relax
-\setlength\parindent{1em}
-\or
-\setlength\parindent{1.5em}
-\fi}
-% \end{macrocode}
% \subsubsection*{Part page}
% \begin{macrocode}
\define@choicekey{}{partpage}[\val\nr]{true,false}[true]{%
@@ -2904,7 +2999,7 @@ dotarabic,dotroman,dotRoman}[arabic]{%
subsecfont,subsubsecfont,partstyle,chapstyle,secstyle,%
subsecstyle,subsubsecstyle,partnumstyle,chapnumstyle,%
secnumstyle,tocstyle,headerstyle,headerfont,quotestyle,%
-quotesize,footnotestyle,liststyle,captionstyle,parindent}
+quotesize,footnotestyle,liststyle,captionstyle}
\or
\suftesi@periodicalaureotrue
\suftesi@FSPLtrue
@@ -2922,7 +3017,7 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
subsecfont,subsubsecfont,partstyle,chapstyle,secstyle,%
subsecstyle,subsubsecstyle,partnumstyle,chapnumstyle,%
secnumstyle,tocstyle,headerstyle,headerfont,quotestyle,%
-quotesize,footnotestyle,liststyle,captionstyle,parindent}
+quotesize,footnotestyle,liststyle,captionstyle}
\or
\suftesi@periodicalaureotrue
\suftesi@FSPLtrue
@@ -2941,7 +3036,7 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
subsecfont,subsubsecfont,partstyle,chapstyle,secstyle,%
subsecstyle,subsubsecstyle,partnumstyle,chapnumstyle,%
secnumstyle,tocstyle,headerstyle,headerfont,quotestyle,%
-quotesize,footnotestyle,liststyle,captionstyle,parindent}
+quotesize,footnotestyle,liststyle,captionstyle}
\fi}
% \end{macrocode}
% \subsubsection*{Options for \opt{collection} document structure}
@@ -2985,7 +3080,6 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
structure=book,
captionstyle=standard,
marginpar=true,
- parindent=compact,
tocstyle=standard,
defaultfont=cochineal,
mathfont=minimal,
@@ -3019,8 +3113,6 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
tocauthorfont=roman,
revauthortitle=false,
papertitlestyle=left,
- authorfont=roman,
- titlefont=italic,
tocchapfont=roman,
tocsecfont=roman,
tocsubsecfont=roman,
@@ -3052,12 +3144,12 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
% \end{macrocode}
% \subsection*{Basic packages}
% \begin{macrocode}
-\RequirePackage{color}
- \definecolor{sufred}{rgb}{0.5,0,0}
- \definecolor{sufgray}{rgb}{0.5,0.5,0.5}
\RequirePackage{multicol}
\RequirePackage{emptypage}
\RequirePackage{microtype}
+\RequirePackage{color}
+\definecolor{sufred}{rgb}{0.5,0,0}
+\definecolor{sufgray}{rgb}{0.5,0.5,0.5}
\RequirePackage{iftex}
\ifLuaTeX
\RequirePackage{luatex85}
@@ -3071,8 +3163,7 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
\else
\fi
% \end{macrocode}
-% \subsection*{Page layout}
-% The \cmd{geometry} command must be declare before the \sty{fontenc} package. If declared after it, the \opt{heightrounded} option becomes ineffective and many underfull vertical boxes may occur.
+% \subsection*{Page layouts}
% \begin{macrocode}
\ifsuftesi@screen
\newcommand*\crop[1][]{}
@@ -4263,48 +4354,50 @@ quotesize,footnotestyle,liststyle,captionstyle,parindent}
\renewcommand{\appendixtocname}{Appendici}
\renewcommand{\appendixname}{Appendice}
\noappendicestocpagenum
-%^^A Bug using defaultfont=none,libertine,standard,compatibility
-%^^A \AtBeginEnvironment{appendices}{\appendix\mainmatter}
+% Bug using defaultfont=none,libertine,standard,compatibility
+% \AtBeginEnvironment{appendices}{\appendix\mainmatter}
\def\appendicesname{%
\ClassError{suftesi}%
{Command \noexpand\appendicesname undefined\MessageBreak
- Redefine the \noexpand\appendixpagename command instead. See the 'appendix' package documentation.\MessageBreak
+ Redefine the \noexpand\appendixpagename command instead.
+ See the 'appendix' package documentation.\MessageBreak
\noexpand\renewcommand{\noexpand\appendixpagename{newname}}}
{Command \noexpand\appendicesname undefined\MessageBreak
- Redefine the \noexpand\appendixpagename command instead. See the 'appendix' package documentation.\MessageBreak
+ Redefine the \noexpand\appendixpagename command instead.
+ See the 'appendix' package documentation.\MessageBreak
\noexpand\renewcommand{\noexpand\appendixpagename{newname}}}}
-%^^A\newcommand{\appendicesname}[1]{\def\SUF@appendices{#1}}
-%^^A \appendicesname{Appendici}
-%^^A \newcommand{\appendixpage}{\SUF@appendixpage}
-%^^A\def\SUF@appendixpage{%
-%^^A \@mainmattertrue
-%^^A \titlecontents{part}
-%^^A [0em]
-%^^A {\addvspace{3ex}}
-%^^A {}
-%^^A {}
-%^^A {}
-%^^A [\addvspace{1ex}]
-%^^A\let\contentspage\relax
-%^^A \cleardoublepage
-%^^A \thispagestyle{empty}
-%^^A \addcontentsline{toc}{part}{\SUF@appendices}
-%^^A \begingroup
-%^^A \centering
-%^^A \null\vfil
-%^^A {\LARGE\SUF@appendices\par}
-%^^A \vfil
-%^^A \endgroup
-%^^A \cleardoublepage
-%^^A\titlecontents{part}
-%^^A [0em]
-%^^A {\addvspace{3ex}\partname~}
-%^^A {\makebox[\SUF@label@part][l]{%
-%^^A \thecontentslabel}\hspace*{1em}}
-%^^A {}
-%^^A {}
-%^^A [\addvspace{1ex}]
-%^^A}
+% \newcommand{\appendicesname}[1]{\def\SUF@appendices{#1}}
+% \appendicesname{Appendici}
+% \newcommand{\appendixpage}{\SUF@appendixpage}
+% \def\SUF@appendixpage{%
+% \@mainmattertrue
+% \titlecontents{part}
+% [0em]
+% {\addvspace{3ex}}
+% {}
+% {}
+% {}
+% [\addvspace{1ex}]
+% \let\contentspage\relax
+% \cleardoublepage
+% \thispagestyle{empty}
+% \addcontentsline{toc}{part}{\SUF@appendices}
+% \begingroup
+% \centering
+% \null\vfil
+% {\LARGE\SUF@appendices\par}
+% \vfil
+% \endgroup
+% \cleardoublepage
+% \titlecontents{part}
+% [0em]
+% {\addvspace{3ex}\partname~}
+% {\makebox[\SUF@label@part][l]{%
+% \thecontentslabel}\hspace*{1em}}
+% {}
+% {}
+% [\addvspace{1ex}]
+% }
\renewcommand{\@chap@pppage}{%
\clear@ppage
\thispagestyle{plain}%
@@ -4683,6 +4776,14 @@ Janusz M. Nowacki.
\addtolength{\csname SUF@tocindent@#1\endcsname}{#2}%
}
}
+% \end{macrocode}
+% These commands control the space before and after the label of the sections in the table of contents, using the \opt{compactfont} option.
+% \begin{macrocode}
+\newcommand{\adjtoclabelsep}{\hskip.2em plus 1pt minus 1pt}
+\newcommand{\adjtocpagesep}{\hskip.5em plus 2pt minus 1pt}
+% \end{macrocode}
+% A class error if the obsolete \cmd{toclabelspace} is used:
+% \begin{macrocode}
\newcommand{\toclabelspace}{%
\ClassError{suftesi}
{\MessageBreak
@@ -4813,16 +4914,17 @@ Janusz M. Nowacki.
[\addvspace{1ex}]
\ifsuftesi@toccompactsec
\titlecontents*{section}[\SUF@tochang@chap]{}{%
- \SUF@SEC@thecontentslabel\ \SUF@tocSEC@font}{}{, \thecontentspage}[][.\hskip.5em][\suf@ctocdotsec]
+ \SUF@SEC@thecontentslabel\adjtoclabelsep\SUF@tocSEC@font}{}{,
+ \thecontentspage}[][.\adjtocpagesep][\suf@ctocdotsec]
\else
\titlecontents{section}
[\SUF@tochang@sec]
{}
{\hskip-\SUF@tochang@sec%
\makebox[1em][l]{\thecontentspage}\hskip\SUF@addto@tochang@sec%
-%^^A \makebox[\SUF@label@sec][l]{%
-%^^A \ifsuftesi@article\SUF@toclabelnum%
-%^^A \else\fi\thecontentslabel}\hspace*{1em}%
+% \makebox[\SUF@label@sec][l]{%
+% \ifsuftesi@article\SUF@toclabelnum%
+% \else\fi\thecontentslabel}\hspace*{1em}%
\makebox[\SUF@label@sec][l]{\SUF@SEC@thecontentslabel}\hspace*{1em}%
\SUF@tocSEC@font}
{\hskip-\SUF@tochang@sec%
@@ -4832,7 +4934,8 @@ Janusz M. Nowacki.
\fi
\ifsuftesi@toccompactsubsec
\titlecontents*{subsection}[\SUF@tochang@sec]{\suf@sscorrect}{%
- \SUF@SUBSEC@thecontentslabel\ \SUF@tocSUBSEC@font}{}{, \thecontentspage}[][.\hskip.5em][\suf@ctocdotssec]
+ \SUF@SUBSEC@thecontentslabel\adjtoclabelsep\SUF@tocSUBSEC@font}{}{,
+ \thecontentspage}[][.\adjtocpagesep][\suf@ctocdotssec]
\else
\titlecontents{subsection}
[\SUF@tochang@subsec]
@@ -4848,7 +4951,8 @@ Janusz M. Nowacki.
\fi
\ifsuftesi@toccompactsubsubsec
\titlecontents*{subsubsection}[\SUF@tochang@subsec]{\suf@ssscorrect}{%
- \SUF@SUBSUBSEC@thecontentslabel\ \SUF@tocSUBSUBSEC@font}{}{, \thecontentspage}[][.\hskip.5em][\suf@ctocdotsssec]
+ \SUF@SUBSUBSEC@thecontentslabel\adjtoclabelsep\SUF@tocSUBSUBSEC@font}{}{,
+ \thecontentspage}[][.\adjtocpagesep][\suf@ctocdotsssec]
\else
\titlecontents{subsubsection}
[\SUF@tochang@subsubsec]
@@ -4959,15 +5063,16 @@ Janusz M. Nowacki.
[\addvspace{1ex}]
\ifsuftesi@toccompactsec
\titlecontents*{section}[\SUF@tocindent@chap]{}{%
- \SUF@SEC@thecontentslabel\ \SUF@tocSEC@font}{}{, \thecontentspage}[][.\hskip.5em][\suf@ctocdotsec]
+ \SUF@SEC@thecontentslabel\adjtoclabelsep\SUF@tocSEC@font}{}{,
+ \thecontentspage}[][.\adjtocpagesep][\suf@ctocdotsec]
\else
\titlecontents{section}
[\SUF@tocindent@sec]
{}
{\hskip-\dimexpr(\SUF@label@sec+1em)%
-%^^A \makebox[\SUF@label@sec][l]{%
-%^^A \ifsuftesi@article\SUF@toclabelnum%
-%^^A \else\fi\thecontentslabel}\hspace*{1em}%
+% \makebox[\SUF@label@sec][l]{%
+% \ifsuftesi@article\SUF@toclabelnum%
+% \else\fi\thecontentslabel}\hspace*{1em}%
\makebox[\SUF@label@sec][l]{\SUF@SEC@thecontentslabel}\hspace*{1em}%
\SUF@tocSEC@font}
{\hskip-\dimexpr(\SUF@label@sec+1em)%
@@ -4977,7 +5082,8 @@ Janusz M. Nowacki.
\fi
\ifsuftesi@toccompactsubsec
\titlecontents*{subsection}[\SUF@tocindent@sec]{\suf@sscorrect}{%
- \SUF@SUBSEC@thecontentslabel\ \SUF@tocSUBSEC@font}{}{, \thecontentspage}[][.\hskip.5em][\suf@ctocdotssec]
+ \SUF@SUBSEC@thecontentslabel\adjtoclabelsep\SUF@tocSUBSEC@font}{}{,
+ \thecontentspage}[][.\adjtocpagesep][\suf@ctocdotssec]
\else
\titlecontents{subsection}
[\SUF@tocindent@subsec]
@@ -4991,7 +5097,8 @@ Janusz M. Nowacki.
\fi
\ifsuftesi@toccompactsubsubsec
\titlecontents*{subsubsection}[\SUF@tocindent@subsec]{\suf@ssscorrect}{%
- \SUF@SUBSUBSEC@thecontentslabel\ \SUF@tocSUBSUBSEC@font}{}{, \thecontentspage}[][.\hskip.5em][\suf@ctocdotsssec]
+ \SUF@SUBSUBSEC@thecontentslabel\adjtoclabelsep\SUF@tocSUBSUBSEC@font}{}{,
+ \thecontentspage}[][.\adjtocpagesep][\suf@ctocdotsssec]
\else
\titlecontents{subsubsection}
[\SUF@tocindent@subsubsec]
diff --git a/macros/latex/contrib/suftesi/suftesi.pdf b/macros/latex/contrib/suftesi/suftesi.pdf
index a98cf7a81f..4c6a1e43c4 100644
--- a/macros/latex/contrib/suftesi/suftesi.pdf
+++ b/macros/latex/contrib/suftesi/suftesi.pdf
Binary files differ
diff --git a/macros/latex/contrib/xsim/README b/macros/latex/contrib/xsim/README
index c96de8d2a3..43d9ae3536 100644
--- a/macros/latex/contrib/xsim/README
+++ b/macros/latex/contrib/xsim/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-XSIM 2020/01/16 v0.16a
+XSIM 2020/01/21 v0.17
XSIMVERB 2019/12/29 v0.1a
eXercise Sheets IMproved
@@ -9,7 +9,7 @@ Clemens Niederberger
Web: https://github.com/cgnieder/xsim
E-Mail: contact@mychemistry.eu
--------------------------------------------------------------------------
-Copyright 2017--2019 Clemens Niederberger
+Copyright 2017--2020 Clemens Niederberger
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex b/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex
index 69e5a9a618..4fa95620a3 100644
--- a/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex
@@ -49,10 +49,10 @@
\cs_new_protected:Npn \XSIM #1 { \use:c {XSIMaux#1} }
-\cs_new_protected:Npn \xsim_new_aux_cs:cpn #1
+\cs_new_protected:Npn \xsim_new_aux_property:cpn #1
{ \cs_new_protected:cpn {XSIMaux#1} }
-\cs_new_protected:Npn \xsim_add_cs_to_aux:nn #1#2
+\cs_new_protected:Npn \xsim_add_property_to_aux:nn #1#2
{
\xsim_verbose:n { Writing~ command~ \XSIM {#1}~ to~ aux~ file }
\xsim_write_to_aux:x { \token_to_str:N \XSIM {#1} #2 }
@@ -83,8 +83,11 @@
}
}
-\xsim_new_aux_cs:cpn {readaux}
- { \file_input:n { \c_sys_jobname_str .xsim } }
+\xsim_new_aux_property:cpn {readaux}
+ {
+ \file_if_exist:nT { \c_sys_jobname_str .xsim }
+ { \file_input:n { \c_sys_jobname_str .xsim } }
+ }
% ----------------------------------------------------------------------------
% list for recording values that need to be written to the aux file and
@@ -105,7 +108,7 @@
\prop_new:c {g__xsim_list_#1_prop}
\seq_new:c {g__xsim_list_#1_seq}
\seq_new:c {g__xsim_list_recorded_#1_seq}
- \xsim_new_aux_cs:cpn {#1} ##1
+ \xsim_new_aux_property:cpn {#1} ##1
{
\prop_gclear:c {g__xsim_list_#1_prop}
\tl_if_blank:nF {##1}
@@ -193,7 +196,7 @@
{ \xsim_rerun: }
\bool_if:NF \l__xsim_empty_lists_bool
{
- \xsim_add_cs_to_aux:nn {#1}
+ \xsim_add_property_to_aux:nn {#1}
{ { \seq_use:cV {g__xsim_list_#1_seq} \l__xsim_split_aux_lists_str } }
}
}
diff --git a/macros/latex/contrib/xsim/code/xsim.base.code.tex b/macros/latex/contrib/xsim/code/xsim.base.code.tex
index 3eb336e3a3..fbaf246c0f 100644
--- a/macros/latex/contrib/xsim/code/xsim.base.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.base.code.tex
@@ -124,14 +124,21 @@
\prg_new_conditional:Npnn \xsim_if_final: {p,T,F,TF}
{
- \bool_if:NTF \g_xsim_final_bool
+ \bool_if:NTF \g__xsim_final_bool
{ \prg_return_true: }
{ \prg_return_false: }
}
\prg_new_conditional:Npnn \xsim_if_verbose: {p,T,F,TF}
{
- \bool_if:NTF \g_xsim_verbose_bool
+ \bool_if:NTF \g__xsim_verbose_bool
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+\prg_new_conditional:Npnn \xsim_if_package_blank: {p,T,F,TF}
+ {
+ \bool_if:NTF \g__xsim_blank_bool
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -170,8 +177,9 @@
\prg_new_conditional:Npnn \xsim_if_chapter: {p,T,F,TF}
{
- \bool_if:nTF
- { \cs_if_exist_p:N \chapter && \cs_if_exist_p:N \c@chapter }
+ \bool_lazy_and:nnTF
+ { \cs_if_exist_p:N \chapter }
+ { \cs_if_exist_p:N \c@chapter }
{ \prg_return_true: }
{ \prg_return_false: }
}
diff --git a/macros/latex/contrib/xsim/code/xsim.blanks.code.tex b/macros/latex/contrib/xsim/code/xsim.blanks.code.tex
index 70c4440537..e2cc6c584c 100644
--- a/macros/latex/contrib/xsim/code/xsim.blanks.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.blanks.code.tex
@@ -78,8 +78,9 @@
\mode_if_math:TF
{ \hbox_set:Nn \l__xsim_blank_box { $ \m@th \mathpalette{}{#1} $ } }
{ \hbox_set:Nn \l__xsim_blank_box {#1} }
- \bool_if:nTF
- { \xsim_if_inside_solution_p: || \l__xsim_fill_blank_bool }
+ \bool_lazy_or:nnTF
+ { \xsim_if_inside_solution_p: }
+ { \l__xsim_fill_blank_bool }
{ \xsim_write_cloze_filled:n {#1} }
{
\bool_if:NTF \l__xsim_blank_width_bool
diff --git a/macros/latex/contrib/xsim/code/xsim.collections.code.tex b/macros/latex/contrib/xsim/code/xsim.collections.code.tex
index eba9940e23..b85ffa2a15 100644
--- a/macros/latex/contrib/xsim/code/xsim.collections.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.collections.code.tex
@@ -351,11 +351,9 @@
{
\prop_if_in:NnTF \g__xsim_collections_prop {#1}
{
- \bool_if:nTF
- {
- !\str_if_eq_p:en {#1} {all~ exercises} &&
- \prop_item:Nn \g__xsim_collections_prop {#1}
- }
+ \bool_lazy_and:nnTF
+ { !\str_if_eq_p:en {#1} {all~ exercises} }
+ { \prop_item:Nn \g__xsim_collections_prop {#1} }
{ \prg_return_true: }
{ \prg_return_false: }
}
diff --git a/macros/latex/contrib/xsim/code/xsim.definitions.code.tex b/macros/latex/contrib/xsim/code/xsim.definitions.code.tex
index c6fa9bd011..5b87fb0f4f 100644
--- a/macros/latex/contrib/xsim/code/xsim.definitions.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.definitions.code.tex
@@ -59,6 +59,7 @@
\DeclareExerciseProperty * {use}
\DeclareExerciseProperty * {used}
\DeclareExerciseProperty *-{use!}
+\DeclareExerciseProperty * {solution}
\XSIMifchapterT{
\DeclareExerciseProperty {chapter-value}
\DeclareExerciseProperty {chapter}
@@ -165,18 +166,21 @@
% ----------------------------------------------------------------------------
-\DeclareExerciseType {exercise} {
- exercise-env = exercise ,
- solution-env = solution ,
- exercise-name = \XSIMtranslate {exercise} ,
- exercises-name = \XSIMtranslate {exercises} ,
- solution-name = \XSIMtranslate {solution} ,
- solutions-name = \XSIMtranslate {solutions} ,
- exercise-template = default ,
- solution-template = default ,
- exercise-heading = \subsection* ,
- solution-heading = \subsection*
-}
+\xsim_if_package_blank:F
+ {
+ \DeclareExerciseType {exercise} {
+ exercise-env = exercise ,
+ solution-env = solution ,
+ exercise-name = \XSIMtranslate {exercise} ,
+ exercises-name = \XSIMtranslate {exercises} ,
+ solution-name = \XSIMtranslate {solution} ,
+ solutions-name = \XSIMtranslate {solutions} ,
+ exercise-template = default ,
+ solution-template = default ,
+ exercise-heading = \subsection* ,
+ solution-heading = \subsection*
+ }
+ }
% ----------------------------------------------------------------------------
@@ -473,4 +477,6 @@
% ----------------------------------------------------------------------------
\file_input_stop:
-2019/02/17 fixed error in German translations (issue 39)
+2019/02/17 - fix issue #39 (error in German translations)
+2020/02/19 - implement issue #33 (solution property)
+2020/02/20 - implement issue #31 (blank package option)
diff --git a/macros/latex/contrib/xsim/code/xsim.environments.code.tex b/macros/latex/contrib/xsim/code/xsim.environments.code.tex
index 9c0c30111a..37a3df68e9 100644
--- a/macros/latex/contrib/xsim/code/xsim.environments.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.environments.code.tex
@@ -48,6 +48,7 @@
\tl_new:N \l__xsim_file_path_and_name_tl
\tl_new:N \l__xsim_file_name_tl
\tl_new:N \l__xsim_file_extension_tl
+\tl_new:N \l__xsim_solution_tl
\bool_new:N \l__xsim_options_given_bool
\bool_new:N \l__xsim_insert_mode_bool
@@ -276,33 +277,51 @@
% #3: exercise|solution
\cs_new_protected:Npn \xsim_typeset_environment:nnn #1#2#3
{
+ \xsim_if_exchange:nnnT {#1} {#2} {#3}
+ { \__xsim_set_file_signature:nnn {#1} {#2} {exercise} }
\xsim_verbose:n
{ Typesetting~ #3~ environment~ type~ `#1'~ id~ `#2' }
- \use:x
+ \xsim_use_hook:nnn {#1} {#3} {pre}
+ \xsim_use_template:nx
+ {begin}
+ { \xsim_get_parameter:nn {#1} {#3-template} }
+ \xsim_use_hook:nnn {#1} {#3} {begin}
+ \xsim_if_write_to_files:TF
{
- \exp_not:N \par
- \xsim_use_hook:nnn {#1} {#3} {pre}
- \xsim_use_template:nn
- {begin}
- { \xsim_get_parameter:nn {#1} {#3-template} }
- \xsim_use_hook:nnn {#1} {#3} {begin}
- \xsim_if_write_to_files:TF
+ \file_if_exist:nTF { \exp_not:V \l__xsim_file_path_and_name_tl }
+ { \file_input:n { \exp_not:V \l__xsim_file_path_and_name_tl } }
{
- \file_if_exist:nTF { \exp_not:V \l__xsim_file_path_and_name_tl }
- { \file_input:n { \exp_not:V \l__xsim_file_path_and_name_tl } }
- {
- \xsim_verbose:n
- { File~ `\l__xsim_file_path_and_name_tl'~ doesn't~ exist. }
- }
+ \xsim_verbose:n
+ { File~ `\l__xsim_file_path_and_name_tl'~ doesn't~ exist. }
}
+ }
+ {
+ \xsim_if_exchange:nnnTF {#1} {#2} {#3}
+ { \xsim_get_property:nnn {#1} {#2} {exercise-body} }
{ \xsim_get_property:nnn {#1} {#2} {#3-body} }
- \xsim_use_hook:nnn {#1} {#3} {end}
- \xsim_use_template:nn
- {end}
- { \xsim_get_parameter:nn {#1} {#3-template} }
- \xsim_use_hook:nnn {#1} {#3} {post}
- \exp_not:N \par
}
+ \xsim_synchronize_goals:nn {#1} {#2}
+ \str_if_eq:nnT {#3} {exercise}
+ { \xsim_update_goals:nn {#1} {#2} }
+ \xsim_use_hook:nnn {#1} {#3} {end}
+ \xsim_use_template:nx
+ {end}
+ { \xsim_get_parameter:nn {#1} {#3-template} }
+ \xsim_use_hook:nnn {#1} {#3} {post}
+ }
+
+% #1: type
+% #2: id
+% #3: exercise|solution
+\prg_new_conditional:Npnn \xsim_if_exchange:nnn #1#2#3 {T,F,TF}
+ {
+ \str_if_eq:nnTF {#3} {solution}
+ {
+ \xsim_if_boolean_property:nnnTF {#1} {#2} {solution}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ { \prg_return_false: }
}
% #1: type
@@ -334,7 +353,9 @@
% #4: exercise|solution
\cs_new_protected:Npn \xsim_insert:nnnn #1#2#3#4
{
- \xsim_if_exist:nnnTF {#1} {#2} {#4}
+ \xsim_if_exchange:nnnTF {#1} {#2} {#4}
+ { \xsim_if_exist:nnnTF {#1} {#2} {exercise} }
+ { \xsim_if_exist:nnnTF {#1} {#2} {#4} }
{
\xsim_verbose:n
{ Inserting~ #4~ type~ `#1'~ id~ `#2'. }
@@ -355,6 +376,8 @@
section-value = \the\value{section} ,
section = \thesection
}
+ \xsim_synchronize_goals:nn {#1} {#2}
+ \xsim_update_goals:nn {#1} {#2}
}
\xsim_if_property_exist:nT {chapter}
{
@@ -414,10 +437,16 @@
\group_begin:
\xsim_if_write_to_files:TF
{
- \__xsim_set_file_signature:nnn {#1} {#2} {#3}
+ \xsim_if_exchange:nnnTF {#1} {#2} {#3}
+ { \__xsim_set_file_signature:nnn {#1} {#2} {exercise} }
+ { \__xsim_set_file_signature:nnn {#1} {#2} {#3} }
\file_input:n { \l__xsim_file_path_and_name_tl }
}
- { \xsim_get_property:nnn {#1} {#2} {#3-body} }
+ {
+ \xsim_if_exchange:nnnTF {#1} {#2} {#3}
+ { \xsim_get_property:nnn {#1} {#2} {exercise-body} }
+ { \xsim_get_property:nnn {#1} {#2} {#3-body} }
+ }
\group_end:
}
\cs_generate_variant:Nn \xsim_input:nnn {oo}
@@ -492,3 +521,8 @@
2019/02/17 - fix issue #43
2019/10/03 - add possibility to save environment bodies to property list
+2020/02/15 - remove spurious \par at the beginning and end of typeset
+ exercises and solutions
+2020/02/19 - implement issue #33 (solution property)
+2020/02/20 - fix issue #27
+ - implement issue #2
diff --git a/macros/latex/contrib/xsim/code/xsim.exercises.code.tex b/macros/latex/contrib/xsim/code/xsim.exercises.code.tex
index 6f1503dbc4..2fc9e4d142 100644
--- a/macros/latex/contrib/xsim/code/xsim.exercises.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.exercises.code.tex
@@ -394,35 +394,82 @@
\int_gincr:N \g_xsim_id_int
\int_compare:nF { \g_xsim_max_id_int > \g_xsim_id_int }
{ \int_gset_eq:NN \g_xsim_max_id_int \g_xsim_id_int }
- \xsim_set_properties:nxx {#1} { \int_use:N \g_xsim_id_int }
+ \tl_gset:Nx \g_xsim_exercise_id_tl { \int_use:N \g_xsim_id_int }
+ % save the goal values from the auxiliary files:
+ \xsim_foreach_goal:n
{
+ \xsim_temporary_goal_new:nVn {#1} \g_xsim_exercise_id_tl {##1}
+ \xsim_if_property_set:nVnT {#1} \g_xsim_exercise_id_tl {##1}
+ {
+ \xsim_temporary_goal_set:nVnn
+ {#1}
+ \g_xsim_exercise_id_tl
+ {##1}
+ { \xsim_get_property:nVn {#1} \g_xsim_exercise_id_tl {##1} }
+ }
+ }
+ \xsim_set_properties:nVx {#1} \g_xsim_exercise_id_tl
+ {
+ % preset options so the user doesn't has to:
print = true ,
use = true ,
+ % options set by the user:
\exp_not:n {#2} ,
- id = \int_use:N \g_xsim_id_int ,
+ % options which need to have certain values:
+ id = \g_xsim_exercise_id_tl ,
section-value = \arabic{section} ,
section = \thesection ,
page-value = \arabic{page} ,
sectioning =
- { \cs_if_exist:NTF \chapter { \arabic{chapter} } {0} }
+ { \cs_if_exist:NTF \thechapter { \arabic {chapter} } {0} }
{ \arabic {section} }
{ \arabic {subsection} }
{ \arabic {subsubsection} }
{ \arabic {paragraph} } ,
page = \thepage ,
+ % this cannot yet be set (see below):
used = false
}
+ % temporary goal now: either 0 or equal the complete property
+ % property: equal to the given value
+ \xsim_foreach_goal:n
+ {
+ \fp_set:Nn \l__xsim_tmpa_fp
+ { \xsim_temporary_goal_get:nVn {#1} \g_xsim_exercise_id_tl {##1} }
+ % set temporary goal to given property:
+ \xsim_if_property_given:nTF {##1}
+ {
+ \xsim_temporary_goal_set:nVnn
+ {#1}
+ \g_xsim_exercise_id_tl
+ {##1}
+ { \xsim_get_property:nVn {#1} \g_xsim_exercise_id_tl {##1} }
+ }
+ {
+ \xsim_temporary_goal_set:nVnn
+ {#1}
+ \g_xsim_exercise_id_tl
+ {##1}
+ {0}
+ }
+ % update to property to complete value:
+ \xsim_if_property_set:nVnT {#1} \g_xsim_exercise_id_tl {##1}
+ {
+ \xsim_set_property:nVnx {#1} \g_xsim_exercise_id_tl {##1}
+ { \fp_to_decimal:N \l__xsim_tmpa_fp }
+ }
+ }
\xsim_if_property_exist:nT {chapter}
{
- \xsim_set_properties:nxx {#1} { \int_use:N \g_xsim_id_int }
+ \xsim_set_properties:nVx {#1} \g_xsim_exercise_id_tl
{
chapter-value = \arabic{chapter} ,
chapter = \thechapter
}
}
- \tl_gclear:N \g_xsim_exercise_id_tl
- \xsim_gsave_property:nxnN {#1} { \int_use:N \g_xsim_id_int } {id}
- \g_xsim_exercise_id_tl
+ % \tl_gclear:N \g_xsim_exercise_id_tl
+ % \xsim_gsave_property:nVnN {#1} \l__xsim_tmpa_tl {id}
+ % \g_xsim_exercise_id_tl
\tl_gset_eq:NN \ExerciseID \g_xsim_exercise_id_tl
\tl_gset:Nn \ExerciseType {#1}
\xsim_verbose:x
@@ -449,7 +496,6 @@
\xsim_set_property:nVnn {#1} \g_xsim_exercise_id_tl
{use}
{true}
- \xsim_update_goals:nV {#1} \g_xsim_exercise_id_tl
}
{
\xsim_set_properties:nVn {#1} \g_xsim_exercise_id_tl
@@ -524,7 +570,7 @@
% ----------------------------------------------------------------------------
-\xsim_new_aux_cs:cpn {total-number} #1
+\xsim_new_aux_property:cpn {total-number} #1
{ \int_gset:Nn \g_xsim_max_id_int {#1} }
\RequirePackage {etoolbox}
@@ -535,7 +581,7 @@
{
\tl_new:c { number of #1 s }
\tl_set:cn { number of #1 s } {0}
- \xsim_new_aux_cs:cpn {#1} ##1
+ \xsim_new_aux_property:cpn {#1} ##1
{ \tl_gset:cn { number of #1 s } {##1} }
}
}
@@ -556,10 +602,10 @@
\int_compare:nNnF { \g_xsim_max_id_int } = { \g_xsim_id_int }
{ \xsim_empty_lists: }
}
- \xsim_add_cs_to_aux:nn {total-number} { { \int_use:N \g_xsim_id_int } }
+ \xsim_add_property_to_aux:nn {total-number} { { \int_use:N \g_xsim_id_int } }
\xsim_foreach_exercise_type:n
{
- \xsim_add_cs_to_aux:nn {#1}
+ \xsim_add_property_to_aux:nn {#1}
{ { \arabic { \xsim_get_parameter:nn {#1} {number} } } }
}
\xsim_update_list:n {types}
@@ -567,3 +613,5 @@
% ----------------------------------------------------------------------------
\file_input_stop:
+
+2020/02/21 - implement issue #2
diff --git a/macros/latex/contrib/xsim/code/xsim.goals.code.tex b/macros/latex/contrib/xsim/code/xsim.goals.code.tex
index cf7975c4bd..6b17d2bc3f 100644
--- a/macros/latex/contrib/xsim/code/xsim.goals.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.goals.code.tex
@@ -49,6 +49,7 @@
{#1}
\seq_put_right:Nn \l__xsim_goals_seq {#1}
\fp_gzero_new:c {g__xsim_goal_#1_fp}
+ \bool_new:c {l__xsim_goal_#1_given_bool}
\fp_gzero_new:c {l__xsim_current_goal_#1_fp}
\fp_if_exist:cF {g__xsim_total_goal_#1_fp}
{ \fp_new:c {g__xsim_total_goal_#1_fp} }
@@ -73,6 +74,16 @@
{ \prg_return_false: }
}
+\prg_new_conditional:Npnn \xsim_if_goal_given:n #1 {p,T,F,TF}
+ {
+ \bool_if:cTF {l__xsim_goal_#1_given_bool}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+\cs_new_protected:Npn \xsim_goal_given:n #1
+ { \bool_set_true:c {l__xsim_goal_#1_given_bool} }
+
% #1: exercise type
% #2: id
% #3: goal
@@ -99,6 +110,28 @@
\cs_new_protected:Npn \xsim_foreach_goal:n #1
{ \seq_map_inline:Nn \l__xsim_goals_seq {#1} }
+% #1: type
+% #2: id
+\cs_new_protected:Npn \xsim_synchronize_goals:nn #1#2
+ {
+ \xsim_foreach_goal:n
+ {
+ \xsim_if_property_set:nnnTF {#1} {#2} {##1}
+ {
+ \xsim_set_property:nnnx {#1} {#2} {##1}
+ { \xsim_temporary_goal_get:nnn {#1} {#2} {##1} }
+ }
+ {
+ \fp_compare:nNnT
+ { \xsim_temporary_goal_get:nnn {#1} {#2} {##1} } > {0}
+ {
+ \xsim_set_property:nnnx {#1} {#2} {##1}
+ { \xsim_temporary_goal_get:nnn {#1} {#2} {##1} }
+ }
+ }
+ }
+ }
+
% #1: exercise type
% #2: id
% #3: goal
@@ -108,9 +141,10 @@
\xsim_if_goal_exist:nT {#3}
{
\xsim_verbose:n { Adding~ `#4'~ to~ `#3'~ goal~ of~ #1~ #2 }
- \fp_gadd:cn {g__xsim_goal_#3_fp} {#4}
- \fp_gadd:cn {g__xsim_#1_goal_#3_fp} {#4}
- \fp_add:cn {l__xsim_current_goal_#3_fp} {#4}
+ % \fp_gadd:cn {g__xsim_goal_#3_fp} {#4}
+ % \fp_gadd:cn {g__xsim_#1_goal_#3_fp} {#4}
+ % \fp_add:cn {l__xsim_current_goal_#3_fp} {#4}
+ \xsim_temporary_goal_add:nnnn {#1} {#2} {#3} {#4}
}
}
\cs_generate_variant:Nn \xsim_addto_goal:nnnn {xx,nVnx}
@@ -129,6 +163,46 @@
\cs_generate_variant:Nn \xsim_if_goal_value:nnnnTF {xx}
% ----------------------------------------------------------------------------
+% we need some kind of temporary variable to be able to set goals both as
+% option to exercises and within the exercise body
+
+% #1: type
+% #2: id
+% #3: goal
+\cs_new_protected:Npn \xsim_temporary_goal_new:nnn #1#2#3
+ { \fp_new:c {g__xsim_goal_#3_#1_#2_fp} }
+\cs_generate_variant:Nn \xsim_temporary_goal_new:nnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+% #4: value
+\cs_new_protected:Npn \xsim_temporary_goal_set:nnnn #1#2#3#4
+ { \fp_gset:cn {g__xsim_goal_#3_#1_#2_fp} {#4} }
+\cs_generate_variant:Nn \xsim_temporary_goal_set:nnnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+% #4: value
+\cs_new_protected:Npn \xsim_temporary_goal_add:nnnn #1#2#3#4
+ { \fp_gadd:cn {g__xsim_goal_#3_#1_#2_fp} {#4} }
+\cs_generate_variant:Nn \xsim_temporary_goal_add:nnnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+\cs_new:Npn \xsim_temporary_goal_get:nnn #1#2#3
+ { \fp_to_decimal:c {g__xsim_goal_#3_#1_#2_fp} }
+\cs_generate_variant:Nn \xsim_temporary_goal_get:nnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+\cs_new_protected:Npn \__xsim_temporary_goal_show:nnn #1#2#3
+ { \fp_show:c {g__xsim_goal_#3_#1_#2_fp} }
+
+% ----------------------------------------------------------------------------
% a function which can be used to modify how the numbers of a goal are
% printed:
\cs_new_protected:Npn \__xsim_print_goal:n #1 {#1}
@@ -254,12 +328,12 @@
% #1: exercise type
% #2: goal
% #3: value
-\xsim_new_aux_cs:cpn {goal} #1#2#3
+\xsim_new_aux_property:cpn {goal} #1#2#3
{ \fp_gset:cn {g__xsim_total_#1_goal_#2_fp} {#3} }
% #1: goal
% #2: value
-\xsim_new_aux_cs:cpn {totalgoal} #1#2
+\xsim_new_aux_property:cpn {totalgoal} #1#2
{ \fp_gset:cn {g__xsim_total_goal_#1_fp} {#2} }
\xsim_at_begin_document:n
@@ -278,7 +352,7 @@
{
\xsim_foreach_exercise_type:n
{
- \xsim_add_cs_to_aux:nn {goal}
+ \xsim_add_property_to_aux:nn {goal}
{ {##1} {#1} { \fp_to_decimal:c {g__xsim_##1_goal_#1_fp} } }
}
\tl_set:Nx \l__xsim_tmpa_tl
@@ -286,7 +360,7 @@
\tl_set:Nx \l__xsim_tmpb_tl
{ \fp_to_decimal:c {g__xsim_total_goal_recorded_#1_fp} }
\tl_if_eq:NNF \l__xsim_tmpa_tl \l__xsim_tmpb_tl { \xsim_rerun: }
- \xsim_add_cs_to_aux:nn {totalgoal}
+ \xsim_add_property_to_aux:nn {totalgoal}
{ {#1} { \fp_to_decimal:c {g__xsim_goal_#1_fp} } }
}
}
@@ -306,4 +380,6 @@
% ----------------------------------------------------------------------------
\file_input_stop:
-2019/01/30 bug fix (cf. https://texwelt.de/wissen/fragen/24101/)
+2019/01/30 - bug fix (cf. https://texwelt.de/wissen/fragen/24101/)
+2020/02/20 - add temporary variables for the whole subpoint thing
+ (cf. issue #2)
diff --git a/macros/latex/contrib/xsim/code/xsim.properties.code.tex b/macros/latex/contrib/xsim/code/xsim.properties.code.tex
index add2431018..825b8f2517 100644
--- a/macros/latex/contrib/xsim/code/xsim.properties.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.properties.code.tex
@@ -54,6 +54,7 @@
\seq_new:N \l__xsim_boolean_properties_seq
\seq_new:N \l__xsim_unique_properties_seq
\seq_new:N \l__xsim_noupdate_properties_seq
+\seq_new:N \l__xsim_given_properties_seq
\prop_new:N \g__xsim_properties_prop
% new property:
@@ -131,6 +132,15 @@
{ \prg_return_false: }
}
+% true if property #1 has been set in the /last/ call of
+% \xsim_set_properties:nnn
+\prg_new_conditional:Npnn \xsim_if_property_given:n #1 {p,T,F,TF}
+ {
+ \seq_if_in:NnTF \l__xsim_given_properties_seq {#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
% #1: property
% #2: value
\prg_new_conditional:Npnn \xsim_if_property_unique_value:nn #1#2 {p,T,F,TF}
@@ -178,8 +188,12 @@
}
{ \msg_error:nnn {xsim} {unknown-property} {#3} }
}
-\cs_generate_variant:Nn \xsim_set_property:nnnn {nnxx,nnnV,nV,nVnx,nnnx,xx,xxnx}
+\cs_generate_variant:Nn \xsim_set_property:nnnn {nnxx,nnnV,nV,nVnx,nnnx,xx,xxnx,nxnx}
+% #1: type
+% #2: id
+% #3: property
+% #4: value
\cs_new_protected:Npn \__xsim_set_boolean_property:nnnn #1#2#3#4
{
\str_case_e:nnTF { \str_lowercase:n {#4} }
@@ -191,6 +205,10 @@
{ \__xsim_set_property:nnnn {#1} {#2} {#3} {false} }
}
+% #1: type
+% #2: id
+% #3: property
+% #4: value
\cs_new_protected:Npn \__xsim_set_unique_property:nnnn #1#2#3#4
{
\__xsim_set_property:nnnn {#1} {#2} {#3} {#4}
@@ -309,6 +327,7 @@
% #3: csv list of properties
\cs_new_protected:Npn \xsim_set_properties:nnn #1#2#3
{
+ \seq_clear:N \l__xsim_given_properties_seq
\clist_map_inline:nn {#3}
{
\seq_set_split:Nnx \l__xsim_tmpa_seq {=} { \tl_trim_spaces:n {##1} }
@@ -317,6 +336,8 @@
{#2}
{ \seq_item:Nn \l__xsim_tmpa_seq {1} }
{ \seq_item:Nn \l__xsim_tmpa_seq {2} }
+ \seq_put_right:Nx \l__xsim_given_properties_seq
+ { \seq_item:Nn \l__xsim_tmpa_seq {1} }
}
\xsim_property_set_aliases:nn {#1} {#2}
}
@@ -326,16 +347,15 @@
% #1: type
% #2: id
% #3: property
-\prg_new_protected_conditional:Npnn \xsim_if_property_set:nnn #1#2#3 {T,F,TF}
+\prg_new_conditional:Npnn \xsim_if_property_set:nnn #1#2#3 {T,F,TF}
{
- \prop_if_in:NxTF \g__xsim_properties_prop
- { #2 ! #1 ! #3 }
+ \prop_if_in:NnTF \g__xsim_properties_prop {#2!#1!#3}
{ \prg_return_true: }
{ \prg_return_false: }
}
-\cs_generate_variant:Nn \xsim_if_property_set:nnnTF {nnx,xx,nV}
-\cs_generate_variant:Nn \xsim_if_property_set:nnnF {nx,nnx,xx}
-\cs_generate_variant:Nn \xsim_if_property_set:nnnT {nnx,xx}
+\prg_generate_conditional_variant:Nnn \xsim_if_property_set:nnn
+ {nx,nnx,xx,nV}
+ {T,F,TF}
% ----------------------------------------------------------------------------
@@ -414,7 +434,7 @@
% #3: property
\cs_new:Npn \xsim_get_property:nnn #1#2#3
{ \prop_item:Nn \g__xsim_properties_prop { #2 ! #1 ! #3 } }
-\cs_generate_variant:Nn \xsim_get_property:nnn {nx,xx,oo,no,nnf,nf,oof,nV}
+\cs_generate_variant:Nn \xsim_get_property:nnn {nx,ne,xx,oo,no,nnf,nf,oof,nV}
% #1: property
% #2: value
@@ -482,7 +502,7 @@
\cs_generate_variant:Nn \xsim_if_boolean_property:nnnF {nV}
\cs_new_protected:Npn \xsim_save_property:nnnN #1#2#3#4
- { \prop_get:NnN \g__xsim_properties_prop { #2 ! #1 ! #3 } #4 }
+ { \prop_get:NnN \g__xsim_properties_prop {#2!#1!#3} #4 }
\cs_generate_variant:Nn \xsim_save_property:nnnN {nx,xx}
\cs_new_protected:Npn \xsim_gsave_property:nnnN #1#2#3#4
@@ -490,7 +510,7 @@
\xsim_save_property:nnnN {#1} {#2} {#3} #4
\tl_gset:NV #4 #4
}
-\cs_generate_variant:Nn \xsim_gsave_property:nnnN {nx,xx}
+\cs_generate_variant:Nn \xsim_gsave_property:nnnN {nx,xx,nV}
% ----------------------------------------------------------------------------
\file_input_stop:
diff --git a/macros/latex/contrib/xsim/code/xsim.random.code.tex b/macros/latex/contrib/xsim/code/xsim.random.code.tex
index 2444ef1745..2087adf9de 100644
--- a/macros/latex/contrib/xsim/code/xsim.random.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.random.code.tex
@@ -52,7 +52,7 @@
% #1: random list id
% #2: csv list of integers
-\xsim_new_aux_cs:cpn {random} #1#2
+\xsim_new_aux_property:cpn {random} #1#2
{
\xsim_random_list_if_exist:nF {#1}
{ \xsim_new_random_list:n {#1} }
@@ -100,7 +100,7 @@
\xsim_random_list_if_empty:nT {#1}
{ \xsim_set_random_list_from_seq:nN {#1} #2 }
\xsim_verbose:n {Saving~ random~ list~ `#1'}
- \xsim_add_cs_to_aux:nn {random}
+ \xsim_add_property_to_aux:nn {random}
{ {#1} { \xsim_use_random_list:nn {#1} {,} } }
}
@@ -165,12 +165,9 @@
% #4: seq variable
\cs_new_protected:Npn \xsim_generate_random_list:nnnN #1#2#3#4
{
- \bool_if:nT
- {
- !\xsim_random_list_if_exist_p:n {#1}
- ||
- \xsim_random_list_if_empty_p:n {#1}
- }
+ \bool_lazy_or:nnT
+ { !\xsim_random_list_if_exist_p:n {#1} }
+ { \xsim_random_list_if_empty_p:n {#1} }
{
\xsim_verbose:n
{Generating~ random~ list~ `#1'~ with~ #3~ out~ of~ #2~ items}
@@ -199,12 +196,9 @@
% #2: random list id
\cs_new_protected:Npn \xsim_print_random_exercises:Nn #1#2
{
- \bool_if:nT
- {
- \xsim_random_list_if_exist_p:n {#2}
- &&
- !\xsim_random_list_if_empty_p:n {#2}
- }
+ \bool_lazy_and:nnT
+ { \xsim_random_list_if_exist_p:n {#2} }
+ { !\xsim_random_list_if_empty_p:n {#2} }
{
\xsim_verbose:x
{
@@ -220,12 +214,13 @@
{ \seq_item:Nn #1 {##1} }
\tl_set:Nx \l__xsim_tmpb_tl
{ \xsim_get_type_for_property:nV {id} \l__xsim_tmpa_tl }
- \bool_if:nT
+ \bool_lazy_or:nnT
{
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_both_tl
- ||
+ }
+ {
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_exercise_tl
@@ -242,12 +237,13 @@
{exercise}
}
}
- \bool_if:nT
+ \bool_lazy_or:nnT
{
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_both_tl
- ||
+ }
+ {
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_solution_tl
diff --git a/macros/latex/contrib/xsim/code/xsim.solutions.code.tex b/macros/latex/contrib/xsim/code/xsim.solutions.code.tex
index eddeaa911f..902f377864 100644
--- a/macros/latex/contrib/xsim/code/xsim.solutions.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.solutions.code.tex
@@ -82,7 +82,9 @@
% #2: id
\prg_new_protected_conditional:Npnn \xsim_if_solution_exist:nn #1#2 {T,F,TF}
{
- \xsim_if_exist:nnnTF {#1} {#2} {solution}
+ \xsim_if_boolean_property:nnnTF {#1} {#2} {solution}
+ { \xsim_if_exist:nnnTF {#1} {#2} {exercise} }
+ { \xsim_if_exist:nnnTF {#1} {#2} {solution} }
{ \prg_return_true: }
{ \prg_return_false: }
}
diff --git a/macros/latex/contrib/xsim/code/xsim.sty b/macros/latex/contrib/xsim/code/xsim.sty
index a6a5538c67..0939f4796a 100644
--- a/macros/latex/contrib/xsim/code/xsim.sty
+++ b/macros/latex/contrib/xsim/code/xsim.sty
@@ -29,9 +29,9 @@
\ExplSyntaxOn
-\tl_const:Nn \c_xsim_date_tl {2020/01/16}
+\tl_const:Nn \c_xsim_date_tl {2020/02/21}
\tl_const:Nn \c_xsim_version_major_number_tl {0}
-\tl_const:Nn \c_xsim_version_minor_number_tl {16a}
+\tl_const:Nn \c_xsim_version_minor_number_tl {17}
\tl_const:Nn \c_xsim_version_subrelease_tl {}
\tl_const:Nx \c_xsim_version_number_tl
{
@@ -55,29 +55,49 @@
% options, information
-\bool_new:N \g_xsim_final_bool
-\bool_new:N \g_xsim_verbose_bool
+\bool_new:N \g__xsim_final_bool
+\bool_new:N \g__xsim_verbose_bool
\bool_new:N \g_xsim_clear_aux_bool
\bool_new:N \g__xsim_write_to_file_bool
\bool_new:N \g_xsim_use_aux_bool
\bool_new:N \g__xsim_rerun_bool
+\bool_new:N \g__xsim_blank_bool
\keys_define:nn {xsim/package}
{
- final .bool_gset:N = \g_xsim_final_bool ,
- verbose .bool_gset:N = \g_xsim_verbose_bool ,
+ final .bool_gset:N = \g__xsim_final_bool ,
+ verbose .bool_gset:N = \g__xsim_verbose_bool ,
clear-aux .bool_gset:N = \g_xsim_clear_aux_bool ,
no-files .bool_gset_inverse:N = \g__xsim_write_to_file_bool ,
no-files .initial:n = false ,
use-aux .bool_gset:N = \g_xsim_use_aux_bool ,
- use-aux .initial:n = false
+ use-aux .initial:n = false ,
+ blank .bool_gset:N = \g__xsim_blank_bool ,
+ blank .initial:n = false
}
\ProcessKeysPackageOptions {xsim/package}
+\keys_define:nn {xsim/package}
+ {
+ final .code:n = \msg_error:nnn {xsim} {load-time-option} {final} ,
+ verbose .code:n = \msg_error:nnn {xsim} {load-time-option} {verbose} ,
+ clear-aux .code:n = \msg_error:nnn {xsim} {load-time-option} {clear-aux} ,
+ no-files .code:n = \msg_error:nnn {xsim} {load-time-option} {no-files} ,
+ use-aux .code:n = \msg_error:nnn {xsim} {load-time-option} {use-aux} ,
+ blank .code:n = \msg_error:nnn {xsim} {load-time-option} {blank}
+ }
+
% --------------------------------------------------------------------------
% messages:
+\msg_new:nnn {xsim} {load-time-option}
+ {
+ `#1'~ is~ a~ load-time~ option! \\
+ You~ cannot~ set~ it~ with~ \token_to_str:N \xsimsetup ! \\
+ You~ need~ to~ use~ \token_to_str:N \usepackage [#1] {xsim} .
+ }
+
\msg_new:nnn {xsim} {rerun}
{
Exercise~ properties~ may~ have~ changed.~ Rerun~ to~ get~ them~
@@ -105,5 +125,9 @@
\xsim_do_rerun:
\xsim_close_aux:
}
-
+
+% --------------------------------------------------------------------------
\file_input_stop:
+
+2020/02/20 - implement issue #31 (blank package option)
+2020/02/21 - don't allow package options to be set with \xsimsetup
diff --git a/macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex b/macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex
index 5d87f7c750..e43c30d34d 100644
--- a/macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.verbwrite.code.tex
@@ -52,11 +52,11 @@
\file_if_exist:nTF {#2}
{ \xsim_if_final:F { \iow_open:Nn #1 {#2} } }
{
- % \g_xsim_final_bool is a global variable; however, if it is true and
+ % \g__xsim_final_bool is a global variable; however, if it is true and
% the exercise file doesn't exist, yet, we need to set it locally to
% false in order to ensure that the file is correctly written and the
% stream closed afterwards
- \bool_set_false:N \g_xsim_final_bool
+ \bool_set_false:N \g__xsim_final_bool
\iow_open:Nn #1 {#2}
}
}
diff --git a/macros/latex/contrib/xsim/code/xsimverb.sty b/macros/latex/contrib/xsim/code/xsimverb.sty
index a7cbd0706b..90373e9021 100644
--- a/macros/latex/contrib/xsim/code/xsimverb.sty
+++ b/macros/latex/contrib/xsim/code/xsimverb.sty
@@ -59,8 +59,8 @@
\cs_new_protected:Npn \xsimverb_bool_provide:N #1
{ \bool_if_exist:NF #1 { \bool_new:N #1 } }
-\xsimverb_bool_provide:N \g_xsim_final_bool
-\xsimverb_bool_provide:N \g_xsim_verbose_bool
+\xsimverb_bool_provide:N \g__xsim_final_bool
+\xsimverb_bool_provide:N \g__xsim_verbose_bool
\xsimverb_bool_provide:N \g_xsim_clear_aux_bool
\xsimverb_bool_provide:N \g__xsim_write_to_file_bool
\xsimverb_bool_provide:N \g_xsim_use_aux_bool
@@ -68,8 +68,8 @@
\keys_define:nn {xsimverb}
{
- final .bool_gset:N = \g_xsim_final_bool ,
- verbose .bool_gset:N = \g_xsim_verbose_bool ,
+ final .bool_gset:N = \g__xsim_final_bool ,
+ verbose .bool_gset:N = \g__xsim_verbose_bool ,
clear-aux .bool_gset:N = \g_xsim_clear_aux_bool ,
no-files .bool_gset_inverse:N = \g__xsim_write_to_file_bool ,
no-files .initial:n = false ,
diff --git a/macros/latex/contrib/xsim/doc/xsim-manual.cls b/macros/latex/contrib/xsim/doc/xsim-manual.cls
index 6e1359c0b1..3fa56cc833 100644
--- a/macros/latex/contrib/xsim/doc/xsim-manual.cls
+++ b/macros/latex/contrib/xsim/doc/xsim-manual.cls
@@ -522,6 +522,7 @@
\XSIMfilewritestart*{\jobname.tmp}%
}%
\endgroup
+
\def\xsimman@read@options@[#1]{\pgfqkeys{/cnltx}{#1}}
\RenewDocumentEnvironment{sourcecode}{}
@@ -565,6 +566,7 @@
}
{%
\XSIMfilewritestop
+ \catcode`\^^M=5
\ifbool{cnltx@sidebyside}
{%
\cnltxcode
@@ -865,6 +867,16 @@
% ----------------------------------------------------------------------------
% versions:
+\xsim@add@version{0.0} {2017-02-09}
+\xsim@add@version{0.1} {2017-03-19}
+\xsim@add@version{0.2} {2017-03-21}
+\xsim@add@version{0.4} {2017-03-24}
+\xsim@add@version{0.5} {2017-03-30}
+\xsim@add@version{0.5a} {2017-04-15}
+\xsim@add@version{0.5b} {2017-04-16}
+\xsim@add@version{0.6} {2017-04-27}
+\xsim@add@version{0.6a} {2017-04-28}
+\xsim@add@version{0.7} {2017-05-09}
\xsim@add@version{0.8} {2017-05-18}
\xsim@add@version{0.8a} {2017-05-19}
\xsim@add@version{0.8b} {2017-05-23}
@@ -875,8 +887,11 @@
\xsim@add@version{0.12} {2019-09-26}
\xsim@add@version{0.13} {2019-10-06}
\xsim@add@version{0.14} {2019-10-13}
+\xsim@add@version{0.14a} {2019-10-19}
\xsim@add@version{0.15} {2019-11-02}
\xsim@add@version{0.16} {2019-11-10}
+\xsim@add@version{0.16a} {2020-01-16}
+\xsim@add@version{0.17} {2020-02-21}
% ----------------------------------------------------------------------------
\newrobustcmd*\xsimauxfileinfo{%
diff --git a/macros/latex/contrib/xsim/doc/xsim.history b/macros/latex/contrib/xsim/doc/xsim.history
index b2bf16e4c0..7cb4ab4849 100644
--- a/macros/latex/contrib/xsim/doc/xsim.history
+++ b/macros/latex/contrib/xsim/doc/xsim.history
@@ -113,7 +113,7 @@ HISTORY:
- \ProvideExerciseTagging
v0.12 2019/09/30 - add parameter versions for the plural forms of exercise
and solution names
- - bug fixes (issues 37, 39, 43, 47)
+ - bug fixes (issues 37, 39, 43, 47)
v0.13 2019/10/06 - experimental package option `no-files'
v0.14 2019/10/13 - new exercise parameters `exercise-heading' and
`solution-heading'
@@ -133,6 +133,14 @@ HISTORY:
`use-aux'
v0.16 2019/11/10 - fix issue due to usage of own auxiliary file
- \XSIMatbegindocument and \XSIMatenddocument
- - \xprintexercise, \xprintsolution, \xsimprint, \xsimxprint
+ - \xprintexercise, \xprintsolution, \xsimprint, \xsimxprint
2019/12/29 - bugfix in `xsimverb'
v0.16a 2020/01/16 - adapt to renaming of string case changing functions
+ v0.17 2020/02/21 - prefer lazy boolean evaluation if possible
+ - remove spurious \par at the beginning of typeset
+ exercises
+ - add `blank' option, implements issue #31
+ - add `solution' property, implements issue #33
+ - fix issue #27
+ - implement issue #2
+ - don't allow package options to be set with \xsimsetup
diff --git a/macros/latex/contrib/xsim/doc/xsim.ideas b/macros/latex/contrib/xsim/doc/xsim.ideas
index 0882c70535..6ae5cd9a6a 100644
--- a/macros/latex/contrib/xsim/doc/xsim.ideas
+++ b/macros/latex/contrib/xsim/doc/xsim.ideas
@@ -26,4 +26,3 @@ IDEAS:
- a document class `xsim-exam' for creating exams
- a mechanism for providing variants of an exam
-- some kind of `subexercise' mechanism
diff --git a/macros/latex/contrib/xsim/doc/xsim_manual.pdf b/macros/latex/contrib/xsim/doc/xsim_manual.pdf
index 9c3f546204..9014b1c368 100644
--- a/macros/latex/contrib/xsim/doc/xsim_manual.pdf
+++ b/macros/latex/contrib/xsim/doc/xsim_manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/xsim/doc/xsim_manual.tex b/macros/latex/contrib/xsim/doc/xsim_manual.tex
index 46706662a1..e3328631df 100644
--- a/macros/latex/contrib/xsim/doc/xsim_manual.tex
+++ b/macros/latex/contrib/xsim/doc/xsim_manual.tex
@@ -1,8 +1,8 @@
-% !arara: pdflatex: { action: nonstopmode }
+% !arara: pdflatex: { interaction: nonstopmode }
% !arara: biber
-% !arara: pdflatex: { action: nonstopmode }
-% arara: pdflatex: { action: nonstopmode }
-% arara: pdflatex: { action: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
% ----------------------------------------------------------------------------
% the XSIM package
%
@@ -32,8 +32,7 @@
% ----------------------------------------------------------------------------
\documentclass{xsim-manual}
-\usepackage{filecontents}
-\begin{filecontents*}{\jobname.bib}
+\begin{filecontents*}[overwrite]{\jobname.bib}
@online{texsx:romannumeral,
author = {Bruno Le Floch} ,
title = {Cunning (La)TeX tricks} ,
@@ -44,7 +43,7 @@
title = {Questions tagged `exsheets'} ,
author = {various} ,
url = {http://tex.stackexchange.com/questions/tagged/exsheets} ,
- urldate = {2017-05-15}
+ urldate = {2020-02-21}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
@@ -76,7 +75,7 @@ using an up to date \TeX\ distribution, anyway.
It has been quite a while since I first published
\pkg{exsheets}~\cite{pkg:exsheets} in June 2012. Since then it has gained a
user base and a little bit of popularity as the number of questions on tex.sx
-shows (119~at the time of writing)~\cite{texsx:tagged/exsheets}. User
+shows (143~at the time of writing)~\cite{texsx:tagged/exsheets}. User
questions, bug reports and feature requests improved it over the time. It
still has a version number starting with a zero, though, which in my
versioning system means I still consider it experimental.
@@ -138,21 +137,21 @@ meaning in this manual.
\sinceversion{0.15}With this option enabled \xsim\ will use the regular
auxiliary file \cs*{jobname}\code{.aux} instead of its own auxiliary file
\cs*{jobname}\code{.xsim}.
+ \opt{blank}
+ \sinceversion{0.17}With this option enabled \xsim\ will not define the
+ default environments \env{exercise} and \env{solution}.
\end{options}
-Those options are used the usual way as package option
+Those options are load-time options and are used the usual way as package
+options:
\begin{sourcecode}
\usepackage[verbose]{xsim}
\end{sourcecode}
-or as global option
-\begin{sourcecode}
- \documentclass[verbose]{article}
-\end{sourcecode}
-or via the setup\changedversion{0.13} command as options belonging to the
-\module{package}, see also section~\vref{sec:setting-options}:
-\begin{sourcecode}
- \xsimsetup{package/verbose}
-\end{sourcecode}
+\begin{bewareofthedog}
+ Although those options technically belong to the \module{package} module
+ (see also section~\vref{sec:setting-options}) it is \emph{not} possible to
+ set them via \cs{xsimsetup}.
+\end{bewareofthedog}
\subsection{Setting Options}\label{sec:setting-options}
Apart from the package options already described in
@@ -208,7 +207,8 @@ also means two additional commands exist:
\section{Exercises and Solutions}
The two predefined environments for exercises and solutions are the following
-ones:
+ones\footnote{When you load \xsim\ with the \option{blank} those environments
+ will \emph{not} be defined!}:
\begin{environments}
\environment{exercise}[\oarg{\acsp*{prop}}]
Input and typeset an exercise. See section~\vref{sec:exercise-properties}
@@ -334,15 +334,15 @@ package option:
A lot of the lines \xsim\ writes to the auxiliary file and reads in a
subsequent run look like this:
\begin{sourcecode}
- \XSIM{points}{exercise-2=={4}|exercise-10=={2.5}|problem-11=={5}}
+ \XSIM{points}{exercise-2=={4}||exercise-10=={2.5}||problem-11=={5}}
\end{sourcecode}
As you can see different entries of the various properties of exercises are
- separated with a \code{|}. This means that you cannot use this symbol
- inside properties. This is why \xsim\ provides an option to change this
- marker.
+ separated with \code{||}. This means that you cannot use this symbol
+ combination inside properties. For this reason \xsim\ provides an option to
+ change the marker.
\end{bewareofthedog}
\begin{options}
- \keyval{split-aux-lists}{string}\Default{\code{|}}
+ \keyval{split-aux-lists}{string}\Default{\code{||}}
Set\sinceversion{0.11} the string that is used to separate the property
entries in the auxiliary file.
\end{options}
@@ -515,30 +515,37 @@ Exercise like the \env{exercise} environment and possibly others defined with
True if an exercise has been used at least once. For an existing exercise
this is only false for exercises that have been collected
(\cf~section~\vref{sec:collecting-exercises}).
+ \propbool{solution}
+ \sinceversion{0.17}Holds the solution boolean of an exercise. If this is
+ true then a solution has the same text\slash environment body as the
+ corresponding exercise. (This might be useful for multiple choice
+ questions for example.)
\propval{tags}{csv list of tags}
Holds the list of tags the exercise should be associated with.
\propval{topics}{csv list of topics}
Holds the list of topics the exercise should be associated with.
\propval{page}{text}
- Holds the page counter value representation of an exercise (\ie, what you
- usually know as \cs*{thepage}).
+ Holds the page counter value representation of an exercise \\
+ (\ie, what you usually know as \cs*{thepage}).
\propval{page-value}{integer}
- Holds the page counter value of an exercise (\ie, what you usually know as
- \cs*{the}\cs*{value}\Marg{page}).
+ Holds the page counter value of an exercise \\
+ (\ie, what you usually know as \cs*{the}\cs*{value}\Marg{page}).
\propval{section}{text}
- Holds the section counter value representation of an exercise (\ie, what
- you usually know as \cs*{thesection}).
+ Holds the section counter value representation of an exercise \\
+ (\ie, what you usually know as \cs*{thesection}).
\propval{section-value}{integer}
- Holds the section counter value of an exercise (\ie, what you usually know
- as \cs*{the}\cs*{value}\Marg{section}).
+ Holds the section counter value of an exercise \\
+ (\ie, what you usually know as \cs*{the}\cs*{value}\Marg{section}).
\propval{chapter}{text}
- Holds the chapter counter value representation of an exercise (\ie, what
- you usually know as \cs*{thechapter}). \emph{Only if a command
- \cs*{chapter} \emph{and} a counter \code{chapter} exist.}
+ Holds the chapter counter value representation of an exercise \\
+ (\ie, what you usually know as \cs*{thechapter}). \\
+ \emph{Only if a command \cs*{chapter} \emph{and} a counter \code{chapter}
+ exist.}
\propval{chapter-value}{integer}
- Holds the chapter counter value of an exercise (\ie, what you usually know
- as \cs*{the}\cs*{value}\Marg{chapter}). \emph{Only if a command \cs*{chapter}
- \emph{and} a counter \code{chapter} exist.}
+ Holds the chapter counter value of an exercise \\
+ (\ie, what you usually know as \cs*{the}\cs*{value}\Marg{chapter}). \\
+ \emph{Only if a command \cs*{chapter} \emph{and} a counter \code{chapter}
+ exist.}
\propval{sectioning}{section numbers}
Holds five brace groups which in turn hold the section numbers (integers)
of the exercise in the order
@@ -594,15 +601,12 @@ others can be set using the optional argument of the exercise environment.
This is better demonstrated with an example:
\begin{example}
- % \lipsum is provided by package `lipsum'
\begin{exercise}
- \lipsum[4]
\verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} \par
\verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} \par
\verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID}
\end{exercise}
\begin{exercise}[ID=foo-bar]
- \lipsum[4]
\verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} \par
\verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} \par
\verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID}
diff --git a/macros/luatex/latex/emoji/README.md b/macros/luatex/latex/emoji/README.md
new file mode 100644
index 0000000000..7b97828ea4
--- /dev/null
+++ b/macros/luatex/latex/emoji/README.md
@@ -0,0 +1,35 @@
+# The `emoji` package
+
+Emoji support in (Lua)LaTeX.
+
+## Introduction
+
+The `emoji` package allows user to typeset emoji in a LaTeX document. It requires LuaHBTeX, or `lualatex-dev` at present.
+
+## Usage
+
+```tex
+\documentclass{article}
+\usepackage{emoji}
+\setemojifont{Apple Color Emoji} % Optional
+
+\begin{document}
+\emoji{joy}
+\emoji{+1}
+\emoji{family-man-woman-girl-boy}
+\end{document}
+```
+
+Result:
+
+> &#x1F602;
+> &#x1F44D;
+> &#x1F468;&#x200D;&#x1F469;&#x200D;&#x1F467;&#x200D;&#x1F466;
+
+## License
+
+This work may be distributed and/or modified under the conditions of the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt), either version 1.3c of this license or (at your option) any later version.
+
+-----
+
+Copyright (C) 2020 by Xiangdong Zeng.
diff --git a/macros/luatex/latex/emoji/emoji-doc.pdf b/macros/luatex/latex/emoji/emoji-doc.pdf
new file mode 100644
index 0000000000..32b6e07cf5
--- /dev/null
+++ b/macros/luatex/latex/emoji/emoji-doc.pdf
Binary files differ
diff --git a/macros/luatex/latex/emoji/emoji-doc.tex b/macros/luatex/latex/emoji/emoji-doc.tex
new file mode 100644
index 0000000000..b351cb75ee
--- /dev/null
+++ b/macros/luatex/latex/emoji/emoji-doc.tex
@@ -0,0 +1,1791 @@
+%%
+%% Copyright (C) 2020 by Xiangdong Zeng <xdzeng96@gmail.com>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Xiangdong Zeng.
+%%
+\documentclass{l3doc}
+\usepackage{booktabs,emoji,fontspec,graphicx,longtable,xcolor}
+
+\setmainfont{NotoSerif}[
+ Extension = .ttf,
+ UprightFont = *-Light,
+ BoldFont = *-Medium,
+ ItalicFont = *-LightItalic,
+ BoldItalicFont = *-MediumItalic,
+]
+\setsansfont{NotoSans}[
+ Extension = .ttf,
+ UprightFont = *-SemiCondensed,
+ BoldFont = *-SemiCondensedBold,
+ ItalicFont = *-SemiCondensedItalic,
+ BoldItalicFont = *-SemiCondensedBoldItalic,
+]
+\setmonofont{NotoSansMono}[
+ Ligatures = CommonOff,
+ Extension = .ttf,
+ UprightFont = *-CondensedLight,
+ BoldFont = *-CondensedMedium,
+]
+\setemojifont{Twemoji Mozilla}
+
+\newfontface\fontja{Noto Serif CJK JP Light}
+\newfontface\fontsymbol{Noto Sans Symbols Light}
+\newfontface\ttcond{NotoSansMono-ExtraCondensedLight.ttf}
+% \def\fontja{}
+
+\makeatletter
+\ExplSyntaxOn
+
+\cs_set_protected:Npn \__codedoc_meta_original:n #1
+ {
+ {\fontsymbol\symbol{"2329}}
+ \kern.2pt
+ \group_begin:
+ \normalfont \rmfamily \itshape
+ \edef \meta@hyphen@restore
+ { \hyphenchar \the \font \the \hyphenchar \font }
+ \hyphenchar \font \m@ne
+ \language \l@nohyphenation
+ #1 \/
+ \meta@hyphen@restore
+ \group_end:
+ \kern-.2pt
+ {\fontsymbol\symbol{"232A}}
+ }
+
+\DeclareRobustCommand{\LaTeX}{
+ L\kern-.34em
+ \raisebox{.36ex}{\scalebox{0.9}{\textsc{a}}}
+ \kern-.12em
+ \TeX}
+
+\def\@fnsymbol#1{
+ \ensuremath{
+ \ifcase #1
+ \or \text{\emoji{globe-with-meridians}}
+ \or \text{\emoji{email}}
+ \fi}}
+
+\ExplSyntaxOff
+\makeatother
+
+\hypersetup{citecolor=green!75!black}
+\linespread{1.2}
+
+\def\LuaLaTeX{Lua\LaTeX}
+\def\LuaHBTeX{LuaHB\TeX}
+
+\def\contentsname{\emoji{snowman} Contents}
+\def\refname{\emoji{mortar-board} References}
+
+\title{The \pkg{emoji} package \thanks{\url{https://github.com/stone-zeng/latex-emoji}} \\
+ Emoji support in (Lua)\LaTeX}
+\author{Xiangdong Zeng \thanks{\url{xdzeng96@gmail.com}}}
+\date{\emoji{date} 2020/02/23\quad v0.1}
+
+\begin{document}
+
+\maketitle
+
+\tableofcontents
+
+\section{\emoji{hamburger} Introduction}
+
+\strong{Emoji} (\emoji{jp}: {\fontja 絵文字}) are pictographs (pictorial symbols) that are
+typically presented in a colorful cartoon form and used inline in text. They represent things
+such as faces, weather, vehicles and buildings, food and drink, animals and plants, or icons
+that represent emotions, feelings, or activities.\textsuperscript{\cite{utr51}}
+
+In 2019, \href{https://github.com/khaledhosny}{Khaled Hosny} has integrated the
+\href{https://github.com/harfbuzz/harfbuzz}{HarfBuzz} library into \LuaTeX. While the original
+purpose is to optimize the rendering of indic and arabic scripts, emoji is also supported by
+this new version of \TeX{} at the same time.
+
+The \pkg{emoji} package allows user to typeset emoji in a \LaTeX{} document. It requires
+\LuaHBTeX{}: at present, only \texttt{lualatex-dev} can be used to compile. In \TeX{} Live 2020,
+\texttt{lualatex} will base on the new \LuaHBTeX{} engine and can be used as well.
+
+\section{\emoji{fire} Basic usage}
+
+\subsection{\emoji{car} Load the package}
+
+The package should be loaded in the usual way:
+
+\begin{verbatim}
+ \usepackage{emoji}
+\end{verbatim}
+
+\subsection{\emoji{beer} Set emoji fonts}
+
+On Windows or macOS system, the \pkg{emoji} package will automatically select available emoji
+fonts. If the package can't find any emoji fonts, or if you want to change the default font,
+you can use the following command to set emoji font manually.
+
+\begin{function}{\setemojifont}
+ \begin{syntax}
+ \cs{setemojifont}\marg{font}\oarg{font features}
+ \end{syntax}
+ This command is similar to \cs{setmainfont} provided by \pkg{fontspec}, but only works for
+ emoji. The optional \meta{font features} should be a key-value list, which is described in the
+ document of \pkg{fontspec} package in detail.
+
+ You can use this command in the preamble of in the document body. Only emoji afterwards will
+ be affected.
+\end{function}
+
+Examples:
+
+\begin{verbatim}
+ % Font name
+ \setemojifont{Apple Color Emoji}
+
+ % File name with explicit path
+ \setemojifont{EmojiOneMozilla.ttf}[Path=./fonts/]
+\end{verbatim}
+
+\subsection{\emoji{art} Use emoji}
+
+\begin{function}{\emoji}
+ \begin{syntax}
+ \cs{emoji}\marg{name}
+ \end{syntax}
+ This is the main command to use emoji. All valid \meta{name} can be found in
+ \autoref{tab:emoji-list}.
+\end{function}
+
+Examples:
+
+\begin{verbatim}
+ \emoji{joy}
+ \emoji{+1}
+ \emoji{family-man-woman-girl-boy}
+\end{verbatim}
+
+\emoji{joy} \emoji{+1} \emoji{family-man-woman-girl-boy}
+
+\section{\emoji{electric-plug} Technical details}
+
+\subsection{\emoji{hammer-and-wrench} Fonts}
+
+At present, \LuaHBTeX{} doesn's support OpenType \texttt{SVG} table, so not all color emoji fonts
+can be used normally. Some typical fonts are listed in \autoref{tab:emoji-fonts}.
+
+\begingroup
+
+\def\y{\emoji{white-check-mark}}
+\def\x{\emoji{negative-squared-cross-mark}}
+\small
+
+\begin{longtable}{cccccc}
+ \caption{Typical color emoji fonts}
+ \label{tab:emoji-fonts}
+ \endfirsthead
+ \toprule
+ \strong{Font name} &
+ \strong{OpenType table(s)} &
+ \strong{Bitmap?} &
+ \strong{Vector?} &
+ \strong{Support?} &
+ \strong{Reference} \\
+ \midrule
+ Apple Color Emoji & \texttt{sbix} & \y & & \y & \\
+ Segoe UI Emoji & \texttt{COLR}/\texttt{CPAL} & & \y & \y & \\
+ EmojiOne Mozilla & \texttt{COLR}/\texttt{CPAL} & & \y & \y & \cite{twemoji-colr} \\
+ Twemoji Mozilla & \texttt{COLR}/\texttt{CPAL} & & \y & \y & \cite{twemoji-colr} \\
+ Noto Color Emoji & \texttt{CBDT}/\texttt{CBLC} & \y & & \y & \cite{noto-emoji} \\
+ JoyPixels & \texttt{CBDT}/\texttt{CBLC} & \y & & \y & \cite{joypixels} \\
+ EmojiOne & \texttt{SVG} & & \y & \x & \cite{emojione} \\
+ Twitter Color Emoji & \texttt{SVG} & & \y & \x & \cite{twemoji} \\
+ \bottomrule
+\end{longtable}
+
+\endgroup
+
+This document uses the following fonts:
+
+\begin{itemize}
+ \item Noto Serif
+ \item Noto Sans
+ \item Noto Sans Mono
+ \item Noto Sans Symbols
+ \item Noto Serif CJK JP ({\fontja 源ノ明朝})
+ \item Twemoji Mozilla
+\end{itemize}
+
+\subsection{\emoji{notebook} Emoji list}
+
+Names in the list are from \url{https://api.github.com/emojis}.
+
+\begingroup
+
+\def\EMOJI#1#2{\emoji{#1} & #1 & {\ttcond\scriptsize#2} \\}
+\def\HEAD{%
+ \toprule
+ \strong{Emoji} & \strong{Name} & \strong{Unicode codepoints} \\
+ \midrule}
+\small
+
+\begin{longtable}{ccc}
+ \caption{Emoji list (sorted in alphabetical order)}
+ \label{tab:emoji-list} \\
+ \HEAD
+ \endfirsthead
+ \HEAD
+ \endhead
+ \toprule
+ \endfoot
+ \EMOJI{-1} {1F44E}
+ \EMOJI{+1} {1F44D}
+ \EMOJI{100} {1F4AF}
+ \EMOJI{1234} {1F522}
+ \EMOJI{1st-place-medal} {1F947}
+ \EMOJI{2nd-place-medal} {1F948}
+ \EMOJI{3rd-place-medal} {1F949}
+ \EMOJI{8ball} {1F3B1}
+ \EMOJI{a} {1F170}
+ \EMOJI{ab} {1F18E}
+ \EMOJI{abc} {1F524}
+ \EMOJI{abcd} {1F521}
+ \EMOJI{accept} {1F251}
+ \EMOJI{aerial-tramway} {1F6A1}
+ \EMOJI{afghanistan} {1F1E6 1F1EB}
+ \EMOJI{airplane} {2708}
+ \EMOJI{aland-islands} {1F1E6 1F1FD}
+ \EMOJI{alarm-clock} {23F0}
+ \EMOJI{albania} {1F1E6 1F1F1}
+ \EMOJI{alembic} {2697}
+ \EMOJI{algeria} {1F1E9 1F1FF}
+ \EMOJI{alien} {1F47D}
+ \EMOJI{ambulance} {1F691}
+ \EMOJI{american-samoa} {1F1E6 1F1F8}
+ \EMOJI{amphora} {1F3FA}
+ \EMOJI{anchor} {2693}
+ \EMOJI{andorra} {1F1E6 1F1E9}
+ \EMOJI{angel} {1F47C}
+ \EMOJI{anger} {1F4A2}
+ \EMOJI{angola} {1F1E6 1F1F4}
+ \EMOJI{angry} {1F620}
+ \EMOJI{anguilla} {1F1E6 1F1EE}
+ \EMOJI{anguished} {1F627}
+ \EMOJI{ant} {1F41C}
+ \EMOJI{antarctica} {1F1E6 1F1F6}
+ \EMOJI{antigua-barbuda} {1F1E6 1F1EC}
+ \EMOJI{apple} {1F34E}
+ \EMOJI{aquarius} {2652}
+ \EMOJI{argentina} {1F1E6 1F1F7}
+ \EMOJI{aries} {2648}
+ \EMOJI{armenia} {1F1E6 1F1F2}
+ \EMOJI{arrow-backward} {25C0}
+ \EMOJI{arrow-double-down} {23EC}
+ \EMOJI{arrow-double-up} {23EB}
+ \EMOJI{arrow-down-small} {1F53D}
+ \EMOJI{arrow-down} {2B07}
+ \EMOJI{arrow-forward} {25B6}
+ \EMOJI{arrow-heading-down} {2935}
+ \EMOJI{arrow-heading-up} {2934}
+ \EMOJI{arrow-left} {2B05}
+ \EMOJI{arrow-lower-left} {2199}
+ \EMOJI{arrow-lower-right} {2198}
+ \EMOJI{arrow-right-hook} {21AA}
+ \EMOJI{arrow-right} {27A1}
+ \EMOJI{arrow-up-down} {2195}
+ \EMOJI{arrow-up-small} {1F53C}
+ \EMOJI{arrow-up} {2B06}
+ \EMOJI{arrow-upper-left} {2196}
+ \EMOJI{arrow-upper-right} {2197}
+ \EMOJI{arrows-clockwise} {1F503}
+ \EMOJI{arrows-counterclockwise} {1F504}
+ \EMOJI{art} {1F3A8}
+ \EMOJI{articulated-lorry} {1F69B}
+ \EMOJI{artificial-satellite} {1F6F0}
+ \EMOJI{aruba} {1F1E6 1F1FC}
+ \EMOJI{astonished} {1F632}
+ \EMOJI{athletic-shoe} {1F45F}
+ \EMOJI{atm} {1F3E7}
+ \EMOJI{atom-symbol} {269B}
+ \EMOJI{australia} {1F1E6 1F1FA}
+ \EMOJI{austria} {1F1E6 1F1F9}
+ \EMOJI{avocado} {1F951}
+ \EMOJI{azerbaijan} {1F1E6 1F1FF}
+ \EMOJI{b} {1F171}
+ \EMOJI{baby-bottle} {1F37C}
+ \EMOJI{baby-chick} {1F424}
+ \EMOJI{baby-symbol} {1F6BC}
+ \EMOJI{baby} {1F476}
+ \EMOJI{back} {1F519}
+ \EMOJI{bacon} {1F953}
+ \EMOJI{badminton} {1F3F8}
+ \EMOJI{baggage-claim} {1F6C4}
+ \EMOJI{baguette-bread} {1F956}
+ \EMOJI{bahamas} {1F1E7 1F1F8}
+ \EMOJI{bahrain} {1F1E7 1F1ED}
+ \EMOJI{balance-scale} {2696}
+ \EMOJI{balloon} {1F388}
+ \EMOJI{ballot-box-with-check} {2611}
+ \EMOJI{ballot-box} {1F5F3}
+ \EMOJI{bamboo} {1F38D}
+ \EMOJI{banana} {1F34C}
+ \EMOJI{bangbang} {203C}
+ \EMOJI{bangladesh} {1F1E7 1F1E9}
+ \EMOJI{bank} {1F3E6}
+ \EMOJI{bar-chart} {1F4CA}
+ \EMOJI{barbados} {1F1E7 1F1E7}
+ \EMOJI{barber} {1F488}
+ \EMOJI{baseball} {26BE}
+ \EMOJI{basketball-man} {26F9}
+ \EMOJI{basketball-woman} {26F9 200D 2640}
+ \EMOJI{basketball} {1F3C0}
+ \EMOJI{bat} {1F987}
+ \EMOJI{bath} {1F6C0}
+ \EMOJI{bathtub} {1F6C1}
+ \EMOJI{battery} {1F50B}
+ \EMOJI{beach-umbrella} {1F3D6}
+ \EMOJI{bear} {1F43B}
+ \EMOJI{bed} {1F6CF}
+ \EMOJI{bee} {1F41D}
+ \EMOJI{beer} {1F37A}
+ \EMOJI{beers} {1F37B}
+ \EMOJI{beetle} {1F41E}
+ \EMOJI{beginner} {1F530}
+ \EMOJI{belarus} {1F1E7 1F1FE}
+ \EMOJI{belgium} {1F1E7 1F1EA}
+ \EMOJI{belize} {1F1E7 1F1FF}
+ \EMOJI{bell} {1F514}
+ \EMOJI{bellhop-bell} {1F6CE}
+ \EMOJI{benin} {1F1E7 1F1EF}
+ \EMOJI{bento} {1F371}
+ \EMOJI{bermuda} {1F1E7 1F1F2}
+ \EMOJI{bhutan} {1F1E7 1F1F9}
+ \EMOJI{bicyclist} {1F6B4}
+ \EMOJI{bike} {1F6B2}
+ \EMOJI{biking-man} {1F6B4}
+ \EMOJI{biking-woman} {1F6B4 200D 2640}
+ \EMOJI{bikini} {1F459}
+ \EMOJI{biohazard} {2623}
+ \EMOJI{bird} {1F426}
+ \EMOJI{birthday} {1F382}
+ \EMOJI{black-circle} {26AB}
+ \EMOJI{black-flag} {1F3F4}
+ \EMOJI{black-heart} {1F5A4}
+ \EMOJI{black-joker} {1F0CF}
+ \EMOJI{black-large-square} {2B1B}
+ \EMOJI{black-medium-small-square} {25FE}
+ \EMOJI{black-medium-square} {25FC}
+ \EMOJI{black-nib} {2712}
+ \EMOJI{black-small-square} {25AA}
+ \EMOJI{black-square-button} {1F532}
+ \EMOJI{blonde-man} {1F471}
+ \EMOJI{blonde-woman} {1F471 200D 2640}
+ \EMOJI{blossom} {1F33C}
+ \EMOJI{blowfish} {1F421}
+ \EMOJI{blue-book} {1F4D8}
+ \EMOJI{blue-car} {1F699}
+ \EMOJI{blue-heart} {1F499}
+ \EMOJI{blush} {1F60A}
+ \EMOJI{boar} {1F417}
+ \EMOJI{boat} {26F5}
+ \EMOJI{bolivia} {1F1E7 1F1F4}
+ \EMOJI{bomb} {1F4A3}
+ \EMOJI{book} {1F4D6}
+ \EMOJI{bookmark-tabs} {1F4D1}
+ \EMOJI{bookmark} {1F516}
+ \EMOJI{books} {1F4DA}
+ \EMOJI{boom} {1F4A5}
+ \EMOJI{boot} {1F462}
+ \EMOJI{bosnia-herzegovina} {1F1E7 1F1E6}
+ \EMOJI{botswana} {1F1E7 1F1FC}
+ \EMOJI{bouquet} {1F490}
+ \EMOJI{bow-and-arrow} {1F3F9}
+ \EMOJI{bow} {1F647}
+ \EMOJI{bowing-man} {1F647}
+ \EMOJI{bowing-woman} {1F647 200D 2640}
+ \EMOJI{bowling} {1F3B3}
+ \EMOJI{boxing-glove} {1F94A}
+ \EMOJI{boy} {1F466}
+ \EMOJI{brazil} {1F1E7 1F1F7}
+ \EMOJI{bread} {1F35E}
+ \EMOJI{bride-with-veil} {1F470}
+ \EMOJI{bridge-at-night} {1F309}
+ \EMOJI{briefcase} {1F4BC}
+ \EMOJI{british-indian-ocean-territory} {1F1EE 1F1F4}
+ \EMOJI{british-virgin-islands} {1F1FB 1F1EC}
+ \EMOJI{broken-heart} {1F494}
+ \EMOJI{brunei} {1F1E7 1F1F3}
+ \EMOJI{bug} {1F41B}
+ \EMOJI{building-construction} {1F3D7}
+ \EMOJI{bulb} {1F4A1}
+ \EMOJI{bulgaria} {1F1E7 1F1EC}
+ \EMOJI{bullettrain-front} {1F685}
+ \EMOJI{bullettrain-side} {1F684}
+ \EMOJI{burkina-faso} {1F1E7 1F1EB}
+ \EMOJI{burrito} {1F32F}
+ \EMOJI{burundi} {1F1E7 1F1EE}
+ \EMOJI{bus} {1F68C}
+ \EMOJI{business-suit-levitating} {1F574}
+ \EMOJI{busstop} {1F68F}
+ \EMOJI{bust-in-silhouette} {1F464}
+ \EMOJI{busts-in-silhouette} {1F465}
+ \EMOJI{butterfly} {1F98B}
+ \EMOJI{cactus} {1F335}
+ \EMOJI{cake} {1F370}
+ \EMOJI{calendar} {1F4C6}
+ \EMOJI{call-me-hand} {1F919}
+ \EMOJI{calling} {1F4F2}
+ \EMOJI{cambodia} {1F1F0 1F1ED}
+ \EMOJI{camel} {1F42B}
+ \EMOJI{camera-flash} {1F4F8}
+ \EMOJI{camera} {1F4F7}
+ \EMOJI{cameroon} {1F1E8 1F1F2}
+ \EMOJI{camping} {1F3D5}
+ \EMOJI{canada} {1F1E8 1F1E6}
+ \EMOJI{canary-islands} {1F1EE 1F1E8}
+ \EMOJI{cancer} {264B}
+ \EMOJI{candle} {1F56F}
+ \EMOJI{candy} {1F36C}
+ \EMOJI{canoe} {1F6F6}
+ \EMOJI{cape-verde} {1F1E8 1F1FB}
+ \EMOJI{capital-abcd} {1F520}
+ \EMOJI{capricorn} {2651}
+ \EMOJI{car} {1F697}
+ \EMOJI{card-file-box} {1F5C3}
+ \EMOJI{card-index-dividers} {1F5C2}
+ \EMOJI{card-index} {1F4C7}
+ \EMOJI{caribbean-netherlands} {1F1E7 1F1F6}
+ \EMOJI{carousel-horse} {1F3A0}
+ \EMOJI{carrot} {1F955}
+ \EMOJI{cat} {1F431}
+ \EMOJI{cat2} {1F408}
+ \EMOJI{cayman-islands} {1F1F0 1F1FE}
+ \EMOJI{cd} {1F4BF}
+ \EMOJI{central-african-republic} {1F1E8 1F1EB}
+ \EMOJI{chad} {1F1F9 1F1E9}
+ \EMOJI{chains} {26D3}
+ \EMOJI{champagne} {1F37E}
+ \EMOJI{chart-with-downwards-trend} {1F4C9}
+ \EMOJI{chart-with-upwards-trend} {1F4C8}
+ \EMOJI{chart} {1F4B9}
+ \EMOJI{checkered-flag} {1F3C1}
+ \EMOJI{cheese} {1F9C0}
+ \EMOJI{cherries} {1F352}
+ \EMOJI{cherry-blossom} {1F338}
+ \EMOJI{chestnut} {1F330}
+ \EMOJI{chicken} {1F414}
+ \EMOJI{children-crossing} {1F6B8}
+ \EMOJI{chile} {1F1E8 1F1F1}
+ \EMOJI{chipmunk} {1F43F}
+ \EMOJI{chocolate-bar} {1F36B}
+ \EMOJI{christmas-island} {1F1E8 1F1FD}
+ \EMOJI{christmas-tree} {1F384}
+ \EMOJI{church} {26EA}
+ \EMOJI{cinema} {1F3A6}
+ \EMOJI{circus-tent} {1F3AA}
+ \EMOJI{city-sunrise} {1F307}
+ \EMOJI{city-sunset} {1F306}
+ \EMOJI{cityscape} {1F3D9}
+ \EMOJI{cl} {1F191}
+ \EMOJI{clamp} {1F5DC}
+ \EMOJI{clap} {1F44F}
+ \EMOJI{clapper} {1F3AC}
+ \EMOJI{classical-building} {1F3DB}
+ \EMOJI{clinking-glasses} {1F942}
+ \EMOJI{clipboard} {1F4CB}
+ \EMOJI{clock1} {1F550}
+ \EMOJI{clock10} {1F559}
+ \EMOJI{clock1030} {1F565}
+ \EMOJI{clock11} {1F55A}
+ \EMOJI{clock1130} {1F566}
+ \EMOJI{clock12} {1F55B}
+ \EMOJI{clock1230} {1F567}
+ \EMOJI{clock130} {1F55C}
+ \EMOJI{clock2} {1F551}
+ \EMOJI{clock230} {1F55D}
+ \EMOJI{clock3} {1F552}
+ \EMOJI{clock330} {1F55E}
+ \EMOJI{clock4} {1F553}
+ \EMOJI{clock430} {1F55F}
+ \EMOJI{clock5} {1F554}
+ \EMOJI{clock530} {1F560}
+ \EMOJI{clock6} {1F555}
+ \EMOJI{clock630} {1F561}
+ \EMOJI{clock7} {1F556}
+ \EMOJI{clock730} {1F562}
+ \EMOJI{clock8} {1F557}
+ \EMOJI{clock830} {1F563}
+ \EMOJI{clock9} {1F558}
+ \EMOJI{clock930} {1F564}
+ \EMOJI{closed-book} {1F4D5}
+ \EMOJI{closed-lock-with-key} {1F510}
+ \EMOJI{closed-umbrella} {1F302}
+ \EMOJI{cloud-with-lightning-and-rain} {26C8}
+ \EMOJI{cloud-with-lightning} {1F329}
+ \EMOJI{cloud-with-rain} {1F327}
+ \EMOJI{cloud-with-snow} {1F328}
+ \EMOJI{cloud} {2601}
+ \EMOJI{clown-face} {1F921}
+ \EMOJI{clubs} {2663}
+ \EMOJI{cn} {1F1E8 1F1F3}
+ \EMOJI{cocktail} {1F378}
+ \EMOJI{cocos-islands} {1F1E8 1F1E8}
+ \EMOJI{coffee} {2615}
+ \EMOJI{coffin} {26B0}
+ \EMOJI{cold-sweat} {1F630}
+ \EMOJI{collision} {1F4A5}
+ \EMOJI{colombia} {1F1E8 1F1F4}
+ \EMOJI{comet} {2604}
+ \EMOJI{comoros} {1F1F0 1F1F2}
+ \EMOJI{computer-mouse} {1F5B1}
+ \EMOJI{computer} {1F4BB}
+ \EMOJI{confetti-ball} {1F38A}
+ \EMOJI{confounded} {1F616}
+ \EMOJI{confused} {1F615}
+ \EMOJI{congo-brazzaville} {1F1E8 1F1EC}
+ \EMOJI{congo-kinshasa} {1F1E8 1F1E9}
+ \EMOJI{congratulations} {3297}
+ \EMOJI{construction-worker-man} {1F477}
+ \EMOJI{construction-worker-woman} {1F477 200D 2640}
+ \EMOJI{construction-worker} {1F477}
+ \EMOJI{construction} {1F6A7}
+ \EMOJI{control-knobs} {1F39B}
+ \EMOJI{convenience-store} {1F3EA}
+ \EMOJI{cook-islands} {1F1E8 1F1F0}
+ \EMOJI{cookie} {1F36A}
+ \EMOJI{cool} {1F192}
+ \EMOJI{cop} {1F46E}
+ \EMOJI{copyright} {0A9}
+ \EMOJI{corn} {1F33D}
+ \EMOJI{costa-rica} {1F1E8 1F1F7}
+ \EMOJI{cote-divoire} {1F1E8 1F1EE}
+ \EMOJI{couch-and-lamp} {1F6CB}
+ \EMOJI{couple-with-heart-man-man} {1F468 200D 2764 200D 1F468}
+ \EMOJI{couple-with-heart-woman-man} {1F491}
+ \EMOJI{couple-with-heart-woman-woman} {1F469 200D 2764 200D 1F469}
+ \EMOJI{couple-with-heart} {1F491}
+ \EMOJI{couple} {1F46B}
+ \EMOJI{couplekiss-man-man} {1F468 200D 2764 200D 1F48B 200D 1F468}
+ \EMOJI{couplekiss-man-woman} {1F48F}
+ \EMOJI{couplekiss-woman-woman} {1F469 200D 2764 200D 1F48B 200D 1F469}
+ \EMOJI{cow} {1F42E}
+ \EMOJI{cow2} {1F404}
+ \EMOJI{cowboy-hat-face} {1F920}
+ \EMOJI{crab} {1F980}
+ \EMOJI{crayon} {1F58D}
+ \EMOJI{credit-card} {1F4B3}
+ \EMOJI{crescent-moon} {1F319}
+ \EMOJI{cricket} {1F3CF}
+ \EMOJI{croatia} {1F1ED 1F1F7}
+ \EMOJI{crocodile} {1F40A}
+ \EMOJI{croissant} {1F950}
+ \EMOJI{crossed-fingers} {1F91E}
+ \EMOJI{crossed-flags} {1F38C}
+ \EMOJI{crossed-swords} {2694}
+ \EMOJI{crown} {1F451}
+ \EMOJI{cry} {1F622}
+ \EMOJI{crying-cat-face} {1F63F}
+ \EMOJI{crystal-ball} {1F52E}
+ \EMOJI{cuba} {1F1E8 1F1FA}
+ \EMOJI{cucumber} {1F952}
+ \EMOJI{cupid} {1F498}
+ \EMOJI{curacao} {1F1E8 1F1FC}
+ \EMOJI{curly-loop} {27B0}
+ \EMOJI{currency-exchange} {1F4B1}
+ \EMOJI{curry} {1F35B}
+ \EMOJI{custard} {1F36E}
+ \EMOJI{customs} {1F6C3}
+ \EMOJI{cyclone} {1F300}
+ \EMOJI{cyprus} {1F1E8 1F1FE}
+ \EMOJI{czech-republic} {1F1E8 1F1FF}
+ \EMOJI{dagger} {1F5E1}
+ \EMOJI{dancer} {1F483}
+ \EMOJI{dancers} {1F46F}
+ \EMOJI{dancing-men} {1F46F 200D 2642}
+ \EMOJI{dancing-women} {1F46F}
+ \EMOJI{dango} {1F361}
+ \EMOJI{dark-sunglasses} {1F576}
+ \EMOJI{dart} {1F3AF}
+ \EMOJI{dash} {1F4A8}
+ \EMOJI{date} {1F4C5}
+ \EMOJI{de} {1F1E9 1F1EA}
+ \EMOJI{deciduous-tree} {1F333}
+ \EMOJI{deer} {1F98C}
+ \EMOJI{denmark} {1F1E9 1F1F0}
+ \EMOJI{department-store} {1F3EC}
+ \EMOJI{derelict-house} {1F3DA}
+ \EMOJI{desert-island} {1F3DD}
+ \EMOJI{desert} {1F3DC}
+ \EMOJI{desktop-computer} {1F5A5}
+ \EMOJI{detective} {1F575}
+ \EMOJI{diamond-shape-with-a-dot-inside} {1F4A0}
+ \EMOJI{diamonds} {2666}
+ \EMOJI{disappointed-relieved} {1F625}
+ \EMOJI{disappointed} {1F61E}
+ \EMOJI{dizzy-face} {1F635}
+ \EMOJI{dizzy} {1F4AB}
+ \EMOJI{djibouti} {1F1E9 1F1EF}
+ \EMOJI{do-not-litter} {1F6AF}
+ \EMOJI{dog} {1F436}
+ \EMOJI{dog2} {1F415}
+ \EMOJI{dollar} {1F4B5}
+ \EMOJI{dolls} {1F38E}
+ \EMOJI{dolphin} {1F42C}
+ \EMOJI{dominica} {1F1E9 1F1F2}
+ \EMOJI{dominican-republic} {1F1E9 1F1F4}
+ \EMOJI{door} {1F6AA}
+ \EMOJI{doughnut} {1F369}
+ \EMOJI{dove} {1F54A}
+ \EMOJI{dragon-face} {1F432}
+ \EMOJI{dragon} {1F409}
+ \EMOJI{dress} {1F457}
+ \EMOJI{dromedary-camel} {1F42A}
+ \EMOJI{drooling-face} {1F924}
+ \EMOJI{droplet} {1F4A7}
+ \EMOJI{drum} {1F941}
+ \EMOJI{duck} {1F986}
+ \EMOJI{dvd} {1F4C0}
+ \EMOJI{e-mail} {1F4E7}
+ \EMOJI{eagle} {1F985}
+ \EMOJI{ear-of-rice} {1F33E}
+ \EMOJI{ear} {1F442}
+ \EMOJI{earth-africa} {1F30D}
+ \EMOJI{earth-americas} {1F30E}
+ \EMOJI{earth-asia} {1F30F}
+ \EMOJI{ecuador} {1F1EA 1F1E8}
+ \EMOJI{egg} {1F95A}
+ \EMOJI{eggplant} {1F346}
+ \EMOJI{egypt} {1F1EA 1F1EC}
+ \EMOJI{eight-pointed-black-star} {2734}
+ \EMOJI{eight-spoked-asterisk} {2733}
+ \EMOJI{el-salvador} {1F1F8 1F1FB}
+ \EMOJI{electric-plug} {1F50C}
+ \EMOJI{elephant} {1F418}
+ \EMOJI{email} {2709}
+ \EMOJI{end} {1F51A}
+ \EMOJI{envelope-with-arrow} {1F4E9}
+ \EMOJI{envelope} {2709}
+ \EMOJI{equatorial-guinea} {1F1EC 1F1F6}
+ \EMOJI{eritrea} {1F1EA 1F1F7}
+ \EMOJI{es} {1F1EA 1F1F8}
+ \EMOJI{estonia} {1F1EA 1F1EA}
+ \EMOJI{ethiopia} {1F1EA 1F1F9}
+ \EMOJI{eu} {1F1EA 1F1FA}
+ \EMOJI{euro} {1F4B6}
+ \EMOJI{european-castle} {1F3F0}
+ \EMOJI{european-post-office} {1F3E4}
+ \EMOJI{european-union} {1F1EA 1F1FA}
+ \EMOJI{evergreen-tree} {1F332}
+ \EMOJI{exclamation} {2757}
+ \EMOJI{expressionless} {1F611}
+ \EMOJI{eye-speech-bubble} {1F441 200D 1F5E8}
+ \EMOJI{eye} {1F441}
+ \EMOJI{eyeglasses} {1F453}
+ \EMOJI{eyes} {1F440}
+ \EMOJI{face-with-head-bandage} {1F915}
+ \EMOJI{face-with-thermometer} {1F912}
+ \EMOJI{facepunch} {1F44A}
+ \EMOJI{factory} {1F3ED}
+ \EMOJI{falkland-islands} {1F1EB 1F1F0}
+ \EMOJI{fallen-leaf} {1F342}
+ \EMOJI{family-man-boy-boy} {1F468 200D 1F466 200D 1F466}
+ \EMOJI{family-man-boy} {1F468 200D 1F466}
+ \EMOJI{family-man-girl-boy} {1F468 200D 1F467 200D 1F466}
+ \EMOJI{family-man-girl-girl} {1F468 200D 1F467 200D 1F467}
+ \EMOJI{family-man-girl} {1F468 200D 1F467}
+ \EMOJI{family-man-man-boy-boy} {1F468 200D 1F468 200D 1F466 200D 1F466}
+ \EMOJI{family-man-man-boy} {1F468 200D 1F468 200D 1F466}
+ \EMOJI{family-man-man-girl-boy} {1F468 200D 1F468 200D 1F467 200D 1F466}
+ \EMOJI{family-man-man-girl-girl} {1F468 200D 1F468 200D 1F467 200D 1F467}
+ \EMOJI{family-man-man-girl} {1F468 200D 1F468 200D 1F467}
+ \EMOJI{family-man-woman-boy-boy} {1F468 200D 1F469 200D 1F466 200D 1F466}
+ \EMOJI{family-man-woman-boy} {1F46A}
+ \EMOJI{family-man-woman-girl-boy} {1F468 200D 1F469 200D 1F467 200D 1F466}
+ \EMOJI{family-man-woman-girl-girl} {1F468 200D 1F469 200D 1F467 200D 1F467}
+ \EMOJI{family-man-woman-girl} {1F468 200D 1F469 200D 1F467}
+ \EMOJI{family-woman-boy-boy} {1F469 200D 1F466 200D 1F466}
+ \EMOJI{family-woman-boy} {1F469 200D 1F466}
+ \EMOJI{family-woman-girl-boy} {1F469 200D 1F467 200D 1F466}
+ \EMOJI{family-woman-girl-girl} {1F469 200D 1F467 200D 1F467}
+ \EMOJI{family-woman-girl} {1F469 200D 1F467}
+ \EMOJI{family-woman-woman-boy-boy} {1F469 200D 1F469 200D 1F466 200D 1F466}
+ \EMOJI{family-woman-woman-boy} {1F469 200D 1F469 200D 1F466}
+ \EMOJI{family-woman-woman-girl-boy} {1F469 200D 1F469 200D 1F467 200D 1F466}
+ \EMOJI{family-woman-woman-girl-girl} {1F469 200D 1F469 200D 1F467 200D 1F467}
+ \EMOJI{family-woman-woman-girl} {1F469 200D 1F469 200D 1F467}
+ \EMOJI{family} {1F46A}
+ \EMOJI{faroe-islands} {1F1EB 1F1F4}
+ \EMOJI{fast-forward} {23E9}
+ \EMOJI{fax} {1F4E0}
+ \EMOJI{fearful} {1F628}
+ \EMOJI{feet} {1F43E}
+ \EMOJI{female-detective} {1F575 200D 2640}
+ \EMOJI{ferris-wheel} {1F3A1}
+ \EMOJI{ferry} {26F4}
+ \EMOJI{field-hockey} {1F3D1}
+ \EMOJI{fiji} {1F1EB 1F1EF}
+ \EMOJI{file-cabinet} {1F5C4}
+ \EMOJI{file-folder} {1F4C1}
+ \EMOJI{film-projector} {1F4FD}
+ \EMOJI{film-strip} {1F39E}
+ \EMOJI{finland} {1F1EB 1F1EE}
+ \EMOJI{fire-engine} {1F692}
+ \EMOJI{fire} {1F525}
+ \EMOJI{fireworks} {1F386}
+ \EMOJI{first-quarter-moon-with-face} {1F31B}
+ \EMOJI{first-quarter-moon} {1F313}
+ \EMOJI{fish-cake} {1F365}
+ \EMOJI{fish} {1F41F}
+ \EMOJI{fishing-pole-and-fish} {1F3A3}
+ \EMOJI{fist-left} {1F91B}
+ \EMOJI{fist-oncoming} {1F44A}
+ \EMOJI{fist-raised} {270A}
+ \EMOJI{fist-right} {1F91C}
+ \EMOJI{fist} {270A}
+ \EMOJI{flags} {1F38F}
+ \EMOJI{flashlight} {1F526}
+ \EMOJI{fleur-de-lis} {269C}
+ \EMOJI{flight-arrival} {1F6EC}
+ \EMOJI{flight-departure} {1F6EB}
+ \EMOJI{flipper} {1F42C}
+ \EMOJI{floppy-disk} {1F4BE}
+ \EMOJI{flower-playing-cards} {1F3B4}
+ \EMOJI{flushed} {1F633}
+ \EMOJI{fog} {1F32B}
+ \EMOJI{foggy} {1F301}
+ \EMOJI{football} {1F3C8}
+ \EMOJI{footprints} {1F463}
+ \EMOJI{fork-and-knife} {1F374}
+ \EMOJI{fountain-pen} {1F58B}
+ \EMOJI{fountain} {26F2}
+ \EMOJI{four-leaf-clover} {1F340}
+ \EMOJI{fox-face} {1F98A}
+ \EMOJI{fr} {1F1EB 1F1F7}
+ \EMOJI{framed-picture} {1F5BC}
+ \EMOJI{free} {1F193}
+ \EMOJI{french-guiana} {1F1EC 1F1EB}
+ \EMOJI{french-polynesia} {1F1F5 1F1EB}
+ \EMOJI{french-southern-territories} {1F1F9 1F1EB}
+ \EMOJI{fried-egg} {1F373}
+ \EMOJI{fried-shrimp} {1F364}
+ \EMOJI{fries} {1F35F}
+ \EMOJI{frog} {1F438}
+ \EMOJI{frowning-face} {2639}
+ \EMOJI{frowning-man} {1F64D 200D 2642}
+ \EMOJI{frowning-woman} {1F64D}
+ \EMOJI{frowning} {1F626}
+ \EMOJI{fu} {1F595}
+ \EMOJI{fuelpump} {26FD}
+ \EMOJI{full-moon-with-face} {1F31D}
+ \EMOJI{full-moon} {1F315}
+ \EMOJI{funeral-urn} {26B1}
+ \EMOJI{gabon} {1F1EC 1F1E6}
+ \EMOJI{gambia} {1F1EC 1F1F2}
+ \EMOJI{game-die} {1F3B2}
+ \EMOJI{gb} {1F1EC 1F1E7}
+ \EMOJI{gear} {2699}
+ \EMOJI{gem} {1F48E}
+ \EMOJI{gemini} {264A}
+ \EMOJI{georgia} {1F1EC 1F1EA}
+ \EMOJI{ghana} {1F1EC 1F1ED}
+ \EMOJI{ghost} {1F47B}
+ \EMOJI{gibraltar} {1F1EC 1F1EE}
+ \EMOJI{gift-heart} {1F49D}
+ \EMOJI{gift} {1F381}
+ \EMOJI{girl} {1F467}
+ \EMOJI{globe-with-meridians} {1F310}
+ \EMOJI{goal-net} {1F945}
+ \EMOJI{goat} {1F410}
+ \EMOJI{golf} {26F3}
+ \EMOJI{golfing-man} {1F3CC}
+ \EMOJI{golfing-woman} {1F3CC 200D 2640}
+ \EMOJI{gorilla} {1F98D}
+ \EMOJI{grapes} {1F347}
+ \EMOJI{greece} {1F1EC 1F1F7}
+ \EMOJI{green-apple} {1F34F}
+ \EMOJI{green-book} {1F4D7}
+ \EMOJI{green-heart} {1F49A}
+ \EMOJI{green-salad} {1F957}
+ \EMOJI{greenland} {1F1EC 1F1F1}
+ \EMOJI{grenada} {1F1EC 1F1E9}
+ \EMOJI{grey-exclamation} {2755}
+ \EMOJI{grey-question} {2754}
+ \EMOJI{grimacing} {1F62C}
+ \EMOJI{grin} {1F601}
+ \EMOJI{grinning} {1F600}
+ \EMOJI{guadeloupe} {1F1EC 1F1F5}
+ \EMOJI{guam} {1F1EC 1F1FA}
+ \EMOJI{guardsman} {1F482}
+ \EMOJI{guardswoman} {1F482 200D 2640}
+ \EMOJI{guatemala} {1F1EC 1F1F9}
+ \EMOJI{guernsey} {1F1EC 1F1EC}
+ \EMOJI{guinea-bissau} {1F1EC 1F1FC}
+ \EMOJI{guinea} {1F1EC 1F1F3}
+ \EMOJI{guitar} {1F3B8}
+ \EMOJI{gun} {1F52B}
+ \EMOJI{guyana} {1F1EC 1F1FE}
+ \EMOJI{haircut-man} {1F487 200D 2642}
+ \EMOJI{haircut-woman} {1F487}
+ \EMOJI{haircut} {1F487}
+ \EMOJI{haiti} {1F1ED 1F1F9}
+ \EMOJI{hamburger} {1F354}
+ \EMOJI{hammer-and-pick} {2692}
+ \EMOJI{hammer-and-wrench} {1F6E0}
+ \EMOJI{hammer} {1F528}
+ \EMOJI{hamster} {1F439}
+ \EMOJI{hand} {270B}
+ \EMOJI{handbag} {1F45C}
+ \EMOJI{handshake} {1F91D}
+ \EMOJI{hankey} {1F4A9}
+ \EMOJI{hatched-chick} {1F425}
+ \EMOJI{hatching-chick} {1F423}
+ \EMOJI{headphones} {1F3A7}
+ \EMOJI{hear-no-evil} {1F649}
+ \EMOJI{heart-decoration} {1F49F}
+ \EMOJI{heart-eyes-cat} {1F63B}
+ \EMOJI{heart-eyes} {1F60D}
+ \EMOJI{heart} {2764}
+ \EMOJI{heartbeat} {1F493}
+ \EMOJI{heartpulse} {1F497}
+ \EMOJI{hearts} {2665}
+ \EMOJI{heavy-check-mark} {2714}
+ \EMOJI{heavy-division-sign} {2797}
+ \EMOJI{heavy-dollar-sign} {1F4B2}
+ \EMOJI{heavy-exclamation-mark} {2757}
+ \EMOJI{heavy-heart-exclamation} {2763}
+ \EMOJI{heavy-minus-sign} {2796}
+ \EMOJI{heavy-multiplication-x} {2716}
+ \EMOJI{heavy-plus-sign} {2795}
+ \EMOJI{helicopter} {1F681}
+ \EMOJI{herb} {1F33F}
+ \EMOJI{hibiscus} {1F33A}
+ \EMOJI{high-brightness} {1F506}
+ \EMOJI{high-heel} {1F460}
+ \EMOJI{hocho} {1F52A}
+ \EMOJI{hole} {1F573}
+ \EMOJI{honduras} {1F1ED 1F1F3}
+ \EMOJI{honey-pot} {1F36F}
+ \EMOJI{honeybee} {1F41D}
+ \EMOJI{hong-kong} {1F1ED 1F1F0}
+ \EMOJI{horse-racing} {1F3C7}
+ \EMOJI{horse} {1F434}
+ \EMOJI{hospital} {1F3E5}
+ \EMOJI{hot-pepper} {1F336}
+ \EMOJI{hotdog} {1F32D}
+ \EMOJI{hotel} {1F3E8}
+ \EMOJI{hotsprings} {2668}
+ \EMOJI{hourglass-flowing-sand} {23F3}
+ \EMOJI{hourglass} {231B}
+ \EMOJI{house-with-garden} {1F3E1}
+ \EMOJI{house} {1F3E0}
+ \EMOJI{houses} {1F3D8}
+ \EMOJI{hugs} {1F917}
+ \EMOJI{hungary} {1F1ED 1F1FA}
+ \EMOJI{hushed} {1F62F}
+ \EMOJI{ice-cream} {1F368}
+ \EMOJI{ice-hockey} {1F3D2}
+ \EMOJI{ice-skate} {26F8}
+ \EMOJI{icecream} {1F366}
+ \EMOJI{iceland} {1F1EE 1F1F8}
+ \EMOJI{id} {1F194}
+ \EMOJI{ideograph-advantage} {1F250}
+ \EMOJI{imp} {1F47F}
+ \EMOJI{inbox-tray} {1F4E5}
+ \EMOJI{incoming-envelope} {1F4E8}
+ \EMOJI{india} {1F1EE 1F1F3}
+ \EMOJI{indonesia} {1F1EE 1F1E9}
+ \EMOJI{information-desk-person} {1F481}
+ \EMOJI{information-source} {2139}
+ \EMOJI{innocent} {1F607}
+ \EMOJI{interrobang} {2049}
+ \EMOJI{iphone} {1F4F1}
+ \EMOJI{iran} {1F1EE 1F1F7}
+ \EMOJI{iraq} {1F1EE 1F1F6}
+ \EMOJI{ireland} {1F1EE 1F1EA}
+ \EMOJI{isle-of-man} {1F1EE 1F1F2}
+ \EMOJI{israel} {1F1EE 1F1F1}
+ \EMOJI{it} {1F1EE 1F1F9}
+ \EMOJI{izakaya-lantern} {1F3EE}
+ \EMOJI{jack-o-lantern} {1F383}
+ \EMOJI{jamaica} {1F1EF 1F1F2}
+ \EMOJI{japan} {1F5FE}
+ \EMOJI{japanese-castle} {1F3EF}
+ \EMOJI{japanese-goblin} {1F47A}
+ \EMOJI{japanese-ogre} {1F479}
+ \EMOJI{jeans} {1F456}
+ \EMOJI{jersey} {1F1EF 1F1EA}
+ \EMOJI{jordan} {1F1EF 1F1F4}
+ \EMOJI{joy-cat} {1F639}
+ \EMOJI{joy} {1F602}
+ \EMOJI{joystick} {1F579}
+ \EMOJI{jp} {1F1EF 1F1F5}
+ \EMOJI{kaaba} {1F54B}
+ \EMOJI{kazakhstan} {1F1F0 1F1FF}
+ \EMOJI{kenya} {1F1F0 1F1EA}
+ \EMOJI{key} {1F511}
+ \EMOJI{keyboard} {2328}
+ \EMOJI{keycap-ten} {1F51F}
+ \EMOJI{kick-scooter} {1F6F4}
+ \EMOJI{kimono} {1F458}
+ \EMOJI{kiribati} {1F1F0 1F1EE}
+ \EMOJI{kiss} {1F48B}
+ \EMOJI{kissing-cat} {1F63D}
+ \EMOJI{kissing-closed-eyes} {1F61A}
+ \EMOJI{kissing-heart} {1F618}
+ \EMOJI{kissing-smiling-eyes} {1F619}
+ \EMOJI{kissing} {1F617}
+ \EMOJI{kiwi-fruit} {1F95D}
+ \EMOJI{knife} {1F52A}
+ \EMOJI{koala} {1F428}
+ \EMOJI{koko} {1F201}
+ \EMOJI{kosovo} {1F1FD 1F1F0}
+ \EMOJI{kr} {1F1F0 1F1F7}
+ \EMOJI{kuwait} {1F1F0 1F1FC}
+ \EMOJI{kyrgyzstan} {1F1F0 1F1EC}
+ \EMOJI{label} {1F3F7}
+ \EMOJI{lantern} {1F3EE}
+ \EMOJI{laos} {1F1F1 1F1E6}
+ \EMOJI{large-blue-circle} {1F535}
+ \EMOJI{large-blue-diamond} {1F537}
+ \EMOJI{large-orange-diamond} {1F536}
+ \EMOJI{last-quarter-moon-with-face} {1F31C}
+ \EMOJI{last-quarter-moon} {1F317}
+ \EMOJI{latin-cross} {271D}
+ \EMOJI{latvia} {1F1F1 1F1FB}
+ \EMOJI{laughing} {1F606}
+ \EMOJI{leaves} {1F343}
+ \EMOJI{lebanon} {1F1F1 1F1E7}
+ \EMOJI{ledger} {1F4D2}
+ \EMOJI{left-luggage} {1F6C5}
+ \EMOJI{left-right-arrow} {2194}
+ \EMOJI{leftwards-arrow-with-hook} {21A9}
+ \EMOJI{lemon} {1F34B}
+ \EMOJI{leo} {264C}
+ \EMOJI{leopard} {1F406}
+ \EMOJI{lesotho} {1F1F1 1F1F8}
+ \EMOJI{level-slider} {1F39A}
+ \EMOJI{liberia} {1F1F1 1F1F7}
+ \EMOJI{libra} {264E}
+ \EMOJI{libya} {1F1F1 1F1FE}
+ \EMOJI{liechtenstein} {1F1F1 1F1EE}
+ \EMOJI{light-rail} {1F688}
+ \EMOJI{link} {1F517}
+ \EMOJI{lion} {1F981}
+ \EMOJI{lips} {1F444}
+ \EMOJI{lipstick} {1F484}
+ \EMOJI{lithuania} {1F1F1 1F1F9}
+ \EMOJI{lizard} {1F98E}
+ \EMOJI{lock-with-ink-pen} {1F50F}
+ \EMOJI{lock} {1F512}
+ \EMOJI{lollipop} {1F36D}
+ \EMOJI{loop} {27BF}
+ \EMOJI{loud-sound} {1F50A}
+ \EMOJI{loudspeaker} {1F4E2}
+ \EMOJI{love-hotel} {1F3E9}
+ \EMOJI{love-letter} {1F48C}
+ \EMOJI{low-brightness} {1F505}
+ \EMOJI{luxembourg} {1F1F1 1F1FA}
+ \EMOJI{lying-face} {1F925}
+ \EMOJI{m} {24C2}
+ \EMOJI{macau} {1F1F2 1F1F4}
+ \EMOJI{macedonia} {1F1F2 1F1F0}
+ \EMOJI{madagascar} {1F1F2 1F1EC}
+ \EMOJI{mag-right} {1F50E}
+ \EMOJI{mag} {1F50D}
+ \EMOJI{mahjong} {1F004}
+ \EMOJI{mailbox-closed} {1F4EA}
+ \EMOJI{mailbox-with-mail} {1F4EC}
+ \EMOJI{mailbox-with-no-mail} {1F4ED}
+ \EMOJI{mailbox} {1F4EB}
+ \EMOJI{malawi} {1F1F2 1F1FC}
+ \EMOJI{malaysia} {1F1F2 1F1FE}
+ \EMOJI{maldives} {1F1F2 1F1FB}
+ \EMOJI{male-detective} {1F575}
+ \EMOJI{mali} {1F1F2 1F1F1}
+ \EMOJI{malta} {1F1F2 1F1F9}
+ \EMOJI{man-artist} {1F468 200D 1F3A8}
+ \EMOJI{man-astronaut} {1F468 200D 1F680}
+ \EMOJI{man-cartwheeling} {1F938 200D 2642}
+ \EMOJI{man-cook} {1F468 200D 1F373}
+ \EMOJI{man-dancing} {1F57A}
+ \EMOJI{man-facepalming} {1F926 200D 2642}
+ \EMOJI{man-factory-worker} {1F468 200D 1F3ED}
+ \EMOJI{man-farmer} {1F468 200D 1F33E}
+ \EMOJI{man-firefighter} {1F468 200D 1F692}
+ \EMOJI{man-health-worker} {1F468 200D 2695}
+ \EMOJI{man-in-tuxedo} {1F935}
+ \EMOJI{man-judge} {1F468 200D 2696}
+ \EMOJI{man-juggling} {1F939 200D 2642}
+ \EMOJI{man-mechanic} {1F468 200D 1F527}
+ \EMOJI{man-office-worker} {1F468 200D 1F4BC}
+ \EMOJI{man-pilot} {1F468 200D 2708}
+ \EMOJI{man-playing-handball} {1F93E 200D 2642}
+ \EMOJI{man-playing-water-polo} {1F93D 200D 2642}
+ \EMOJI{man-scientist} {1F468 200D 1F52C}
+ \EMOJI{man-shrugging} {1F937 200D 2642}
+ \EMOJI{man-singer} {1F468 200D 1F3A4}
+ \EMOJI{man-student} {1F468 200D 1F393}
+ \EMOJI{man-teacher} {1F468 200D 1F3EB}
+ \EMOJI{man-technologist} {1F468 200D 1F4BB}
+ \EMOJI{man-with-gua-pi-mao} {1F472}
+ \EMOJI{man-with-turban} {1F473}
+ \EMOJI{man} {1F468}
+ \EMOJI{mandarin} {1F34A}
+ \EMOJI{mans-shoe} {1F45E}
+ \EMOJI{mantelpiece-clock} {1F570}
+ \EMOJI{maple-leaf} {1F341}
+ \EMOJI{marshall-islands} {1F1F2 1F1ED}
+ \EMOJI{martial-arts-uniform} {1F94B}
+ \EMOJI{martinique} {1F1F2 1F1F6}
+ \EMOJI{mask} {1F637}
+ \EMOJI{massage-man} {1F486 200D 2642}
+ \EMOJI{massage-woman} {1F486}
+ \EMOJI{massage} {1F486}
+ \EMOJI{mauritania} {1F1F2 1F1F7}
+ \EMOJI{mauritius} {1F1F2 1F1FA}
+ \EMOJI{mayotte} {1F1FE 1F1F9}
+ \EMOJI{meat-on-bone} {1F356}
+ \EMOJI{medal-military} {1F396}
+ \EMOJI{medal-sports} {1F3C5}
+ \EMOJI{mega} {1F4E3}
+ \EMOJI{melon} {1F348}
+ \EMOJI{memo} {1F4DD}
+ \EMOJI{men-wrestling} {1F93C 200D 2642}
+ \EMOJI{menorah} {1F54E}
+ \EMOJI{mens} {1F6B9}
+ \EMOJI{metal} {1F918}
+ \EMOJI{metro} {1F687}
+ \EMOJI{mexico} {1F1F2 1F1FD}
+ \EMOJI{micronesia} {1F1EB 1F1F2}
+ \EMOJI{microphone} {1F3A4}
+ \EMOJI{microscope} {1F52C}
+ \EMOJI{middle-finger} {1F595}
+ \EMOJI{milk-glass} {1F95B}
+ \EMOJI{milky-way} {1F30C}
+ \EMOJI{minibus} {1F690}
+ \EMOJI{minidisc} {1F4BD}
+ \EMOJI{mobile-phone-off} {1F4F4}
+ \EMOJI{moldova} {1F1F2 1F1E9}
+ \EMOJI{monaco} {1F1F2 1F1E8}
+ \EMOJI{money-mouth-face} {1F911}
+ \EMOJI{money-with-wings} {1F4B8}
+ \EMOJI{moneybag} {1F4B0}
+ \EMOJI{mongolia} {1F1F2 1F1F3}
+ \EMOJI{monkey-face} {1F435}
+ \EMOJI{monkey} {1F412}
+ \EMOJI{monorail} {1F69D}
+ \EMOJI{montenegro} {1F1F2 1F1EA}
+ \EMOJI{montserrat} {1F1F2 1F1F8}
+ \EMOJI{moon} {1F314}
+ \EMOJI{morocco} {1F1F2 1F1E6}
+ \EMOJI{mortar-board} {1F393}
+ \EMOJI{mosque} {1F54C}
+ \EMOJI{motor-boat} {1F6E5}
+ \EMOJI{motor-scooter} {1F6F5}
+ \EMOJI{motorcycle} {1F3CD}
+ \EMOJI{motorway} {1F6E3}
+ \EMOJI{mount-fuji} {1F5FB}
+ \EMOJI{mountain-bicyclist} {1F6B5}
+ \EMOJI{mountain-biking-man} {1F6B5}
+ \EMOJI{mountain-biking-woman} {1F6B5 200D 2640}
+ \EMOJI{mountain-cableway} {1F6A0}
+ \EMOJI{mountain-railway} {1F69E}
+ \EMOJI{mountain-snow} {1F3D4}
+ \EMOJI{mountain} {26F0}
+ \EMOJI{mouse} {1F42D}
+ \EMOJI{mouse2} {1F401}
+ \EMOJI{movie-camera} {1F3A5}
+ \EMOJI{moyai} {1F5FF}
+ \EMOJI{mozambique} {1F1F2 1F1FF}
+ \EMOJI{mrs-claus} {1F936}
+ \EMOJI{muscle} {1F4AA}
+ \EMOJI{mushroom} {1F344}
+ \EMOJI{musical-keyboard} {1F3B9}
+ \EMOJI{musical-note} {1F3B5}
+ \EMOJI{musical-score} {1F3BC}
+ \EMOJI{mute} {1F507}
+ \EMOJI{myanmar} {1F1F2 1F1F2}
+ \EMOJI{nail-care} {1F485}
+ \EMOJI{name-badge} {1F4DB}
+ \EMOJI{namibia} {1F1F3 1F1E6}
+ \EMOJI{national-park} {1F3DE}
+ \EMOJI{nauru} {1F1F3 1F1F7}
+ \EMOJI{nauseated-face} {1F922}
+ \EMOJI{necktie} {1F454}
+ \EMOJI{negative-squared-cross-mark} {274E}
+ \EMOJI{nepal} {1F1F3 1F1F5}
+ \EMOJI{nerd-face} {1F913}
+ \EMOJI{netherlands} {1F1F3 1F1F1}
+ \EMOJI{neutral-face} {1F610}
+ \EMOJI{new-caledonia} {1F1F3 1F1E8}
+ \EMOJI{new-moon-with-face} {1F31A}
+ \EMOJI{new-moon} {1F311}
+ \EMOJI{new-zealand} {1F1F3 1F1FF}
+ \EMOJI{new} {1F195}
+ \EMOJI{newspaper-roll} {1F5DE}
+ \EMOJI{newspaper} {1F4F0}
+ \EMOJI{next-track-button} {23ED}
+ \EMOJI{ng-man} {1F645 200D 2642}
+ \EMOJI{ng-woman} {1F645}
+ \EMOJI{ng} {1F196}
+ \EMOJI{nicaragua} {1F1F3 1F1EE}
+ \EMOJI{niger} {1F1F3 1F1EA}
+ \EMOJI{nigeria} {1F1F3 1F1EC}
+ \EMOJI{night-with-stars} {1F303}
+ \EMOJI{niue} {1F1F3 1F1FA}
+ \EMOJI{no-bell} {1F515}
+ \EMOJI{no-bicycles} {1F6B3}
+ \EMOJI{no-entry-sign} {1F6AB}
+ \EMOJI{no-entry} {26D4}
+ \EMOJI{no-good-man} {1F645 200D 2642}
+ \EMOJI{no-good-woman} {1F645}
+ \EMOJI{no-good} {1F645}
+ \EMOJI{no-mobile-phones} {1F4F5}
+ \EMOJI{no-mouth} {1F636}
+ \EMOJI{no-pedestrians} {1F6B7}
+ \EMOJI{no-smoking} {1F6AD}
+ \EMOJI{non-potable-water} {1F6B1}
+ \EMOJI{norfolk-island} {1F1F3 1F1EB}
+ \EMOJI{north-korea} {1F1F0 1F1F5}
+ \EMOJI{northern-mariana-islands} {1F1F2 1F1F5}
+ \EMOJI{norway} {1F1F3 1F1F4}
+ \EMOJI{nose} {1F443}
+ \EMOJI{notebook-with-decorative-cover} {1F4D4}
+ \EMOJI{notebook} {1F4D3}
+ \EMOJI{notes} {1F3B6}
+ \EMOJI{nut-and-bolt} {1F529}
+ \EMOJI{o} {2B55}
+ \EMOJI{o2} {1F17E}
+ \EMOJI{ocean} {1F30A}
+ \EMOJI{octopus} {1F419}
+ \EMOJI{oden} {1F362}
+ \EMOJI{office} {1F3E2}
+ \EMOJI{oil-drum} {1F6E2}
+ \EMOJI{ok-hand} {1F44C}
+ \EMOJI{ok-man} {1F646 200D 2642}
+ \EMOJI{ok-woman} {1F646}
+ \EMOJI{ok} {1F197}
+ \EMOJI{old-key} {1F5DD}
+ \EMOJI{older-man} {1F474}
+ \EMOJI{older-woman} {1F475}
+ \EMOJI{om} {1F549}
+ \EMOJI{oman} {1F1F4 1F1F2}
+ \EMOJI{on} {1F51B}
+ \EMOJI{oncoming-automobile} {1F698}
+ \EMOJI{oncoming-bus} {1F68D}
+ \EMOJI{oncoming-police-car} {1F694}
+ \EMOJI{oncoming-taxi} {1F696}
+ \EMOJI{open-book} {1F4D6}
+ \EMOJI{open-file-folder} {1F4C2}
+ \EMOJI{open-hands} {1F450}
+ \EMOJI{open-mouth} {1F62E}
+ \EMOJI{open-umbrella} {2602}
+ \EMOJI{ophiuchus} {26CE}
+ \EMOJI{orange-book} {1F4D9}
+ \EMOJI{orange} {1F34A}
+ \EMOJI{orthodox-cross} {2626}
+ \EMOJI{outbox-tray} {1F4E4}
+ \EMOJI{owl} {1F989}
+ \EMOJI{ox} {1F402}
+ \EMOJI{package} {1F4E6}
+ \EMOJI{page-facing-up} {1F4C4}
+ \EMOJI{page-with-curl} {1F4C3}
+ \EMOJI{pager} {1F4DF}
+ \EMOJI{paintbrush} {1F58C}
+ \EMOJI{pakistan} {1F1F5 1F1F0}
+ \EMOJI{palau} {1F1F5 1F1FC}
+ \EMOJI{palestinian-territories} {1F1F5 1F1F8}
+ \EMOJI{palm-tree} {1F334}
+ \EMOJI{panama} {1F1F5 1F1E6}
+ \EMOJI{pancakes} {1F95E}
+ \EMOJI{panda-face} {1F43C}
+ \EMOJI{paperclip} {1F4CE}
+ \EMOJI{paperclips} {1F587}
+ \EMOJI{papua-new-guinea} {1F1F5 1F1EC}
+ \EMOJI{paraguay} {1F1F5 1F1FE}
+ \EMOJI{parasol-on-ground} {26F1}
+ \EMOJI{parking} {1F17F}
+ \EMOJI{part-alternation-mark} {303D}
+ \EMOJI{partly-sunny} {26C5}
+ \EMOJI{passenger-ship} {1F6F3}
+ \EMOJI{passport-control} {1F6C2}
+ \EMOJI{pause-button} {23F8}
+ \EMOJI{paw-prints} {1F43E}
+ \EMOJI{peace-symbol} {262E}
+ \EMOJI{peach} {1F351}
+ \EMOJI{peanuts} {1F95C}
+ \EMOJI{pear} {1F350}
+ \EMOJI{pen} {1F58A}
+ \EMOJI{pencil} {1F4DD}
+ \EMOJI{pencil2} {270F}
+ \EMOJI{penguin} {1F427}
+ \EMOJI{pensive} {1F614}
+ \EMOJI{performing-arts} {1F3AD}
+ \EMOJI{persevere} {1F623}
+ \EMOJI{person-fencing} {1F93A}
+ \EMOJI{person-frowning} {1F64D}
+ \EMOJI{person-with-blond-hair} {1F471}
+ \EMOJI{person-with-pouting-face} {1F64E}
+ \EMOJI{peru} {1F1F5 1F1EA}
+ \EMOJI{philippines} {1F1F5 1F1ED}
+ \EMOJI{phone} {260E}
+ \EMOJI{pick} {26CF}
+ \EMOJI{pig-nose} {1F43D}
+ \EMOJI{pig} {1F437}
+ \EMOJI{pig2} {1F416}
+ \EMOJI{pill} {1F48A}
+ \EMOJI{pineapple} {1F34D}
+ \EMOJI{ping-pong} {1F3D3}
+ \EMOJI{pisces} {2653}
+ \EMOJI{pitcairn-islands} {1F1F5 1F1F3}
+ \EMOJI{pizza} {1F355}
+ \EMOJI{place-of-worship} {1F6D0}
+ \EMOJI{plate-with-cutlery} {1F37D}
+ \EMOJI{play-or-pause-button} {23EF}
+ \EMOJI{point-down} {1F447}
+ \EMOJI{point-left} {1F448}
+ \EMOJI{point-right} {1F449}
+ \EMOJI{point-up-2} {1F446}
+ \EMOJI{point-up} {261D}
+ \EMOJI{poland} {1F1F5 1F1F1}
+ \EMOJI{police-car} {1F693}
+ \EMOJI{policeman} {1F46E}
+ \EMOJI{policewoman} {1F46E 200D 2640}
+ \EMOJI{poodle} {1F429}
+ \EMOJI{poop} {1F4A9}
+ \EMOJI{popcorn} {1F37F}
+ \EMOJI{portugal} {1F1F5 1F1F9}
+ \EMOJI{post-office} {1F3E3}
+ \EMOJI{postal-horn} {1F4EF}
+ \EMOJI{postbox} {1F4EE}
+ \EMOJI{potable-water} {1F6B0}
+ \EMOJI{potato} {1F954}
+ \EMOJI{pouch} {1F45D}
+ \EMOJI{poultry-leg} {1F357}
+ \EMOJI{pound} {1F4B7}
+ \EMOJI{pout} {1F621}
+ \EMOJI{pouting-cat} {1F63E}
+ \EMOJI{pouting-man} {1F64E 200D 2642}
+ \EMOJI{pouting-woman} {1F64E}
+ \EMOJI{pray} {1F64F}
+ \EMOJI{prayer-beads} {1F4FF}
+ \EMOJI{pregnant-woman} {1F930}
+ \EMOJI{previous-track-button} {23EE}
+ \EMOJI{prince} {1F934}
+ \EMOJI{princess} {1F478}
+ \EMOJI{printer} {1F5A8}
+ \EMOJI{puerto-rico} {1F1F5 1F1F7}
+ \EMOJI{punch} {1F44A}
+ \EMOJI{purple-heart} {1F49C}
+ \EMOJI{purse} {1F45B}
+ \EMOJI{pushpin} {1F4CC}
+ \EMOJI{put-litter-in-its-place} {1F6AE}
+ \EMOJI{qatar} {1F1F6 1F1E6}
+ \EMOJI{question} {2753}
+ \EMOJI{rabbit} {1F430}
+ \EMOJI{rabbit2} {1F407}
+ \EMOJI{racehorse} {1F40E}
+ \EMOJI{racing-car} {1F3CE}
+ \EMOJI{radio-button} {1F518}
+ \EMOJI{radio} {1F4FB}
+ \EMOJI{radioactive} {2622}
+ \EMOJI{rage} {1F621}
+ \EMOJI{railway-car} {1F683}
+ \EMOJI{railway-track} {1F6E4}
+ \EMOJI{rainbow-flag} {1F3F3 200D 1F308}
+ \EMOJI{rainbow} {1F308}
+ \EMOJI{raised-back-of-hand} {1F91A}
+ \EMOJI{raised-hand-with-fingers-splayed} {1F590}
+ \EMOJI{raised-hand} {270B}
+ \EMOJI{raised-hands} {1F64C}
+ \EMOJI{raising-hand-man} {1F64B 200D 2642}
+ \EMOJI{raising-hand-woman} {1F64B}
+ \EMOJI{raising-hand} {1F64B}
+ \EMOJI{ram} {1F40F}
+ \EMOJI{ramen} {1F35C}
+ \EMOJI{rat} {1F400}
+ \EMOJI{record-button} {23FA}
+ \EMOJI{recycle} {267B}
+ \EMOJI{red-car} {1F697}
+ \EMOJI{red-circle} {1F534}
+ \EMOJI{registered} {0AE}
+ \EMOJI{relaxed} {263A}
+ \EMOJI{relieved} {1F60C}
+ \EMOJI{reminder-ribbon} {1F397}
+ \EMOJI{repeat-one} {1F502}
+ \EMOJI{repeat} {1F501}
+ \EMOJI{rescue-worker-helmet} {26D1}
+ \EMOJI{restroom} {1F6BB}
+ \EMOJI{reunion} {1F1F7 1F1EA}
+ \EMOJI{revolving-hearts} {1F49E}
+ \EMOJI{rewind} {23EA}
+ \EMOJI{rhinoceros} {1F98F}
+ \EMOJI{ribbon} {1F380}
+ \EMOJI{rice-ball} {1F359}
+ \EMOJI{rice-cracker} {1F358}
+ \EMOJI{rice-scene} {1F391}
+ \EMOJI{rice} {1F35A}
+ \EMOJI{right-anger-bubble} {1F5EF}
+ \EMOJI{ring} {1F48D}
+ \EMOJI{robot} {1F916}
+ \EMOJI{rocket} {1F680}
+ \EMOJI{rofl} {1F923}
+ \EMOJI{roll-eyes} {1F644}
+ \EMOJI{roller-coaster} {1F3A2}
+ \EMOJI{romania} {1F1F7 1F1F4}
+ \EMOJI{rooster} {1F413}
+ \EMOJI{rose} {1F339}
+ \EMOJI{rosette} {1F3F5}
+ \EMOJI{rotating-light} {1F6A8}
+ \EMOJI{round-pushpin} {1F4CD}
+ \EMOJI{rowboat} {1F6A3}
+ \EMOJI{rowing-man} {1F6A3}
+ \EMOJI{rowing-woman} {1F6A3 200D 2640}
+ \EMOJI{ru} {1F1F7 1F1FA}
+ \EMOJI{rugby-football} {1F3C9}
+ \EMOJI{runner} {1F3C3}
+ \EMOJI{running-man} {1F3C3}
+ \EMOJI{running-shirt-with-sash} {1F3BD}
+ \EMOJI{running-woman} {1F3C3 200D 2640}
+ \EMOJI{running} {1F3C3}
+ \EMOJI{rwanda} {1F1F7 1F1FC}
+ \EMOJI{sa} {1F202}
+ \EMOJI{sagittarius} {2650}
+ \EMOJI{sailboat} {26F5}
+ \EMOJI{sake} {1F376}
+ \EMOJI{samoa} {1F1FC 1F1F8}
+ \EMOJI{san-marino} {1F1F8 1F1F2}
+ \EMOJI{sandal} {1F461}
+ \EMOJI{santa} {1F385}
+ \EMOJI{sao-tome-principe} {1F1F8 1F1F9}
+ \EMOJI{sassy-man} {1F481 200D 2642}
+ \EMOJI{sassy-woman} {1F481}
+ \EMOJI{satellite} {1F4E1}
+ \EMOJI{satisfied} {1F606}
+ \EMOJI{saudi-arabia} {1F1F8 1F1E6}
+ \EMOJI{saxophone} {1F3B7}
+ \EMOJI{school-satchel} {1F392}
+ \EMOJI{school} {1F3EB}
+ \EMOJI{scissors} {2702}
+ \EMOJI{scorpion} {1F982}
+ \EMOJI{scorpius} {264F}
+ \EMOJI{scream-cat} {1F640}
+ \EMOJI{scream} {1F631}
+ \EMOJI{scroll} {1F4DC}
+ \EMOJI{seat} {1F4BA}
+ \EMOJI{secret} {3299}
+ \EMOJI{see-no-evil} {1F648}
+ \EMOJI{seedling} {1F331}
+ \EMOJI{selfie} {1F933}
+ \EMOJI{senegal} {1F1F8 1F1F3}
+ \EMOJI{serbia} {1F1F7 1F1F8}
+ \EMOJI{seychelles} {1F1F8 1F1E8}
+ \EMOJI{shallow-pan-of-food} {1F958}
+ \EMOJI{shamrock} {2618}
+ \EMOJI{shark} {1F988}
+ \EMOJI{shaved-ice} {1F367}
+ \EMOJI{sheep} {1F411}
+ \EMOJI{shell} {1F41A}
+ \EMOJI{shield} {1F6E1}
+ \EMOJI{shinto-shrine} {26E9}
+ \EMOJI{ship} {1F6A2}
+ \EMOJI{shirt} {1F455}
+ \EMOJI{shit} {1F4A9}
+ \EMOJI{shoe} {1F45E}
+ \EMOJI{shopping-cart} {1F6D2}
+ \EMOJI{shopping} {1F6CD}
+ \EMOJI{shower} {1F6BF}
+ \EMOJI{shrimp} {1F990}
+ \EMOJI{sierra-leone} {1F1F8 1F1F1}
+ \EMOJI{signal-strength} {1F4F6}
+ \EMOJI{singapore} {1F1F8 1F1EC}
+ \EMOJI{sint-maarten} {1F1F8 1F1FD}
+ \EMOJI{six-pointed-star} {1F52F}
+ \EMOJI{ski} {1F3BF}
+ \EMOJI{skier} {26F7}
+ \EMOJI{skull-and-crossbones} {2620}
+ \EMOJI{skull} {1F480}
+ \EMOJI{sleeping-bed} {1F6CC}
+ \EMOJI{sleeping} {1F634}
+ \EMOJI{sleepy} {1F62A}
+ \EMOJI{slightly-frowning-face} {1F641}
+ \EMOJI{slightly-smiling-face} {1F642}
+ \EMOJI{slot-machine} {1F3B0}
+ \EMOJI{slovakia} {1F1F8 1F1F0}
+ \EMOJI{slovenia} {1F1F8 1F1EE}
+ \EMOJI{small-airplane} {1F6E9}
+ \EMOJI{small-blue-diamond} {1F539}
+ \EMOJI{small-orange-diamond} {1F538}
+ \EMOJI{small-red-triangle-down} {1F53B}
+ \EMOJI{small-red-triangle} {1F53A}
+ \EMOJI{smile-cat} {1F638}
+ \EMOJI{smile} {1F604}
+ \EMOJI{smiley-cat} {1F63A}
+ \EMOJI{smiley} {1F603}
+ \EMOJI{smiling-imp} {1F608}
+ \EMOJI{smirk-cat} {1F63C}
+ \EMOJI{smirk} {1F60F}
+ \EMOJI{smoking} {1F6AC}
+ \EMOJI{snail} {1F40C}
+ \EMOJI{snake} {1F40D}
+ \EMOJI{sneezing-face} {1F927}
+ \EMOJI{snowboarder} {1F3C2}
+ \EMOJI{snowflake} {2744}
+ \EMOJI{snowman-with-snow} {2603}
+ \EMOJI{snowman} {26C4}
+ \EMOJI{sob} {1F62D}
+ \EMOJI{soccer} {26BD}
+ \EMOJI{solomon-islands} {1F1F8 1F1E7}
+ \EMOJI{somalia} {1F1F8 1F1F4}
+ \EMOJI{soon} {1F51C}
+ \EMOJI{sos} {1F198}
+ \EMOJI{sound} {1F509}
+ \EMOJI{south-africa} {1F1FF 1F1E6}
+ \EMOJI{south-georgia-south-sandwich-islands} {1F1EC 1F1F8}
+ \EMOJI{south-sudan} {1F1F8 1F1F8}
+ \EMOJI{space-invader} {1F47E}
+ \EMOJI{spades} {2660}
+ \EMOJI{spaghetti} {1F35D}
+ \EMOJI{sparkle} {2747}
+ \EMOJI{sparkler} {1F387}
+ \EMOJI{sparkles} {2728}
+ \EMOJI{sparkling-heart} {1F496}
+ \EMOJI{speak-no-evil} {1F64A}
+ \EMOJI{speaker} {1F508}
+ \EMOJI{speaking-head} {1F5E3}
+ \EMOJI{speech-balloon} {1F4AC}
+ \EMOJI{speedboat} {1F6A4}
+ \EMOJI{spider-web} {1F578}
+ \EMOJI{spider} {1F577}
+ \EMOJI{spiral-calendar} {1F5D3}
+ \EMOJI{spiral-notepad} {1F5D2}
+ \EMOJI{spoon} {1F944}
+ \EMOJI{squid} {1F991}
+ \EMOJI{sri-lanka} {1F1F1 1F1F0}
+ \EMOJI{st-barthelemy} {1F1E7 1F1F1}
+ \EMOJI{st-helena} {1F1F8 1F1ED}
+ \EMOJI{st-kitts-nevis} {1F1F0 1F1F3}
+ \EMOJI{st-lucia} {1F1F1 1F1E8}
+ \EMOJI{st-pierre-miquelon} {1F1F5 1F1F2}
+ \EMOJI{st-vincent-grenadines} {1F1FB 1F1E8}
+ \EMOJI{stadium} {1F3DF}
+ \EMOJI{star-and-crescent} {262A}
+ \EMOJI{star-of-david} {2721}
+ \EMOJI{star} {2B50}
+ \EMOJI{star2} {1F31F}
+ \EMOJI{stars} {1F320}
+ \EMOJI{station} {1F689}
+ \EMOJI{statue-of-liberty} {1F5FD}
+ \EMOJI{steam-locomotive} {1F682}
+ \EMOJI{stew} {1F372}
+ \EMOJI{stop-button} {23F9}
+ \EMOJI{stop-sign} {1F6D1}
+ \EMOJI{stopwatch} {23F1}
+ \EMOJI{straight-ruler} {1F4CF}
+ \EMOJI{strawberry} {1F353}
+ \EMOJI{stuck-out-tongue-closed-eyes} {1F61D}
+ \EMOJI{stuck-out-tongue-winking-eye} {1F61C}
+ \EMOJI{stuck-out-tongue} {1F61B}
+ \EMOJI{studio-microphone} {1F399}
+ \EMOJI{stuffed-flatbread} {1F959}
+ \EMOJI{sudan} {1F1F8 1F1E9}
+ \EMOJI{sun-behind-large-cloud} {1F325}
+ \EMOJI{sun-behind-rain-cloud} {1F326}
+ \EMOJI{sun-behind-small-cloud} {1F324}
+ \EMOJI{sun-with-face} {1F31E}
+ \EMOJI{sunflower} {1F33B}
+ \EMOJI{sunglasses} {1F60E}
+ \EMOJI{sunny} {2600}
+ \EMOJI{sunrise-over-mountains} {1F304}
+ \EMOJI{sunrise} {1F305}
+ \EMOJI{surfer} {1F3C4}
+ \EMOJI{surfing-man} {1F3C4}
+ \EMOJI{surfing-woman} {1F3C4 200D 2640}
+ \EMOJI{suriname} {1F1F8 1F1F7}
+ \EMOJI{sushi} {1F363}
+ \EMOJI{suspension-railway} {1F69F}
+ \EMOJI{swaziland} {1F1F8 1F1FF}
+ \EMOJI{sweat-drops} {1F4A6}
+ \EMOJI{sweat-smile} {1F605}
+ \EMOJI{sweat} {1F613}
+ \EMOJI{sweden} {1F1F8 1F1EA}
+ \EMOJI{sweet-potato} {1F360}
+ \EMOJI{swimmer} {1F3CA}
+ \EMOJI{swimming-man} {1F3CA}
+ \EMOJI{swimming-woman} {1F3CA 200D 2640}
+ \EMOJI{switzerland} {1F1E8 1F1ED}
+ \EMOJI{symbols} {1F523}
+ \EMOJI{synagogue} {1F54D}
+ \EMOJI{syria} {1F1F8 1F1FE}
+ \EMOJI{syringe} {1F489}
+ \EMOJI{taco} {1F32E}
+ \EMOJI{tada} {1F389}
+ \EMOJI{taiwan} {1F1F9 1F1FC}
+ \EMOJI{tajikistan} {1F1F9 1F1EF}
+ \EMOJI{tanabata-tree} {1F38B}
+ \EMOJI{tangerine} {1F34A}
+ \EMOJI{tanzania} {1F1F9 1F1FF}
+ \EMOJI{taurus} {2649}
+ \EMOJI{taxi} {1F695}
+ \EMOJI{tea} {1F375}
+ \EMOJI{telephone-receiver} {1F4DE}
+ \EMOJI{telephone} {260E}
+ \EMOJI{telescope} {1F52D}
+ \EMOJI{tennis} {1F3BE}
+ \EMOJI{tent} {26FA}
+ \EMOJI{thailand} {1F1F9 1F1ED}
+ \EMOJI{thermometer} {1F321}
+ \EMOJI{thinking} {1F914}
+ \EMOJI{thought-balloon} {1F4AD}
+ \EMOJI{thumbsdown} {1F44E}
+ \EMOJI{thumbsup} {1F44D}
+ \EMOJI{ticket} {1F3AB}
+ \EMOJI{tickets} {1F39F}
+ \EMOJI{tiger} {1F42F}
+ \EMOJI{tiger2} {1F405}
+ \EMOJI{timer-clock} {23F2}
+ \EMOJI{timor-leste} {1F1F9 1F1F1}
+ \EMOJI{tipping-hand-man} {1F481 200D 2642}
+ \EMOJI{tipping-hand-woman} {1F481}
+ \EMOJI{tired-face} {1F62B}
+ \EMOJI{tm} {2122}
+ \EMOJI{togo} {1F1F9 1F1EC}
+ \EMOJI{toilet} {1F6BD}
+ \EMOJI{tokelau} {1F1F9 1F1F0}
+ \EMOJI{tokyo-tower} {1F5FC}
+ \EMOJI{tomato} {1F345}
+ \EMOJI{tonga} {1F1F9 1F1F4}
+ \EMOJI{tongue} {1F445}
+ \EMOJI{top} {1F51D}
+ \EMOJI{tophat} {1F3A9}
+ \EMOJI{tornado} {1F32A}
+ \EMOJI{tr} {1F1F9 1F1F7}
+ \EMOJI{trackball} {1F5B2}
+ \EMOJI{tractor} {1F69C}
+ \EMOJI{traffic-light} {1F6A5}
+ \EMOJI{train} {1F68B}
+ \EMOJI{train2} {1F686}
+ \EMOJI{tram} {1F68A}
+ \EMOJI{triangular-flag-on-post} {1F6A9}
+ \EMOJI{triangular-ruler} {1F4D0}
+ \EMOJI{trident} {1F531}
+ \EMOJI{trinidad-tobago} {1F1F9 1F1F9}
+ \EMOJI{triumph} {1F624}
+ \EMOJI{trolleybus} {1F68E}
+ \EMOJI{trophy} {1F3C6}
+ \EMOJI{tropical-drink} {1F379}
+ \EMOJI{tropical-fish} {1F420}
+ \EMOJI{truck} {1F69A}
+ \EMOJI{trumpet} {1F3BA}
+ \EMOJI{tshirt} {1F455}
+ \EMOJI{tulip} {1F337}
+ \EMOJI{tumbler-glass} {1F943}
+ \EMOJI{tunisia} {1F1F9 1F1F3}
+ \EMOJI{turkey} {1F983}
+ \EMOJI{turkmenistan} {1F1F9 1F1F2}
+ \EMOJI{turks-caicos-islands} {1F1F9 1F1E8}
+ \EMOJI{turtle} {1F422}
+ \EMOJI{tuvalu} {1F1F9 1F1FB}
+ \EMOJI{tv} {1F4FA}
+ \EMOJI{twisted-rightwards-arrows} {1F500}
+ \EMOJI{two-hearts} {1F495}
+ \EMOJI{two-men-holding-hands} {1F46C}
+ \EMOJI{two-women-holding-hands} {1F46D}
+ \EMOJI{u5272} {1F239}
+ \EMOJI{u5408} {1F234}
+ \EMOJI{u55b6} {1F23A}
+ \EMOJI{u6307} {1F22F}
+ \EMOJI{u6708} {1F237}
+ \EMOJI{u6709} {1F236}
+ \EMOJI{u6e80} {1F235}
+ \EMOJI{u7121} {1F21A}
+ \EMOJI{u7533} {1F238}
+ \EMOJI{u7981} {1F232}
+ \EMOJI{u7a7a} {1F233}
+ \EMOJI{uganda} {1F1FA 1F1EC}
+ \EMOJI{uk} {1F1EC 1F1E7}
+ \EMOJI{ukraine} {1F1FA 1F1E6}
+ \EMOJI{umbrella} {2614}
+ \EMOJI{unamused} {1F612}
+ \EMOJI{underage} {1F51E}
+ \EMOJI{unicorn} {1F984}
+ \EMOJI{united-arab-emirates} {1F1E6 1F1EA}
+ \EMOJI{unlock} {1F513}
+ \EMOJI{up} {1F199}
+ \EMOJI{upside-down-face} {1F643}
+ \EMOJI{uruguay} {1F1FA 1F1FE}
+ \EMOJI{us-virgin-islands} {1F1FB 1F1EE}
+ \EMOJI{us} {1F1FA 1F1F8}
+ \EMOJI{uzbekistan} {1F1FA 1F1FF}
+ \EMOJI{v} {270C}
+ \EMOJI{vanuatu} {1F1FB 1F1FA}
+ \EMOJI{vatican-city} {1F1FB 1F1E6}
+ \EMOJI{venezuela} {1F1FB 1F1EA}
+ \EMOJI{vertical-traffic-light} {1F6A6}
+ \EMOJI{vhs} {1F4FC}
+ \EMOJI{vibration-mode} {1F4F3}
+ \EMOJI{video-camera} {1F4F9}
+ \EMOJI{video-game} {1F3AE}
+ \EMOJI{vietnam} {1F1FB 1F1F3}
+ \EMOJI{violin} {1F3BB}
+ \EMOJI{virgo} {264D}
+ \EMOJI{volcano} {1F30B}
+ \EMOJI{volleyball} {1F3D0}
+ \EMOJI{vs} {1F19A}
+ \EMOJI{vulcan-salute} {1F596}
+ \EMOJI{walking-man} {1F6B6}
+ \EMOJI{walking-woman} {1F6B6 200D 2640}
+ \EMOJI{walking} {1F6B6}
+ \EMOJI{wallis-futuna} {1F1FC 1F1EB}
+ \EMOJI{waning-crescent-moon} {1F318}
+ \EMOJI{waning-gibbous-moon} {1F316}
+ \EMOJI{warning} {26A0}
+ \EMOJI{wastebasket} {1F5D1}
+ \EMOJI{watch} {231A}
+ \EMOJI{water-buffalo} {1F403}
+ \EMOJI{watermelon} {1F349}
+ \EMOJI{wave} {1F44B}
+ \EMOJI{wavy-dash} {3030}
+ \EMOJI{waxing-crescent-moon} {1F312}
+ \EMOJI{waxing-gibbous-moon} {1F314}
+ \EMOJI{wc} {1F6BE}
+ \EMOJI{weary} {1F629}
+ \EMOJI{wedding} {1F492}
+ \EMOJI{weight-lifting-man} {1F3CB}
+ \EMOJI{weight-lifting-woman} {1F3CB 200D 2640}
+ \EMOJI{western-sahara} {1F1EA 1F1ED}
+ \EMOJI{whale} {1F433}
+ \EMOJI{whale2} {1F40B}
+ \EMOJI{wheel-of-dharma} {2638}
+ \EMOJI{wheelchair} {267F}
+ \EMOJI{white-check-mark} {2705}
+ \EMOJI{white-circle} {26AA}
+ \EMOJI{white-flag} {1F3F3}
+ \EMOJI{white-flower} {1F4AE}
+ \EMOJI{white-large-square} {2B1C}
+ \EMOJI{white-medium-small-square} {25FD}
+ \EMOJI{white-medium-square} {25FB}
+ \EMOJI{white-small-square} {25AB}
+ \EMOJI{white-square-button} {1F533}
+ \EMOJI{wilted-flower} {1F940}
+ \EMOJI{wind-chime} {1F390}
+ \EMOJI{wind-face} {1F32C}
+ \EMOJI{wine-glass} {1F377}
+ \EMOJI{wink} {1F609}
+ \EMOJI{wolf} {1F43A}
+ \EMOJI{woman-artist} {1F469 200D 1F3A8}
+ \EMOJI{woman-astronaut} {1F469 200D 1F680}
+ \EMOJI{woman-cartwheeling} {1F938 200D 2640}
+ \EMOJI{woman-cook} {1F469 200D 1F373}
+ \EMOJI{woman-facepalming} {1F926 200D 2640}
+ \EMOJI{woman-factory-worker} {1F469 200D 1F3ED}
+ \EMOJI{woman-farmer} {1F469 200D 1F33E}
+ \EMOJI{woman-firefighter} {1F469 200D 1F692}
+ \EMOJI{woman-health-worker} {1F469 200D 2695}
+ \EMOJI{woman-judge} {1F469 200D 2696}
+ \EMOJI{woman-juggling} {1F939 200D 2640}
+ \EMOJI{woman-mechanic} {1F469 200D 1F527}
+ \EMOJI{woman-office-worker} {1F469 200D 1F4BC}
+ \EMOJI{woman-pilot} {1F469 200D 2708}
+ \EMOJI{woman-playing-handball} {1F93E 200D 2640}
+ \EMOJI{woman-playing-water-polo} {1F93D 200D 2640}
+ \EMOJI{woman-scientist} {1F469 200D 1F52C}
+ \EMOJI{woman-shrugging} {1F937 200D 2640}
+ \EMOJI{woman-singer} {1F469 200D 1F3A4}
+ \EMOJI{woman-student} {1F469 200D 1F393}
+ \EMOJI{woman-teacher} {1F469 200D 1F3EB}
+ \EMOJI{woman-technologist} {1F469 200D 1F4BB}
+ \EMOJI{woman-with-turban} {1F473 200D 2640}
+ \EMOJI{woman} {1F469}
+ \EMOJI{womans-clothes} {1F45A}
+ \EMOJI{womans-hat} {1F452}
+ \EMOJI{women-wrestling} {1F93C 200D 2640}
+ \EMOJI{womens} {1F6BA}
+ \EMOJI{world-map} {1F5FA}
+ \EMOJI{worried} {1F61F}
+ \EMOJI{wrench} {1F527}
+ \EMOJI{writing-hand} {270D}
+ \EMOJI{x} {274C}
+ \EMOJI{yellow-heart} {1F49B}
+ \EMOJI{yemen} {1F1FE 1F1EA}
+ \EMOJI{yen} {1F4B4}
+ \EMOJI{yin-yang} {262F}
+ \EMOJI{yum} {1F60B}
+ \EMOJI{zambia} {1F1FF 1F1F2}
+ \EMOJI{zap} {26A1}
+ \EMOJI{zimbabwe} {1F1FF 1F1FC}
+ \EMOJI{zipper-mouth-face} {1F910}
+ \EMOJI{zzz} {1F4A4}
+\end{longtable}
+
+\endgroup
+
+\subsection{\emoji{construction} Known issues}
+
+The \pkg{emoji} package is highly experimental and may have a lot of bugs inevitably. For example:
+
+\begin{itemize}
+ \item Spacing around emoji may be abnormal
+ \item Complex emoji may not combine correctly in some fonts
+ \item The emoji cannot be copied from PDF
+\end{itemize}
+
+If you have any problems when using this package, please create an issue on GitHub or send
+an email to the author.
+
+\subsection{\emoji{pencil} Todo list}
+
+The following features may be added in the future:
+
+\begin{itemize}
+ \item Allow direct input of emoji
+ \item Support more names/aliases
+ \item Fulfill the Unicode emoji standard
+ \item Add options including default skin tones, genders, etc.
+ \item Support more fonts
+ \item Automatically fallback
+\end{itemize}
+
+\begin{thebibliography}{9}
+ \def\newblock{\\}
+ \small
+
+ \bibitem{utr51}
+ Unicode\textregistered{} Technical Standard \#51: Unicode Emoji
+ \newblock \url{https://www.unicode.org/reports/tr51/}
+
+ \bibitem{emojipedia}
+ \emoji{orange-book} Emojipedia --- \emoji{smiley} Home of Emoji Meanings
+ \emoji{information-desk-person}\emoji{ok-hand}\emoji{bamboo}\emoji{heart-eyes}
+ \newblock \url{https://emojipedia.org/}
+
+ \bibitem{noto-emoji}
+ Noto Color Emoji --- Google Noto Fonts
+ \newblock \url{https://www.google.com/get/noto/help/emoji/}
+
+ \bibitem{twemoji}
+ Twemoji
+ \newblock \url{https://twemoji.twitter.com/}
+
+ \bibitem{twemoji-colr}
+ Twemoji font in COLR/CPAL layered format\footnote{Before v0.3, it was based on EmojiOne.}
+ \newblock \url{https://github.com/mozilla/twemoji-colr}
+
+ \bibitem{emojione}
+ OpenType-SVG font of EmojiOne 2.3
+ \newblock \url{https://github.com/adobe-fonts/emojione-color}
+
+ \bibitem{joypixels}
+ JoyPixels\texttrademark{} --- Emoji as a Service (formerly EmojiOne)
+ \newblock \url{https://www.joypixels.com/}
+\end{thebibliography}
+
+\end{document}
diff --git a/macros/luatex/latex/emoji/emoji.sty b/macros/luatex/latex/emoji/emoji.sty
new file mode 100644
index 0000000000..d1d6561297
--- /dev/null
+++ b/macros/luatex/latex/emoji/emoji.sty
@@ -0,0 +1,1592 @@
+%%
+%% Copyright (C) 2020 by Xiangdong Zeng <xdzeng96@gmail.com>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Xiangdong Zeng.
+%%
+\NeedsTeXFormat{LaTeX2e}[2020/02/02]
+\ProvidesExplPackage{emoji}{2020/02/23}{0.1}{Emoji support in (Lua)LaTeX}
+
+\msg_new:nnn { emoji } { require-luatex }
+ { The~'emoji'~package~requires~LuaTeX. }
+\sys_if_engine_luatex:F
+ { \msg_critical:nn { emoji } { require-luatex } }
+
+\RequirePackage { fontspec }
+
+\NewDocumentCommand \setemojifont { m o }
+ {
+ \AtBeginDocument
+ {
+ \IfValueTF {#2}
+ { \emoji_set_font:nn {#1} {#2} }
+ { \emoji_set_font:n {#1} }
+ }
+ }
+
+\cs_new_protected:Npn \emoji_set_font:nn #1#2
+ { \setfontface \emoji_font: {#1} [ Renderer = Harfbuzz, #2 ] }
+\cs_new_protected:Npn \emoji_set_font:n #1
+ { \emoji_set_font:nn {#1} {} }
+
+\cs_new_protected:Npn \__emoji_detect_font:
+ {
+ \file_if_exist:nTF { /System/Library/Fonts/Apple~Color~Emoji.ttc }
+ { \emoji_set_font:n { Apple~Color~Emoji } }
+ {
+ \file_if_exist:nTF { \c_dollar_str WINDIR/Fonts/seguiemj.ttf }
+ { \emoji_set_font:n { Segoe~UI~Emoji } }
+ { \msg_warning:nn { emoji } { no-emoji-font } }
+ }
+ }
+
+\msg_new:nnn { emoji } { no-emoji-font }
+ {
+ It~seems~that~you~have~not~declare~an~emoji~font. \\
+ You~should~use~"\setemojifont"~to~set~a~font.
+ }
+
+\AtBeginDocument
+ {
+ \cs_if_exist_use:NF \emoji_font:
+ { \__emoji_detect_font: }
+ }
+
+\NewDocumentCommand \emoji { m }
+ {
+ % TODO: options
+ \emoji_if_name_exist:nTF {#1}
+ { \emoji_print:n {#1} }
+ { \msg_error:nnn { emoji } { emoji-not-exist } {#1} }
+ }
+
+\AtBeginDocument
+ {
+ \@ifpackageloaded { hyperref }
+ {
+ \pdfstringdefDisableCommands
+ {
+ \cs_set_nopar:Npn \emoji #1
+ { \tl_use:c { c__emoji_ #1 _tl } }
+ }
+ }
+ {}
+ }
+
+\msg_new:nnn { emoji } { emoji-not-exist }
+ {
+ The~emoji~name~"#1"~can't~be~found. \\
+ Please~check~your~spelling~or~try~another~one.
+ }
+
+\prg_new_protected_conditional:Npnn \emoji_if_name_exist:n #1 { T, F, TF }
+ {
+ \tl_if_exist:cTF { c__emoji_ #1 _tl }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+\cs_new_protected:Npn \emoji_print:n #1
+ {
+ \group_begin:
+ \emoji_font:
+ \tl_use:c { c__emoji_ #1 _tl }
+ \group_end:
+ }
+
+\cs_new_protected:Npn \__emoji_def:nn #1#2
+ { \tl_const:cn { c__emoji_ #1 _tl } {#2} }
+
+\__emoji_def:nn {-1 } {^^^^^^01f44e}
+\__emoji_def:nn {+1 } {^^^^^^01f44d}
+\__emoji_def:nn {100 } {^^^^^^01f4af}
+\__emoji_def:nn {1234 } {^^^^^^01f522}
+\__emoji_def:nn {1st-place-medal } {^^^^^^01f947}
+\__emoji_def:nn {2nd-place-medal } {^^^^^^01f948}
+\__emoji_def:nn {3rd-place-medal } {^^^^^^01f949}
+\__emoji_def:nn {8ball } {^^^^^^01f3b1}
+\__emoji_def:nn {a } {^^^^^^01f170}
+\__emoji_def:nn {ab } {^^^^^^01f18e}
+\__emoji_def:nn {abc } {^^^^^^01f524}
+\__emoji_def:nn {abcd } {^^^^^^01f521}
+\__emoji_def:nn {accept } {^^^^^^01f251}
+\__emoji_def:nn {aerial-tramway } {^^^^^^01f6a1}
+\__emoji_def:nn {afghanistan } {^^^^^^01f1e6^^^^^^01f1eb}
+\__emoji_def:nn {airplane } {^^^^2708}
+\__emoji_def:nn {aland-islands } {^^^^^^01f1e6^^^^^^01f1fd}
+\__emoji_def:nn {alarm-clock } {^^^^23f0}
+\__emoji_def:nn {albania } {^^^^^^01f1e6^^^^^^01f1f1}
+\__emoji_def:nn {alembic } {^^^^2697}
+\__emoji_def:nn {algeria } {^^^^^^01f1e9^^^^^^01f1ff}
+\__emoji_def:nn {alien } {^^^^^^01f47d}
+\__emoji_def:nn {ambulance } {^^^^^^01f691}
+\__emoji_def:nn {american-samoa } {^^^^^^01f1e6^^^^^^01f1f8}
+\__emoji_def:nn {amphora } {^^^^^^01f3fa}
+\__emoji_def:nn {anchor } {^^^^2693}
+\__emoji_def:nn {andorra } {^^^^^^01f1e6^^^^^^01f1e9}
+\__emoji_def:nn {angel } {^^^^^^01f47c}
+\__emoji_def:nn {anger } {^^^^^^01f4a2}
+\__emoji_def:nn {angola } {^^^^^^01f1e6^^^^^^01f1f4}
+\__emoji_def:nn {angry } {^^^^^^01f620}
+\__emoji_def:nn {anguilla } {^^^^^^01f1e6^^^^^^01f1ee}
+\__emoji_def:nn {anguished } {^^^^^^01f627}
+\__emoji_def:nn {ant } {^^^^^^01f41c}
+\__emoji_def:nn {antarctica } {^^^^^^01f1e6^^^^^^01f1f6}
+\__emoji_def:nn {antigua-barbuda } {^^^^^^01f1e6^^^^^^01f1ec}
+\__emoji_def:nn {apple } {^^^^^^01f34e}
+\__emoji_def:nn {aquarius } {^^^^2652}
+\__emoji_def:nn {argentina } {^^^^^^01f1e6^^^^^^01f1f7}
+\__emoji_def:nn {aries } {^^^^2648}
+\__emoji_def:nn {armenia } {^^^^^^01f1e6^^^^^^01f1f2}
+\__emoji_def:nn {arrow-backward } {^^^^25c0}
+\__emoji_def:nn {arrow-double-down } {^^^^23ec}
+\__emoji_def:nn {arrow-double-up } {^^^^23eb}
+\__emoji_def:nn {arrow-down-small } {^^^^^^01f53d}
+\__emoji_def:nn {arrow-down } {^^^^2b07}
+\__emoji_def:nn {arrow-forward } {^^^^25b6}
+\__emoji_def:nn {arrow-heading-down } {^^^^2935}
+\__emoji_def:nn {arrow-heading-up } {^^^^2934}
+\__emoji_def:nn {arrow-left } {^^^^2b05}
+\__emoji_def:nn {arrow-lower-left } {^^^^2199}
+\__emoji_def:nn {arrow-lower-right } {^^^^2198}
+\__emoji_def:nn {arrow-right-hook } {^^^^21aa}
+\__emoji_def:nn {arrow-right } {^^^^27a1}
+\__emoji_def:nn {arrow-up-down } {^^^^2195}
+\__emoji_def:nn {arrow-up-small } {^^^^^^01f53c}
+\__emoji_def:nn {arrow-up } {^^^^2b06}
+\__emoji_def:nn {arrow-upper-left } {^^^^2196}
+\__emoji_def:nn {arrow-upper-right } {^^^^2197}
+\__emoji_def:nn {arrows-clockwise } {^^^^^^01f503}
+\__emoji_def:nn {arrows-counterclockwise } {^^^^^^01f504}
+\__emoji_def:nn {art } {^^^^^^01f3a8}
+\__emoji_def:nn {articulated-lorry } {^^^^^^01f69b}
+\__emoji_def:nn {artificial-satellite } {^^^^^^01f6f0}
+\__emoji_def:nn {aruba } {^^^^^^01f1e6^^^^^^01f1fc}
+\__emoji_def:nn {astonished } {^^^^^^01f632}
+\__emoji_def:nn {athletic-shoe } {^^^^^^01f45f}
+\__emoji_def:nn {atm } {^^^^^^01f3e7}
+\__emoji_def:nn {atom-symbol } {^^^^269b}
+\__emoji_def:nn {australia } {^^^^^^01f1e6^^^^^^01f1fa}
+\__emoji_def:nn {austria } {^^^^^^01f1e6^^^^^^01f1f9}
+\__emoji_def:nn {avocado } {^^^^^^01f951}
+\__emoji_def:nn {azerbaijan } {^^^^^^01f1e6^^^^^^01f1ff}
+\__emoji_def:nn {b } {^^^^^^01f171}
+\__emoji_def:nn {baby-bottle } {^^^^^^01f37c}
+\__emoji_def:nn {baby-chick } {^^^^^^01f424}
+\__emoji_def:nn {baby-symbol } {^^^^^^01f6bc}
+\__emoji_def:nn {baby } {^^^^^^01f476}
+\__emoji_def:nn {back } {^^^^^^01f519}
+\__emoji_def:nn {bacon } {^^^^^^01f953}
+\__emoji_def:nn {badminton } {^^^^^^01f3f8}
+\__emoji_def:nn {baggage-claim } {^^^^^^01f6c4}
+\__emoji_def:nn {baguette-bread } {^^^^^^01f956}
+\__emoji_def:nn {bahamas } {^^^^^^01f1e7^^^^^^01f1f8}
+\__emoji_def:nn {bahrain } {^^^^^^01f1e7^^^^^^01f1ed}
+\__emoji_def:nn {balance-scale } {^^^^2696}
+\__emoji_def:nn {balloon } {^^^^^^01f388}
+\__emoji_def:nn {ballot-box-with-check } {^^^^2611}
+\__emoji_def:nn {ballot-box } {^^^^^^01f5f3}
+\__emoji_def:nn {bamboo } {^^^^^^01f38d}
+\__emoji_def:nn {banana } {^^^^^^01f34c}
+\__emoji_def:nn {bangbang } {^^^^203c}
+\__emoji_def:nn {bangladesh } {^^^^^^01f1e7^^^^^^01f1e9}
+\__emoji_def:nn {bank } {^^^^^^01f3e6}
+\__emoji_def:nn {bar-chart } {^^^^^^01f4ca}
+\__emoji_def:nn {barbados } {^^^^^^01f1e7^^^^^^01f1e7}
+\__emoji_def:nn {barber } {^^^^^^01f488}
+\__emoji_def:nn {baseball } {^^^^26be}
+\__emoji_def:nn {basketball-man } {^^^^26f9}
+\__emoji_def:nn {basketball-woman } {^^^^26f9^^^^200d^^^^2640}
+\__emoji_def:nn {basketball } {^^^^^^01f3c0}
+\__emoji_def:nn {bat } {^^^^^^01f987}
+\__emoji_def:nn {bath } {^^^^^^01f6c0}
+\__emoji_def:nn {bathtub } {^^^^^^01f6c1}
+\__emoji_def:nn {battery } {^^^^^^01f50b}
+\__emoji_def:nn {beach-umbrella } {^^^^^^01f3d6}
+\__emoji_def:nn {bear } {^^^^^^01f43b}
+\__emoji_def:nn {bed } {^^^^^^01f6cf}
+\__emoji_def:nn {bee } {^^^^^^01f41d}
+\__emoji_def:nn {beer } {^^^^^^01f37a}
+\__emoji_def:nn {beers } {^^^^^^01f37b}
+\__emoji_def:nn {beetle } {^^^^^^01f41e}
+\__emoji_def:nn {beginner } {^^^^^^01f530}
+\__emoji_def:nn {belarus } {^^^^^^01f1e7^^^^^^01f1fe}
+\__emoji_def:nn {belgium } {^^^^^^01f1e7^^^^^^01f1ea}
+\__emoji_def:nn {belize } {^^^^^^01f1e7^^^^^^01f1ff}
+\__emoji_def:nn {bell } {^^^^^^01f514}
+\__emoji_def:nn {bellhop-bell } {^^^^^^01f6ce}
+\__emoji_def:nn {benin } {^^^^^^01f1e7^^^^^^01f1ef}
+\__emoji_def:nn {bento } {^^^^^^01f371}
+\__emoji_def:nn {bermuda } {^^^^^^01f1e7^^^^^^01f1f2}
+\__emoji_def:nn {bhutan } {^^^^^^01f1e7^^^^^^01f1f9}
+\__emoji_def:nn {bicyclist } {^^^^^^01f6b4}
+\__emoji_def:nn {bike } {^^^^^^01f6b2}
+\__emoji_def:nn {biking-man } {^^^^^^01f6b4}
+\__emoji_def:nn {biking-woman } {^^^^^^01f6b4^^^^200d^^^^2640}
+\__emoji_def:nn {bikini } {^^^^^^01f459}
+\__emoji_def:nn {biohazard } {^^^^2623}
+\__emoji_def:nn {bird } {^^^^^^01f426}
+\__emoji_def:nn {birthday } {^^^^^^01f382}
+\__emoji_def:nn {black-circle } {^^^^26ab}
+\__emoji_def:nn {black-flag } {^^^^^^01f3f4}
+\__emoji_def:nn {black-heart } {^^^^^^01f5a4}
+\__emoji_def:nn {black-joker } {^^^^^^01f0cf}
+\__emoji_def:nn {black-large-square } {^^^^2b1b}
+\__emoji_def:nn {black-medium-small-square } {^^^^25fe}
+\__emoji_def:nn {black-medium-square } {^^^^25fc}
+\__emoji_def:nn {black-nib } {^^^^2712}
+\__emoji_def:nn {black-small-square } {^^^^25aa}
+\__emoji_def:nn {black-square-button } {^^^^^^01f532}
+\__emoji_def:nn {blonde-man } {^^^^^^01f471}
+\__emoji_def:nn {blonde-woman } {^^^^^^01f471^^^^200d^^^^2640}
+\__emoji_def:nn {blossom } {^^^^^^01f33c}
+\__emoji_def:nn {blowfish } {^^^^^^01f421}
+\__emoji_def:nn {blue-book } {^^^^^^01f4d8}
+\__emoji_def:nn {blue-car } {^^^^^^01f699}
+\__emoji_def:nn {blue-heart } {^^^^^^01f499}
+\__emoji_def:nn {blush } {^^^^^^01f60a}
+\__emoji_def:nn {boar } {^^^^^^01f417}
+\__emoji_def:nn {boat } {^^^^26f5}
+\__emoji_def:nn {bolivia } {^^^^^^01f1e7^^^^^^01f1f4}
+\__emoji_def:nn {bomb } {^^^^^^01f4a3}
+\__emoji_def:nn {book } {^^^^^^01f4d6}
+\__emoji_def:nn {bookmark-tabs } {^^^^^^01f4d1}
+\__emoji_def:nn {bookmark } {^^^^^^01f516}
+\__emoji_def:nn {books } {^^^^^^01f4da}
+\__emoji_def:nn {boom } {^^^^^^01f4a5}
+\__emoji_def:nn {boot } {^^^^^^01f462}
+\__emoji_def:nn {bosnia-herzegovina } {^^^^^^01f1e7^^^^^^01f1e6}
+\__emoji_def:nn {botswana } {^^^^^^01f1e7^^^^^^01f1fc}
+\__emoji_def:nn {bouquet } {^^^^^^01f490}
+\__emoji_def:nn {bow-and-arrow } {^^^^^^01f3f9}
+\__emoji_def:nn {bow } {^^^^^^01f647}
+\__emoji_def:nn {bowing-man } {^^^^^^01f647}
+\__emoji_def:nn {bowing-woman } {^^^^^^01f647^^^^200d^^^^2640}
+\__emoji_def:nn {bowling } {^^^^^^01f3b3}
+\__emoji_def:nn {boxing-glove } {^^^^^^01f94a}
+\__emoji_def:nn {boy } {^^^^^^01f466}
+\__emoji_def:nn {brazil } {^^^^^^01f1e7^^^^^^01f1f7}
+\__emoji_def:nn {bread } {^^^^^^01f35e}
+\__emoji_def:nn {bride-with-veil } {^^^^^^01f470}
+\__emoji_def:nn {bridge-at-night } {^^^^^^01f309}
+\__emoji_def:nn {briefcase } {^^^^^^01f4bc}
+\__emoji_def:nn {british-indian-ocean-territory } {^^^^^^01f1ee^^^^^^01f1f4}
+\__emoji_def:nn {british-virgin-islands } {^^^^^^01f1fb^^^^^^01f1ec}
+\__emoji_def:nn {broken-heart } {^^^^^^01f494}
+\__emoji_def:nn {brunei } {^^^^^^01f1e7^^^^^^01f1f3}
+\__emoji_def:nn {bug } {^^^^^^01f41b}
+\__emoji_def:nn {building-construction } {^^^^^^01f3d7}
+\__emoji_def:nn {bulb } {^^^^^^01f4a1}
+\__emoji_def:nn {bulgaria } {^^^^^^01f1e7^^^^^^01f1ec}
+\__emoji_def:nn {bullettrain-front } {^^^^^^01f685}
+\__emoji_def:nn {bullettrain-side } {^^^^^^01f684}
+\__emoji_def:nn {burkina-faso } {^^^^^^01f1e7^^^^^^01f1eb}
+\__emoji_def:nn {burrito } {^^^^^^01f32f}
+\__emoji_def:nn {burundi } {^^^^^^01f1e7^^^^^^01f1ee}
+\__emoji_def:nn {bus } {^^^^^^01f68c}
+\__emoji_def:nn {business-suit-levitating } {^^^^^^01f574}
+\__emoji_def:nn {busstop } {^^^^^^01f68f}
+\__emoji_def:nn {bust-in-silhouette } {^^^^^^01f464}
+\__emoji_def:nn {busts-in-silhouette } {^^^^^^01f465}
+\__emoji_def:nn {butterfly } {^^^^^^01f98b}
+\__emoji_def:nn {cactus } {^^^^^^01f335}
+\__emoji_def:nn {cake } {^^^^^^01f370}
+\__emoji_def:nn {calendar } {^^^^^^01f4c6}
+\__emoji_def:nn {call-me-hand } {^^^^^^01f919}
+\__emoji_def:nn {calling } {^^^^^^01f4f2}
+\__emoji_def:nn {cambodia } {^^^^^^01f1f0^^^^^^01f1ed}
+\__emoji_def:nn {camel } {^^^^^^01f42b}
+\__emoji_def:nn {camera-flash } {^^^^^^01f4f8}
+\__emoji_def:nn {camera } {^^^^^^01f4f7}
+\__emoji_def:nn {cameroon } {^^^^^^01f1e8^^^^^^01f1f2}
+\__emoji_def:nn {camping } {^^^^^^01f3d5}
+\__emoji_def:nn {canada } {^^^^^^01f1e8^^^^^^01f1e6}
+\__emoji_def:nn {canary-islands } {^^^^^^01f1ee^^^^^^01f1e8}
+\__emoji_def:nn {cancer } {^^^^264b}
+\__emoji_def:nn {candle } {^^^^^^01f56f}
+\__emoji_def:nn {candy } {^^^^^^01f36c}
+\__emoji_def:nn {canoe } {^^^^^^01f6f6}
+\__emoji_def:nn {cape-verde } {^^^^^^01f1e8^^^^^^01f1fb}
+\__emoji_def:nn {capital-abcd } {^^^^^^01f520}
+\__emoji_def:nn {capricorn } {^^^^2651}
+\__emoji_def:nn {car } {^^^^^^01f697}
+\__emoji_def:nn {card-file-box } {^^^^^^01f5c3}
+\__emoji_def:nn {card-index-dividers } {^^^^^^01f5c2}
+\__emoji_def:nn {card-index } {^^^^^^01f4c7}
+\__emoji_def:nn {caribbean-netherlands } {^^^^^^01f1e7^^^^^^01f1f6}
+\__emoji_def:nn {carousel-horse } {^^^^^^01f3a0}
+\__emoji_def:nn {carrot } {^^^^^^01f955}
+\__emoji_def:nn {cat } {^^^^^^01f431}
+\__emoji_def:nn {cat2 } {^^^^^^01f408}
+\__emoji_def:nn {cayman-islands } {^^^^^^01f1f0^^^^^^01f1fe}
+\__emoji_def:nn {cd } {^^^^^^01f4bf}
+\__emoji_def:nn {central-african-republic } {^^^^^^01f1e8^^^^^^01f1eb}
+\__emoji_def:nn {chad } {^^^^^^01f1f9^^^^^^01f1e9}
+\__emoji_def:nn {chains } {^^^^26d3}
+\__emoji_def:nn {champagne } {^^^^^^01f37e}
+\__emoji_def:nn {chart-with-downwards-trend } {^^^^^^01f4c9}
+\__emoji_def:nn {chart-with-upwards-trend } {^^^^^^01f4c8}
+\__emoji_def:nn {chart } {^^^^^^01f4b9}
+\__emoji_def:nn {checkered-flag } {^^^^^^01f3c1}
+\__emoji_def:nn {cheese } {^^^^^^01f9c0}
+\__emoji_def:nn {cherries } {^^^^^^01f352}
+\__emoji_def:nn {cherry-blossom } {^^^^^^01f338}
+\__emoji_def:nn {chestnut } {^^^^^^01f330}
+\__emoji_def:nn {chicken } {^^^^^^01f414}
+\__emoji_def:nn {children-crossing } {^^^^^^01f6b8}
+\__emoji_def:nn {chile } {^^^^^^01f1e8^^^^^^01f1f1}
+\__emoji_def:nn {chipmunk } {^^^^^^01f43f}
+\__emoji_def:nn {chocolate-bar } {^^^^^^01f36b}
+\__emoji_def:nn {christmas-island } {^^^^^^01f1e8^^^^^^01f1fd}
+\__emoji_def:nn {christmas-tree } {^^^^^^01f384}
+\__emoji_def:nn {church } {^^^^26ea}
+\__emoji_def:nn {cinema } {^^^^^^01f3a6}
+\__emoji_def:nn {circus-tent } {^^^^^^01f3aa}
+\__emoji_def:nn {city-sunrise } {^^^^^^01f307}
+\__emoji_def:nn {city-sunset } {^^^^^^01f306}
+\__emoji_def:nn {cityscape } {^^^^^^01f3d9}
+\__emoji_def:nn {cl } {^^^^^^01f191}
+\__emoji_def:nn {clamp } {^^^^^^01f5dc}
+\__emoji_def:nn {clap } {^^^^^^01f44f}
+\__emoji_def:nn {clapper } {^^^^^^01f3ac}
+\__emoji_def:nn {classical-building } {^^^^^^01f3db}
+\__emoji_def:nn {clinking-glasses } {^^^^^^01f942}
+\__emoji_def:nn {clipboard } {^^^^^^01f4cb}
+\__emoji_def:nn {clock1 } {^^^^^^01f550}
+\__emoji_def:nn {clock10 } {^^^^^^01f559}
+\__emoji_def:nn {clock1030 } {^^^^^^01f565}
+\__emoji_def:nn {clock11 } {^^^^^^01f55a}
+\__emoji_def:nn {clock1130 } {^^^^^^01f566}
+\__emoji_def:nn {clock12 } {^^^^^^01f55b}
+\__emoji_def:nn {clock1230 } {^^^^^^01f567}
+\__emoji_def:nn {clock130 } {^^^^^^01f55c}
+\__emoji_def:nn {clock2 } {^^^^^^01f551}
+\__emoji_def:nn {clock230 } {^^^^^^01f55d}
+\__emoji_def:nn {clock3 } {^^^^^^01f552}
+\__emoji_def:nn {clock330 } {^^^^^^01f55e}
+\__emoji_def:nn {clock4 } {^^^^^^01f553}
+\__emoji_def:nn {clock430 } {^^^^^^01f55f}
+\__emoji_def:nn {clock5 } {^^^^^^01f554}
+\__emoji_def:nn {clock530 } {^^^^^^01f560}
+\__emoji_def:nn {clock6 } {^^^^^^01f555}
+\__emoji_def:nn {clock630 } {^^^^^^01f561}
+\__emoji_def:nn {clock7 } {^^^^^^01f556}
+\__emoji_def:nn {clock730 } {^^^^^^01f562}
+\__emoji_def:nn {clock8 } {^^^^^^01f557}
+\__emoji_def:nn {clock830 } {^^^^^^01f563}
+\__emoji_def:nn {clock9 } {^^^^^^01f558}
+\__emoji_def:nn {clock930 } {^^^^^^01f564}
+\__emoji_def:nn {closed-book } {^^^^^^01f4d5}
+\__emoji_def:nn {closed-lock-with-key } {^^^^^^01f510}
+\__emoji_def:nn {closed-umbrella } {^^^^^^01f302}
+\__emoji_def:nn {cloud-with-lightning-and-rain } {^^^^26c8}
+\__emoji_def:nn {cloud-with-lightning } {^^^^^^01f329}
+\__emoji_def:nn {cloud-with-rain } {^^^^^^01f327}
+\__emoji_def:nn {cloud-with-snow } {^^^^^^01f328}
+\__emoji_def:nn {cloud } {^^^^2601}
+\__emoji_def:nn {clown-face } {^^^^^^01f921}
+\__emoji_def:nn {clubs } {^^^^2663}
+\__emoji_def:nn {cn } {^^^^^^01f1e8^^^^^^01f1f3}
+\__emoji_def:nn {cocktail } {^^^^^^01f378}
+\__emoji_def:nn {cocos-islands } {^^^^^^01f1e8^^^^^^01f1e8}
+\__emoji_def:nn {coffee } {^^^^2615}
+\__emoji_def:nn {coffin } {^^^^26b0}
+\__emoji_def:nn {cold-sweat } {^^^^^^01f630}
+\__emoji_def:nn {collision } {^^^^^^01f4a5}
+\__emoji_def:nn {colombia } {^^^^^^01f1e8^^^^^^01f1f4}
+\__emoji_def:nn {comet } {^^^^2604}
+\__emoji_def:nn {comoros } {^^^^^^01f1f0^^^^^^01f1f2}
+\__emoji_def:nn {computer-mouse } {^^^^^^01f5b1}
+\__emoji_def:nn {computer } {^^^^^^01f4bb}
+\__emoji_def:nn {confetti-ball } {^^^^^^01f38a}
+\__emoji_def:nn {confounded } {^^^^^^01f616}
+\__emoji_def:nn {confused } {^^^^^^01f615}
+\__emoji_def:nn {congo-brazzaville } {^^^^^^01f1e8^^^^^^01f1ec}
+\__emoji_def:nn {congo-kinshasa } {^^^^^^01f1e8^^^^^^01f1e9}
+\__emoji_def:nn {congratulations } {^^^^3297}
+\__emoji_def:nn {construction-worker-man } {^^^^^^01f477}
+\__emoji_def:nn {construction-worker-woman } {^^^^^^01f477^^^^200d^^^^2640}
+\__emoji_def:nn {construction-worker } {^^^^^^01f477}
+\__emoji_def:nn {construction } {^^^^^^01f6a7}
+\__emoji_def:nn {control-knobs } {^^^^^^01f39b}
+\__emoji_def:nn {convenience-store } {^^^^^^01f3ea}
+\__emoji_def:nn {cook-islands } {^^^^^^01f1e8^^^^^^01f1f0}
+\__emoji_def:nn {cookie } {^^^^^^01f36a}
+\__emoji_def:nn {cool } {^^^^^^01f192}
+\__emoji_def:nn {cop } {^^^^^^01f46e}
+\__emoji_def:nn {copyright } {^^^^00a9}
+\__emoji_def:nn {corn } {^^^^^^01f33d}
+\__emoji_def:nn {costa-rica } {^^^^^^01f1e8^^^^^^01f1f7}
+\__emoji_def:nn {cote-divoire } {^^^^^^01f1e8^^^^^^01f1ee}
+\__emoji_def:nn {couch-and-lamp } {^^^^^^01f6cb}
+\__emoji_def:nn {couple-with-heart-man-man } {^^^^^^01f468^^^^200d^^^^2764^^^^200d^^^^^^01f468}
+\__emoji_def:nn {couple-with-heart-woman-man } {^^^^^^01f491}
+\__emoji_def:nn {couple-with-heart-woman-woman } {^^^^^^01f469^^^^200d^^^^2764^^^^200d^^^^^^01f469}
+\__emoji_def:nn {couple-with-heart } {^^^^^^01f491}
+\__emoji_def:nn {couple } {^^^^^^01f46b}
+\__emoji_def:nn {couplekiss-man-man } {^^^^^^01f468^^^^200d^^^^2764^^^^200d^^^^^^01f48b^^^^200d^^^^^^01f468}
+\__emoji_def:nn {couplekiss-man-woman } {^^^^^^01f48f}
+\__emoji_def:nn {couplekiss-woman-woman } {^^^^^^01f469^^^^200d^^^^2764^^^^200d^^^^^^01f48b^^^^200d^^^^^^01f469}
+\__emoji_def:nn {cow } {^^^^^^01f42e}
+\__emoji_def:nn {cow2 } {^^^^^^01f404}
+\__emoji_def:nn {cowboy-hat-face } {^^^^^^01f920}
+\__emoji_def:nn {crab } {^^^^^^01f980}
+\__emoji_def:nn {crayon } {^^^^^^01f58d}
+\__emoji_def:nn {credit-card } {^^^^^^01f4b3}
+\__emoji_def:nn {crescent-moon } {^^^^^^01f319}
+\__emoji_def:nn {cricket } {^^^^^^01f3cf}
+\__emoji_def:nn {croatia } {^^^^^^01f1ed^^^^^^01f1f7}
+\__emoji_def:nn {crocodile } {^^^^^^01f40a}
+\__emoji_def:nn {croissant } {^^^^^^01f950}
+\__emoji_def:nn {crossed-fingers } {^^^^^^01f91e}
+\__emoji_def:nn {crossed-flags } {^^^^^^01f38c}
+\__emoji_def:nn {crossed-swords } {^^^^2694}
+\__emoji_def:nn {crown } {^^^^^^01f451}
+\__emoji_def:nn {cry } {^^^^^^01f622}
+\__emoji_def:nn {crying-cat-face } {^^^^^^01f63f}
+\__emoji_def:nn {crystal-ball } {^^^^^^01f52e}
+\__emoji_def:nn {cuba } {^^^^^^01f1e8^^^^^^01f1fa}
+\__emoji_def:nn {cucumber } {^^^^^^01f952}
+\__emoji_def:nn {cupid } {^^^^^^01f498}
+\__emoji_def:nn {curacao } {^^^^^^01f1e8^^^^^^01f1fc}
+\__emoji_def:nn {curly-loop } {^^^^27b0}
+\__emoji_def:nn {currency-exchange } {^^^^^^01f4b1}
+\__emoji_def:nn {curry } {^^^^^^01f35b}
+\__emoji_def:nn {custard } {^^^^^^01f36e}
+\__emoji_def:nn {customs } {^^^^^^01f6c3}
+\__emoji_def:nn {cyclone } {^^^^^^01f300}
+\__emoji_def:nn {cyprus } {^^^^^^01f1e8^^^^^^01f1fe}
+\__emoji_def:nn {czech-republic } {^^^^^^01f1e8^^^^^^01f1ff}
+\__emoji_def:nn {dagger } {^^^^^^01f5e1}
+\__emoji_def:nn {dancer } {^^^^^^01f483}
+\__emoji_def:nn {dancers } {^^^^^^01f46f}
+\__emoji_def:nn {dancing-men } {^^^^^^01f46f^^^^200d^^^^2642}
+\__emoji_def:nn {dancing-women } {^^^^^^01f46f}
+\__emoji_def:nn {dango } {^^^^^^01f361}
+\__emoji_def:nn {dark-sunglasses } {^^^^^^01f576}
+\__emoji_def:nn {dart } {^^^^^^01f3af}
+\__emoji_def:nn {dash } {^^^^^^01f4a8}
+\__emoji_def:nn {date } {^^^^^^01f4c5}
+\__emoji_def:nn {de } {^^^^^^01f1e9^^^^^^01f1ea}
+\__emoji_def:nn {deciduous-tree } {^^^^^^01f333}
+\__emoji_def:nn {deer } {^^^^^^01f98c}
+\__emoji_def:nn {denmark } {^^^^^^01f1e9^^^^^^01f1f0}
+\__emoji_def:nn {department-store } {^^^^^^01f3ec}
+\__emoji_def:nn {derelict-house } {^^^^^^01f3da}
+\__emoji_def:nn {desert-island } {^^^^^^01f3dd}
+\__emoji_def:nn {desert } {^^^^^^01f3dc}
+\__emoji_def:nn {desktop-computer } {^^^^^^01f5a5}
+\__emoji_def:nn {detective } {^^^^^^01f575}
+\__emoji_def:nn {diamond-shape-with-a-dot-inside } {^^^^^^01f4a0}
+\__emoji_def:nn {diamonds } {^^^^2666}
+\__emoji_def:nn {disappointed-relieved } {^^^^^^01f625}
+\__emoji_def:nn {disappointed } {^^^^^^01f61e}
+\__emoji_def:nn {dizzy-face } {^^^^^^01f635}
+\__emoji_def:nn {dizzy } {^^^^^^01f4ab}
+\__emoji_def:nn {djibouti } {^^^^^^01f1e9^^^^^^01f1ef}
+\__emoji_def:nn {do-not-litter } {^^^^^^01f6af}
+\__emoji_def:nn {dog } {^^^^^^01f436}
+\__emoji_def:nn {dog2 } {^^^^^^01f415}
+\__emoji_def:nn {dollar } {^^^^^^01f4b5}
+\__emoji_def:nn {dolls } {^^^^^^01f38e}
+\__emoji_def:nn {dolphin } {^^^^^^01f42c}
+\__emoji_def:nn {dominica } {^^^^^^01f1e9^^^^^^01f1f2}
+\__emoji_def:nn {dominican-republic } {^^^^^^01f1e9^^^^^^01f1f4}
+\__emoji_def:nn {door } {^^^^^^01f6aa}
+\__emoji_def:nn {doughnut } {^^^^^^01f369}
+\__emoji_def:nn {dove } {^^^^^^01f54a}
+\__emoji_def:nn {dragon-face } {^^^^^^01f432}
+\__emoji_def:nn {dragon } {^^^^^^01f409}
+\__emoji_def:nn {dress } {^^^^^^01f457}
+\__emoji_def:nn {dromedary-camel } {^^^^^^01f42a}
+\__emoji_def:nn {drooling-face } {^^^^^^01f924}
+\__emoji_def:nn {droplet } {^^^^^^01f4a7}
+\__emoji_def:nn {drum } {^^^^^^01f941}
+\__emoji_def:nn {duck } {^^^^^^01f986}
+\__emoji_def:nn {dvd } {^^^^^^01f4c0}
+\__emoji_def:nn {e-mail } {^^^^^^01f4e7}
+\__emoji_def:nn {eagle } {^^^^^^01f985}
+\__emoji_def:nn {ear-of-rice } {^^^^^^01f33e}
+\__emoji_def:nn {ear } {^^^^^^01f442}
+\__emoji_def:nn {earth-africa } {^^^^^^01f30d}
+\__emoji_def:nn {earth-americas } {^^^^^^01f30e}
+\__emoji_def:nn {earth-asia } {^^^^^^01f30f}
+\__emoji_def:nn {ecuador } {^^^^^^01f1ea^^^^^^01f1e8}
+\__emoji_def:nn {egg } {^^^^^^01f95a}
+\__emoji_def:nn {eggplant } {^^^^^^01f346}
+\__emoji_def:nn {egypt } {^^^^^^01f1ea^^^^^^01f1ec}
+\__emoji_def:nn {eight-pointed-black-star } {^^^^2734}
+\__emoji_def:nn {eight-spoked-asterisk } {^^^^2733}
+\__emoji_def:nn {el-salvador } {^^^^^^01f1f8^^^^^^01f1fb}
+\__emoji_def:nn {electric-plug } {^^^^^^01f50c}
+\__emoji_def:nn {elephant } {^^^^^^01f418}
+\__emoji_def:nn {email } {^^^^2709}
+\__emoji_def:nn {end } {^^^^^^01f51a}
+\__emoji_def:nn {envelope-with-arrow } {^^^^^^01f4e9}
+\__emoji_def:nn {envelope } {^^^^2709}
+\__emoji_def:nn {equatorial-guinea } {^^^^^^01f1ec^^^^^^01f1f6}
+\__emoji_def:nn {eritrea } {^^^^^^01f1ea^^^^^^01f1f7}
+\__emoji_def:nn {es } {^^^^^^01f1ea^^^^^^01f1f8}
+\__emoji_def:nn {estonia } {^^^^^^01f1ea^^^^^^01f1ea}
+\__emoji_def:nn {ethiopia } {^^^^^^01f1ea^^^^^^01f1f9}
+\__emoji_def:nn {eu } {^^^^^^01f1ea^^^^^^01f1fa}
+\__emoji_def:nn {euro } {^^^^^^01f4b6}
+\__emoji_def:nn {european-castle } {^^^^^^01f3f0}
+\__emoji_def:nn {european-post-office } {^^^^^^01f3e4}
+\__emoji_def:nn {european-union } {^^^^^^01f1ea^^^^^^01f1fa}
+\__emoji_def:nn {evergreen-tree } {^^^^^^01f332}
+\__emoji_def:nn {exclamation } {^^^^2757}
+\__emoji_def:nn {expressionless } {^^^^^^01f611}
+\__emoji_def:nn {eye-speech-bubble } {^^^^^^01f441^^^^200d^^^^^^01f5e8}
+\__emoji_def:nn {eye } {^^^^^^01f441}
+\__emoji_def:nn {eyeglasses } {^^^^^^01f453}
+\__emoji_def:nn {eyes } {^^^^^^01f440}
+\__emoji_def:nn {face-with-head-bandage } {^^^^^^01f915}
+\__emoji_def:nn {face-with-thermometer } {^^^^^^01f912}
+\__emoji_def:nn {facepunch } {^^^^^^01f44a}
+\__emoji_def:nn {factory } {^^^^^^01f3ed}
+\__emoji_def:nn {falkland-islands } {^^^^^^01f1eb^^^^^^01f1f0}
+\__emoji_def:nn {fallen-leaf } {^^^^^^01f342}
+\__emoji_def:nn {family-man-boy-boy } {^^^^^^01f468^^^^200d^^^^^^01f466^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-boy } {^^^^^^01f468^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-girl-boy } {^^^^^^01f468^^^^200d^^^^^^01f467^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-girl-girl } {^^^^^^01f468^^^^200d^^^^^^01f467^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-man-girl } {^^^^^^01f468^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-man-man-boy-boy } {^^^^^^01f468^^^^200d^^^^^^01f468^^^^200d^^^^^^01f466^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-man-boy } {^^^^^^01f468^^^^200d^^^^^^01f468^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-man-girl-boy } {^^^^^^01f468^^^^200d^^^^^^01f468^^^^200d^^^^^^01f467^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-man-girl-girl } {^^^^^^01f468^^^^200d^^^^^^01f468^^^^200d^^^^^^01f467^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-man-man-girl } {^^^^^^01f468^^^^200d^^^^^^01f468^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-man-woman-boy-boy } {^^^^^^01f468^^^^200d^^^^^^01f469^^^^200d^^^^^^01f466^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-woman-boy } {^^^^^^01f46a}
+\__emoji_def:nn {family-man-woman-girl-boy } {^^^^^^01f468^^^^200d^^^^^^01f469^^^^200d^^^^^^01f467^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-man-woman-girl-girl } {^^^^^^01f468^^^^200d^^^^^^01f469^^^^200d^^^^^^01f467^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-man-woman-girl } {^^^^^^01f468^^^^200d^^^^^^01f469^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-woman-boy-boy } {^^^^^^01f469^^^^200d^^^^^^01f466^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-woman-boy } {^^^^^^01f469^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-woman-girl-boy } {^^^^^^01f469^^^^200d^^^^^^01f467^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-woman-girl-girl } {^^^^^^01f469^^^^200d^^^^^^01f467^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-woman-girl } {^^^^^^01f469^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-woman-woman-boy-boy } {^^^^^^01f469^^^^200d^^^^^^01f469^^^^200d^^^^^^01f466^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-woman-woman-boy } {^^^^^^01f469^^^^200d^^^^^^01f469^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-woman-woman-girl-boy } {^^^^^^01f469^^^^200d^^^^^^01f469^^^^200d^^^^^^01f467^^^^200d^^^^^^01f466}
+\__emoji_def:nn {family-woman-woman-girl-girl } {^^^^^^01f469^^^^200d^^^^^^01f469^^^^200d^^^^^^01f467^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family-woman-woman-girl } {^^^^^^01f469^^^^200d^^^^^^01f469^^^^200d^^^^^^01f467}
+\__emoji_def:nn {family } {^^^^^^01f46a}
+\__emoji_def:nn {faroe-islands } {^^^^^^01f1eb^^^^^^01f1f4}
+\__emoji_def:nn {fast-forward } {^^^^23e9}
+\__emoji_def:nn {fax } {^^^^^^01f4e0}
+\__emoji_def:nn {fearful } {^^^^^^01f628}
+\__emoji_def:nn {feet } {^^^^^^01f43e}
+\__emoji_def:nn {female-detective } {^^^^^^01f575^^^^200d^^^^2640}
+\__emoji_def:nn {ferris-wheel } {^^^^^^01f3a1}
+\__emoji_def:nn {ferry } {^^^^26f4}
+\__emoji_def:nn {field-hockey } {^^^^^^01f3d1}
+\__emoji_def:nn {fiji } {^^^^^^01f1eb^^^^^^01f1ef}
+\__emoji_def:nn {file-cabinet } {^^^^^^01f5c4}
+\__emoji_def:nn {file-folder } {^^^^^^01f4c1}
+\__emoji_def:nn {film-projector } {^^^^^^01f4fd}
+\__emoji_def:nn {film-strip } {^^^^^^01f39e}
+\__emoji_def:nn {finland } {^^^^^^01f1eb^^^^^^01f1ee}
+\__emoji_def:nn {fire-engine } {^^^^^^01f692}
+\__emoji_def:nn {fire } {^^^^^^01f525}
+\__emoji_def:nn {fireworks } {^^^^^^01f386}
+\__emoji_def:nn {first-quarter-moon-with-face } {^^^^^^01f31b}
+\__emoji_def:nn {first-quarter-moon } {^^^^^^01f313}
+\__emoji_def:nn {fish-cake } {^^^^^^01f365}
+\__emoji_def:nn {fish } {^^^^^^01f41f}
+\__emoji_def:nn {fishing-pole-and-fish } {^^^^^^01f3a3}
+\__emoji_def:nn {fist-left } {^^^^^^01f91b}
+\__emoji_def:nn {fist-oncoming } {^^^^^^01f44a}
+\__emoji_def:nn {fist-raised } {^^^^270a}
+\__emoji_def:nn {fist-right } {^^^^^^01f91c}
+\__emoji_def:nn {fist } {^^^^270a}
+\__emoji_def:nn {flags } {^^^^^^01f38f}
+\__emoji_def:nn {flashlight } {^^^^^^01f526}
+\__emoji_def:nn {fleur-de-lis } {^^^^269c}
+\__emoji_def:nn {flight-arrival } {^^^^^^01f6ec}
+\__emoji_def:nn {flight-departure } {^^^^^^01f6eb}
+\__emoji_def:nn {flipper } {^^^^^^01f42c}
+\__emoji_def:nn {floppy-disk } {^^^^^^01f4be}
+\__emoji_def:nn {flower-playing-cards } {^^^^^^01f3b4}
+\__emoji_def:nn {flushed } {^^^^^^01f633}
+\__emoji_def:nn {fog } {^^^^^^01f32b}
+\__emoji_def:nn {foggy } {^^^^^^01f301}
+\__emoji_def:nn {football } {^^^^^^01f3c8}
+\__emoji_def:nn {footprints } {^^^^^^01f463}
+\__emoji_def:nn {fork-and-knife } {^^^^^^01f374}
+\__emoji_def:nn {fountain-pen } {^^^^^^01f58b}
+\__emoji_def:nn {fountain } {^^^^26f2}
+\__emoji_def:nn {four-leaf-clover } {^^^^^^01f340}
+\__emoji_def:nn {fox-face } {^^^^^^01f98a}
+\__emoji_def:nn {fr } {^^^^^^01f1eb^^^^^^01f1f7}
+\__emoji_def:nn {framed-picture } {^^^^^^01f5bc}
+\__emoji_def:nn {free } {^^^^^^01f193}
+\__emoji_def:nn {french-guiana } {^^^^^^01f1ec^^^^^^01f1eb}
+\__emoji_def:nn {french-polynesia } {^^^^^^01f1f5^^^^^^01f1eb}
+\__emoji_def:nn {french-southern-territories } {^^^^^^01f1f9^^^^^^01f1eb}
+\__emoji_def:nn {fried-egg } {^^^^^^01f373}
+\__emoji_def:nn {fried-shrimp } {^^^^^^01f364}
+\__emoji_def:nn {fries } {^^^^^^01f35f}
+\__emoji_def:nn {frog } {^^^^^^01f438}
+\__emoji_def:nn {frowning-face } {^^^^2639}
+\__emoji_def:nn {frowning-man } {^^^^^^01f64d^^^^200d^^^^2642}
+\__emoji_def:nn {frowning-woman } {^^^^^^01f64d}
+\__emoji_def:nn {frowning } {^^^^^^01f626}
+\__emoji_def:nn {fu } {^^^^^^01f595}
+\__emoji_def:nn {fuelpump } {^^^^26fd}
+\__emoji_def:nn {full-moon-with-face } {^^^^^^01f31d}
+\__emoji_def:nn {full-moon } {^^^^^^01f315}
+\__emoji_def:nn {funeral-urn } {^^^^26b1}
+\__emoji_def:nn {gabon } {^^^^^^01f1ec^^^^^^01f1e6}
+\__emoji_def:nn {gambia } {^^^^^^01f1ec^^^^^^01f1f2}
+\__emoji_def:nn {game-die } {^^^^^^01f3b2}
+\__emoji_def:nn {gb } {^^^^^^01f1ec^^^^^^01f1e7}
+\__emoji_def:nn {gear } {^^^^2699}
+\__emoji_def:nn {gem } {^^^^^^01f48e}
+\__emoji_def:nn {gemini } {^^^^264a}
+\__emoji_def:nn {georgia } {^^^^^^01f1ec^^^^^^01f1ea}
+\__emoji_def:nn {ghana } {^^^^^^01f1ec^^^^^^01f1ed}
+\__emoji_def:nn {ghost } {^^^^^^01f47b}
+\__emoji_def:nn {gibraltar } {^^^^^^01f1ec^^^^^^01f1ee}
+\__emoji_def:nn {gift-heart } {^^^^^^01f49d}
+\__emoji_def:nn {gift } {^^^^^^01f381}
+\__emoji_def:nn {girl } {^^^^^^01f467}
+\__emoji_def:nn {globe-with-meridians } {^^^^^^01f310}
+\__emoji_def:nn {goal-net } {^^^^^^01f945}
+\__emoji_def:nn {goat } {^^^^^^01f410}
+\__emoji_def:nn {golf } {^^^^26f3}
+\__emoji_def:nn {golfing-man } {^^^^^^01f3cc}
+\__emoji_def:nn {golfing-woman } {^^^^^^01f3cc^^^^200d^^^^2640}
+\__emoji_def:nn {gorilla } {^^^^^^01f98d}
+\__emoji_def:nn {grapes } {^^^^^^01f347}
+\__emoji_def:nn {greece } {^^^^^^01f1ec^^^^^^01f1f7}
+\__emoji_def:nn {green-apple } {^^^^^^01f34f}
+\__emoji_def:nn {green-book } {^^^^^^01f4d7}
+\__emoji_def:nn {green-heart } {^^^^^^01f49a}
+\__emoji_def:nn {green-salad } {^^^^^^01f957}
+\__emoji_def:nn {greenland } {^^^^^^01f1ec^^^^^^01f1f1}
+\__emoji_def:nn {grenada } {^^^^^^01f1ec^^^^^^01f1e9}
+\__emoji_def:nn {grey-exclamation } {^^^^2755}
+\__emoji_def:nn {grey-question } {^^^^2754}
+\__emoji_def:nn {grimacing } {^^^^^^01f62c}
+\__emoji_def:nn {grin } {^^^^^^01f601}
+\__emoji_def:nn {grinning } {^^^^^^01f600}
+\__emoji_def:nn {guadeloupe } {^^^^^^01f1ec^^^^^^01f1f5}
+\__emoji_def:nn {guam } {^^^^^^01f1ec^^^^^^01f1fa}
+\__emoji_def:nn {guardsman } {^^^^^^01f482}
+\__emoji_def:nn {guardswoman } {^^^^^^01f482^^^^200d^^^^2640}
+\__emoji_def:nn {guatemala } {^^^^^^01f1ec^^^^^^01f1f9}
+\__emoji_def:nn {guernsey } {^^^^^^01f1ec^^^^^^01f1ec}
+\__emoji_def:nn {guinea-bissau } {^^^^^^01f1ec^^^^^^01f1fc}
+\__emoji_def:nn {guinea } {^^^^^^01f1ec^^^^^^01f1f3}
+\__emoji_def:nn {guitar } {^^^^^^01f3b8}
+\__emoji_def:nn {gun } {^^^^^^01f52b}
+\__emoji_def:nn {guyana } {^^^^^^01f1ec^^^^^^01f1fe}
+\__emoji_def:nn {haircut-man } {^^^^^^01f487^^^^200d^^^^2642}
+\__emoji_def:nn {haircut-woman } {^^^^^^01f487}
+\__emoji_def:nn {haircut } {^^^^^^01f487}
+\__emoji_def:nn {haiti } {^^^^^^01f1ed^^^^^^01f1f9}
+\__emoji_def:nn {hamburger } {^^^^^^01f354}
+\__emoji_def:nn {hammer-and-pick } {^^^^2692}
+\__emoji_def:nn {hammer-and-wrench } {^^^^^^01f6e0}
+\__emoji_def:nn {hammer } {^^^^^^01f528}
+\__emoji_def:nn {hamster } {^^^^^^01f439}
+\__emoji_def:nn {hand } {^^^^270b}
+\__emoji_def:nn {handbag } {^^^^^^01f45c}
+\__emoji_def:nn {handshake } {^^^^^^01f91d}
+\__emoji_def:nn {hankey } {^^^^^^01f4a9}
+\__emoji_def:nn {hatched-chick } {^^^^^^01f425}
+\__emoji_def:nn {hatching-chick } {^^^^^^01f423}
+\__emoji_def:nn {headphones } {^^^^^^01f3a7}
+\__emoji_def:nn {hear-no-evil } {^^^^^^01f649}
+\__emoji_def:nn {heart-decoration } {^^^^^^01f49f}
+\__emoji_def:nn {heart-eyes-cat } {^^^^^^01f63b}
+\__emoji_def:nn {heart-eyes } {^^^^^^01f60d}
+\__emoji_def:nn {heart } {^^^^2764}
+\__emoji_def:nn {heartbeat } {^^^^^^01f493}
+\__emoji_def:nn {heartpulse } {^^^^^^01f497}
+\__emoji_def:nn {hearts } {^^^^2665}
+\__emoji_def:nn {heavy-check-mark } {^^^^2714}
+\__emoji_def:nn {heavy-division-sign } {^^^^2797}
+\__emoji_def:nn {heavy-dollar-sign } {^^^^^^01f4b2}
+\__emoji_def:nn {heavy-exclamation-mark } {^^^^2757}
+\__emoji_def:nn {heavy-heart-exclamation } {^^^^2763}
+\__emoji_def:nn {heavy-minus-sign } {^^^^2796}
+\__emoji_def:nn {heavy-multiplication-x } {^^^^2716}
+\__emoji_def:nn {heavy-plus-sign } {^^^^2795}
+\__emoji_def:nn {helicopter } {^^^^^^01f681}
+\__emoji_def:nn {herb } {^^^^^^01f33f}
+\__emoji_def:nn {hibiscus } {^^^^^^01f33a}
+\__emoji_def:nn {high-brightness } {^^^^^^01f506}
+\__emoji_def:nn {high-heel } {^^^^^^01f460}
+\__emoji_def:nn {hocho } {^^^^^^01f52a}
+\__emoji_def:nn {hole } {^^^^^^01f573}
+\__emoji_def:nn {honduras } {^^^^^^01f1ed^^^^^^01f1f3}
+\__emoji_def:nn {honey-pot } {^^^^^^01f36f}
+\__emoji_def:nn {honeybee } {^^^^^^01f41d}
+\__emoji_def:nn {hong-kong } {^^^^^^01f1ed^^^^^^01f1f0}
+\__emoji_def:nn {horse-racing } {^^^^^^01f3c7}
+\__emoji_def:nn {horse } {^^^^^^01f434}
+\__emoji_def:nn {hospital } {^^^^^^01f3e5}
+\__emoji_def:nn {hot-pepper } {^^^^^^01f336}
+\__emoji_def:nn {hotdog } {^^^^^^01f32d}
+\__emoji_def:nn {hotel } {^^^^^^01f3e8}
+\__emoji_def:nn {hotsprings } {^^^^2668}
+\__emoji_def:nn {hourglass-flowing-sand } {^^^^23f3}
+\__emoji_def:nn {hourglass } {^^^^231b}
+\__emoji_def:nn {house-with-garden } {^^^^^^01f3e1}
+\__emoji_def:nn {house } {^^^^^^01f3e0}
+\__emoji_def:nn {houses } {^^^^^^01f3d8}
+\__emoji_def:nn {hugs } {^^^^^^01f917}
+\__emoji_def:nn {hungary } {^^^^^^01f1ed^^^^^^01f1fa}
+\__emoji_def:nn {hushed } {^^^^^^01f62f}
+\__emoji_def:nn {ice-cream } {^^^^^^01f368}
+\__emoji_def:nn {ice-hockey } {^^^^^^01f3d2}
+\__emoji_def:nn {ice-skate } {^^^^26f8}
+\__emoji_def:nn {icecream } {^^^^^^01f366}
+\__emoji_def:nn {iceland } {^^^^^^01f1ee^^^^^^01f1f8}
+\__emoji_def:nn {id } {^^^^^^01f194}
+\__emoji_def:nn {ideograph-advantage } {^^^^^^01f250}
+\__emoji_def:nn {imp } {^^^^^^01f47f}
+\__emoji_def:nn {inbox-tray } {^^^^^^01f4e5}
+\__emoji_def:nn {incoming-envelope } {^^^^^^01f4e8}
+\__emoji_def:nn {india } {^^^^^^01f1ee^^^^^^01f1f3}
+\__emoji_def:nn {indonesia } {^^^^^^01f1ee^^^^^^01f1e9}
+\__emoji_def:nn {information-desk-person } {^^^^^^01f481}
+\__emoji_def:nn {information-source } {^^^^2139}
+\__emoji_def:nn {innocent } {^^^^^^01f607}
+\__emoji_def:nn {interrobang } {^^^^2049}
+\__emoji_def:nn {iphone } {^^^^^^01f4f1}
+\__emoji_def:nn {iran } {^^^^^^01f1ee^^^^^^01f1f7}
+\__emoji_def:nn {iraq } {^^^^^^01f1ee^^^^^^01f1f6}
+\__emoji_def:nn {ireland } {^^^^^^01f1ee^^^^^^01f1ea}
+\__emoji_def:nn {isle-of-man } {^^^^^^01f1ee^^^^^^01f1f2}
+\__emoji_def:nn {israel } {^^^^^^01f1ee^^^^^^01f1f1}
+\__emoji_def:nn {it } {^^^^^^01f1ee^^^^^^01f1f9}
+\__emoji_def:nn {izakaya-lantern } {^^^^^^01f3ee}
+\__emoji_def:nn {jack-o-lantern } {^^^^^^01f383}
+\__emoji_def:nn {jamaica } {^^^^^^01f1ef^^^^^^01f1f2}
+\__emoji_def:nn {japan } {^^^^^^01f5fe}
+\__emoji_def:nn {japanese-castle } {^^^^^^01f3ef}
+\__emoji_def:nn {japanese-goblin } {^^^^^^01f47a}
+\__emoji_def:nn {japanese-ogre } {^^^^^^01f479}
+\__emoji_def:nn {jeans } {^^^^^^01f456}
+\__emoji_def:nn {jersey } {^^^^^^01f1ef^^^^^^01f1ea}
+\__emoji_def:nn {jordan } {^^^^^^01f1ef^^^^^^01f1f4}
+\__emoji_def:nn {joy-cat } {^^^^^^01f639}
+\__emoji_def:nn {joy } {^^^^^^01f602}
+\__emoji_def:nn {joystick } {^^^^^^01f579}
+\__emoji_def:nn {jp } {^^^^^^01f1ef^^^^^^01f1f5}
+\__emoji_def:nn {kaaba } {^^^^^^01f54b}
+\__emoji_def:nn {kazakhstan } {^^^^^^01f1f0^^^^^^01f1ff}
+\__emoji_def:nn {kenya } {^^^^^^01f1f0^^^^^^01f1ea}
+\__emoji_def:nn {key } {^^^^^^01f511}
+\__emoji_def:nn {keyboard } {^^^^2328}
+\__emoji_def:nn {keycap-ten } {^^^^^^01f51f}
+\__emoji_def:nn {kick-scooter } {^^^^^^01f6f4}
+\__emoji_def:nn {kimono } {^^^^^^01f458}
+\__emoji_def:nn {kiribati } {^^^^^^01f1f0^^^^^^01f1ee}
+\__emoji_def:nn {kiss } {^^^^^^01f48b}
+\__emoji_def:nn {kissing-cat } {^^^^^^01f63d}
+\__emoji_def:nn {kissing-closed-eyes } {^^^^^^01f61a}
+\__emoji_def:nn {kissing-heart } {^^^^^^01f618}
+\__emoji_def:nn {kissing-smiling-eyes } {^^^^^^01f619}
+\__emoji_def:nn {kissing } {^^^^^^01f617}
+\__emoji_def:nn {kiwi-fruit } {^^^^^^01f95d}
+\__emoji_def:nn {knife } {^^^^^^01f52a}
+\__emoji_def:nn {koala } {^^^^^^01f428}
+\__emoji_def:nn {koko } {^^^^^^01f201}
+\__emoji_def:nn {kosovo } {^^^^^^01f1fd^^^^^^01f1f0}
+\__emoji_def:nn {kr } {^^^^^^01f1f0^^^^^^01f1f7}
+\__emoji_def:nn {kuwait } {^^^^^^01f1f0^^^^^^01f1fc}
+\__emoji_def:nn {kyrgyzstan } {^^^^^^01f1f0^^^^^^01f1ec}
+\__emoji_def:nn {label } {^^^^^^01f3f7}
+\__emoji_def:nn {lantern } {^^^^^^01f3ee}
+\__emoji_def:nn {laos } {^^^^^^01f1f1^^^^^^01f1e6}
+\__emoji_def:nn {large-blue-circle } {^^^^^^01f535}
+\__emoji_def:nn {large-blue-diamond } {^^^^^^01f537}
+\__emoji_def:nn {large-orange-diamond } {^^^^^^01f536}
+\__emoji_def:nn {last-quarter-moon-with-face } {^^^^^^01f31c}
+\__emoji_def:nn {last-quarter-moon } {^^^^^^01f317}
+\__emoji_def:nn {latin-cross } {^^^^271d}
+\__emoji_def:nn {latvia } {^^^^^^01f1f1^^^^^^01f1fb}
+\__emoji_def:nn {laughing } {^^^^^^01f606}
+\__emoji_def:nn {leaves } {^^^^^^01f343}
+\__emoji_def:nn {lebanon } {^^^^^^01f1f1^^^^^^01f1e7}
+\__emoji_def:nn {ledger } {^^^^^^01f4d2}
+\__emoji_def:nn {left-luggage } {^^^^^^01f6c5}
+\__emoji_def:nn {left-right-arrow } {^^^^2194}
+\__emoji_def:nn {leftwards-arrow-with-hook } {^^^^21a9}
+\__emoji_def:nn {lemon } {^^^^^^01f34b}
+\__emoji_def:nn {leo } {^^^^264c}
+\__emoji_def:nn {leopard } {^^^^^^01f406}
+\__emoji_def:nn {lesotho } {^^^^^^01f1f1^^^^^^01f1f8}
+\__emoji_def:nn {level-slider } {^^^^^^01f39a}
+\__emoji_def:nn {liberia } {^^^^^^01f1f1^^^^^^01f1f7}
+\__emoji_def:nn {libra } {^^^^264e}
+\__emoji_def:nn {libya } {^^^^^^01f1f1^^^^^^01f1fe}
+\__emoji_def:nn {liechtenstein } {^^^^^^01f1f1^^^^^^01f1ee}
+\__emoji_def:nn {light-rail } {^^^^^^01f688}
+\__emoji_def:nn {link } {^^^^^^01f517}
+\__emoji_def:nn {lion } {^^^^^^01f981}
+\__emoji_def:nn {lips } {^^^^^^01f444}
+\__emoji_def:nn {lipstick } {^^^^^^01f484}
+\__emoji_def:nn {lithuania } {^^^^^^01f1f1^^^^^^01f1f9}
+\__emoji_def:nn {lizard } {^^^^^^01f98e}
+\__emoji_def:nn {lock-with-ink-pen } {^^^^^^01f50f}
+\__emoji_def:nn {lock } {^^^^^^01f512}
+\__emoji_def:nn {lollipop } {^^^^^^01f36d}
+\__emoji_def:nn {loop } {^^^^27bf}
+\__emoji_def:nn {loud-sound } {^^^^^^01f50a}
+\__emoji_def:nn {loudspeaker } {^^^^^^01f4e2}
+\__emoji_def:nn {love-hotel } {^^^^^^01f3e9}
+\__emoji_def:nn {love-letter } {^^^^^^01f48c}
+\__emoji_def:nn {low-brightness } {^^^^^^01f505}
+\__emoji_def:nn {luxembourg } {^^^^^^01f1f1^^^^^^01f1fa}
+\__emoji_def:nn {lying-face } {^^^^^^01f925}
+\__emoji_def:nn {m } {^^^^24c2}
+\__emoji_def:nn {macau } {^^^^^^01f1f2^^^^^^01f1f4}
+\__emoji_def:nn {macedonia } {^^^^^^01f1f2^^^^^^01f1f0}
+\__emoji_def:nn {madagascar } {^^^^^^01f1f2^^^^^^01f1ec}
+\__emoji_def:nn {mag-right } {^^^^^^01f50e}
+\__emoji_def:nn {mag } {^^^^^^01f50d}
+\__emoji_def:nn {mahjong } {^^^^^^01f004}
+\__emoji_def:nn {mailbox-closed } {^^^^^^01f4ea}
+\__emoji_def:nn {mailbox-with-mail } {^^^^^^01f4ec}
+\__emoji_def:nn {mailbox-with-no-mail } {^^^^^^01f4ed}
+\__emoji_def:nn {mailbox } {^^^^^^01f4eb}
+\__emoji_def:nn {malawi } {^^^^^^01f1f2^^^^^^01f1fc}
+\__emoji_def:nn {malaysia } {^^^^^^01f1f2^^^^^^01f1fe}
+\__emoji_def:nn {maldives } {^^^^^^01f1f2^^^^^^01f1fb}
+\__emoji_def:nn {male-detective } {^^^^^^01f575}
+\__emoji_def:nn {mali } {^^^^^^01f1f2^^^^^^01f1f1}
+\__emoji_def:nn {malta } {^^^^^^01f1f2^^^^^^01f1f9}
+\__emoji_def:nn {man-artist } {^^^^^^01f468^^^^200d^^^^^^01f3a8}
+\__emoji_def:nn {man-astronaut } {^^^^^^01f468^^^^200d^^^^^^01f680}
+\__emoji_def:nn {man-cartwheeling } {^^^^^^01f938^^^^200d^^^^2642}
+\__emoji_def:nn {man-cook } {^^^^^^01f468^^^^200d^^^^^^01f373}
+\__emoji_def:nn {man-dancing } {^^^^^^01f57a}
+\__emoji_def:nn {man-facepalming } {^^^^^^01f926^^^^200d^^^^2642}
+\__emoji_def:nn {man-factory-worker } {^^^^^^01f468^^^^200d^^^^^^01f3ed}
+\__emoji_def:nn {man-farmer } {^^^^^^01f468^^^^200d^^^^^^01f33e}
+\__emoji_def:nn {man-firefighter } {^^^^^^01f468^^^^200d^^^^^^01f692}
+\__emoji_def:nn {man-health-worker } {^^^^^^01f468^^^^200d^^^^2695}
+\__emoji_def:nn {man-in-tuxedo } {^^^^^^01f935}
+\__emoji_def:nn {man-judge } {^^^^^^01f468^^^^200d^^^^2696}
+\__emoji_def:nn {man-juggling } {^^^^^^01f939^^^^200d^^^^2642}
+\__emoji_def:nn {man-mechanic } {^^^^^^01f468^^^^200d^^^^^^01f527}
+\__emoji_def:nn {man-office-worker } {^^^^^^01f468^^^^200d^^^^^^01f4bc}
+\__emoji_def:nn {man-pilot } {^^^^^^01f468^^^^200d^^^^2708}
+\__emoji_def:nn {man-playing-handball } {^^^^^^01f93e^^^^200d^^^^2642}
+\__emoji_def:nn {man-playing-water-polo } {^^^^^^01f93d^^^^200d^^^^2642}
+\__emoji_def:nn {man-scientist } {^^^^^^01f468^^^^200d^^^^^^01f52c}
+\__emoji_def:nn {man-shrugging } {^^^^^^01f937^^^^200d^^^^2642}
+\__emoji_def:nn {man-singer } {^^^^^^01f468^^^^200d^^^^^^01f3a4}
+\__emoji_def:nn {man-student } {^^^^^^01f468^^^^200d^^^^^^01f393}
+\__emoji_def:nn {man-teacher } {^^^^^^01f468^^^^200d^^^^^^01f3eb}
+\__emoji_def:nn {man-technologist } {^^^^^^01f468^^^^200d^^^^^^01f4bb}
+\__emoji_def:nn {man-with-gua-pi-mao } {^^^^^^01f472}
+\__emoji_def:nn {man-with-turban } {^^^^^^01f473}
+\__emoji_def:nn {man } {^^^^^^01f468}
+\__emoji_def:nn {mandarin } {^^^^^^01f34a}
+\__emoji_def:nn {mans-shoe } {^^^^^^01f45e}
+\__emoji_def:nn {mantelpiece-clock } {^^^^^^01f570}
+\__emoji_def:nn {maple-leaf } {^^^^^^01f341}
+\__emoji_def:nn {marshall-islands } {^^^^^^01f1f2^^^^^^01f1ed}
+\__emoji_def:nn {martial-arts-uniform } {^^^^^^01f94b}
+\__emoji_def:nn {martinique } {^^^^^^01f1f2^^^^^^01f1f6}
+\__emoji_def:nn {mask } {^^^^^^01f637}
+\__emoji_def:nn {massage-man } {^^^^^^01f486^^^^200d^^^^2642}
+\__emoji_def:nn {massage-woman } {^^^^^^01f486}
+\__emoji_def:nn {massage } {^^^^^^01f486}
+\__emoji_def:nn {mauritania } {^^^^^^01f1f2^^^^^^01f1f7}
+\__emoji_def:nn {mauritius } {^^^^^^01f1f2^^^^^^01f1fa}
+\__emoji_def:nn {mayotte } {^^^^^^01f1fe^^^^^^01f1f9}
+\__emoji_def:nn {meat-on-bone } {^^^^^^01f356}
+\__emoji_def:nn {medal-military } {^^^^^^01f396}
+\__emoji_def:nn {medal-sports } {^^^^^^01f3c5}
+\__emoji_def:nn {mega } {^^^^^^01f4e3}
+\__emoji_def:nn {melon } {^^^^^^01f348}
+\__emoji_def:nn {memo } {^^^^^^01f4dd}
+\__emoji_def:nn {men-wrestling } {^^^^^^01f93c^^^^200d^^^^2642}
+\__emoji_def:nn {menorah } {^^^^^^01f54e}
+\__emoji_def:nn {mens } {^^^^^^01f6b9}
+\__emoji_def:nn {metal } {^^^^^^01f918}
+\__emoji_def:nn {metro } {^^^^^^01f687}
+\__emoji_def:nn {mexico } {^^^^^^01f1f2^^^^^^01f1fd}
+\__emoji_def:nn {micronesia } {^^^^^^01f1eb^^^^^^01f1f2}
+\__emoji_def:nn {microphone } {^^^^^^01f3a4}
+\__emoji_def:nn {microscope } {^^^^^^01f52c}
+\__emoji_def:nn {middle-finger } {^^^^^^01f595}
+\__emoji_def:nn {milk-glass } {^^^^^^01f95b}
+\__emoji_def:nn {milky-way } {^^^^^^01f30c}
+\__emoji_def:nn {minibus } {^^^^^^01f690}
+\__emoji_def:nn {minidisc } {^^^^^^01f4bd}
+\__emoji_def:nn {mobile-phone-off } {^^^^^^01f4f4}
+\__emoji_def:nn {moldova } {^^^^^^01f1f2^^^^^^01f1e9}
+\__emoji_def:nn {monaco } {^^^^^^01f1f2^^^^^^01f1e8}
+\__emoji_def:nn {money-mouth-face } {^^^^^^01f911}
+\__emoji_def:nn {money-with-wings } {^^^^^^01f4b8}
+\__emoji_def:nn {moneybag } {^^^^^^01f4b0}
+\__emoji_def:nn {mongolia } {^^^^^^01f1f2^^^^^^01f1f3}
+\__emoji_def:nn {monkey-face } {^^^^^^01f435}
+\__emoji_def:nn {monkey } {^^^^^^01f412}
+\__emoji_def:nn {monorail } {^^^^^^01f69d}
+\__emoji_def:nn {montenegro } {^^^^^^01f1f2^^^^^^01f1ea}
+\__emoji_def:nn {montserrat } {^^^^^^01f1f2^^^^^^01f1f8}
+\__emoji_def:nn {moon } {^^^^^^01f314}
+\__emoji_def:nn {morocco } {^^^^^^01f1f2^^^^^^01f1e6}
+\__emoji_def:nn {mortar-board } {^^^^^^01f393}
+\__emoji_def:nn {mosque } {^^^^^^01f54c}
+\__emoji_def:nn {motor-boat } {^^^^^^01f6e5}
+\__emoji_def:nn {motor-scooter } {^^^^^^01f6f5}
+\__emoji_def:nn {motorcycle } {^^^^^^01f3cd}
+\__emoji_def:nn {motorway } {^^^^^^01f6e3}
+\__emoji_def:nn {mount-fuji } {^^^^^^01f5fb}
+\__emoji_def:nn {mountain-bicyclist } {^^^^^^01f6b5}
+\__emoji_def:nn {mountain-biking-man } {^^^^^^01f6b5}
+\__emoji_def:nn {mountain-biking-woman } {^^^^^^01f6b5^^^^200d^^^^2640}
+\__emoji_def:nn {mountain-cableway } {^^^^^^01f6a0}
+\__emoji_def:nn {mountain-railway } {^^^^^^01f69e}
+\__emoji_def:nn {mountain-snow } {^^^^^^01f3d4}
+\__emoji_def:nn {mountain } {^^^^26f0}
+\__emoji_def:nn {mouse } {^^^^^^01f42d}
+\__emoji_def:nn {mouse2 } {^^^^^^01f401}
+\__emoji_def:nn {movie-camera } {^^^^^^01f3a5}
+\__emoji_def:nn {moyai } {^^^^^^01f5ff}
+\__emoji_def:nn {mozambique } {^^^^^^01f1f2^^^^^^01f1ff}
+\__emoji_def:nn {mrs-claus } {^^^^^^01f936}
+\__emoji_def:nn {muscle } {^^^^^^01f4aa}
+\__emoji_def:nn {mushroom } {^^^^^^01f344}
+\__emoji_def:nn {musical-keyboard } {^^^^^^01f3b9}
+\__emoji_def:nn {musical-note } {^^^^^^01f3b5}
+\__emoji_def:nn {musical-score } {^^^^^^01f3bc}
+\__emoji_def:nn {mute } {^^^^^^01f507}
+\__emoji_def:nn {myanmar } {^^^^^^01f1f2^^^^^^01f1f2}
+\__emoji_def:nn {nail-care } {^^^^^^01f485}
+\__emoji_def:nn {name-badge } {^^^^^^01f4db}
+\__emoji_def:nn {namibia } {^^^^^^01f1f3^^^^^^01f1e6}
+\__emoji_def:nn {national-park } {^^^^^^01f3de}
+\__emoji_def:nn {nauru } {^^^^^^01f1f3^^^^^^01f1f7}
+\__emoji_def:nn {nauseated-face } {^^^^^^01f922}
+\__emoji_def:nn {necktie } {^^^^^^01f454}
+\__emoji_def:nn {negative-squared-cross-mark } {^^^^274e}
+\__emoji_def:nn {nepal } {^^^^^^01f1f3^^^^^^01f1f5}
+\__emoji_def:nn {nerd-face } {^^^^^^01f913}
+\__emoji_def:nn {netherlands } {^^^^^^01f1f3^^^^^^01f1f1}
+\__emoji_def:nn {neutral-face } {^^^^^^01f610}
+\__emoji_def:nn {new-caledonia } {^^^^^^01f1f3^^^^^^01f1e8}
+\__emoji_def:nn {new-moon-with-face } {^^^^^^01f31a}
+\__emoji_def:nn {new-moon } {^^^^^^01f311}
+\__emoji_def:nn {new-zealand } {^^^^^^01f1f3^^^^^^01f1ff}
+\__emoji_def:nn {new } {^^^^^^01f195}
+\__emoji_def:nn {newspaper-roll } {^^^^^^01f5de}
+\__emoji_def:nn {newspaper } {^^^^^^01f4f0}
+\__emoji_def:nn {next-track-button } {^^^^23ed}
+\__emoji_def:nn {ng-man } {^^^^^^01f645^^^^200d^^^^2642}
+\__emoji_def:nn {ng-woman } {^^^^^^01f645}
+\__emoji_def:nn {ng } {^^^^^^01f196}
+\__emoji_def:nn {nicaragua } {^^^^^^01f1f3^^^^^^01f1ee}
+\__emoji_def:nn {niger } {^^^^^^01f1f3^^^^^^01f1ea}
+\__emoji_def:nn {nigeria } {^^^^^^01f1f3^^^^^^01f1ec}
+\__emoji_def:nn {night-with-stars } {^^^^^^01f303}
+\__emoji_def:nn {niue } {^^^^^^01f1f3^^^^^^01f1fa}
+\__emoji_def:nn {no-bell } {^^^^^^01f515}
+\__emoji_def:nn {no-bicycles } {^^^^^^01f6b3}
+\__emoji_def:nn {no-entry-sign } {^^^^^^01f6ab}
+\__emoji_def:nn {no-entry } {^^^^26d4}
+\__emoji_def:nn {no-good-man } {^^^^^^01f645^^^^200d^^^^2642}
+\__emoji_def:nn {no-good-woman } {^^^^^^01f645}
+\__emoji_def:nn {no-good } {^^^^^^01f645}
+\__emoji_def:nn {no-mobile-phones } {^^^^^^01f4f5}
+\__emoji_def:nn {no-mouth } {^^^^^^01f636}
+\__emoji_def:nn {no-pedestrians } {^^^^^^01f6b7}
+\__emoji_def:nn {no-smoking } {^^^^^^01f6ad}
+\__emoji_def:nn {non-potable-water } {^^^^^^01f6b1}
+\__emoji_def:nn {norfolk-island } {^^^^^^01f1f3^^^^^^01f1eb}
+\__emoji_def:nn {north-korea } {^^^^^^01f1f0^^^^^^01f1f5}
+\__emoji_def:nn {northern-mariana-islands } {^^^^^^01f1f2^^^^^^01f1f5}
+\__emoji_def:nn {norway } {^^^^^^01f1f3^^^^^^01f1f4}
+\__emoji_def:nn {nose } {^^^^^^01f443}
+\__emoji_def:nn {notebook-with-decorative-cover } {^^^^^^01f4d4}
+\__emoji_def:nn {notebook } {^^^^^^01f4d3}
+\__emoji_def:nn {notes } {^^^^^^01f3b6}
+\__emoji_def:nn {nut-and-bolt } {^^^^^^01f529}
+\__emoji_def:nn {o } {^^^^2b55}
+\__emoji_def:nn {o2 } {^^^^^^01f17e}
+\__emoji_def:nn {ocean } {^^^^^^01f30a}
+\__emoji_def:nn {octopus } {^^^^^^01f419}
+\__emoji_def:nn {oden } {^^^^^^01f362}
+\__emoji_def:nn {office } {^^^^^^01f3e2}
+\__emoji_def:nn {oil-drum } {^^^^^^01f6e2}
+\__emoji_def:nn {ok-hand } {^^^^^^01f44c}
+\__emoji_def:nn {ok-man } {^^^^^^01f646^^^^200d^^^^2642}
+\__emoji_def:nn {ok-woman } {^^^^^^01f646}
+\__emoji_def:nn {ok } {^^^^^^01f197}
+\__emoji_def:nn {old-key } {^^^^^^01f5dd}
+\__emoji_def:nn {older-man } {^^^^^^01f474}
+\__emoji_def:nn {older-woman } {^^^^^^01f475}
+\__emoji_def:nn {om } {^^^^^^01f549}
+\__emoji_def:nn {oman } {^^^^^^01f1f4^^^^^^01f1f2}
+\__emoji_def:nn {on } {^^^^^^01f51b}
+\__emoji_def:nn {oncoming-automobile } {^^^^^^01f698}
+\__emoji_def:nn {oncoming-bus } {^^^^^^01f68d}
+\__emoji_def:nn {oncoming-police-car } {^^^^^^01f694}
+\__emoji_def:nn {oncoming-taxi } {^^^^^^01f696}
+\__emoji_def:nn {open-book } {^^^^^^01f4d6}
+\__emoji_def:nn {open-file-folder } {^^^^^^01f4c2}
+\__emoji_def:nn {open-hands } {^^^^^^01f450}
+\__emoji_def:nn {open-mouth } {^^^^^^01f62e}
+\__emoji_def:nn {open-umbrella } {^^^^2602}
+\__emoji_def:nn {ophiuchus } {^^^^26ce}
+\__emoji_def:nn {orange-book } {^^^^^^01f4d9}
+\__emoji_def:nn {orange } {^^^^^^01f34a}
+\__emoji_def:nn {orthodox-cross } {^^^^2626}
+\__emoji_def:nn {outbox-tray } {^^^^^^01f4e4}
+\__emoji_def:nn {owl } {^^^^^^01f989}
+\__emoji_def:nn {ox } {^^^^^^01f402}
+\__emoji_def:nn {package } {^^^^^^01f4e6}
+\__emoji_def:nn {page-facing-up } {^^^^^^01f4c4}
+\__emoji_def:nn {page-with-curl } {^^^^^^01f4c3}
+\__emoji_def:nn {pager } {^^^^^^01f4df}
+\__emoji_def:nn {paintbrush } {^^^^^^01f58c}
+\__emoji_def:nn {pakistan } {^^^^^^01f1f5^^^^^^01f1f0}
+\__emoji_def:nn {palau } {^^^^^^01f1f5^^^^^^01f1fc}
+\__emoji_def:nn {palestinian-territories } {^^^^^^01f1f5^^^^^^01f1f8}
+\__emoji_def:nn {palm-tree } {^^^^^^01f334}
+\__emoji_def:nn {panama } {^^^^^^01f1f5^^^^^^01f1e6}
+\__emoji_def:nn {pancakes } {^^^^^^01f95e}
+\__emoji_def:nn {panda-face } {^^^^^^01f43c}
+\__emoji_def:nn {paperclip } {^^^^^^01f4ce}
+\__emoji_def:nn {paperclips } {^^^^^^01f587}
+\__emoji_def:nn {papua-new-guinea } {^^^^^^01f1f5^^^^^^01f1ec}
+\__emoji_def:nn {paraguay } {^^^^^^01f1f5^^^^^^01f1fe}
+\__emoji_def:nn {parasol-on-ground } {^^^^26f1}
+\__emoji_def:nn {parking } {^^^^^^01f17f}
+\__emoji_def:nn {part-alternation-mark } {^^^^303d}
+\__emoji_def:nn {partly-sunny } {^^^^26c5}
+\__emoji_def:nn {passenger-ship } {^^^^^^01f6f3}
+\__emoji_def:nn {passport-control } {^^^^^^01f6c2}
+\__emoji_def:nn {pause-button } {^^^^23f8}
+\__emoji_def:nn {paw-prints } {^^^^^^01f43e}
+\__emoji_def:nn {peace-symbol } {^^^^262e}
+\__emoji_def:nn {peach } {^^^^^^01f351}
+\__emoji_def:nn {peanuts } {^^^^^^01f95c}
+\__emoji_def:nn {pear } {^^^^^^01f350}
+\__emoji_def:nn {pen } {^^^^^^01f58a}
+\__emoji_def:nn {pencil } {^^^^^^01f4dd}
+\__emoji_def:nn {pencil2 } {^^^^270f}
+\__emoji_def:nn {penguin } {^^^^^^01f427}
+\__emoji_def:nn {pensive } {^^^^^^01f614}
+\__emoji_def:nn {performing-arts } {^^^^^^01f3ad}
+\__emoji_def:nn {persevere } {^^^^^^01f623}
+\__emoji_def:nn {person-fencing } {^^^^^^01f93a}
+\__emoji_def:nn {person-frowning } {^^^^^^01f64d}
+\__emoji_def:nn {person-with-blond-hair } {^^^^^^01f471}
+\__emoji_def:nn {person-with-pouting-face } {^^^^^^01f64e}
+\__emoji_def:nn {peru } {^^^^^^01f1f5^^^^^^01f1ea}
+\__emoji_def:nn {philippines } {^^^^^^01f1f5^^^^^^01f1ed}
+\__emoji_def:nn {phone } {^^^^260e}
+\__emoji_def:nn {pick } {^^^^26cf}
+\__emoji_def:nn {pig-nose } {^^^^^^01f43d}
+\__emoji_def:nn {pig } {^^^^^^01f437}
+\__emoji_def:nn {pig2 } {^^^^^^01f416}
+\__emoji_def:nn {pill } {^^^^^^01f48a}
+\__emoji_def:nn {pineapple } {^^^^^^01f34d}
+\__emoji_def:nn {ping-pong } {^^^^^^01f3d3}
+\__emoji_def:nn {pisces } {^^^^2653}
+\__emoji_def:nn {pitcairn-islands } {^^^^^^01f1f5^^^^^^01f1f3}
+\__emoji_def:nn {pizza } {^^^^^^01f355}
+\__emoji_def:nn {place-of-worship } {^^^^^^01f6d0}
+\__emoji_def:nn {plate-with-cutlery } {^^^^^^01f37d}
+\__emoji_def:nn {play-or-pause-button } {^^^^23ef}
+\__emoji_def:nn {point-down } {^^^^^^01f447}
+\__emoji_def:nn {point-left } {^^^^^^01f448}
+\__emoji_def:nn {point-right } {^^^^^^01f449}
+\__emoji_def:nn {point-up-2 } {^^^^^^01f446}
+\__emoji_def:nn {point-up } {^^^^261d}
+\__emoji_def:nn {poland } {^^^^^^01f1f5^^^^^^01f1f1}
+\__emoji_def:nn {police-car } {^^^^^^01f693}
+\__emoji_def:nn {policeman } {^^^^^^01f46e}
+\__emoji_def:nn {policewoman } {^^^^^^01f46e^^^^200d^^^^2640}
+\__emoji_def:nn {poodle } {^^^^^^01f429}
+\__emoji_def:nn {poop } {^^^^^^01f4a9}
+\__emoji_def:nn {popcorn } {^^^^^^01f37f}
+\__emoji_def:nn {portugal } {^^^^^^01f1f5^^^^^^01f1f9}
+\__emoji_def:nn {post-office } {^^^^^^01f3e3}
+\__emoji_def:nn {postal-horn } {^^^^^^01f4ef}
+\__emoji_def:nn {postbox } {^^^^^^01f4ee}
+\__emoji_def:nn {potable-water } {^^^^^^01f6b0}
+\__emoji_def:nn {potato } {^^^^^^01f954}
+\__emoji_def:nn {pouch } {^^^^^^01f45d}
+\__emoji_def:nn {poultry-leg } {^^^^^^01f357}
+\__emoji_def:nn {pound } {^^^^^^01f4b7}
+\__emoji_def:nn {pout } {^^^^^^01f621}
+\__emoji_def:nn {pouting-cat } {^^^^^^01f63e}
+\__emoji_def:nn {pouting-man } {^^^^^^01f64e^^^^200d^^^^2642}
+\__emoji_def:nn {pouting-woman } {^^^^^^01f64e}
+\__emoji_def:nn {pray } {^^^^^^01f64f}
+\__emoji_def:nn {prayer-beads } {^^^^^^01f4ff}
+\__emoji_def:nn {pregnant-woman } {^^^^^^01f930}
+\__emoji_def:nn {previous-track-button } {^^^^23ee}
+\__emoji_def:nn {prince } {^^^^^^01f934}
+\__emoji_def:nn {princess } {^^^^^^01f478}
+\__emoji_def:nn {printer } {^^^^^^01f5a8}
+\__emoji_def:nn {puerto-rico } {^^^^^^01f1f5^^^^^^01f1f7}
+\__emoji_def:nn {punch } {^^^^^^01f44a}
+\__emoji_def:nn {purple-heart } {^^^^^^01f49c}
+\__emoji_def:nn {purse } {^^^^^^01f45b}
+\__emoji_def:nn {pushpin } {^^^^^^01f4cc}
+\__emoji_def:nn {put-litter-in-its-place } {^^^^^^01f6ae}
+\__emoji_def:nn {qatar } {^^^^^^01f1f6^^^^^^01f1e6}
+\__emoji_def:nn {question } {^^^^2753}
+\__emoji_def:nn {rabbit } {^^^^^^01f430}
+\__emoji_def:nn {rabbit2 } {^^^^^^01f407}
+\__emoji_def:nn {racehorse } {^^^^^^01f40e}
+\__emoji_def:nn {racing-car } {^^^^^^01f3ce}
+\__emoji_def:nn {radio-button } {^^^^^^01f518}
+\__emoji_def:nn {radio } {^^^^^^01f4fb}
+\__emoji_def:nn {radioactive } {^^^^2622}
+\__emoji_def:nn {rage } {^^^^^^01f621}
+\__emoji_def:nn {railway-car } {^^^^^^01f683}
+\__emoji_def:nn {railway-track } {^^^^^^01f6e4}
+\__emoji_def:nn {rainbow-flag } {^^^^^^01f3f3^^^^200d^^^^^^01f308}
+\__emoji_def:nn {rainbow } {^^^^^^01f308}
+\__emoji_def:nn {raised-back-of-hand } {^^^^^^01f91a}
+\__emoji_def:nn {raised-hand-with-fingers-splayed } {^^^^^^01f590}
+\__emoji_def:nn {raised-hand } {^^^^270b}
+\__emoji_def:nn {raised-hands } {^^^^^^01f64c}
+\__emoji_def:nn {raising-hand-man } {^^^^^^01f64b^^^^200d^^^^2642}
+\__emoji_def:nn {raising-hand-woman } {^^^^^^01f64b}
+\__emoji_def:nn {raising-hand } {^^^^^^01f64b}
+\__emoji_def:nn {ram } {^^^^^^01f40f}
+\__emoji_def:nn {ramen } {^^^^^^01f35c}
+\__emoji_def:nn {rat } {^^^^^^01f400}
+\__emoji_def:nn {record-button } {^^^^23fa}
+\__emoji_def:nn {recycle } {^^^^267b}
+\__emoji_def:nn {red-car } {^^^^^^01f697}
+\__emoji_def:nn {red-circle } {^^^^^^01f534}
+\__emoji_def:nn {registered } {^^^^00ae}
+\__emoji_def:nn {relaxed } {^^^^263a}
+\__emoji_def:nn {relieved } {^^^^^^01f60c}
+\__emoji_def:nn {reminder-ribbon } {^^^^^^01f397}
+\__emoji_def:nn {repeat-one } {^^^^^^01f502}
+\__emoji_def:nn {repeat } {^^^^^^01f501}
+\__emoji_def:nn {rescue-worker-helmet } {^^^^26d1}
+\__emoji_def:nn {restroom } {^^^^^^01f6bb}
+\__emoji_def:nn {reunion } {^^^^^^01f1f7^^^^^^01f1ea}
+\__emoji_def:nn {revolving-hearts } {^^^^^^01f49e}
+\__emoji_def:nn {rewind } {^^^^23ea}
+\__emoji_def:nn {rhinoceros } {^^^^^^01f98f}
+\__emoji_def:nn {ribbon } {^^^^^^01f380}
+\__emoji_def:nn {rice-ball } {^^^^^^01f359}
+\__emoji_def:nn {rice-cracker } {^^^^^^01f358}
+\__emoji_def:nn {rice-scene } {^^^^^^01f391}
+\__emoji_def:nn {rice } {^^^^^^01f35a}
+\__emoji_def:nn {right-anger-bubble } {^^^^^^01f5ef}
+\__emoji_def:nn {ring } {^^^^^^01f48d}
+\__emoji_def:nn {robot } {^^^^^^01f916}
+\__emoji_def:nn {rocket } {^^^^^^01f680}
+\__emoji_def:nn {rofl } {^^^^^^01f923}
+\__emoji_def:nn {roll-eyes } {^^^^^^01f644}
+\__emoji_def:nn {roller-coaster } {^^^^^^01f3a2}
+\__emoji_def:nn {romania } {^^^^^^01f1f7^^^^^^01f1f4}
+\__emoji_def:nn {rooster } {^^^^^^01f413}
+\__emoji_def:nn {rose } {^^^^^^01f339}
+\__emoji_def:nn {rosette } {^^^^^^01f3f5}
+\__emoji_def:nn {rotating-light } {^^^^^^01f6a8}
+\__emoji_def:nn {round-pushpin } {^^^^^^01f4cd}
+\__emoji_def:nn {rowboat } {^^^^^^01f6a3}
+\__emoji_def:nn {rowing-man } {^^^^^^01f6a3}
+\__emoji_def:nn {rowing-woman } {^^^^^^01f6a3^^^^200d^^^^2640}
+\__emoji_def:nn {ru } {^^^^^^01f1f7^^^^^^01f1fa}
+\__emoji_def:nn {rugby-football } {^^^^^^01f3c9}
+\__emoji_def:nn {runner } {^^^^^^01f3c3}
+\__emoji_def:nn {running-man } {^^^^^^01f3c3}
+\__emoji_def:nn {running-shirt-with-sash } {^^^^^^01f3bd}
+\__emoji_def:nn {running-woman } {^^^^^^01f3c3^^^^200d^^^^2640}
+\__emoji_def:nn {running } {^^^^^^01f3c3}
+\__emoji_def:nn {rwanda } {^^^^^^01f1f7^^^^^^01f1fc}
+\__emoji_def:nn {sa } {^^^^^^01f202}
+\__emoji_def:nn {sagittarius } {^^^^2650}
+\__emoji_def:nn {sailboat } {^^^^26f5}
+\__emoji_def:nn {sake } {^^^^^^01f376}
+\__emoji_def:nn {samoa } {^^^^^^01f1fc^^^^^^01f1f8}
+\__emoji_def:nn {san-marino } {^^^^^^01f1f8^^^^^^01f1f2}
+\__emoji_def:nn {sandal } {^^^^^^01f461}
+\__emoji_def:nn {santa } {^^^^^^01f385}
+\__emoji_def:nn {sao-tome-principe } {^^^^^^01f1f8^^^^^^01f1f9}
+\__emoji_def:nn {sassy-man } {^^^^^^01f481^^^^200d^^^^2642}
+\__emoji_def:nn {sassy-woman } {^^^^^^01f481}
+\__emoji_def:nn {satellite } {^^^^^^01f4e1}
+\__emoji_def:nn {satisfied } {^^^^^^01f606}
+\__emoji_def:nn {saudi-arabia } {^^^^^^01f1f8^^^^^^01f1e6}
+\__emoji_def:nn {saxophone } {^^^^^^01f3b7}
+\__emoji_def:nn {school-satchel } {^^^^^^01f392}
+\__emoji_def:nn {school } {^^^^^^01f3eb}
+\__emoji_def:nn {scissors } {^^^^2702}
+\__emoji_def:nn {scorpion } {^^^^^^01f982}
+\__emoji_def:nn {scorpius } {^^^^264f}
+\__emoji_def:nn {scream-cat } {^^^^^^01f640}
+\__emoji_def:nn {scream } {^^^^^^01f631}
+\__emoji_def:nn {scroll } {^^^^^^01f4dc}
+\__emoji_def:nn {seat } {^^^^^^01f4ba}
+\__emoji_def:nn {secret } {^^^^3299}
+\__emoji_def:nn {see-no-evil } {^^^^^^01f648}
+\__emoji_def:nn {seedling } {^^^^^^01f331}
+\__emoji_def:nn {selfie } {^^^^^^01f933}
+\__emoji_def:nn {senegal } {^^^^^^01f1f8^^^^^^01f1f3}
+\__emoji_def:nn {serbia } {^^^^^^01f1f7^^^^^^01f1f8}
+\__emoji_def:nn {seychelles } {^^^^^^01f1f8^^^^^^01f1e8}
+\__emoji_def:nn {shallow-pan-of-food } {^^^^^^01f958}
+\__emoji_def:nn {shamrock } {^^^^2618}
+\__emoji_def:nn {shark } {^^^^^^01f988}
+\__emoji_def:nn {shaved-ice } {^^^^^^01f367}
+\__emoji_def:nn {sheep } {^^^^^^01f411}
+\__emoji_def:nn {shell } {^^^^^^01f41a}
+\__emoji_def:nn {shield } {^^^^^^01f6e1}
+\__emoji_def:nn {shinto-shrine } {^^^^26e9}
+\__emoji_def:nn {ship } {^^^^^^01f6a2}
+\__emoji_def:nn {shirt } {^^^^^^01f455}
+\__emoji_def:nn {shit } {^^^^^^01f4a9}
+\__emoji_def:nn {shoe } {^^^^^^01f45e}
+\__emoji_def:nn {shopping-cart } {^^^^^^01f6d2}
+\__emoji_def:nn {shopping } {^^^^^^01f6cd}
+\__emoji_def:nn {shower } {^^^^^^01f6bf}
+\__emoji_def:nn {shrimp } {^^^^^^01f990}
+\__emoji_def:nn {sierra-leone } {^^^^^^01f1f8^^^^^^01f1f1}
+\__emoji_def:nn {signal-strength } {^^^^^^01f4f6}
+\__emoji_def:nn {singapore } {^^^^^^01f1f8^^^^^^01f1ec}
+\__emoji_def:nn {sint-maarten } {^^^^^^01f1f8^^^^^^01f1fd}
+\__emoji_def:nn {six-pointed-star } {^^^^^^01f52f}
+\__emoji_def:nn {ski } {^^^^^^01f3bf}
+\__emoji_def:nn {skier } {^^^^26f7}
+\__emoji_def:nn {skull-and-crossbones } {^^^^2620}
+\__emoji_def:nn {skull } {^^^^^^01f480}
+\__emoji_def:nn {sleeping-bed } {^^^^^^01f6cc}
+\__emoji_def:nn {sleeping } {^^^^^^01f634}
+\__emoji_def:nn {sleepy } {^^^^^^01f62a}
+\__emoji_def:nn {slightly-frowning-face } {^^^^^^01f641}
+\__emoji_def:nn {slightly-smiling-face } {^^^^^^01f642}
+\__emoji_def:nn {slot-machine } {^^^^^^01f3b0}
+\__emoji_def:nn {slovakia } {^^^^^^01f1f8^^^^^^01f1f0}
+\__emoji_def:nn {slovenia } {^^^^^^01f1f8^^^^^^01f1ee}
+\__emoji_def:nn {small-airplane } {^^^^^^01f6e9}
+\__emoji_def:nn {small-blue-diamond } {^^^^^^01f539}
+\__emoji_def:nn {small-orange-diamond } {^^^^^^01f538}
+\__emoji_def:nn {small-red-triangle-down } {^^^^^^01f53b}
+\__emoji_def:nn {small-red-triangle } {^^^^^^01f53a}
+\__emoji_def:nn {smile-cat } {^^^^^^01f638}
+\__emoji_def:nn {smile } {^^^^^^01f604}
+\__emoji_def:nn {smiley-cat } {^^^^^^01f63a}
+\__emoji_def:nn {smiley } {^^^^^^01f603}
+\__emoji_def:nn {smiling-imp } {^^^^^^01f608}
+\__emoji_def:nn {smirk-cat } {^^^^^^01f63c}
+\__emoji_def:nn {smirk } {^^^^^^01f60f}
+\__emoji_def:nn {smoking } {^^^^^^01f6ac}
+\__emoji_def:nn {snail } {^^^^^^01f40c}
+\__emoji_def:nn {snake } {^^^^^^01f40d}
+\__emoji_def:nn {sneezing-face } {^^^^^^01f927}
+\__emoji_def:nn {snowboarder } {^^^^^^01f3c2}
+\__emoji_def:nn {snowflake } {^^^^2744}
+\__emoji_def:nn {snowman-with-snow } {^^^^2603}
+\__emoji_def:nn {snowman } {^^^^26c4}
+\__emoji_def:nn {sob } {^^^^^^01f62d}
+\__emoji_def:nn {soccer } {^^^^26bd}
+\__emoji_def:nn {solomon-islands } {^^^^^^01f1f8^^^^^^01f1e7}
+\__emoji_def:nn {somalia } {^^^^^^01f1f8^^^^^^01f1f4}
+\__emoji_def:nn {soon } {^^^^^^01f51c}
+\__emoji_def:nn {sos } {^^^^^^01f198}
+\__emoji_def:nn {sound } {^^^^^^01f509}
+\__emoji_def:nn {south-africa } {^^^^^^01f1ff^^^^^^01f1e6}
+\__emoji_def:nn {south-georgia-south-sandwich-islands} {^^^^^^01f1ec^^^^^^01f1f8}
+\__emoji_def:nn {south-sudan } {^^^^^^01f1f8^^^^^^01f1f8}
+\__emoji_def:nn {space-invader } {^^^^^^01f47e}
+\__emoji_def:nn {spades } {^^^^2660}
+\__emoji_def:nn {spaghetti } {^^^^^^01f35d}
+\__emoji_def:nn {sparkle } {^^^^2747}
+\__emoji_def:nn {sparkler } {^^^^^^01f387}
+\__emoji_def:nn {sparkles } {^^^^2728}
+\__emoji_def:nn {sparkling-heart } {^^^^^^01f496}
+\__emoji_def:nn {speak-no-evil } {^^^^^^01f64a}
+\__emoji_def:nn {speaker } {^^^^^^01f508}
+\__emoji_def:nn {speaking-head } {^^^^^^01f5e3}
+\__emoji_def:nn {speech-balloon } {^^^^^^01f4ac}
+\__emoji_def:nn {speedboat } {^^^^^^01f6a4}
+\__emoji_def:nn {spider-web } {^^^^^^01f578}
+\__emoji_def:nn {spider } {^^^^^^01f577}
+\__emoji_def:nn {spiral-calendar } {^^^^^^01f5d3}
+\__emoji_def:nn {spiral-notepad } {^^^^^^01f5d2}
+\__emoji_def:nn {spoon } {^^^^^^01f944}
+\__emoji_def:nn {squid } {^^^^^^01f991}
+\__emoji_def:nn {sri-lanka } {^^^^^^01f1f1^^^^^^01f1f0}
+\__emoji_def:nn {st-barthelemy } {^^^^^^01f1e7^^^^^^01f1f1}
+\__emoji_def:nn {st-helena } {^^^^^^01f1f8^^^^^^01f1ed}
+\__emoji_def:nn {st-kitts-nevis } {^^^^^^01f1f0^^^^^^01f1f3}
+\__emoji_def:nn {st-lucia } {^^^^^^01f1f1^^^^^^01f1e8}
+\__emoji_def:nn {st-pierre-miquelon } {^^^^^^01f1f5^^^^^^01f1f2}
+\__emoji_def:nn {st-vincent-grenadines } {^^^^^^01f1fb^^^^^^01f1e8}
+\__emoji_def:nn {stadium } {^^^^^^01f3df}
+\__emoji_def:nn {star-and-crescent } {^^^^262a}
+\__emoji_def:nn {star-of-david } {^^^^2721}
+\__emoji_def:nn {star } {^^^^2b50}
+\__emoji_def:nn {star2 } {^^^^^^01f31f}
+\__emoji_def:nn {stars } {^^^^^^01f320}
+\__emoji_def:nn {station } {^^^^^^01f689}
+\__emoji_def:nn {statue-of-liberty } {^^^^^^01f5fd}
+\__emoji_def:nn {steam-locomotive } {^^^^^^01f682}
+\__emoji_def:nn {stew } {^^^^^^01f372}
+\__emoji_def:nn {stop-button } {^^^^23f9}
+\__emoji_def:nn {stop-sign } {^^^^^^01f6d1}
+\__emoji_def:nn {stopwatch } {^^^^23f1}
+\__emoji_def:nn {straight-ruler } {^^^^^^01f4cf}
+\__emoji_def:nn {strawberry } {^^^^^^01f353}
+\__emoji_def:nn {stuck-out-tongue-closed-eyes } {^^^^^^01f61d}
+\__emoji_def:nn {stuck-out-tongue-winking-eye } {^^^^^^01f61c}
+\__emoji_def:nn {stuck-out-tongue } {^^^^^^01f61b}
+\__emoji_def:nn {studio-microphone } {^^^^^^01f399}
+\__emoji_def:nn {stuffed-flatbread } {^^^^^^01f959}
+\__emoji_def:nn {sudan } {^^^^^^01f1f8^^^^^^01f1e9}
+\__emoji_def:nn {sun-behind-large-cloud } {^^^^^^01f325}
+\__emoji_def:nn {sun-behind-rain-cloud } {^^^^^^01f326}
+\__emoji_def:nn {sun-behind-small-cloud } {^^^^^^01f324}
+\__emoji_def:nn {sun-with-face } {^^^^^^01f31e}
+\__emoji_def:nn {sunflower } {^^^^^^01f33b}
+\__emoji_def:nn {sunglasses } {^^^^^^01f60e}
+\__emoji_def:nn {sunny } {^^^^2600}
+\__emoji_def:nn {sunrise-over-mountains } {^^^^^^01f304}
+\__emoji_def:nn {sunrise } {^^^^^^01f305}
+\__emoji_def:nn {surfer } {^^^^^^01f3c4}
+\__emoji_def:nn {surfing-man } {^^^^^^01f3c4}
+\__emoji_def:nn {surfing-woman } {^^^^^^01f3c4^^^^200d^^^^2640}
+\__emoji_def:nn {suriname } {^^^^^^01f1f8^^^^^^01f1f7}
+\__emoji_def:nn {sushi } {^^^^^^01f363}
+\__emoji_def:nn {suspension-railway } {^^^^^^01f69f}
+\__emoji_def:nn {swaziland } {^^^^^^01f1f8^^^^^^01f1ff}
+\__emoji_def:nn {sweat-drops } {^^^^^^01f4a6}
+\__emoji_def:nn {sweat-smile } {^^^^^^01f605}
+\__emoji_def:nn {sweat } {^^^^^^01f613}
+\__emoji_def:nn {sweden } {^^^^^^01f1f8^^^^^^01f1ea}
+\__emoji_def:nn {sweet-potato } {^^^^^^01f360}
+\__emoji_def:nn {swimmer } {^^^^^^01f3ca}
+\__emoji_def:nn {swimming-man } {^^^^^^01f3ca}
+\__emoji_def:nn {swimming-woman } {^^^^^^01f3ca^^^^200d^^^^2640}
+\__emoji_def:nn {switzerland } {^^^^^^01f1e8^^^^^^01f1ed}
+\__emoji_def:nn {symbols } {^^^^^^01f523}
+\__emoji_def:nn {synagogue } {^^^^^^01f54d}
+\__emoji_def:nn {syria } {^^^^^^01f1f8^^^^^^01f1fe}
+\__emoji_def:nn {syringe } {^^^^^^01f489}
+\__emoji_def:nn {taco } {^^^^^^01f32e}
+\__emoji_def:nn {tada } {^^^^^^01f389}
+\__emoji_def:nn {taiwan } {^^^^^^01f1f9^^^^^^01f1fc}
+\__emoji_def:nn {tajikistan } {^^^^^^01f1f9^^^^^^01f1ef}
+\__emoji_def:nn {tanabata-tree } {^^^^^^01f38b}
+\__emoji_def:nn {tangerine } {^^^^^^01f34a}
+\__emoji_def:nn {tanzania } {^^^^^^01f1f9^^^^^^01f1ff}
+\__emoji_def:nn {taurus } {^^^^2649}
+\__emoji_def:nn {taxi } {^^^^^^01f695}
+\__emoji_def:nn {tea } {^^^^^^01f375}
+\__emoji_def:nn {telephone-receiver } {^^^^^^01f4de}
+\__emoji_def:nn {telephone } {^^^^260e}
+\__emoji_def:nn {telescope } {^^^^^^01f52d}
+\__emoji_def:nn {tennis } {^^^^^^01f3be}
+\__emoji_def:nn {tent } {^^^^26fa}
+\__emoji_def:nn {thailand } {^^^^^^01f1f9^^^^^^01f1ed}
+\__emoji_def:nn {thermometer } {^^^^^^01f321}
+\__emoji_def:nn {thinking } {^^^^^^01f914}
+\__emoji_def:nn {thought-balloon } {^^^^^^01f4ad}
+\__emoji_def:nn {thumbsdown } {^^^^^^01f44e}
+\__emoji_def:nn {thumbsup } {^^^^^^01f44d}
+\__emoji_def:nn {ticket } {^^^^^^01f3ab}
+\__emoji_def:nn {tickets } {^^^^^^01f39f}
+\__emoji_def:nn {tiger } {^^^^^^01f42f}
+\__emoji_def:nn {tiger2 } {^^^^^^01f405}
+\__emoji_def:nn {timer-clock } {^^^^23f2}
+\__emoji_def:nn {timor-leste } {^^^^^^01f1f9^^^^^^01f1f1}
+\__emoji_def:nn {tipping-hand-man } {^^^^^^01f481^^^^200d^^^^2642}
+\__emoji_def:nn {tipping-hand-woman } {^^^^^^01f481}
+\__emoji_def:nn {tired-face } {^^^^^^01f62b}
+\__emoji_def:nn {tm } {^^^^2122}
+\__emoji_def:nn {togo } {^^^^^^01f1f9^^^^^^01f1ec}
+\__emoji_def:nn {toilet } {^^^^^^01f6bd}
+\__emoji_def:nn {tokelau } {^^^^^^01f1f9^^^^^^01f1f0}
+\__emoji_def:nn {tokyo-tower } {^^^^^^01f5fc}
+\__emoji_def:nn {tomato } {^^^^^^01f345}
+\__emoji_def:nn {tonga } {^^^^^^01f1f9^^^^^^01f1f4}
+\__emoji_def:nn {tongue } {^^^^^^01f445}
+\__emoji_def:nn {top } {^^^^^^01f51d}
+\__emoji_def:nn {tophat } {^^^^^^01f3a9}
+\__emoji_def:nn {tornado } {^^^^^^01f32a}
+\__emoji_def:nn {tr } {^^^^^^01f1f9^^^^^^01f1f7}
+\__emoji_def:nn {trackball } {^^^^^^01f5b2}
+\__emoji_def:nn {tractor } {^^^^^^01f69c}
+\__emoji_def:nn {traffic-light } {^^^^^^01f6a5}
+\__emoji_def:nn {train } {^^^^^^01f68b}
+\__emoji_def:nn {train2 } {^^^^^^01f686}
+\__emoji_def:nn {tram } {^^^^^^01f68a}
+\__emoji_def:nn {triangular-flag-on-post } {^^^^^^01f6a9}
+\__emoji_def:nn {triangular-ruler } {^^^^^^01f4d0}
+\__emoji_def:nn {trident } {^^^^^^01f531}
+\__emoji_def:nn {trinidad-tobago } {^^^^^^01f1f9^^^^^^01f1f9}
+\__emoji_def:nn {triumph } {^^^^^^01f624}
+\__emoji_def:nn {trolleybus } {^^^^^^01f68e}
+\__emoji_def:nn {trophy } {^^^^^^01f3c6}
+\__emoji_def:nn {tropical-drink } {^^^^^^01f379}
+\__emoji_def:nn {tropical-fish } {^^^^^^01f420}
+\__emoji_def:nn {truck } {^^^^^^01f69a}
+\__emoji_def:nn {trumpet } {^^^^^^01f3ba}
+\__emoji_def:nn {tshirt } {^^^^^^01f455}
+\__emoji_def:nn {tulip } {^^^^^^01f337}
+\__emoji_def:nn {tumbler-glass } {^^^^^^01f943}
+\__emoji_def:nn {tunisia } {^^^^^^01f1f9^^^^^^01f1f3}
+\__emoji_def:nn {turkey } {^^^^^^01f983}
+\__emoji_def:nn {turkmenistan } {^^^^^^01f1f9^^^^^^01f1f2}
+\__emoji_def:nn {turks-caicos-islands } {^^^^^^01f1f9^^^^^^01f1e8}
+\__emoji_def:nn {turtle } {^^^^^^01f422}
+\__emoji_def:nn {tuvalu } {^^^^^^01f1f9^^^^^^01f1fb}
+\__emoji_def:nn {tv } {^^^^^^01f4fa}
+\__emoji_def:nn {twisted-rightwards-arrows } {^^^^^^01f500}
+\__emoji_def:nn {two-hearts } {^^^^^^01f495}
+\__emoji_def:nn {two-men-holding-hands } {^^^^^^01f46c}
+\__emoji_def:nn {two-women-holding-hands } {^^^^^^01f46d}
+\__emoji_def:nn {u5272 } {^^^^^^01f239}
+\__emoji_def:nn {u5408 } {^^^^^^01f234}
+\__emoji_def:nn {u55b6 } {^^^^^^01f23a}
+\__emoji_def:nn {u6307 } {^^^^^^01f22f}
+\__emoji_def:nn {u6708 } {^^^^^^01f237}
+\__emoji_def:nn {u6709 } {^^^^^^01f236}
+\__emoji_def:nn {u6e80 } {^^^^^^01f235}
+\__emoji_def:nn {u7121 } {^^^^^^01f21a}
+\__emoji_def:nn {u7533 } {^^^^^^01f238}
+\__emoji_def:nn {u7981 } {^^^^^^01f232}
+\__emoji_def:nn {u7a7a } {^^^^^^01f233}
+\__emoji_def:nn {uganda } {^^^^^^01f1fa^^^^^^01f1ec}
+\__emoji_def:nn {uk } {^^^^^^01f1ec^^^^^^01f1e7}
+\__emoji_def:nn {ukraine } {^^^^^^01f1fa^^^^^^01f1e6}
+\__emoji_def:nn {umbrella } {^^^^2614}
+\__emoji_def:nn {unamused } {^^^^^^01f612}
+\__emoji_def:nn {underage } {^^^^^^01f51e}
+\__emoji_def:nn {unicorn } {^^^^^^01f984}
+\__emoji_def:nn {united-arab-emirates } {^^^^^^01f1e6^^^^^^01f1ea}
+\__emoji_def:nn {unlock } {^^^^^^01f513}
+\__emoji_def:nn {up } {^^^^^^01f199}
+\__emoji_def:nn {upside-down-face } {^^^^^^01f643}
+\__emoji_def:nn {uruguay } {^^^^^^01f1fa^^^^^^01f1fe}
+\__emoji_def:nn {us-virgin-islands } {^^^^^^01f1fb^^^^^^01f1ee}
+\__emoji_def:nn {us } {^^^^^^01f1fa^^^^^^01f1f8}
+\__emoji_def:nn {uzbekistan } {^^^^^^01f1fa^^^^^^01f1ff}
+\__emoji_def:nn {v } {^^^^270c}
+\__emoji_def:nn {vanuatu } {^^^^^^01f1fb^^^^^^01f1fa}
+\__emoji_def:nn {vatican-city } {^^^^^^01f1fb^^^^^^01f1e6}
+\__emoji_def:nn {venezuela } {^^^^^^01f1fb^^^^^^01f1ea}
+\__emoji_def:nn {vertical-traffic-light } {^^^^^^01f6a6}
+\__emoji_def:nn {vhs } {^^^^^^01f4fc}
+\__emoji_def:nn {vibration-mode } {^^^^^^01f4f3}
+\__emoji_def:nn {video-camera } {^^^^^^01f4f9}
+\__emoji_def:nn {video-game } {^^^^^^01f3ae}
+\__emoji_def:nn {vietnam } {^^^^^^01f1fb^^^^^^01f1f3}
+\__emoji_def:nn {violin } {^^^^^^01f3bb}
+\__emoji_def:nn {virgo } {^^^^264d}
+\__emoji_def:nn {volcano } {^^^^^^01f30b}
+\__emoji_def:nn {volleyball } {^^^^^^01f3d0}
+\__emoji_def:nn {vs } {^^^^^^01f19a}
+\__emoji_def:nn {vulcan-salute } {^^^^^^01f596}
+\__emoji_def:nn {walking-man } {^^^^^^01f6b6}
+\__emoji_def:nn {walking-woman } {^^^^^^01f6b6^^^^200d^^^^2640}
+\__emoji_def:nn {walking } {^^^^^^01f6b6}
+\__emoji_def:nn {wallis-futuna } {^^^^^^01f1fc^^^^^^01f1eb}
+\__emoji_def:nn {waning-crescent-moon } {^^^^^^01f318}
+\__emoji_def:nn {waning-gibbous-moon } {^^^^^^01f316}
+\__emoji_def:nn {warning } {^^^^26a0}
+\__emoji_def:nn {wastebasket } {^^^^^^01f5d1}
+\__emoji_def:nn {watch } {^^^^231a}
+\__emoji_def:nn {water-buffalo } {^^^^^^01f403}
+\__emoji_def:nn {watermelon } {^^^^^^01f349}
+\__emoji_def:nn {wave } {^^^^^^01f44b}
+\__emoji_def:nn {wavy-dash } {^^^^3030}
+\__emoji_def:nn {waxing-crescent-moon } {^^^^^^01f312}
+\__emoji_def:nn {waxing-gibbous-moon } {^^^^^^01f314}
+\__emoji_def:nn {wc } {^^^^^^01f6be}
+\__emoji_def:nn {weary } {^^^^^^01f629}
+\__emoji_def:nn {wedding } {^^^^^^01f492}
+\__emoji_def:nn {weight-lifting-man } {^^^^^^01f3cb}
+\__emoji_def:nn {weight-lifting-woman } {^^^^^^01f3cb^^^^200d^^^^2640}
+\__emoji_def:nn {western-sahara } {^^^^^^01f1ea^^^^^^01f1ed}
+\__emoji_def:nn {whale } {^^^^^^01f433}
+\__emoji_def:nn {whale2 } {^^^^^^01f40b}
+\__emoji_def:nn {wheel-of-dharma } {^^^^2638}
+\__emoji_def:nn {wheelchair } {^^^^267f}
+\__emoji_def:nn {white-check-mark } {^^^^2705}
+\__emoji_def:nn {white-circle } {^^^^26aa}
+\__emoji_def:nn {white-flag } {^^^^^^01f3f3}
+\__emoji_def:nn {white-flower } {^^^^^^01f4ae}
+\__emoji_def:nn {white-large-square } {^^^^2b1c}
+\__emoji_def:nn {white-medium-small-square } {^^^^25fd}
+\__emoji_def:nn {white-medium-square } {^^^^25fb}
+\__emoji_def:nn {white-small-square } {^^^^25ab}
+\__emoji_def:nn {white-square-button } {^^^^^^01f533}
+\__emoji_def:nn {wilted-flower } {^^^^^^01f940}
+\__emoji_def:nn {wind-chime } {^^^^^^01f390}
+\__emoji_def:nn {wind-face } {^^^^^^01f32c}
+\__emoji_def:nn {wine-glass } {^^^^^^01f377}
+\__emoji_def:nn {wink } {^^^^^^01f609}
+\__emoji_def:nn {wolf } {^^^^^^01f43a}
+\__emoji_def:nn {woman-artist } {^^^^^^01f469^^^^200d^^^^^^01f3a8}
+\__emoji_def:nn {woman-astronaut } {^^^^^^01f469^^^^200d^^^^^^01f680}
+\__emoji_def:nn {woman-cartwheeling } {^^^^^^01f938^^^^200d^^^^2640}
+\__emoji_def:nn {woman-cook } {^^^^^^01f469^^^^200d^^^^^^01f373}
+\__emoji_def:nn {woman-facepalming } {^^^^^^01f926^^^^200d^^^^2640}
+\__emoji_def:nn {woman-factory-worker } {^^^^^^01f469^^^^200d^^^^^^01f3ed}
+\__emoji_def:nn {woman-farmer } {^^^^^^01f469^^^^200d^^^^^^01f33e}
+\__emoji_def:nn {woman-firefighter } {^^^^^^01f469^^^^200d^^^^^^01f692}
+\__emoji_def:nn {woman-health-worker } {^^^^^^01f469^^^^200d^^^^2695}
+\__emoji_def:nn {woman-judge } {^^^^^^01f469^^^^200d^^^^2696}
+\__emoji_def:nn {woman-juggling } {^^^^^^01f939^^^^200d^^^^2640}
+\__emoji_def:nn {woman-mechanic } {^^^^^^01f469^^^^200d^^^^^^01f527}
+\__emoji_def:nn {woman-office-worker } {^^^^^^01f469^^^^200d^^^^^^01f4bc}
+\__emoji_def:nn {woman-pilot } {^^^^^^01f469^^^^200d^^^^2708}
+\__emoji_def:nn {woman-playing-handball } {^^^^^^01f93e^^^^200d^^^^2640}
+\__emoji_def:nn {woman-playing-water-polo } {^^^^^^01f93d^^^^200d^^^^2640}
+\__emoji_def:nn {woman-scientist } {^^^^^^01f469^^^^200d^^^^^^01f52c}
+\__emoji_def:nn {woman-shrugging } {^^^^^^01f937^^^^200d^^^^2640}
+\__emoji_def:nn {woman-singer } {^^^^^^01f469^^^^200d^^^^^^01f3a4}
+\__emoji_def:nn {woman-student } {^^^^^^01f469^^^^200d^^^^^^01f393}
+\__emoji_def:nn {woman-teacher } {^^^^^^01f469^^^^200d^^^^^^01f3eb}
+\__emoji_def:nn {woman-technologist } {^^^^^^01f469^^^^200d^^^^^^01f4bb}
+\__emoji_def:nn {woman-with-turban } {^^^^^^01f473^^^^200d^^^^2640}
+\__emoji_def:nn {woman } {^^^^^^01f469}
+\__emoji_def:nn {womans-clothes } {^^^^^^01f45a}
+\__emoji_def:nn {womans-hat } {^^^^^^01f452}
+\__emoji_def:nn {women-wrestling } {^^^^^^01f93c^^^^200d^^^^2640}
+\__emoji_def:nn {womens } {^^^^^^01f6ba}
+\__emoji_def:nn {world-map } {^^^^^^01f5fa}
+\__emoji_def:nn {worried } {^^^^^^01f61f}
+\__emoji_def:nn {wrench } {^^^^^^01f527}
+\__emoji_def:nn {writing-hand } {^^^^270d}
+\__emoji_def:nn {x } {^^^^274c}
+\__emoji_def:nn {yellow-heart } {^^^^^^01f49b}
+\__emoji_def:nn {yemen } {^^^^^^01f1fe^^^^^^01f1ea}
+\__emoji_def:nn {yen } {^^^^^^01f4b4}
+\__emoji_def:nn {yin-yang } {^^^^262f}
+\__emoji_def:nn {yum } {^^^^^^01f60b}
+\__emoji_def:nn {zambia } {^^^^^^01f1ff^^^^^^01f1f2}
+\__emoji_def:nn {zap } {^^^^26a1}
+\__emoji_def:nn {zimbabwe } {^^^^^^01f1ff^^^^^^01f1fc}
+\__emoji_def:nn {zipper-mouth-face } {^^^^^^01f910}
+\__emoji_def:nn {zzz } {^^^^^^01f4a4}
+
+% \__emoji_def:nn {united-nations } {^^^^^^01f1fa^^^^^^01f1f3}
+
+\endinput
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
index 87cff357ed..fbd7d1c7a4 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLCrypto.pm
@@ -1,4 +1,4 @@
-# $Id: TLCrypto.pm 53820 2020-02-17 03:23:13Z preining $
+# $Id: TLCrypto.pm 53853 2020-02-21 08:39:42Z preining $
# TeXLive::TLCrypto.pm - handle checksums and signatures.
# Copyright 2016-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
@@ -12,7 +12,7 @@ use TeXLive::TLConfig;
use TeXLive::TLUtils qw(debug ddebug win32 which platform
conv_to_w32_path tlwarn tldie);
-my $svnrev = '$Revision: 53820 $';
+my $svnrev = '$Revision: 53853 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -247,6 +247,7 @@ sub verify_checksum_and_check_return {
if (!$localcopymode) {
tldie("$0: checksum error when downloading $file from $path: $m\n");
}
+ return(0, $r);
} elsif ($r == $VS_SIGNATURE_ERROR) {
tldie("$0: signature verification error of $file from $path: $m\n");
} elsif ($r == $VS_CONNECTION_ERROR) {
@@ -278,6 +279,8 @@ sub verify_checksum_and_check_return {
} else {
tldie("$0: unexpected return value from verify_checksum: $r\n");
}
+ # we should never come here, but just to be sure
+ return(0, $r);
}
diff --git a/systems/texlive/tlnet/tlpkg/texlive.tlpdb b/systems/texlive/tlnet/tlpkg/texlive.tlpdb
index ca06389223..dfd489b22b 100644
--- a/systems/texlive/tlnet/tlpkg/texlive.tlpdb
+++ b/systems/texlive/tlnet/tlpkg/texlive.tlpdb
@@ -26,7 +26,7 @@ depend container_split_src_files/1
depend frozen/0
depend minrelease/2016
depend release/2019
-depend revision/53851
+depend revision/53863
name 00texlive.image
category TLCore
@@ -102677,11 +102677,11 @@ binfiles arch=i386-solaris size=2
name epspdf.win32
category Package
-revision 47104
+revision 53854
shortdesc win32 files of epspdf
-containersize 5252
-containerchecksum 7789518dfb9beaabaada4318b9a0773f77eef279a15d3078cd2d6fd0733ee543fa3849e2c254d4b109161f0996068a45b3ab15eabd90e6ad65a44b3ac4a3447c
-binfiles arch=win32 size=4
+containersize 8348
+containerchecksum b940f8a6243a166380c43adf1b47988e811168e2c94bed42588fdaaa04edb7bacaf19fa7c7ba7c1a7cb38cb5718cb035984795c8ed246482f54df383a465e361
+binfiles arch=win32 size=5
bin/win32/epspdf.exe
bin/win32/epspdftk.exe
@@ -118043,7 +118043,7 @@ catalogue-version 1.002
name fontspec
category Package
-revision 53656
+revision 53860
shortdesc Advanced font selection in XeLaTeX and LuaLaTeX
relocated 1
longdesc Fontspec is a package for XeLaTeX and LuaLaTeX. It provides an
@@ -118057,19 +118057,19 @@ depend l3packages
depend xunicode
depend lm
depend euenc
-containersize 26640
-containerchecksum 4cdb42b146883008b8dc0fbfefaf15b8580532ca4f6281da9bdd4c5f067fc98b302a33e4a16b8b23fd73d37c516af3d0e787c736a3000f0bb588f62766b0ecbe
-doccontainersize 1196228
-doccontainerchecksum 9662314513b3c1f300584c3be535723bccd6ae02f755acb2d3ca5d419b78ff7af00ca68173cc1a07ab2280b38ee713daf7f84b7377ccce43a833c86d6707be97
-docfiles size=317
+containersize 26792
+containerchecksum ef65e31a03f5bfe5dad80aa3bd33c5eca727e3200a9cee5bb199908accf429464efcf999680b02776f2ca49f8bf8175520fc91bf37eee03bd9e0fe87feadc941
+doccontainersize 1189088
+doccontainerchecksum c3f3c52ba06d107913d2b47c9784b1807461051dfb9e3705efaa5ea3a400f98c975f200411599ea5755c46d9919e4f90721e8d7f8ae89e940866a2beb88b4424
+docfiles size=314
RELOC/doc/latex/fontspec/CHANGES.md
RELOC/doc/latex/fontspec/LICENSE
RELOC/doc/latex/fontspec/README.md details="Package README"
RELOC/doc/latex/fontspec/fontspec-code.pdf
RELOC/doc/latex/fontspec/fontspec-example.tex
RELOC/doc/latex/fontspec/fontspec.pdf details="Package documentation"
-srccontainersize 82840
-srccontainerchecksum eb9b58b0e142dd005c3cb739784969a42781cb1d6e7e0415032b0d8e1910e1accdfe695b261988181464032470fa16e0eb68b3163129246dac6a2a554d74fcff
+srccontainersize 83044
+srccontainerchecksum ec740228a34972d328e854f45678dc421c92dffb105d743ffe8845b56ad581031a7f97b28c2703a9c7166fa4c166af45f9f2be69a7cec94d6f0bfd85123d453b
srcfiles size=118
RELOC/source/latex/fontspec/fontspec-code-api.dtx
RELOC/source/latex/fontspec/fontspec-code-closing.dtx
@@ -118106,7 +118106,7 @@ srcfiles size=118
RELOC/source/latex/fontspec/fontspec.dtx
RELOC/source/latex/fontspec/fontspec.ins
RELOC/source/latex/fontspec/fontspec.ltx
-runfiles size=80
+runfiles size=81
RELOC/tex/latex/fontspec/fontspec-luatex.sty
RELOC/tex/latex/fontspec/fontspec-xetex.sty
RELOC/tex/latex/fontspec/fontspec.cfg
@@ -118117,7 +118117,7 @@ catalogue-contact-repository https://github.com/wspr/fontspec/
catalogue-ctan /macros/latex/contrib/fontspec
catalogue-license lppl1.3c
catalogue-topics font-sel luatex xetex
-catalogue-version 2.7h
+catalogue-version 2.7i
name fonttable
category Package
@@ -146826,7 +146826,7 @@ catalogue-version 0.0.2
name keyvaltable
category Package
-revision 51288
+revision 53861
shortdesc Re-usable table layouts separating content and presentation
relocated 1
longdesc The main goal of this package is to offer means for typesetting
@@ -146836,26 +146836,26 @@ longdesc for tables of the same type. For this purpose, the package
longdesc provides the environment KeyValTable, which allows one to
longdesc typeset tables that have a previously defined column layout and
longdesc whose rows can be produced in a key-value fashion.
-containersize 6988
-containerchecksum b7a0fc52feb2a4e4bf6b626701f7d4fcc455e4ebd560389f2ac7eb15e9cb2ba814ed3f179c1662364ddd4fdd899158f863656555e9d3bfe08ab03ac2471c1025
-doccontainersize 402220
-doccontainerchecksum 277544403f8e06739789396077dfa08b3a0fecb99c8eaf41dc61528d66f0765a519a8314b85196bca5adb733dd1356034b72c9a949fe0d09a845ed3d35ddce5e
-docfiles size=103
+containersize 7624
+containerchecksum 7d60a87919114209b20bae17603f53b8b22bb1b4ec6b9e411488a9e0eeec661376c0f74c7fa0f229c5bbec771b23e1d0fd8b8ec1167a8f98432f2f196568bec1
+doccontainersize 425960
+doccontainerchecksum 6988e60ca067d77b82c5c339bfe958c0d486c04869c0b74f9c92fe87946079a380a0863edadf136bc54a849f4a751621f649feca591a8d89a402a88453a359c2
+docfiles size=109
RELOC/doc/latex/keyvaltable/README.md details="Readme"
RELOC/doc/latex/keyvaltable/keyvaltable.pdf details="Package documentation"
-srccontainersize 31816
-srccontainerchecksum 039b27d55b8b51a4d49e8e06cdebf3266633a3ee658f7c99e191d248c27ed05ebae7bb433bc5b242d815a795160e13ab8a0853e92147979a6ac0a1568e013662
-srcfiles size=35
+srccontainersize 34428
+srccontainerchecksum c1b6c85c3c292b3dbcc811fdce7d1e9fc45ae03717e83c317c4623c9f1edbb06a3ef115dbc742be2b440f9642bc8c95e77d33bf3c5adde7a92da7bcb0b008002
+srcfiles size=38
RELOC/source/latex/keyvaltable/keyvaltable.dtx
RELOC/source/latex/keyvaltable/keyvaltable.ins
-runfiles size=7
+runfiles size=8
RELOC/tex/latex/keyvaltable/keyvaltable.sty
catalogue-contact-bugs https://github.com/Ri-Ga/keyvaltable/issues
catalogue-contact-repository https://github.com/Ri-Ga/keyvaltable
catalogue-ctan /macros/latex/contrib/keyvaltable
catalogue-license lppl1.2
catalogue-topics table
-catalogue-version 2.0
+catalogue-version 2.1
name kix
category Package
@@ -151443,7 +151443,7 @@ catalogue-topics latex3 expl3 macro-supp pre-release
name l3build
category Package
-revision 53834
+revision 53862
shortdesc A testing and building system for (La)TeX
longdesc The build system supports testing and building LaTeX3 code, on
longdesc Linux, Mac OS X and Windows systems. The package offers: A unit
@@ -151455,10 +151455,10 @@ longdesc material released by the LaTeX3 team, and may be updated on a
longdesc different schedule.
depend luatex
depend l3build.ARCH
-containersize 31944
-containerchecksum 95db7312c62e414c865731567f22dcd86860a069c61dd38ddaa6e8aea5b26c7b1b988abbc5b903e0069ec8c24e65af0b98c63544e89122c561081d9ea1fcc29c
-doccontainersize 722200
-doccontainerchecksum 2b0a06d8974ddaea99c9b69c844969c28994e4b57d2524161bf85170ee04174a7520293a0d86e1eb00a26da31e2dd62194455caeb7093336a2b039678fa99cd2
+containersize 31844
+containerchecksum c18aa191efa5c9af53a7012e4453ad615178e90798377ba0de39434c917c99732799edd3a3b89f719ae4c79da8fe4b97d867778d9cc01db81e6ff68fd9a441f1
+doccontainersize 722904
+doccontainerchecksum 94eea53a369def65df51ad48fbbcba851d1c6d9208c7ee1475af284752e853c4f9286e70010f494803bc02fe26afdc421143cb5eb659093d2ff0580e0f4c5b40
docfiles size=183
texmf-dist/doc/latex/l3build/CHANGELOG.md
texmf-dist/doc/latex/l3build/CONTRIBUTING.md
@@ -151466,8 +151466,8 @@ docfiles size=183
texmf-dist/doc/latex/l3build/l3build.pdf details="Package documentation"
texmf-dist/doc/man/man1/l3build.1
texmf-dist/doc/man/man1/l3build.man1.pdf
-srccontainersize 29224
-srccontainerchecksum 32b97fa7da96e1277f3dc48a9eb1a03211072e0adada0566ae299823c8c5edb16a17c4e128f70067a71895eef01bf6b512dc667ce46d305b9031e399d50c6cc9
+srccontainersize 29304
+srccontainerchecksum 1e15ccc9f0b71115935325eb97698b2660ad479f08e66a18634be2a5703d3b86f6953f4bc3570d95a1964d841dc026efb1663923ce962db767aa2711b5ef259c
srcfiles size=27
texmf-dist/source/latex/l3build/l3build.dtx
texmf-dist/source/latex/l3build/l3build.ins
@@ -151740,7 +151740,7 @@ catalogue-topics macro-supp layout latex3 pre-release
name l3kernel
category Package
-revision 53781
+revision 53862
shortdesc LaTeX3 programming conventions
relocated 1
longdesc The l3kernel bundle provides an implementation of the LaTeX3
@@ -151750,11 +151750,11 @@ longdesc LaTeX3 kernel and other future code are built: it is an API for
longdesc TeX programmers. The packages are set up so that the LaTeX3
longdesc conventions can be used with regular LaTeX2e packages.
depend l3backend
-containersize 148736
-containerchecksum 39686645f99af949da1776ca1f13c9a02104ea73fcb825d04193f17fb5183b76d170db1531f8e31e61a825637003febb61fb9227070a678d611656040f46c1fe
-doccontainersize 9937192
-doccontainerchecksum 01d31c3922d934973200cef6ef8e914a4f37fc7317dd58fb52828cc631553fd6f6d10bf59c501a33ce6de52d4f3662a60def887e43d98da4640480ad52fd9d5e
-docfiles size=2801
+containersize 148716
+containerchecksum 18a7028a3e4e380a015769bbaa9fbf83c26c5da5d743777216d1d7fd5bfb0950f933d1d3a6596323a3a0ad0b93dbb78980d89229e6bba231c5f97d245f81de38
+doccontainersize 9955180
+doccontainerchecksum ed3d4151206921bdbf2449cc9c9da9bc43b34ca0dd41f0edeb0d8409a4360bbf768025e9573b3f85493077fe8281fe560b6765de99c0768b3dca2d174afbce18
+docfiles size=2806
RELOC/doc/latex/l3kernel/CHANGELOG.md
RELOC/doc/latex/l3kernel/README.md details="Readme"
RELOC/doc/latex/l3kernel/expl3.pdf details="The LaTeX3 Programming Language"
@@ -151800,9 +151800,9 @@ docfiles size=2801
RELOC/doc/latex/l3kernel/source3.pdf
RELOC/doc/latex/l3kernel/source3.tex
RELOC/doc/latex/l3kernel/source3body.tex
-srccontainersize 529452
-srccontainerchecksum f2322b13b7d7b6ec0357e6d504898ba53a891fe66af1150ee3aa1170aa697411d7d7493d597d0719c3b4815f6a2e1dd502d32b612d2ca971150852cb0afab4ec
-srcfiles size=817
+srccontainersize 530100
+srccontainerchecksum 1896e03d3e07384c3e8afa6b6a7312c73d1ed26891b6e6f8cb786af82daaaf4fe790c3873fb288863d2f926be753139a557450a0df6c606516bb867d4fe1d7fd
+srcfiles size=818
RELOC/source/latex/l3kernel/expl3.dtx
RELOC/source/latex/l3kernel/l3.ins
RELOC/source/latex/l3kernel/l3alloc.dtx
@@ -151885,7 +151885,7 @@ runfiles size=309
RELOC/tex/latex/l3kernel/l3str-enc-iso88597.def
RELOC/tex/latex/l3kernel/l3str-enc-iso88598.def
RELOC/tex/latex/l3kernel/l3str-enc-iso88599.def
-catalogue-also l3packages l3experimental
+catalogue-also l3backend l3packages l3experimental
catalogue-contact-bugs https://github.com/latex3/latex3/issues
catalogue-contact-home http://www.latex-project.org/code.html
catalogue-contact-repository https://github.com/latex3/latex3
@@ -152670,7 +152670,7 @@ catalogue-version 1.2m
name latex
category Package
-revision 53771
+revision 53857
shortdesc A TeX macro package that defines LaTeX
relocated 1
longdesc LaTeX is a widely-used macro package for TeX, providing many
@@ -152692,11 +152692,11 @@ depend luatex
depend pdftex
depend latexconfig
depend latex-fonts
-containersize 168600
-containerchecksum 6cabc1776874e9806565137fb0260095abd5dbe5bfd18e2d6f4b32977f0fa65cd56b73287e79c2e5966cf22c15a9e991269a52ebbff5d004244d3aa4427a0282
-doccontainersize 18424840
-doccontainerchecksum b9cbc2a9e653dd8a4939b1970afc6182e0da9207e8de6e0a387cdc49c7258b4f630b2ea95e70cefaaaa3ff11c58c2176d342dc5b0410ae626487f3ec1bce2a02
-docfiles size=5684
+containersize 168616
+containerchecksum ce5a34e7119d03fbfa7498e4e10b33d15a52687a06d5959a2ce92b21a37b21848e8e0fa2ec4da823fb9dca01ffcf76a4456fe00be3c3f6058fa5590d9f00742e
+doccontainersize 18428188
+doccontainerchecksum 034b8b816d616990b8542733fae3a813922dd3995e24af595e88b1805c1d5e387366f6f43f29d03aea7f48aae616b0ed393ab086b49777a00dcb08132b236908
+docfiles size=5685
RELOC/doc/latex/base/README.md
RELOC/doc/latex/base/alltt.pdf
RELOC/doc/latex/base/bugs.txt
@@ -152826,8 +152826,8 @@ docfiles size=5684
RELOC/doc/latex/base/utf8ienc.pdf
RELOC/doc/latex/base/webcomp.err
RELOC/doc/latex/base/webcomp.pdf
-srccontainersize 523452
-srccontainerchecksum 54e4c192b7d89b08c661b29dc783177e7219fd53c29bc8135e903236d1eb5b0fe462712d2cb2042c89a21af2caf4b29e397c2f0efbb631d7f72a32c98702e629
+srccontainersize 524152
+srccontainerchecksum bf3c4fa1aee20274c32e8d185909239331528e2fd998c858cb8aee0fa1ce1a290bf45b91908099ca4bf537e7640401aaf5a6e93d6548c16ba99be2c89a0ffb23
srcfiles size=775
RELOC/source/latex/base/alltt.dtx
RELOC/source/latex/base/alltt.ins
@@ -153088,7 +153088,7 @@ runfiles size=460
catalogue-contact-home http://www.latex-project.org/
catalogue-license lppl1.3c
catalogue-topics format
-catalogue-version 2020-02-02-PL2
+catalogue-version 2020-02-02-PL3
name latex-amsmath-dev
category Package
@@ -197722,7 +197722,7 @@ catalogue-version 0.7
name nameauth
category Package
-revision 43586
+revision 53863
shortdesc Name authority mechanism for consistency in body text and index
relocated 1
longdesc Publications, that reference many names, require editors and
@@ -197731,28 +197731,27 @@ longdesc package offers name authority macros that allow authors and
longdesc compilers to normalize occurrences of names, variant name
longdesc forms, and pen names in the text and index. This may help
longdesc minimize writing and production time and cost.
-containersize 6128
-containerchecksum e393937e84856a21433266f18f78d739036df951f68d21ff17c607206abcf6b77f32253be2e7a771f10f1f789df47fe6bd45f629417eff94b91ff9b4f7179f74
-doccontainersize 976704
-doccontainerchecksum b586f85eb88204670384a0c7559219704f92c9f03922f98ca01ae2a8206ba3afbd920f94374f3c62ea3923129708a2edd74bc9b79be0d09ed1c29491811cc2d1
-docfiles size=245
- RELOC/doc/latex/nameauth/Makefile
+containersize 6632
+containerchecksum 67af95a1ff8c6f4780ddcf184f162c9c1a107243f833d984425aa36fb7360ae7e8b2633506d5156aebade1ba49f0e29a38e0ccbd72c989b021d2618fcf270f35
+doccontainersize 1052036
+doccontainerchecksum e6dd5adc394f8b0431260f92b8ffc1e846d6c12288541e4ac17b04f6e357fce9ee445673de55fecaba94ee6dbac53cdb3ef54c88140217db58af7d9900a2875a
+docfiles size=271
RELOC/doc/latex/nameauth/README details="Readme"
RELOC/doc/latex/nameauth/README.txt
RELOC/doc/latex/nameauth/examples.tex
- RELOC/doc/latex/nameauth/nameauth.hd
RELOC/doc/latex/nameauth/nameauth.pdf details="Package documentation"
-srccontainersize 63968
-srccontainerchecksum 781de5fa5d74cf295718a0225e5faa87c3f65aa7f42def1610eb43ea86371ee3dff406f7b7fb7ff5a1dcfba84671847ac975bd55b14ec15875712405d912bd9f
-srcfiles size=81
+srccontainersize 72504
+srccontainerchecksum b3ac5f253e84c299c708a93561d2efd6cb9b12507037a7196aaa8d4f6ca1b2eddf53c1b63021e46af0b66a1fa6d676a3ca15477458c639839f2882b825cac924
+srcfiles size=96
+ RELOC/source/latex/nameauth/Makefile
RELOC/source/latex/nameauth/nameauth.dtx
RELOC/source/latex/nameauth/nameauth.ins
-runfiles size=12
+runfiles size=13
RELOC/tex/latex/nameauth/nameauth.sty
catalogue-ctan /macros/latex/contrib/nameauth
catalogue-license lppl1.3
catalogue-topics editorial editorial-consistency
-catalogue-version 3.2
+catalogue-version 3.3
name namespc
category Package
@@ -249843,7 +249842,7 @@ catalogue-version 4.0
name rgltxdoc
category Package
-revision 51166
+revision 53858
shortdesc Common code for documentation of the author's packages
relocated 1
longdesc This package combines several other packages and defines
@@ -249852,15 +249851,15 @@ longdesc The package mainly serves the purpose of combining the
longdesc preferences used in the author's own package documentations.
longdesc However, others can use the package as well. Compatibility
longdesc between versions cannot be guaranteed, however.
-containersize 3356
-containerchecksum dce35e42e8a81cef5f31db1beddcae93b7c02a8baf3563e21a95d5f3a13daca83368c432702e7836dc9ed8cac2e55e0276062a643ced3b41ac85db9280e74d99
-doccontainersize 160052
-doccontainerchecksum c194c7464e2e3689309aa54a4a26d5bdc30f0b865448b1b3e51b8cc7288a91ae2d40914de3064d766e7142c0c319ad389a166711cef2d9758ff2309b7a86fb36
-docfiles size=41
+containersize 3340
+containerchecksum 85b9166bb4408d3b1091b033455650fdf53b24c2fce821c872420191390a1bfbf457326a1a85aab1bf0d6c15765275337764f87adcb393464f2533e2462f10c3
+doccontainersize 161168
+doccontainerchecksum 5e35c6d1e6883c895d031f047fff1ededd4629158a8958b61fb6fcbd885c57797726f595894081b4933c78e5f346289a020424405e0dcae6df40b279b86395cb
+docfiles size=42
RELOC/doc/latex/rgltxdoc/README.md details="Readme"
RELOC/doc/latex/rgltxdoc/rgltxdoc.pdf details="Package documentation"
-srccontainersize 9400
-srccontainerchecksum 8df979de9f4ac297ee94d7fc3758e9c7e2430ee8ed6206012a55f15a57c4c683c65dc186b835fd7a1864a5437c41875b0aea136b00d5808f5c4d10641824a7c7
+srccontainersize 9516
+srccontainerchecksum 8f94655ca8d0006aed02fa7e8fd28c5e3b8be6e92ab010a674d85bc88ce8f6e0120392540fcf5f7649a4af1e6bed4e0aec3d1d15cd095738beeb709fa2efe526
srcfiles size=9
RELOC/source/latex/rgltxdoc/rgltxdoc.dtx
RELOC/source/latex/rgltxdoc/rgltxdoc.ins
@@ -249871,7 +249870,7 @@ catalogue-contact-repository https://github.com/Ri-Ga/rgltxdoc
catalogue-ctan /macros/latex/contrib/rgltxdoc
catalogue-license lppl1.2
catalogue-topics doc-supp
-catalogue-version 1.2
+catalogue-version 1.3
name ribbonproofs
category Package
@@ -261809,7 +261808,7 @@ catalogue-version 1.0
name siunitx
category Package
-revision 53414
+revision 53856
shortdesc A comprehensive (SI) units package
relocated 1
longdesc Typesetting values with units requires care to ensure that the
@@ -261834,19 +261833,18 @@ longdesc The package relies on LaTeX 3 support from the l3kernel and
longdesc l3packages bundles.
depend l3kernel
depend l3packages
-containersize 35144
-containerchecksum 3a6295ec6a5c1154501963e8c857425224c54ff44082541ee319d51f41a0a26646618435ef78a1f55a25ad3b7e691ee7a4d884b497b10cbc0873928677dcf54a
-doccontainersize 1759948
-doccontainerchecksum 262add0413e7e498172502cb81c691941a0e42fcd91fb52be9122a15e04411d8e6142e49503d6b1b260bfd0f206445ada48e597f9c8f007d36fd481b345662cf
-docfiles size=445
+containersize 34640
+containerchecksum 98f11eadac969a7257a98e98a6e6d7bdfe71bbefc3e96003c54aa5fc6592536a1d928ec6068fde2e63bea7a817e09dc31cdaaa0307d565b0fb8371e36cd7f83d
+doccontainersize 629712
+doccontainerchecksum be488a00d1a894891cdf632064480d44ba7ddc521c87fbcb190de3aff9aa87518df3961c434dd263b6ed1c8f188d2f0ffac7ab44f3e2ba8b247d6b7e66a784bc
+docfiles size=158
RELOC/doc/latex/siunitx/README.md details="Readme"
- RELOC/doc/latex/siunitx/siunitx-code.pdf details="Code documentation"
RELOC/doc/latex/siunitx/siunitx.pdf details="User manual"
-srccontainersize 104184
-srccontainerchecksum 539cc545fc7fc6ca09dee74a12c0828033af5c5eebda084c0cd65c80cf6ef50a5818011dd44579de6315f199cc9933f8c911e1089ca5a57bcd7e91105f4489b2
-srcfiles size=152
+srccontainersize 103308
+srccontainerchecksum 90767e7b2aa88f3da772b084ada37694dee1c40337f88bbe717255786b065e6408fd0e348c22f796c745d1ec17ea8acf483ec31d7312717d605f19470522e303
+srcfiles size=150
RELOC/source/latex/siunitx/siunitx.dtx
-runfiles size=79
+runfiles size=78
RELOC/tex/latex/siunitx/siunitx-abbreviations.cfg
RELOC/tex/latex/siunitx/siunitx-binary.cfg
RELOC/tex/latex/siunitx/siunitx-version-1.cfg
@@ -261857,7 +261855,7 @@ catalogue-contact-repository https://github.com/josephwright/siunitx
catalogue-ctan /macros/latex/contrib/siunitx
catalogue-license lppl1.3c
catalogue-topics units scientific-docs expl3
-catalogue-version 2.7u
+catalogue-version 2.8
name skak
category Package
@@ -284278,7 +284276,7 @@ binfiles arch=x86_64-solaris size=1
name texdoc
category TLCore
-revision 53643
+revision 53859
shortdesc Documentation access for TeX Live
longdesc texdoc is a Lua script providing easy access to the
longdesc documentation in TeX Live: PDF, DVI, plain text files, and
@@ -284288,10 +284286,10 @@ longdesc program by the same name to do the same job, but its
longdesc implementation is unrelated.
depend kpathsea
depend texdoc.ARCH
-containersize 26672
-containerchecksum 8eb1eace5ee79430d6aa6584f3f11acad1d173d20c9d56b168d2a6ec042dea206ec8d70136511e09bee741c9a11357c66f096b80bbcda38ac6e86f31be4b5463
-doccontainersize 132400
-doccontainerchecksum c23cedadaa8508524207d6ffeb4f11fb5baef5f1e47c5b3f017563ac08a27e7df91e9a68357fab79b38481254bd0e19aa61bf7ea75be26d1d60d1be27dda19b5
+containersize 26728
+containerchecksum ff55c658b4baf265bf9ca2ba6e5a161eecc1c75bd112e6400c9df4708ae3f355dcff277cb60ff0178bd41940d090e3dd28a7ce06421f509b352489d7a8d98b2c
+doccontainersize 132412
+doccontainerchecksum 54931eb9882415f2182fed56b4905c723bb0df1444b1e2af939e2b6093ed9acceba6af7d46d6aceeac853686a57e366c13ab76da05f18469da61c36588ce66c1
docfiles size=52
texmf-dist/doc/man/man1/texdoc.1
texmf-dist/doc/man/man1/texdoc.man1.pdf
@@ -284321,7 +284319,7 @@ catalogue-contact-support http://lists.tug.org/texdoc
catalogue-ctan /support/texdoc
catalogue-license gpl
catalogue-topics view-doc
-catalogue-version 3.2
+catalogue-version 3.2.1
name texdoc.aarch64-linux
category TLCore
@@ -296910,11 +296908,11 @@ binfiles arch=i386-solaris size=1
name tlshell.win32
category TLCore
-revision 52301
+revision 53854
shortdesc win32 files of tlshell
-containersize 3934704
-containerchecksum 005f629bf552a6e629bcdd6d649970d9434c14701f34e95567d00af423cd5040212c9bdbebd8064517f08aaf3b92711abcffc7c94c4ae7282303d4222d047c1d
-binfiles arch=win32 size=1543
+containersize 3941456
+containerchecksum a08af85a67ff491f4099c500628d14b54aaa87e8a8c656a0615328d2a86540a10e4cdd40e7fdaedfa90fd4536f660f6c1c501d2bee4de6a94f7220b0c3827dd0
+binfiles arch=win32 size=1545
bin/win32/tlshell.exe
tlpkg/tltcl/tclkit.exe
tlpkg/tltcl/tclkit.exe.manifest
@@ -313948,7 +313946,7 @@ catalogue-topics biblatex
name wintools.win32
category TLCore
-revision 52828
+revision 53854
shortdesc utilities provided only for Windows
longdesc Common utilities, mainly from the w32tex distribution.
postaction filetype name="TL.bitmap2eps.convert" cmd='"TEXDIR/bin/win32/bitmap2eps.exe" "%1"'
@@ -313960,10 +313958,10 @@ postaction progid extension=.jpe filetype="TL.bitmap2eps.convert"
postaction progid extension=.jpeg filetype="TL.bitmap2eps.convert"
postaction progid extension=.tif filetype="TL.bitmap2eps.convert"
postaction progid extension=.tiff filetype="TL.bitmap2eps.convert"
-containersize 4788948
-containerchecksum 9fd1a810e0aab90588d03512097676e36965690b355813fa4760dee761140555f1e62d463e82f6fdf1c33cd41fae4030f784bc7b6a7afb63f8d44852b7ee0b7e
+containersize 4796672
+containerchecksum af7d4af85936d48c9c861806b5d0b5d45f6591ea34b5b698d6e2aa49b0e3f1379b3d3b03219ffcf3ecef371e5bb6c156b9b07188339853a7d898ca0cdbb7283a
doccontainersize 973264
-doccontainerchecksum 5bceaaf15a7fb1ec158e3fdc3b941c657e2617f32d0cf1d6ec7827fd016c980110f35a07c74d7b7cc2c95c8762d9dae771485857dfae48b8154c45765ccf19fd
+doccontainerchecksum 6fa563f1ab18b3286ecbe96a6a25386840a8bdfe034fa405d502075d8328ea2686e828242c2cf99328a966d924eecddb468de71739cd8d55a10876614006e518
docfiles size=332
texmf-dist/doc/support/tlaunch/COPYING
texmf-dist/doc/support/tlaunch/Changes
@@ -314002,7 +314000,7 @@ runfiles size=3
texmf-dist/scripts/bitmap2eps/bitmap2eps.vbs
texmf-dist/scripts/tlaunch/tlaunchmode.pl
texmf-dist/web2c/tlaunch.ini
-binfiles arch=win32 size=7435
+binfiles arch=win32 size=7437
bin/win32/aftopl.exe
bin/win32/bitmap2eps.exe
bin/win32/bmeps.exe
diff --git a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5 b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
index c5f05fdbce..52db866e46 100644
--- a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
+++ b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.md5
@@ -1 +1 @@
-75f7dc21329e0813b695ec78635bbf28 texlive.tlpdb
+e00b3fc471bc093d2b83b7f5d7f13eb0 texlive.tlpdb
diff --git a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512 b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
index 8cb1d8b2bb..282e5e0d80 100644
--- a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
+++ b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512
@@ -1 +1 @@
-dcc36b10dec1465a664cf6d108497fbc98b94ef0f431988ad53ce5161b7590092be4e11443391daa794da08b8179dd546a11103f08b1cfffb81e4484005b16aa texlive.tlpdb
+0d90334f6bd5849e401d9ac0cf7eb8dc0f1739039ed789efa6d28fc8ca3c1eb10920e147cafc89657059c5b284bf1b5af319c9d766cefd906c149d75ec50952a texlive.tlpdb
diff --git a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
index cb6d8de8ac..f287c49542 100644
--- a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
+++ b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.sha512.asc
@@ -1,10 +1,10 @@
-----BEGIN PGP SIGNATURE-----
-iQEcBAEBCgAGBQJeTypqAAoJEEzhh34ZQ4xwjtoH/R9GB5BXgPVJPGNpAtCyZTal
-3dEuLVhLTXH42CfHHnIHi2nsPlM3ytT5qu5PT9Ykef7Su63MpfHgWUK0OLe4S9Kj
-KNnL3zJp8aoydSJf9xsBW6uTvPGzQF9Mx1owMm8TR2yFimiubAqQhe0JNpFFD+Vj
-wd2W1tKU0mIttlgcEhwFjdX+PkKQiryV+a2rnLsDhi1w6VKUsVLPZko1IyqDydcj
-+kztdkVEa3lzwe5fIjQaEw1dZkYf24l586FjRMwSoHFFzGokckfZn/cjmGHGo9na
-TTEZKKH8mUNlcMQPjFxWNDGgdCzO2GwOXKiNdUxjSPckGXEGlsuko/jncSG9chk=
-=S47S
+iQEcBAEBCgAGBQJeUHwLAAoJEEzhh34ZQ4xwRNUH+gPYxC1ubnphkzy/AAp9F4YZ
+dL3NEywoK/Q/WjjthSHoCZAHKuag01KSgDzrVbAbdqIct10i0le6Sx+taFnDen1t
+j+yMd/ANtXVA6EtUswtrZRBeiTaUY16oF9vURGkt2PynTASMHZ+hPFqvwIGTmHd9
+YR/T5ptAVsV0CHV3BSvoNUjAmKhqFDkI+BfoVNboQn2T8WqWvk07clORlTroVZ7W
+uSCrsxGFUW2bAN0Igxa5jxuHJSZWW+p53Me0CGTV5jbe1dq50UdoFu7f3t672Y0p
+C9KVk7xG+E91zWTAV1GVIe3n0YlFYHps0GZeWwm7lYu9zgUUJaME/gdDROkTF0E=
+=Kg6M
-----END PGP SIGNATURE-----
diff --git a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
index ffd63bb937..636595f0c7 100644
--- a/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
+++ b/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
Binary files differ
diff --git a/systems/win32/miktex/tm/packages/files.csv.lzma b/systems/win32/miktex/tm/packages/files.csv.lzma
index 1bfe1be403..32a35b6696 100644
--- a/systems/win32/miktex/tm/packages/files.csv.lzma
+++ b/systems/win32/miktex/tm/packages/files.csv.lzma
Binary files differ
diff --git a/systems/win32/miktex/tm/packages/next/pr.ini b/systems/win32/miktex/tm/packages/next/pr.ini
index 8faa46fe2a..d0025f102d 100644
--- a/systems/win32/miktex/tm/packages/next/pr.ini
+++ b/systems/win32/miktex/tm/packages/next/pr.ini
@@ -2,9 +2,9 @@
[repository]
-date=1582319739
+date=1582406081
lastupd=miktex-arctrl-bin-2.9 miktex-arctrl-bin-x64-2.9 miktex-asymptote-bin-2.9 miktex-asymptote-bin-x64-2.9 miktex-autosp-bin-2.9 miktex-autosp-bin-x64-2.9 miktex-axohelp-bin-2.9 miktex-axohelp-bin-x64-2.9 miktex-bibarts-bin-2.9 miktex-bibarts-bin-x64-2.9 miktex-bibtex-bin-2.9 miktex-bibtex-bin-x64-2.9 miktex-bibtex8bit-bin-2.9 miktex-bibtex8bit-bin-x64-2.9 miktex-bzip2-bin-2.9 miktex-bzip2-bin-x64-2.9 miktex-cairo-bin-2.9 miktex-cairo-bin-x64-2.9 miktex-chktex-bin-2.9 miktex-chktex-bin-x64-2.9
-lstdigest=2b69fafa2bc85a853f214abe1797c7a4
+lstdigest=978b579b8588e3a9b89945af1099597b
numpkg=3863
relstate=next
-version=7356
+version=7357
diff --git a/systems/win32/miktex/tm/packages/pr.ini b/systems/win32/miktex/tm/packages/pr.ini
index a5e82b0f72..99ebc19c0c 100644
--- a/systems/win32/miktex/tm/packages/pr.ini
+++ b/systems/win32/miktex/tm/packages/pr.ini
@@ -2,9 +2,9 @@
[repository]
-date=1582319487
-lastupd=ltxbase siunitx lexend lwarp rgltxdoc xint breqn dynkin-diagrams etbb hitszthesis miktex-misc optex xecjk ghsystem l3build luatodonotes archaeologie bxjscls haranoaji haranoaji-extra
-lstdigest=2a9186ad9e306321874b993e9b03ee4a
+date=1582405876
+lastupd=fontspec keyvaltable l3backend l3build l3kernel nameauth ltxbase siunitx lexend lwarp rgltxdoc xint breqn dynkin-diagrams etbb hitszthesis miktex-misc optex xecjk ghsystem
+lstdigest=9fae0c90ac960b1bd9679b021bdc1734
numpkg=3863
relstate=stable
-version=7356
+version=7357
diff --git a/systems/win32/w32tex/ChangeLog b/systems/win32/w32tex/ChangeLog
index 93f4f1d6cc..2c6a592964 100644
--- a/systems/win32/w32tex/ChangeLog
+++ b/systems/win32/w32tex/ChangeLog
@@ -1,5 +1,29 @@
W32TeX (x86 & x64) ChangeLog
+[2020/02/21]
+(01) aleph-w32.tar.xz
+ Update format files.
+(02) latex.tar.xz
+ Update latex-base.
+(03) luatex-dev-w32.tar.xz
+ Update format files.
+(04) luatex-exp-w32.tar.xz
+ Update format files.
+(05) luatex-w32.tar.xz
+ Update format files.
+(06) pdftex-w32.tar.xz
+ Update format files.
+(07) ptex-ng-w32.tar.xz
+ Update format files.
+(08) ptex-w32.tar.xz
+ Update format files.
+(09) uptex-w32.tar.xz
+ Update format files.
+(10) web2c-w32.tar.xz
+ Update texdoc.
+(11) xetex-w32.tar.xz
+ Update format files.
+
[2020/02/20]
(01) ltxpkgdocs.tar.xz
Update documents for packages.
diff --git a/timestamp b/timestamp
index dbbbef4e23..5bcf82bca7 100644
--- a/timestamp
+++ b/timestamp
@@ -2,4 +2,4 @@
# The source CTAN of this site's material:
dante.ctan.org
# The year-month-day-hour-minute of this site's material:
-2020-02-22-02-02
+2020-02-23-02-02