texlive[71389] Master/texmf-dist/doc/latex/circuit-macros:
commits+karl at tug.org
commits+karl at tug.org
Thu May 30 21:57:12 CEST 2024
Revision: 71389
https://tug.org/svn/texlive?view=revision&revision=71389
Author: karl
Date: 2024-05-30 21:57:12 +0200 (Thu, 30 May 2024)
Log Message:
-----------
circuit_macros (30may24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/circuit-macros/CHANGES
trunk/Master/texmf-dist/doc/latex/circuit-macros/Copying
trunk/Master/texmf-dist/doc/latex/circuit-macros/README
trunk/Master/texmf-dist/doc/latex/circuit-macros/darrow.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AlogixMan.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AmpTableMan.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Circuit_macros.pdf
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Circuit_macros.tex
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/FF.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Makefile
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/QTrans.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/ResistorsMan.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/SourcesMan.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Taps.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Version.tex
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/defines.tex
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/quick.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/relaycoilMan.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/dpictools.pic
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Alogix.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/AmpTable.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Buttons.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Chips.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Consumption.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Dini.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/EVplugs.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Fuses.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Geometry.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Incleps.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Makefile
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/MoreTable.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Quantum.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Resistors.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sources.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Switches.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/AmpTableDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/DiniDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/EVplugsDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/GeometryDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Makefile
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/QuantumDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ResistorsDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SourcesDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPV.htmx
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPVs.htmx
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/quickDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/relaycoilDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/examples.pdf
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chuck.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ClassDAmp.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Highgain.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Makefile
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/README_extras
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/SampleFlow.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/files.tex
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ics.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/keyboard.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/mf/cct.mf
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/quick.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/relaycoil.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/xfig/xfiglib.fig
trunk/Master/texmf-dist/doc/latex/circuit-macros/gpic.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/libSLD.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/libgen.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/mfpic.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/mpost.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/pdf.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/pgf.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/postscript.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/psfrag.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/pstricks.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/svg.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/xfig.m4
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sevensegment.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Shadowed.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/cbresistor.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SevensegmentDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Spec555DPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/cbresistorDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Asymptotes.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Birds.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Bistable.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Brace.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chaos.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/HSV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Parallel-series.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Person.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Rotellipse.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Spec555.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Squiggle.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Venus.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ex17.m4
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/SQUID.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SQUIDDPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ex00DPV.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex00.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex17.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ant.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ccurve.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cruller.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Koch.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/birds.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/bistable.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/brace.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/chaos.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/hsv.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/person.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/rotellipse.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/squiggle.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/venus.m4
trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/shadowed.m4
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/CHANGES 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/CHANGES 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,8 +1,12 @@
CHANGES
+Version 10.6: New macro geiger. Corrected dpv .txt files.
+ Tweaked macros ColoredV, ShadeObject, ebox, shadowed, shadedball, addtaps.
+ Options for macros delay, resistor, source, relaycoil. List of macros
+ reformatted in the manual.
Version 10.5: Options for numersous element macros: sfgarc, sfgline,
sfgself, LCintersect, LEintersect, and others. Systematic facilities
- for Filling and customizing element bodies. New macros ColoredV,
+ for filling and customizing element bodies. New macros ColoredV,
cangle, definergbcolor. Added dpictools.pic macros to the manual.
Removed obsolete macros. Edits of the manual.
Version 10.4: New options for source, sarrow, darrow routines.
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/Copying
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/Copying 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/Copying 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,4 +1,4 @@
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/README 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/README 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,5 +1,5 @@
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -17,14 +17,15 @@
and non-WYSIWYG. Graphical interfaces are available for specific
operating systems.
- The macros are to be processed by an m4 macro processor, and evaluate to
- drawing commands in the pic "little language," which is easy to read and
- learn. The diagram is then automatically translated into TiKZ, PSTricks,
- or other formats for processing by LaTeX or other applications. Pic
- is well suited to line drawings requiring parametric or conditional
- components, fine adjustment, geometric calculations, repetition, or
- recursion. Arbitrary text for formatting by LaTeX can be included.
- Free interpreters for m4 and pic are readily available.
+ The macros are to be processed by an m4 macro processor, and evaluate
+ to drawing commands in the pic "little language," which is easy to
+ read and learn. The diagram is then automatically translated into
+ TiKZ, PSTricks, or other formats for processing by LaTeX or other
+ applications. Pic is well suited to line drawings requiring parametric
+ or conditional components, fine adjustment, geometric calculations
+ (it is Turing complete), repetition, or recursion. Arbitrary text
+ for formatting by LaTeX can be included. Free interpreters for m4
+ and pic are readily available.
Sources are available as a git repository at
https://gitlab.com/aplevich/Circuit_macros
@@ -110,14 +111,14 @@
m4 gpic.m4 cct.m4 | gpic -t > cct.tex
- The basic commands given above suffice for documents of moderate
- size and complexity; otherwise, a "make" facility or equivalent should
- be used or, for modest documents, diagram processing can be controlled
+ The basic commands given above suffice for documents of moderate size
+ and complexity; otherwise, a "make" facility or equivalent should be
+ used or, for modest documents, diagram processing can be controlled
from within the tex document source as described in the manual. For
- near-immediate viewing of the basic process, three windows can be kept
- open: one in which to edit the source, one to process the source and
- produce postscript or pdf, and a viewer such as GSview 5.0, which updates
- when clicked.
+ near-immediate viewing of the results, three windows can be kept open:
+ one in which to edit the source, one to process the source and produce
+ postscript or pdf, and a viewer such as gv or GSview 5.0. A window
+ displaying the manual is also useful for composing a significant diagram.
INSTALLATION AND TESTING: See the INSTALL file.
@@ -148,7 +149,7 @@
Several Linux distributions will install dpic by command but the version
may not be the latest. A git repository containing complete source is at
https://gitlab.com/aplevich/dpic
- and source plus a Windows executable can be obtaied from
+ and source plus a Windows executable can be obtained from
http://ece.uwaterloo.ca/~aplevich/dpic/
The best advice is to obtain the newest version.
@@ -176,23 +177,24 @@
SVG is the native file format for the Inkscape graphics editor.
Therefore, elements defined by these macros can be output by dpic -v in
- svg format for later manipulation by Inkscape. A very basic palette of
- circuit elements for Inkscape is found in examples/paletteSVG.m4.
- In the examples subdirectory, type "make paletteSVG.svg", read the resulting
- file into Inkscape, and then ungroup the elements as desired. You would
- probably wish to add to or customize these elements for extensive use.
+ svg format for later manipulation by Inkscape. A basic palette of
+ circuit elements for Inkscape is found in examples/dpv/palettePDV.m4.
+ In the examples/dpv subdirectory, type "make paletteDPV.svg", read
+ the resulting file into Inkscape, and then ungroup the elements as
+ desired. You would probably wish to add to or customize these elements
+ for extensive use.
EXAMPLES
- A set of examples is included in this distribution, showing electric
- circuits, block diagrams, flow charts, signal-flow graphs, basic
- use of colour and fill, and other applications. Some of the examples
+ Numerous examples are included in this distribution, showing electric
+ circuits, block diagrams, flow charts, signal-flow graphs, basic use
+ of colour and fill, and other applications. Some of the examples
test the boundaries of the domain of application of dpic with m4
- macros. Read the manual Circuit_macros.pdf and view examples.pdf
- in the examples directory or make and view the html file in the
- examples/svg directory. For the curious, there are additional source
- files in the examples directory that are not shown in examples.pdf.
- Try http://ece.uwaterloo.ca/~aplevich/Circuit_macros/
- for the possibly unstable development version of these macros.
+ macros. Read the manual Circuit_macros.pdf and view examples.pdf in the
+ examples directory or make and view the html file in the examples/dpv
+ directory. For the curious, there are additional source files in
+ the examples/extras directory that are not shown in examples.pdf.
+ Try http://ece.uwaterloo.ca/~aplevich/Circuit_macros/ for the possibly
+ unstable development version of these macros.
The examples directory Makefile automates the generation of .ps, .eps,
.png, and .pdf files for individual diagrams. Subdirectories of the
@@ -220,10 +222,10 @@
representative but keep in mind that systems and installations evolve
over time:
- A Python-based GUI called PyCirkuit is
- at https://pypi.org/project/pycirkuit/ and
- https://github.com/orestesmas/pycirkuit. For an
- introduction, look at the FOSDEM video by Orestes Mas:
+ A Python-based GUI called PyCirkuit is at
+ https://pypi.org/project/pycirkuit/ and
+ https://github.com/orestesmas/pycirkuit. For an introduction, look at
+ the FOSDEM video by Orestes Mas:
https://archive.fosdem.org/2020/schedule/event/pycirkuit/
A python build-automation tool, m4cm, by Peter Jan Randewijk is at
@@ -242,9 +244,10 @@
https://www.youtube.com/watch?time_continue=53&v=pFRIBvUJHS4
A git repository of a KDE interface by Andrew G. for Linux is at
- https://github.com/ag-ckt/cirkuit/tree/V0.5.0.
+ https://github.com/ag-ckt/cirkuit/tree/V0.5.0 but it seems to be
+ unmaintained.
- Another recent introduction is at
+ A recent elementary introduction to Circuit_macros is at
https://www.root.cz/clanky/publikovanie-elektrickych-schem-a-diagramov-pomocou-circuit-macros/
It is in Czech but Google translate works well.
@@ -254,6 +257,10 @@
A Windows batch file for Circuit_macros is found at
http://someonehasdonethis.blogspot.ca/2012/12/a-solution-for-drawing-circuit-diagrams.html
+ The eschpic package on Github contains macro definitions targeted at
+ IEC-style electrical drawings for industrial and automation purposes:
+ https://github.com/xwhatsit/eschpic
+
Mac users:
Descriptions of Mac installations have been published from time to time;
for example:
@@ -261,18 +268,16 @@
VARIATIONS
Macros such as these will be modified inevitably to suit individual
- needs and taste. They continue to evolve in my own library as I use
- them and as others send comments. No such collection can hope to
- include all possible circuit-related symbols, so you will probably
- find yourself writing your own macros or adapting some of these.
- Be careful to rename modified macros to avoid confusion. The learning
- curve compares well to other packages, but there is no trivially
- easy way to produce high-quality graphics. (If "a picture is worth a
- thousand words," ask yourself how long it would take to write, revise,
- and perfect a thousand words.)
+ needs and taste. They continue to evolve in my own library as I
+ use them and as others send comments. No such collection can hope to
+ include all possible circuit-related symbols, so you will probably find
+ yourself writing your own macros or adapting some of these. The example
+ files might be a good place to start. Be careful to rename modified
+ macros to avoid confusion. The learning curve compares well to other
+ packages, but there is no trivially easy way to produce high-quality
+ graphics. (If "a picture is worth a thousand words," ask yourself
+ how long it would take to write, revise, and perfect a thousand words.)
- See eschpic on Github for IEC-style electrical drawings.
-
The pic language dates from the 1980s and was first developed
as a preprocessor for the *roff family of Unix wordprocessors.
Some additional libraries such as chem (for chemical structures)
@@ -318,15 +323,16 @@
LIBRARIES:
The file libgen.m4 contains general-purpose macros and is read
- automatically by other libraries. The file libcct.m4 defines basic
- circuit elements. Binary logic-circuit elements are in liblog.m4 and
- additional single-line elements are in libSLD.m4. Macros for drawing 3D
- projections are in lib3D.m4, and some macros for drawing double-line
- arrows are in darrow.m4. The file dpictools.pic contains pic macros
- and is read automatically by some of the examples.
+ automatically by other libraries and the macro gen_init. The file
+ libcct.m4 defines basic circuit elements. Binary logic-circuit
+ elements are in liblog.m4 and additional single-line elements are
+ in libSLD.m4. Macros for drawing 3D projections are in lib3D.m4, and
+ some macros for drawing double-line arrows are in darrow.m4. The file
+ dpictools.pic contains dpic macros and is read automatically by some
+ of the examples.
-Feel free to contact me with comments or questions. I have retired
-from full-time work but continue the hobby of maintaining these files.
+Feel free to contact me with comments or questions. I have retired from
+full-time professorship but continue the hobby of maintaining these files.
I may now be able to spend more time on individual requests but I may
not reply instantly to email.
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/darrow.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/darrow.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/darrow.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
darrow.m4 Macros for double lines and arrows
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AlogixMan.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AlogixMan.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AlogixMan.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -20,7 +20,7 @@
# replaced by NOT gates.
B: Autologix(Or(And(B,Not(C)),And(Not(A),B,C)),N) \
with .sw at A.e+(0.4,0.25)
- "{\sl Out}" at B.Out above ljust
+ "{\sl B.Out}" at B.Out above ljust
`"\shortstack[l]{\tt B: Autologix( \\ \tt \
Or(And(B,Not(C)),And(Not(A),B,C)),N)}"' \
wid 242pt__ ht 20pt__ at B.s+(0,-0.2)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AmpTableMan.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AmpTableMan.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/AmpTableMan.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,23 +1,25 @@
.PS
# `AmptableMan.m4'
cct_init
+divert(-1)
+
+divert(0)dnl
+
movewid = 2pt__
-{
+{
{amp ; move ; "{\tt `amp'}" ljust}
- move down 0.4; right_
- {amp(,0.3) ; move ; "\tt `amp'(,0.3)" ljust}
- }
move right_ 2.0
-{ {delay(,,fill_(0.9)) ; move ;
+ {amp(,5mm__) ; move ; "\tt `amp'(,5mm\_\_)" ljust}
+ move right_ 2.0
+ {integrator ; move ; "\tt `integrator'" ljust}
+ }
+ move down 0.5; right_
+{
+ {delay(,,fill_(0.9)) ; move ;
"`\tt\shortstack[l]{delay(,{,}\\ fill\_(0.9))}'" ljust}
- move down 0.4; right_
- {delay(,0.2) ; move ; "{\tt `delay'(,0.2)}" ljust}
- }
-
move right_ 2.0
-{ {integrator ; move ; "\tt `integrator'" ljust}
- move down 0.5; right_
- {integrator(,0.3) ; move ; "\tt `integrator'(,0.3)" wid 82pt__ ljust}
- }
+ {delay(,,type=S;body=shaded "blue!25"); move
+ "{\tt `delay'(,,type=S;}" ljust "{\tt body=shaded \"blue!25\")}" ljust}
+ }
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Circuit_macros.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Circuit_macros.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Circuit_macros.tex 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Circuit_macros.tex 2024-05-30 19:57:12 UTC (rev 71389)
@@ -58,11 +58,10 @@
{\normalfont\normalsize\bfseries%
\let\@@tmp\@svsec\def\@svsec{\llap{\@@tmp}}%
}}
+\makeatother
\renewcommand\contentsname{Contents, \Version}
-\makeatother
-
\hypersetup{
pdflang=English,
unicode=true,
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/FF.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/FF.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/FF.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,11 +1,11 @@
.PS
# `FF.m4'
log_init
-S: NOR_gate
+Sg: NOR_gate
left_
-R: NOR_gate at S+(0,-L_unit*(AND_ht+1))
- line from S.Out right L_unit*3 then down S.Out.y-R.In2.y then to R.In2
- line from R.Out left L_unit*3 then up S.In2.y-R.Out.y then to S.In2
- line left 4*L_unit from S.In1 ; "$S$sp_" rjust
- line right 4*L_unit from R.In1 ; "sp_$R$" ljust
+Rg: NOR_gate at Sg+(0,-L_unit*(AND_ht+1))
+ line from Sg.Out right L_unit*3 then down Sg.Out.y-Rg.In2.y then to Rg.In2
+ line from Rg.Out left L_unit*3 then up Sg.In2.y-Rg.Out.y then to Sg.In2
+ line left 4*L_unit from Sg.In1 ; "$S$" rjust
+ line right 4*L_unit from Rg.In1 ; "$R$" ljust
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Makefile 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Makefile 2024-05-30 19:57:12 UTC (rev 71389)
@@ -40,6 +40,9 @@
LATEX = latex
LATEX = latex --quiet
+
+BIBTEX=BIBINPUTS=. bibtex
+
M4 = m4 -I $(LIBDIR)
# If M4PATH has been set:
M4 = m4
@@ -90,13 +93,13 @@
$(DOC).$(SFX): mode.tex citations $(PICTEX)
@printf "\n $(DOC).SFX=$(DOC).$(SFX):\n\n"
- $(LATEX) $(DOC) ; bibtex $(DOC)
+ $(LATEX) $(DOC) ; $(BIBTEX) $(DOC)
- at if grep -s "Warning: Reference " $(DOC).log ; then \
@printf "\n Warning:\n\n" ; \
- $(LATEX) $(DOC) ; bibtex $(DOC) ; \
+ $(LATEX) $(DOC) ; $(BIBTEX) $(DOC) ; \
elif test ! -f $(DOC).$(SFX) ; then\
@printf "\n No file $(DOC).$(SFX)\n\n" ; \
- $(LATEX) $(DOC) ; bibtex $(DOC) ; fi
+ $(LATEX) $(DOC) ; $(BIBTEX) $(DOC) ; fi
ACsymbol.tex DCsymbol.tex:
touch $(DOC).dim
@@ -105,16 +108,16 @@
citations: mode.tex $(DOC).bbl $(PICTEX)
@printf "\n citations:\n\n"
- $(LATEX) $(DOC) ; bibtex $(DOC)
+ $(LATEX) $(DOC) ; $(BIBTEX) $(DOC)
touch citations
$(DOC).bbl: $(DOC).bib $(DOC).aux
- bibtex $(DOC)
+ $(BIBTEX) $(DOC)
# $(DOC).aux: mode.tex $(DOCSRC) heading.tex $(VERBATIM) $(PICTEX)
$(DOC).aux: mode.tex $(DOCSRC) $(VERBATIM) $(PICTEX)
@printf "\n $(DOC).aux:\n\n"
- $(LATEX) $(DOC) ; bibtex $(DOC)
+ $(LATEX) $(DOC) ; $(BIBTEX) $(DOC)
rm -f $(BOXDIMS)
make $(BOXDIMS)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/QTrans.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/QTrans.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/QTrans.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -2,17 +2,16 @@
#QTrans.m4
cct_init
elen = 0.75
- Origin: Here
Vs: source(up_ elen,S); llabel(-,V_s,+)
resistor(right_ elen); rlabel(,R_s)
dot
- { capacitor(down_ to (Here,Origin))
+ { capacitor(down_ to (Here,Vs.start))
rlabel(+,V,-); llabel(,{1\over{j\omega C}},)
dot }
arrowline(right_ elen*2/3); llabel(,I)
T1: transformer(down_ Vs.len,,6,,4) with .P1 at Here # Place P1
"$T1$" at last [].n above
- line from T1.P2 to Origin
+ line from T1.P2 to Vs.start
line from T1.S1 up_ to (T1.S1,Vs.end) then right_ elen*2/3
resistor(down_ Vs.len); rlabel(,R_L); b_current(I_L,rjust)
line to (T1.S2,Here) then to T1.S2
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/ResistorsMan.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/ResistorsMan.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/ResistorsMan.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -5,36 +5,32 @@
movewid = 2 pt__
hm = 2.05
vm = 0.28
-{ {resistor ; move ;"`{\tt resistor}'" ljust}
+{ {A:resistor ; move ;"`{\tt resistor}'" ljust}
move right_ hm
- {resistor(,,Q) ; move ;"`\tt resistor(,{,}Q) '" ljust}
+ {Q:resistor(,5,Q) ; move ;"`\tt $\ldots$(,5{,}Q) '" ljust}
move right_ hm
- {resistor(,,V) ; move ;"`{\tt resistor(,{,}V)}'" ljust}
+ {V:resistor(,,V) ; move ;"`{\tt $\ldots$(,{,}V)}'" ljust}
}
move down vm; right_
-{ {resistor(,,ES) ; move ;"`\tt resistor(,{,}ES) '" ljust}
+{ {ES:resistor(,,ES); move ;"`\tt $\ldots$(,{,}ES) '" ljust}
move right_ hm
- {resistor(,,H) ; move ;"`\tt resistor(,{,}H) '" ljust}
+ {H:resistor(,4,H) ; move ;"`\tt $\ldots$(,4{,}H) '" ljust}
move right_ hm
- {resistor(,,AC) ; move ;"`{\tt resistor(,{,}AC)}'" ljust}
+ {AC:resistor(,,AC) ; move ;"`{\tt $\ldots$(,{,}AC)}'" ljust}
}
move down vm; right_
-{ {resistor(,5,B) ; move ;"`{\tt resistor(,5,B)}'" ljust}
+{ {B:resistor(,,B) ; move ;"`{\tt $\ldots$(,{,}B)}'" ljust}
move right_ hm
- {resistor(,,E) ; move
- "`\shortstack[l]{\tt resistor(,{,}E)\\ {\tt $\equiv$ ebox}}'" ljust}
+ {F:resistor(,,F) ; move ;"`\tt $\ldots$(,{,}F) '" ljust}
move right_ hm
- {ebox(,0.5,0.3) ; move ;"`{\tt ebox(,0.5,0.3)}'" ljust}
+ {E:resistor(,,E) ; move ; "`\tt $\ldots$(,{,}E) $\equiv$ ebox'" ljust}
}
- move down vm; right_
+ move down vm*1.1; right_
{ {ebox(,,,0.9) ; move ;"`{\tt ebox(,{,},0.9)}'" ljust}
move right_ hm
- {ebox(,,,,shaded "green") ; move
- "`{\tt ebox(,{,},{,}shaded \"green\")}'" ljust}
+ {ebox(,wdth=0.2;box=dashed shaded "green";text="H") ; move
+ "`\shortstack[l]{\tt ebox(,wdth=0.2;box=dashed shaded \"green\";\\' \
+ `\tt text=\"H\")}'" ljust}
}
- move down vm; right_
-{ {ebox(,wdth=0.2;box=dashed shaded "green";text="X") ; move
- "`{\tt ebox(,wdth=0.2;box=dashed shaded \"green\";text=\"X\")}'" ljust}
-}
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/SourcesMan.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/SourcesMan.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/SourcesMan.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -19,18 +19,17 @@
{source(,SC) ; move ; "`\tt source(,SC)'" ljust} NL
{source(,AC); move ; "`\tt source(,AC)'" ljust} NL
{source(,X) ; move ; "`\tt source(,X)'" ljust} NL
- {source(,F) ; move ; "`\tt source(,F)'" ljust} NL
{source(,G) ; move ; "`\tt source(,G)'" ljust} NL
{source(,Q) ; move ; "`\tt source(,Q)'" ljust} NL #(0.3)
+ {source(,F) ; move ; "`\tt source(,F)'" ljust} NL
+ {geiger(,,,,fill_(0.9)); move;
+ "`\tt \shortstack[l]{geiger(,{,},{,}\\ fill\_(0.9))}'" ljust} NL
}
move right_ 2.0
{
-# {source(,,0.4) ; move ; "`\tt source(,{,}0.4)'" ljust} NL(0.35)
{source(,,0.4,,shaded "yellow") ; move ;
"`\tt\shortstack[l]{source(,{,}0.4,{,}\\ shaded \"yellow\")}'" ljust} NL(0.35)
-# {source(,P) ; move ; "`\tt source(,P)'" ljust} NL
- {source(,P,,,fill_(0.9)) ; move ;
- "`\tt\shortstack[l]{source(,P,{,},\\ fill\_(0.9))}'" ljust} NL
+ {source(,P) ; move ; "`\tt source(,P)'" ljust} NL
{source(,U) ; move ; "`\tt source(,U)'" ljust} NL
{source(,H) ; move ; "`\tt source(,H)'" ljust} NL
{source(,R) ; move ; "`\tt source(,R)'" ljust} NL
@@ -38,18 +37,18 @@
{source(,SCr) ; move ; "`\tt source(,SCr)'" ljust} NL
{source(,T) ; move ; "`\tt source(,T)'" ljust} NL
{source(,L) ; move ; "`\tt source(,L)'" ljust} NL
- {source(,B) ; move ; "`\tt source(,B)'" ljust} NL
+ {source(,B) ; move ; "`\tt source(,B)'" ljust} NL(moveht*0.8)
{nullator ; move ; "`\tt nullator'" ljust} NL(moveht*0.8)
{norator ; move ; "`\tt norator'" ljust} NL(moveht*0.9)
{ttmotor(,G) ; move ; "`\tt ttmotor(,G)'" ljust} NL(moveht*1.1)
- {proximity ; move ;
- "`\tt \shortstack[l]{proximity\\ = consource(,P)}'" ljust}
+ {battery ; move ; "`\tt battery'" ljust} NL(0.3)
+ {battery(,3,R) ; move ; "`\tt battery(,3,R)'" ljust} #NL(0.35)
}
move right_ 2.0
{source(,N) ; move ; "`\tt source(,N)'" ljust} NL
+ {source(,NA) ; move ; "`\tt source(,NA)'" ljust} NL
+ {source(,NB) ; move ; "`\tt source(,NB)'" ljust} NL
{source(,"\rm mA");move; "`\tt source(,\"mA\")'" ljust} NL(0.31)
-# {source(,"mA");move; "`\tt source(,'" ljust \
-# "`\tt \enskip \"mA\")'" ljust} NL(0.31)
{consource ; move ; "`\tt consource'" ljust} NL(0.32)
{consource(,I) ; move ; "`\tt consource(,I)'" ljust} NL(0.32)
{consource(,i) ; move ; "`\tt consource(,i)'" ljust} NL(0.32)
@@ -58,8 +57,8 @@
{consource(,V) ; move ; "`\tt consource(,V)'" ljust} NL(0.32)
{consource(,v) ; move ; "`\tt consource(,v)'" ljust} NL(0.3)
{consource(,tv) ; move ; "`\tt consource(,tv)'" ljust} NL(0.3)
- {battery ; move ; "`\tt battery'" ljust} NL(0.3)
- {battery(,3,R) ; move ; "`\tt battery(,3,R)'" ljust} #NL(0.35)
+ {proximity ; move ;
+ "`\tt \shortstack[l]{proximity\\ = consource(,P)}'" ljust} NL(0.35)
iflatex(`ifpsfrag(,`latexcommand(})')')
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Taps.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Taps.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Taps.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -9,7 +9,7 @@
"\sl R1.end" at R1.end above
"\sl Tap1" at Tap1 rjust
"\sl Tap2" at Tap2 ljust
- `"\tt right\_; t = 0.2in\_\_" ljust \
+ `"\tt right\_; t = 0.2 in\_\_" ljust \
"\tt R1:$\;$resistor(,{,}E)" ljust \
"\tt addtaps(<-,0.2,-t,0.8,t)" ljust' at R1.end+(0.3,0)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Version.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Version.tex 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/Version.tex 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1 +1 @@
-Version 10.5
+Version 10.6
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/body.tex 2024-05-30 19:57:12 UTC (rev 71389)
@@ -64,7 +64,7 @@
convert them to \TPGF, \PSTricks, other \latex-compatible code, \SVG,
or other formats.
In its basic usage, the method has the advantages and disadvantages of
-\tex itself, since it is macro-based and non-WYSIWYG,
+\tex itself since it is macro-based and non-WYSIWYG,
with ordinary text input. The book from which the above quotation
is taken correctly points out that the payoff can be in quality of
diagrams at the price of the time spent in drawing them.
@@ -73,7 +73,7 @@
standards~\cite{IECstd,IEEEstd},
and conventions for their internal
structure are described. Macros such as these are only a starting
-point, since it is often convenient to customize elements or to package
+point since it is often convenient to customize elements or to package
combinations of them for particular drawings or contexts,
a process for which \Mfour\ and \pic\ are well suited.
@@ -126,11 +126,11 @@
labeled circuits.
\begin{figure}[ht]
\parbox{\textwidth}{\small\verbatiminput{quick.m4}}%
- \hfill\llap{\raise-1.15in\hbox{\input quick }}%
- \vspace*{-\baselineskip}%
+ \hfill\llap{\raise-1in\hbox{\input quick }}%
+% \vspace*{-\baselineskip}%
\caption{The file {\tt quick.m4} and resulting diagram.
There are several ways of drawing the same picture; for example,
- nodes (such as {\tt Origin}) can be defined and circuit branches
+ nodes (example: {\tt Origin: Here}) can be defined and circuit branches
drawn between them; or absolute coordinates can be used (e.g.,
{\tt source(up\_ from (0,0) to (0,0.75))} ). Element sizes
can be varied and non-two-terminal elements included (\FR{QTrans})
@@ -501,7 +501,8 @@
Any of the above means of specifying line (or arrow) direction and length
will be called a \linespec.
-Lines can be concatenated. For example, to draw a triangle:
+Lines can be concatenated to create multsegmented objects.
+For example, to draw a triangle:
{\tt line up\_ sqrt(3) right\_ 1 then down\_ sqrt(3) right\_ 1 then left\_ 2}
@@ -903,11 +904,11 @@
\begin{figure}[H]
\input ResistorsMan
\caption{Resistors drawn by the macro
- {\tt resistor({\sl linespec, n}|E, {\sl chars}, {\sl cycle wid})}.
- The second argument is either an integer to specify number of cycles,
- the letter {\tt E}, or blank. The third argument specifies the desired
- variant.
- The default {\tt ebox} element designates a resistor.}
+ {\tt resistor({\sl linespec, n}, {\sl chars}, {\sl cycle wid})}.
+ The second argument is either an integer to specify number of cycles
+% the letter {\tt E},
+ or blank. The third argument specifies the desired variant.
+ The default {\tt ebox} element designates a box resistor.}
\label{Resistors}
\end{figure}
\noindent%
@@ -936,7 +937,7 @@
\label{Capacitors}
\end{figure}
-Basic inductors are illustrated in \FR{Inductors}.
+Inductors are illustrated in \FR{Inductors}.
\begin{figure}[H]
\input InductorsMan
\caption{Basic inductors created with the
@@ -992,7 +993,8 @@
\begin{figure}[hbt]
\input SourcesMan
\caption{Sources and source-like elements. An argument of each
- element allows customization such as shading.}
+ element allows customization such as shading. The {\tt geiger}
+ macro is a wrapper for {\tt source}.}
\label{Sources}
\end{figure}
As a convenience,
@@ -1270,6 +1272,8 @@
to establish element length and direction.
As shown in \FR{Oblique},
+``{\tt Point\_(-30); resistor}'' draws a resistor
+along a line with slope of~-30 degrees,
\begin{figure}[hbt]
\vspace{-\baselineskip}
\parbox{4.5in}{\small \verbatiminput{Oblique.m4}}%
@@ -1278,8 +1282,7 @@
\caption{Illustrating elements drawn at oblique angles.}
\label{Oblique}
\end{figure}
-``{\tt Point\_(-30); resistor}'' draws a resistor
-along a line with slope of~-30 degrees, and ``{\tt rpoint\_(to Z)}'' sets
+and ``{\tt rpoint\_(to Z)}'' sets
the current direction cosines to point from the current location to location Z.
Macro {\tt vec\_(x,y)}
evaluates to the position {\tt (x,y)} rotated as defined by the
@@ -1419,19 +1422,22 @@
include a transformer, a composite element described in detail below,
followed by code for the figure.
\begin{figure}[H]
-% \vspace*{-\baselineskip}
-% \parbox{4in}{\small \verbatiminput{QTrans.m4}}%
-% \hspace*{-0.45in}\raise-0.15in\hbox{\input QTrans }
-% \vspace*{-\baselineskip}
\input Qtrans
\caption{The file {\tt quick.m4} modified to include a composite
element, the transformer, which is positioned by placing an
- internal point.}
-% transformer, of which the length and orientation of connectors
-% is given by the first argument, and which is positioned in this
-% example by placing the internal position {\sl P1.}}
+ internal point, thus:
+ {\tt T1:~transformer(down\_ Vs.len,{},6,{},4) with .P1 at Here}.}
\label{QTrans}
\end{figure}
+%\begin{figure}[H]
+% \parbox{\textwidth}{\small\verbatiminput{Qtrans.m4}}%
+% \hfill\llap{\raise-1in\hbox{\input Qtrans }}%
+% \caption{The file {\tt quick.m4} modified to include a composite
+% element, the transformer, which is positioned by placing an
+% internal point, thus:
+% {\tt T1:~transformer(down\_ Vs.len,{},6,{},4) with .P1 at Here}.}
+% \label{QTrans}
+% \end{figure}
\FR{Xform} shows variants of the transformer macro,
which has predefined internal locations
@@ -1457,12 +1463,12 @@
\end{figure}
The code for \FR{QTrans} is reproduced in the following.
-Label {\sl Vs} has been added for later reference.
-The transformer is positioned by placing internal position {\sl P1.}
+%Label {\sl Vs} has been added for later reference.
+The transformer is positioned by placing internal point {\sl P1.}
\verbatiminput{QTrans.m4}
-The macro {\tt
- potentiometer(\linespec,{\sl cycles},{\sl fractional pos},{\sl length},
+Another composite element,
+ {\tt potentiometer(\linespec,{\sl cycles},{\sl fractional pos},{\sl length},
$\ldots$)},
shown in \FR{Potentiometers},
first draws a resistor along the specified line, then adds arrows for taps
@@ -1983,6 +1989,7 @@
\noindent%
These macros depend heavily on the postprocessor and are intended only for
\PSTricks, \TPGF, \MetaPost, \SVG, and the Postscript or PDF output of \dpic.
+Their effects are fragile in some situations.
Basic \Pic\ objects are probably best colored and filled as discussed
in \SR{Planarobjects:}.
@@ -2056,7 +2063,9 @@
for the NOR gate in the figure. By default, $N=2$ except for macros
{\tt NOT\_gate} and {\tt BUFFER\_gate}, which have one input {\tt In1}
unless they are given a first argument, which is treated as the line
-specification of a two-terminal element.
+specification of a two-terminal element. Alternately, the first argument
+can be a sequence of letters {\tt P} or {\tt N} to define a number of
+normal or negated ({\tt Not}-circled) inputs.
\begin{figure}[H]
\vspace*{-0.5\baselineskip}
\input LogicMan
@@ -3068,7 +3077,7 @@
{\tt B1:\ box wid (2) ht (boxht) "Hello"}.
The key prefix {\tt m4} of the automatically created parameter macros can be
-redefined if necessary, since it is given in the distribution by the line
+redefined if necessary since it is given in the distribution by the line
{\tt define(`key\_prefix',`m4')}.
@@ -3550,10 +3559,10 @@
and read but powerful enough (that is, Turing-complete) for coding the
geometrical calculations required for precise component sizing and
placement. It would be nice if arbitrary rotations and scaling were
-simpler and if a general path element with clipping were available
-as in \Postscript. However, all the power of \Postscript or \TPGF,
-for example, remains available, as arbitrary postprocessor code can be
-included with \pic code.
+simpler, if a general path element with clipping were available as in
+\Postscript, and if adding color across postprocessors were easier.
+However, all the power of \Postscript or \TPGF, for example, remains
+available, as arbitrary postprocessor code can be included with \pic code.
The \dpic interpreter has several output-format options that may be
useful. The {\tt eepicemu} and {\tt pict2e} extensions of the
@@ -3568,13 +3577,12 @@
\Dpic will also generate low-level \MetaPost or \Postscript code, so
that diagrams defined using \pic can be manipulated and combined with
others.
-I learned to great benefit that the \Postscript output can be imported into
-CorelDraw and Adobe Illustrator for further processing,
-so that detailed diagram components produced by pic program can be combined
-with effects best acheived using a wysiwyg drawing program.
-With raw \Postscript, \PDF, and \SVG output however, the user is
-responsible for ensuring that the correct fonts are provided and for
-formatting the text.
+I learned to great benefit that the \Postscript output can be imported
+into CorelDraw and Adobe Illustrator for further processing, so that
+detailed diagram components produced by pic program can be combined
+with effects best acheived using a wysiwyg drawing program. With raw
+\Postscript, \PDF, and \SVG output however, the user is responsible for
+ensuring that the correct fonts are provided and for formatting the text.
Many thanks to the people who continue to send comments, questions,
and, occasionally, bug fixes. What began as a tool for my own use changed
@@ -3759,6 +3767,12 @@
\noindent The cure is to add single quotes in pairs as necessary.
+ If text containing single quote characters causes difficulties
+ then replace the \LaTeX\ single quote by {\tt \bsl{}char39}
+ or disable the m4 quote characters temporarily as shown:
+
+ {\tt changequote(,)} {\sl text containing single quotes} {\tt changequote(`,)}
+
The only subtlety required in writing
\Mfour macros is deciding when to quote macro arguments. In the context
of circuits it seemed best to assume that arguments would not
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/defines.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/defines.tex 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/defines.tex 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,6 +1,6 @@
%
-\newdimen{\leftwid}\setlength{\leftwid}{2in}
-\newdimen{\libwid}\setlength{\libwid}{0.5in}
+\newdimen{\leftwid}\setlength{\leftwid}{140pt}
+\newdimen{\libwid}\setlength{\libwid}{35pt}
\newdimen\rightwid
\setlength{\rightwid}{\textwidth}
\addtolength{\rightwid}{-\leftwid}
@@ -11,31 +11,31 @@
%\newcommand{\macx}[2]{%
% \phantomsection\pdfbookmark[subsection]{#1}{#2}#1}
-\newcommand{\macrodef}[5]{%\begin{minipage}[b]{\textwidth}%
-\phantomsection\pdfbookmark[subsubsection]{#1}{#2}%
-\setbox\Defbox=\hbox{\tt #1#3}%
+% This is alchemy but good enough for now.
+\newcommand{\macrodef}[5]{\paragraph*{\hfill}\noindent%
+ \phantomsection\pdfbookmark[subsubsection]{#1}{#2}\hspace*{-\parindent}%
+ \setbox\Defbox=\hbox{\tt #1#3}%
\ifdim\wd\Defbox>\textwidth%
- \setbox\Defbox=\hbox{\parbox{\textwidth}{\tt #1#3}}\fi
+ \setbox\Defbox=\hbox{\parbox[t]{\textwidth}{\tt #1#3}}\fi%
+ \nopagebreak%
\ifdim\wd\Defbox>\leftwid%
- \box\Defbox\hfill\break\hspace*{\leftwid}%
+ \box\Defbox\hfill\break\hspace*{-1ex}\hbox to \leftwid{\hfill}%
\else\hbox to \leftwid{\box\Defbox\hfill}\fi%
- \nopagebreak
- \hbox to \libwid{#4\hfill}\parbox[t]{\rightwid}%
- {\raggedright #5}%
- %\end{minipage}%
- \vspace{\parsep}\\}%
+ \hbox to \libwid{#4\hfill}%
+ \begin{minipage}[t]{\rightwid}\raggedright#5\end{minipage}}%
\newcommand{\seesect}[1]{ (\SR{#1})}
\newcommand{\Letter}[1]{\noindent%
\pdfbookmark[subsection]{#1}{#1}%
- \hskip-2em\hbox to 2em{#1\label{#1}\hfill}\relax}%
+ \hskip-2em\hbox to 2em{\par#1\label{#1}}\relax}%
\newcommand{\LR}[1]{\hyperref[#1]{{#1}}\hskip1em}
+\newcommand{\fra}[1]{\hbox{\sl frac#1}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\raggedbottom
+%\raggedbottom
\vspace{\abovedisplayskip}
\noindent
\LR{A} \LR{B} \LR{C} \LR{D} \LR{E} \LR{F} \LR{G} \LR{H} \LR{I} \LR{J}
@@ -50,7 +50,7 @@
\macrodef{abs\_}{abs_}{({\sl number})}%
{gen}%
{absolute value function}%
-\macrodef{ACsymbol}{ACsymbol}{(at {\sl position, len, ht,}%
+\macrodef{ACsymbol}{ACsymbol}{(at {\sl position, len, ht,} %
[n:][A]U|D|L|R|{\sl degrees}) }%
{cct}%
{draw a stack of $n$ (default 1) AC symbols
@@ -58,12 +58,12 @@
are used. The current drawing direction is default, otherwise Up, Down,
Left, Right, or at {\sl degrees} slant; \seesect{Twoterminal:} e.g.,\\
{\tt ebox; $\lbrace$ACsymbol(at last [],{,}dimen\_/8)$\rbrace$}}%
-\macrodef{adc}{adc}{({\sl width,height,nIn,nN,nOut,nS})}%
+\macrodef{adc}{adc}{({\sl width, height, nIn, nN, nOut, nS})}%
{cct}%
{Analog-digital converter with defined width, height, and number of
inputs {\tt In$i$}, top terminals {\tt N$i$}, ouputs {\tt Out$i$},
and bottom terminals~{\tt S$i$}}%
-\macrodef{addtaps}{addtaps}{[{\sl arrowhd}%
+\macrodef{addtaps}{addtaps}{([{\sl arrowhd}%
| type={\sl arrowhd};name={\sl Name}],
{\sl fraction, length, fraction, length,} $\cdots$)}%
{cct}%
@@ -81,7 +81,7 @@
\macrodef{Along\_}{Along_}{({\sl LinearObj,distance,}[R])}%
{gen}%
{Position arg2 (default all the way) along a linear object
- from {\tt .start} to {\tt .end}%
+ from {\tt .start} to {\tt .end}
(from {\tt .end} to {\tt .start} if arg3={\tt R}) }%
\macrodef{amp}{amp}{(\linespec, {\sl size}, {\sl attributes})}%
{cct}%
@@ -89,7 +89,7 @@
\macrodef{And, Or, Not, Nand, Nor, Xor, Nxor, Buffer}%
{And, Or, Not, Nand, Nor, Xor, Nxor, Buffer}{}%
{log}%
- {Wrappers of {\tt AND\_gate}, $\ldots$ for use in the {\tt Autologix}%
+ {Wrappers of {\tt AND\_gate}, $\ldots$ for use in the {\tt Autologix}
macro}%
\macrodef{AND\_gate}{AND_gate}{({\tt {\sl n}, [N][B],
[{\sl wid}, [{\sl ht}]], {\sl attributes}})}%
@@ -106,11 +106,11 @@
{\sl attributes})}%
{log}%
{general AND gate: $n$=number of inputs $(0\leq n\leq 16)$;
- {\sl chars:}%
+ {\sl chars:}
B=base and straight sides; A=Arc;
[N]NE,[N]SE,[N]I,[N]N,[N]S=inputs or circles;
[N]O=output; C=center.
- Otherwise, arg1 can be a sequence of letters {\tt P|N}%
+ Otherwise, arg1 can be a sequence of letters {\tt P|N}
to define normal or negated inputs; arg2 is as above except that
{\tt [N]I} is ignored. Arg 5 contains body attributes.}%
\macrodef{AND\_ht}{AND_ht}{}%
@@ -170,8 +170,8 @@
the macro affect the arc only,
e.g., {\tt arcr(A,r,0,pi\_/2,->) dotted ->}%
\seesect{Positions:}}%
-\macrodef{arcto}{arcto}{({\sl position 1},{\sl position 2},{\sl
- radius},[dashed|dotted])}%
+\macrodef{arcto}{arcto}{({\sl position 1}, {\sl position 2},
+ {\sl radius}, [dashed|dotted])}%
{gen}%
{line toward position 1 with rounded corner toward position 2}%
\macrodef{array}{array}{({\sl variable, expr1, expr2, \ldots})}%
@@ -181,7 +181,7 @@
\macrodef{array2}{array2}{({\sl variable, expr1, expr2, \ldots})}%
{dpictools}%
{$\;\;$ Populate a doubly-subscripted array:
- {\tt {\sl var}[{\sl expr1},1]={\sl expr2;}%
+ {\tt {\sl var}[{\sl expr1},1]={\sl expr2;}
{\sl var}[{\sl expr1},2]={\sl expr3;} \ldots}.}%
\macrodef{arraymax}{arraymax}{({\sl data array, n, index name, value})}%
{dpictools}%
@@ -188,8 +188,8 @@
{$\;\;$ Find the index in {\sl array[1:n]} of the first occurrence
of the maximum array element value. The value is assigned if arg4 is
nonblank; example:
- {\tt array(x,4,9,8,6); arraymax( x,4,i )}%
- assigns 2 to {\sl i,} and {\tt arraymax( x,4,i,m )}%
+ {\tt array(x,4,9,8,6); arraymax( x,4,i )}
+ assigns 2 to {\sl i,} and {\tt arraymax( x,4,i,m )}
assigns 2 to {\sl i} and 9 to {\sl m.}}%
\macrodef{arraymin}{arraymin}{({\sl data array, n, index name, value})}%
{dpictools}%
@@ -197,37 +197,36 @@
of the minimum array element value. The value is assigned if arg4 is
nonblank; see {\tt arraymax}.}%
\macrodef{arrester}{arrester}{(\linespec,{\sl chars},
- {\sl len}[:arrowhead ht],
- {\sl ht}[:arrowhead wid],
+ {\sl len}[:{\sl arrowhead ht}],
+ {\sl ht}[:{\sl arrowhead wid}],
{\sl attributes} )}%
{cct}%
-{ Arg2 {\sl chars:}\\
- {\tt G=} spark gap (default)\\
- {\tt g=} general (dots)\\
- {\tt E=} gas discharge\\
- {\tt S=} box enclosure\\
- {\tt C=} carbon block\\
- {\tt A=} electrolytic cell\\
- {\tt H=} horn gap\\
- {\tt P=} protective gap\\
- {\tt s=} sphere gap\\
- {\tt F=} film element\\
- {\tt M=} multigap\\
- {\sl Modifiers in arg2:}\\
- {\tt R=} right orientation\\
- {\tt L=} left orientation\\
- {\tt D=} 3-terminal element for {\tt S, E}
- only, with terminals {\sl A, B, G}\\
- Arg5 applies to options C, E, S
- \seesect{Twoterminal:}}%
+{Arg2 {\sl chars:}\\
+ {\tt G=} spark gap (default)\\
+ {\tt g=} general (dots)\\
+ {\tt E=} gas discharge\\
+ {\tt S=} box enclosure\\
+ {\tt C=} carbon block\\
+ {\tt A=} electrolytic cell\\
+ {\tt H=} horn gap\\
+ {\tt P=} protective gap\\
+ {\tt s=} sphere gap\\
+ {\tt F=} film element\\
+ {\tt M=} multigap\\
+ {\sl Modifiers appended to arg2:}\\
+ {\tt R=} right orientation\\
+ {\tt L=} left orientation\\
+ {\tt D=} add terminals {\sl A, B, G} for {\tt S, E} only\\
+ Arg5 applies to options C, E, S
+ \seesect{Twoterminal:}}%
\macrodef{arrowline}{arrowline}{(\linespec)}%
{cct}%
{line (dotted, dashed permissible) with centred arrowhead
\seesect{Twoterminal:}}%
-\macrodef{assign3}{assign3}{({\sl var name,var name,var name,arg4,arg5,arg6})}%
+\macrodef{assign3}{assign3}{({\sl name, name, name, arg4, arg5, arg6})}%
{gen}%
{Assigns \$1 = arg4 if \$1 is nonblank; similarly \$2 = arg5 and \$3 = arg6}%
-\macrodef{AutoGate}{AutoGate}{}%
+\macrodef{AutoGate}{AutoGate}{\relax}%
{log}%
{Draw the tree for a gate as in the {\tt Autologix} macro. No inputs
or external connections are drawn. The names of the internal gate
@@ -239,17 +238,18 @@
{Draw the Boolean expressions defined in function notation.
The first argument is a semicolon (;)-separated sequence of
Boolean function specifications using the functions
- {\tt And, Or, Not, Buffer, Xor, Nand, Nor, Nxor}%
+ {\tt And, Or, Not, Buffer, Xor, Nand, Nor, Nxor}
with variables, e.g.,
- {\tt Autologix(And(Or(x1,~x2),Or(~x1,x2)));}.
- Each function specification is of the form
+ {\tt Autologix(And(Or(x1,\~{}x2),Or(\~{}x1,x2)));}.\\
+ Each function specification is of the form\\
{\tt {\sl function}({\sl arguments}) [@{\sl attributes}]}.
\par
Function outputs are aligned vertically but appending
- {\tt@}{\sl attributes} to a function can be used to place it.
+ {\tt@}{\sl attributes} to a function can be used to place it; e.g.,
+ {\tt Nand(\~{}A,B) @with .n at last [].s+(0,-2bp\_\_).}
\par
The function arguments are variable names or nested Boolean functions.
- Each unique variable {\sl var} causes an input point {\tt In}{\sl var}%
+ Each unique variable {\sl var} causes an input point {\tt In}{\sl var}
to be defined. Preceding the variable by a {\tt \~{}} causes a NOT gate
to be drawn at the input.
The inputs are drawn in a row at the upper left by default.
@@ -264,15 +264,15 @@
Each variable {\sl var} corresponds also to one of the input array
points with label {\tt In}{\sl var}.
Setting {\tt offset=}{\sl value} displaces the
- drawn input list in order to disambiguate the input connections when {\tt L}%
+ drawn input list in order to disambiguate the input connections when {\tt L}
is used.
\par
In the (possibly rare) case where one or more inputs of a normal function
gate is to have a NOT-circle, an additional first argument of the function
- is inserted, of the form {\tt [{\sl charseq}]}, where {\sl charseq}%
+ is inserted, of the form {\tt [{\sl charseq}]}, where {\sl charseq}
is a string containing the characters {\tt P} for a normal input or
{\tt N} for a negated input, the length of the string equal to the number
- of gate inputs. For example:
+ of gate inputs. Example:
{\tt Autologix(Xor([PN],And(x,y),And(x,y)),LRV)}}%
\Letter{B}%
@@ -287,8 +287,8 @@
\macrodef{b\_}{b_}{}%
{gen}%
{blue color value}%
-\macrodef{b\_current}{b_current}{({\sl label},{\sl pos},In|Out,Start|End,{\sl
- frac})}%
+\macrodef{b\_current}{b_current}{({\sl label}, {\sl pos}, In|Out, Start|End,
+ {\sl frac})}%
{cct}%
{labelled branch-current arrow to {\sl frac} between branch end and body
\seesect{Branchcurrent:}}%
@@ -343,14 +343,14 @@
{cct}%
{left or right, N- or P-type bipolar transistor, without or with envelope
\seesect{Semiconductors:}}%
-\macrodef{boxcoord}{boxcoord}{({\sl planar obj},{\sl x fraction},{\sl y
- fraction})}%
+\macrodef{boxcoord}{boxcoord}{({\sl planar obj}, {\sl x fraction},
+ {\sl y fraction})}%
{gen}%
{internal point in a planar object}%
\macrodef{boxdim}{boxdim}{({\sl name},h|w|d|v,{\sl default})}%
{gen}%
- {evaluate, e.g.\ {\sl name}{\tt \_w} if defined, else {\sl default\/}%
- if given, else 0 {\tt v} gives sum of {\tt d} and {\tt h} values
+ {Evaluate, e.g.\ {\sl name}{\tt \_w} if defined, else {\sl default\/}
+ if given, else 0. {\tt v} gives sum of {\tt d} and {\tt h} values
\seesect{Interaction:}}%
\macrodef{BOX\_gate}{BOX_gate}{({\sl inputs, output, swid, sht, label,
attributes })}%
@@ -378,12 +378,12 @@
{log}%
{general buffer, {\sl chars:}\\
{\tt T}: triangle,\\
- {\tt [N]O}: output location {\tt Out}%
+ {\tt [N]O}: output location {\tt Out}
({\tt NO} draws circle {\tt N\_Out});\\
{\tt [N]I, [N]N, [N]S, [N]NE, [N]SE} input locations;\\
{\tt C}: centre location.\\
Args 4-6 allow alternative
- definitions of respective {\tt In, NE,}%
+ definitions of respective {\tt In, NE,}
and {\tt SE} argument sequences }%
\macrodef{BUF\_ht}{BUF_ht}{}%
{log}%
@@ -395,6 +395,7 @@
{cct}%
{buzzer, {\sl In1} to {\sl In3} defined, C=curved
\seesect{Composite:}}%
+
\Letter{C}%
\macrodef{cangle}{cangle}{({\sl Start, End},[d])}%
{gen}%
@@ -427,7 +428,7 @@
\seesect{Twoterminal:}}%
\macrodef{case}{case}{({\sl i, alt1, alt2, \ldots})}%
{dpictools}%
- {$\;\;$ Case statement for dpic; execute alternative {\sl i.}%
+ {$\;\;$ Case statement for dpic; execute alternative {\sl i.}
Example: {\tt case( 2, x=5, x=10, x=15 )} sets {\tt x} to 10.
Note: this is a macro so {\tt \${}n} refers to the {\sl n}-th
argument of {\tt case}.}%
@@ -453,19 +454,17 @@
\macrodef{Cintersect}{Cintersect}{({\sl Pos1, Pos2, rad1, rad2,} [R])}%
{gen}%
{Upper (lower if arg5={\tt R}) intersection of circles at
- {\sl Pos1} and {\sl Pos2}, radius {\sl rad1} and {\sl rad2}}%
-\macrodef{clabel}{clabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
- [{\sl block name}])}%
+ {\sl Pos1} and {\sl Pos2}, radius {\sl rad1} and {\sl rad2}}
+\macrodef{clabel}{clabel}{( {\sl label}, {\sl label}, {\sl label},
+ {\sl relative position}, {\sl block name})}%
{cct}%
{Triple label along the drawing axis of the body of an element in the
current direction \seesect{Labels:}. Labels are placed at the
- beginning, centre, and end of the last {\tt []} block (or a named
- {\tt []} block). Each label is treated as math by default, but is
- copied literally if it is in double quotes or sprintf.
- {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
- right} to supplement the default relative position. The fifth
- argument is the optional name of the {\tt []} block to be labelled,
- which is {\tt last []} by default.}%
+ beginning, centre, and end of the last {\tt []} block (or a {\tt
+ []} block named or enumerated in arg5). Each label is treated as
+ math by default, but is copied literally if it is in double quotes
+ or sprintf. {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,}
+ or {\tt right} to supplement the default relative position.}%
\macrodef{cm\_\_}{cm__}{}%
{gen}%
{absolute centimetres}%
@@ -477,19 +476,29 @@
{voltage or current controlled source with alternate forms;
{\tt R}: reversed polarity\seesect{Twoterminal:}}%
\macrodef{ColoredV}{ColoredV}{%
- (box|circle|ellipse,({\sl r,g,b})|(({\sl colorseq})),{\sl attributes})}%
+ (box|circle|ellipse,({\sl r,g,b})|(({\sl colorseq}))[:{\sl nlines}],%
+ {\sl attributes})}%
{gen}%
{box (default), circle, or ellipse in a {\tt []} block.
- If arg2 is blank then all formatting is in arg3. If arg2 is blank
+ If arg2 is blank
then all formatting is in arg3; if parenthesized r,g,b, the object
is shaded top to bottom white to the specified rgb color; if a
- double-parenthesized colorseq then the colorseq defines the internal
+ double-parenthesized {\sl colorseq} then the {\sl colorseq}
+ defines the internal
shading top to bottom. A {\sl colorseq} is of the form
- 0, r0,g0,b0, {\sl frac1},r1,g1,b1, {\sl frac2},r2,g2,b2,
- \ldots 1,rn,gn,bn with $0 < \hbox{\sl frac1} < \hbox{\sl frac2} \ldots 1$.
+ {\sl 0,r0,g0,b0,\\
+ frac1,r1,g1,b1,\\
+ frac2,r2,g2,b2,\\
+ \ldots\\
+ 1,rn,gn,bn}\\
+ with $0 < \hbox{\sl frac1} < \hbox{\sl frac2} \ldots 1$.
+ The number of {\sl colorseq} lines can be specified with the colon
+ (default {\tt height/(line thickness)*2)}.
Examples: {\tt ColoredV(circle,(1,0,0));
- ColoredV(ellipse,(1,0.04,1),wid 0.75 ht 1 outlined "magenta" "Goodbye");
- ColoredV(box,(1,0,0),outlined "blue" rad 0.1, (0,1,1,0, 1,0,0,1)).} }%
+ ColoredV(ellipse,(1,0.04,1),wid 0.75 ht 1 \textbackslash\\
+ $\;$ outlined "magenta" "Goodbye");
+ ColoredV(box,((0,1,1,0, 1,0,0,1)):50, \\
+ $\;$ outlined "blue" rad 0.1).} }%
\macrodef{contact}{contact}{({\sl chars})}%
{cct}%
{single-pole contact:
@@ -515,7 +524,7 @@
\seesect{Composite:}}%
\macrodef{contline}{contline}{({\sl line})}%
{gen}%
- {evaluates to {\tt continue}%
+ {evaluates to {\tt continue}
if processor is {\bf dpic}, otherwise to first arg (default {\tt line})}%
\macrodef{copy3}{copy3}{({\sl vector1,vector2})}%
{dpictools}%
@@ -522,7 +531,7 @@
{$\;\;$ Copy vector1 into vector named by arg2.}%
\macrodef{copythru}{copythru}{({\sl dpic macro name,} "{\sl file name}")}%
{dpictools}%
- {$\;\;$ Implements the gpic {\tt copy {\sl filename} thru {\sl macro-name}}%
+ {$\;\;$ Implements the gpic {\tt copy {\sl filename} thru {\sl macro-name}}
for file data separated by commas, spaces, or tabs.}%
\macrodef{corner}{corner}{({\sl line thickness,attributes,turn radians})}%
{gen}%
@@ -559,9 +568,10 @@
{\tt size={\sl expr};},
{\tt line={\sl attributes};} }%
\macrodef{crossover}{crossover}{(\linespec, [L|R][:{\sl line attributes}],
- Line1, Line2, .{.}.)}%
+ {\sl Linename1, Linename2,} $\ldots$)}%
{cct}%
- {line jumping left or right over ordered named lines\seesect{Semiconductors:}}%
+ {line jumping left or right over ordered named
+ lines\seesect{Semiconductors:}}%
\macrodef{crosswd\_}{crosswd_}{}%
{gen}%
{cross dimension}%
@@ -568,6 +578,7 @@
\macrodef{csdim\_}{csdim_}{}%
{cct}%
{controlled-source width}%
+
\Letter{D}%
\macrodef{dabove}{dabove}{(at {\sl location})}%
{darrow}%
@@ -583,12 +594,13 @@
{darrow}%
{Wrapper for {\tt darc}.
CCW arc in {\tt dline} style, with closed ends or (dpic only) arrowheads.
- Semicolon-separated {\sl parameters}:
- {\tt thick=}{\sl value}, {\tt wid=}{\sl value}, {\tt ends=}%
- {\sl x}{\tt -},
+ Semicolon-separated {\sl parameters}:\\
+ {\tt thick=}{\sl value};\\
+ {\tt wid=}{\sl value};\\
+ {\tt ends=} {\sl x}{\tt -},
{\tt -}{\sl x}, {\sl x}{\tt -}{\sl x}, {\tt ->}, {\sl x}{\tt ->},
- {\tt <-}, {\tt <-}{\sl x}, {\tt <->}%
- where {\sl x} means {\tt |} or (half-thickness line) {\tt !}.}%
+ {\tt <-}, {\tt <-}{\sl x}, {\tt <->},
+ where {\sl x} is {\tt |} or (half-thickness line) {\tt !}.}%
\macrodef{darc}{darc}{({\sl center position},
{\sl radius}, {\sl start radians}, {\sl end radians}, {\sl dline thickness},
{\sl arrowhead wid}, {\sl arrowhead ht},
@@ -599,8 +611,8 @@
Permissible {\sl end symbols}:
{\sl x}{\tt -},
{\tt -}{\sl x}, {\sl x}{\tt -}{\sl x}, {\tt ->}, {\sl x}{\tt ->},
- {\tt <-}, {\tt <-}{\sl x}, {\tt <->}%
- where {\sl x} means {\tt |} or (half-thickness line) {\tt !}.
+ {\tt <-}, {\tt <-}{\sl x}, {\tt <->}
+ where {\sl x} is {\tt |} or (half-thickness line) {\tt !}.
An inner arc is drawn overlaying the outer arc.
Example: {\tt darc(,{,},{,},{,},{,}outlined "red",outlined "yellow")}.}%
\macrodef{Darlington}{Darlington}{(L|R,{\sl chars})}%
@@ -616,7 +628,7 @@
Z= zener bias diode
\seesect{Semiconductors:}}%
\macrodef{darrow}{darrow}{(\linespec,
- t,t,{\sl width},{\sl arrowhd wd},{\sl arrowhd ht},{\sl parameters},
+ t, t, {\sl width}, {\sl arrowhd wd}, {\sl arrowhd ht}, {\sl parameters},
{\sl color attributes})}%
{darrow}%
{See also {\tt Darrow}.
@@ -623,7 +635,8 @@
Double arrow, truncated at beginning (arg2={\tt t}) or
end (arg3={\tt t}), specified sizes,
with arrowhead and optional closed stem. The parameters (arg7) are
- {\tt {\sl x}-} or {\tt ->} or {\tt {\sl x}->} or {\tt <-} or {\tt <-{\sl x}}%
+ {\tt {\sl x}-} or {\tt ->} or {\tt {\sl x}->} or {\tt <-} or
+ {\tt <-{\sl x}}
or {\tt <->} where {\sl x} is {\tt |} or {\tt !}.
The {\tt !-} or {\tt -!} parameters close
the stem with half-thickness lines to simplify butting to other objects.
@@ -639,7 +652,7 @@
{\tt thick=}{\sl val}; (total thicknes, ie width)\\
{\tt wid=}{\sl val}; (arrowhead width)\\
{\tt ht=}{\sl val}; (arrowhead height)\\
- {\tt ends=}%
+ {\tt ends=}
{\sl x}{\tt -}{\sl x} or
{\tt -}{\sl x} or
{\sl x}{\tt -} where {\sl x} is {\tt !} (half-width line)
@@ -669,12 +682,12 @@
{A DC symbol (a dashed line below a solid line).
The current drawing direction is default, otherwise Up, Down,
Left, Right, or at {\sl degrees} slant; e.g.,
- {\tt source(up\_ dimen\_); $\lbrace$ DCsymbol(at last [],{},{},R) $\rbrace$}%
+ {\tt source(up\_ dimen\_); $\lbrace$ DCsymbol(at last [],{},{},R) $\rbrace$}
\seesect{Twoterminal:} }%
\macrodef{DefineCMYKColor}{DefineCMYKColor}{({\sl color-name, c, m, y, k})}%
{dpictools}%
{$\;\;$ Like {\tt DefineRGBColor} but takes arguments in percent, i.e.,
- the range $[0,100].$ Define dpic macro {\sl colorname}%
+ the range $[0,100].$ Define dpic macro {\sl colorname}
according to the postprocessor specified by dpic command-line option.
The macro evaluates to a string.}%
\macrodef{DefineHSVColor}{DefineHSVColor}{({\sl color-name, h, s, v})}%
@@ -681,18 +694,18 @@
{dpictools}%
{$\;\;$ Like {\tt DefineRGBColor} but takes argument {\sl h} in the
range $[0,360],$ {\sl s} in $[0,1],$ and {\sl v} in $[0,1].$
- Define dpic macro {\sl colorname}%
+ Define dpic macro {\sl colorname}
according to the postprocessor specified by dpic command-line option.
The macro evaluates to a string.}%
\macrodef{DefineRGBColor}{DefineRGBColor}{({\sl color-name, r, g, b})}%
{dpictools}%
- {$\;\;$ Arguments are in the range 0 to 1. Define dpic macro {\sl colorname}%
+ {$\;\;$ Arguments are in the range 0 to 1. Define dpic macro {\sl colorname}
according to the postprocessor specified by dpic command-line option.
The macro evaluates to a string.}%
\macrodef{definergbcolor}{definergbcolor}{({\sl color-name, r, g, b})}%
{gen}%
{Arguments are in the range 0 to 1. Define color name
- according to the postprocessor. Similar to dpictools {\tt DefineRGBColor}%
+ according to the postprocessor. Similar to dpictools {\tt DefineRGBColor}
but the color name is an m4 macro, not a string.}%
\macrodef{delay}{delay}{(\linespec,{\sl size},{\sl attributes})}%
{cct}%
@@ -707,7 +720,7 @@
U|D|L|R|{\sl degrees}) (default {\tt U} for up)}%
{cct}%
{Delta symbol for power-system diagrams.
- {\sl keys:} {\tt size={\sl expression;}}%
+ {\sl keys:} {\tt size={\sl expression;}}
{\tt type=C|O} (default {\tt C} for closed;
{\tt O} draws an ``open'' symbol); }%
\macrodef{Demux}{Demux}{({\sl n},{\sl label},
@@ -727,9 +740,9 @@
\macrodef{dend}{dend}{(at {\sl location},
{\sl line thickness}{\tt |}{\sl attributes})}%
{darrow}%
- {Close (or start) double line (Note specifying {\tt dends=} for {\tt Dline}%
- is a similar function. Arg2 is dline thickness or atributes:
- {\tt thick={\sl expression};} (dline thickness in drawing units)
+ {Close (or start) double line (Note specifying {\tt dends=} for {\tt Dline}
+ is a similar function. Arg2 is dline thickness or atributes:\\
+ {\tt thick={\sl expression};} (dline thickness in drawing units)\\
{\tt outline=({\sl r,g,b})|"{\sl color}";}}%
\macrodef{d\_fet}{d_fet}{(\linespec,R,P,E|S)}%
{cct}%
@@ -744,10 +757,10 @@
$\hbox{\sl vec3} = \hbox{\sl vec1} - \hbox{\sl vec2}$.}%
\macrodef{dfitcurve}{dfitcurve}{({\sl Name, n, linetype, m})}%
{dpictools}%
- {$\;\;$ Draw a spline through {\sl Name}{\tt [m],} \ldots {\sl Name}{\tt [n]}%
+ {$\;\;$ Draw a spline through {\sl Name}{\tt [m],} \ldots {\sl Name}{\tt [n]}
with attribute {\sl linetype} {\tt dotted,} for example.
The calculated control points {\sl P[i]} satisfy approximately:
- {\sl P[0] = V[0];} {\sl P[i-1]/8 + P[i]*3/4 + P[i+1]/8 = V[i];}%
+ {\sl P[0] = V[0];} {\sl P[i-1]/8 + P[i]*3/4 + P[i+1]/8 = V[i];}
{\sl P[n] = V[n].} See m4 macro {\tt fitcurve.}}%
\macrodef{dfitpoints}{dfitpoints}{({\sl V,n,m,P,mp})}%
{dpictools}%
@@ -766,10 +779,9 @@
\macrodef{dimension\_}{dimension_}{(\linespec,{\sl offset},{\sl label},
D|H|W|{\sl blank width},{\sl tic offset},{\sl arrowhead })}%
{gen}%
- {macro for dimensioning diagrams;
- {\sl arrowhead=}{\tt -> | <-}}%
-\macrodef{diode}{diode}{(\linespec,%
-B|b|CR|D|G|L|LE[R]|P[R]|S|Sh|T|U|V|v|w|Z|chars,%
+ {macro for dimensioning diagrams; {\sl arrowhead=}{\tt -> | <-}}%
+\macrodef{diode}{diode}{(\linespec,
+B|b|CR|D|G|L|LE[R]|P[R]|S|Sh|T|U|V|v|w|Z|chars,
[R][E])}%
{cct}%
{diode:
@@ -815,7 +827,7 @@
\macrodef{dlabel}{dlabel}{({\sl long},{\sl lat},{\sl label},{\sl
label},{\sl label},{\sl chars})}%
{cct}%
- {general triple label; {\sl chars:}%
+ {general triple label; {\sl chars:}
$X$ displacement {\tt {\sl long, lat}} with respect to the drawing
direction is from the centre of the last
line rather than the centre of the last {\tt [ ]};
@@ -825,8 +837,8 @@
{\sl attributes})}%
{darrow}%
{Double line left turn 90 degrees. Attributes can be
- {\tt outline=({\sl r, g, b})|"{\sl color}";}%
- {\tt innershade=({\sl r, g, b})|"{\sl color}";}%
+ {\tt outline=({\sl r, g, b})|"{\sl color}";}
+ {\tt innershade=({\sl r, g, b})|"{\sl color}";}
where rgb values in parentheses or a defined color is specified.}%
\macrodef{Dline}{Dline}{(\linespec, {\sl parameters})}%
{darrow}%
@@ -847,7 +859,7 @@
{See also {\tt Dline}.
Double line, truncated by half width at either end, closed
at either or both ends.
- {\sl parameters=}%
+ {\sl parameters=}
{\sl x}{\tt -}{\sl x} or
{\tt -}{\sl x} or
{\sl x}{\tt -} where {\sl x} is {\tt !} (half-width line)
@@ -900,9 +912,9 @@
\macrodef{dright}{dright}{({\tt at} {\sl position}, {\sl line thickness},
{\sl attributes})}%
{darrow}%
- {Double line right turn 90 degrees. Attributes can be
- {\tt outline=({\sl r, g, b})|"{\sl color}";}%
- {\tt innershade=({\sl r, g, b})|"{\sl color}";}%
+ {Double line right turn 90 degrees. Attributes can be\\
+ {\tt outline=({\sl r, g, b})|"{\sl color}";}\\
+ {\tt innershade=({\sl r, g, b})|"{\sl color}";}\\
where rgb values in parentheses or a defined color is specified.}%
\macrodef{drjust}{drjust}{(at {\sl location})}%
{darrow}%
@@ -944,8 +956,8 @@
{\tt diam={\sl expr};
circle={\sl circle attribs};}\\
{\tt GX}: box control mechanism, attribs:
- {\tt lgth={\sl expr}; wdth={\sl expr}; %
- box={\sl box attr};}%
+ {\tt lgth={\sl expr}; wdth={\sl expr};
+ box={\sl box attr};}
{\tt text={\sl char};}\\
{\tt H}: time delay closing\\
{\tt uH}: time delay opening\\
@@ -980,7 +992,7 @@
\{ darrow(down\_,t) \}; darrow(right\_,t)}.
The attributes are
{\tt thick={\sl expr};} (line thickness in drawing units),
- {\tt innershade=({\sl r,g,b})|"{\sl color}";}%
+ {\tt innershade=({\sl r,g,b})|"{\sl color}";}
{\tt outline=({\sl r,g,b})|"{\sl color}";}. }%
\macrodef{dtor\_}{dtor_}{}%
{gen}%
@@ -990,11 +1002,12 @@
{darrow}%
{Tturn dline arg1 degrees left (ccw).
Attributes can be
- {\tt outline=({\sl r, g, b})|"{\sl color}";}%
- {\tt innershade=({\sl r, g, b})|"{\sl color}";}%
+ {\tt outline=({\sl r, g, b})|"{\sl color}";}
+ {\tt innershade=({\sl r, g, b})|"{\sl color}";}
where rgb values in parentheses or a defined color is specified.}%
-%
+
\Letter{E}%
+
\macrodef{earphone}{earphone}{( U|D|L|R|{\sl degrees, size})}%
{cct}%
{earphone, {\sl In1} to {\sl In3} defined
@@ -1064,8 +1077,9 @@
\macrodef{expe}{expe}{}%
{gen}%
{exponential, base $e$}%
-%
+
\Letter{F}%
+
\macrodef{f\_box}{f_box}{({\sl boxspecs},{\sl text},{\sl expr1},$\cdots$)}%
{gen}%
{like {\tt s\_box} but the text is overlaid on a box of identical size.
@@ -1111,7 +1125,7 @@
{log}%
{General flipflop.
Arg 1 modifies the box (labelled Chip) default specification.
- Each of args 3 to 6 is null or a string of {\sl pinspecs}%
+ Each of args 3 to 6 is null or a string of {\sl pinspecs}
separated by semicolons ({\tt;}). A {\sl Pinspec} is either empty
or of the form
{\tt[}{\sl pinopts}{\tt]:[}{\sl label}{\tt[:}{\sl Picname}{\tt]]}.
@@ -1119,10 +1133,10 @@
Pins are placed top to bottom or left to right along the box edges with
null {\sl pinspecs} counted for placement. Pins are named by side and number
by default; eg {\tt W1, W2, ..., N1, N2, ..., E1, ..., S1, ...} ; however,
- if {\tt:}{\sl Picname} is present in a {\sl pinspec} then {\sl Picname}%
+ if {\tt:}{\sl Picname} is present in a {\sl pinspec} then {\sl Picname}
replaces the default name.
A {\sl pinspec} label is text placed at the pin base. Semicolons are
- not allowed in labels; use, e.g., {\tt \char92{}char59\char123\char125}%
+ not allowed in labels; use, e.g., {\tt \char92{}char59\char123\char125}
instead.
To put a bar over a label, use {\tt lg\_bartxt(}{\sl label}{\tt)}.
The {\sl pinopts} are {\tt[N|L|M][E]};
@@ -1131,8 +1145,8 @@
{\tt M}: active low in;
{\tt E}: edge trigger \seesect{Logicgates:}.\\
Optional arg 7 is the length of pins}%
-\macrodef{foreach\_}{foreach_}{(`{\sl variable}',{\sl actions},{\sl
- value1, value2, $\ldots$})}%
+\macrodef{foreach\_}{foreach_}{(`{\sl variable}',{\sl actions},%
+ {\sl value1, value2, $\ldots$})}%
{gen}%
{Clone of Loopover\_ by a different name:
Repeat {\sl actions} with {\sl variable} set successively to
@@ -1144,7 +1158,8 @@
\macrodef{FTcap}{FTcap}{({\sl chars})}%
{cct}%
{Feed-through capacitor; example of a composite element derived from
- a two-terminal element. Defined points: {\sl .Start, .End, .C .T1 .T2 T}%
+ a two-terminal element. Defined points:
+ {\sl .Start, .End, .C, .T1, .T2, T}\\
Arg 1: {\tt A}: type A (default),
{\tt B}: type B,
{\tt C}: type C
@@ -1153,8 +1168,9 @@
{cct}%
{fuse symbol, type$=$
{\tt A|B|C|D|S|HB|HC|SB} or {\tt dA=D}\seesect{Twoterminal:}}%
-%
+
\Letter{G}%
+
\macrodef{gap}{gap}{(\linespec,{\sl fill},A)}%
{cct}%
{gap with (filled) dots, A=chopped arrow between dots\seesect{Twoterminal:}}%
@@ -1172,13 +1188,18 @@
\macrodef{G\_hht}{G_hht}{}%
{log}%
{gate half-height in {\tt L\_unit}s}%
-\macrodef{glabel\_}{glabel_}{}%
+\macrodef{geiger}{geiger}{(\linespec, r, {\sl diameter}, R,
+ {\sl body attributes, body name})}%
{cct}%
- {internal general labeller}%
+ {Wrapper that calls {\tt source} with identical arguments except
+ arg2, which is blank or {\tt r} for right orientation.}
+%\macrodef{glabel\_}{glabel_}{}%
+% {cct}%
+% {internal general labeller}%
%\macrodef{gpar\_}{gpar_}{({\sl element},{\sl element},{\sl separation})}%
% {cct}%
% {two same-direction elements in parallel}%
-\macrodef{gpolyline\_}{gpolyline_}{({\sl fraction},{\sl location}, ...)}%
+\macrodef{gpolyline\_}{gpolyline_}{({\sl fraction}, {\sl location}, ...)}%
{gen}%
{internal to {\tt gshade}}%
\macrodef{graystring}{graystring}{({\sl gray value})}%
@@ -1209,11 +1230,12 @@
vertices, attempting to avoid sharp corners}%
\macrodef{gyrator}{gyrator}{({\sl box specs,space ratio,pin lgth,}[N][V])}%
{cct}%
- {Gyrator two-port wrapper for {\tt nport}, {\tt N} omits pin dots; {\tt V}%
+ {Gyrator two-port wrapper for {\tt nport}, {\tt N} omits pin dots; {\tt V}
gives a vertical orientation
\seesect{Composite:}}%
-%
+
\Letter{H}%
+
\macrodef{hatchbox}{hatchbox}{({\sl boxspec,hashsep,hatchspec,angle})
{\rm or} hatchbox({\sl keys})}%
{gen}%
@@ -1227,7 +1249,7 @@
{\tt fillcolor="{\sl color}"|({\sl r,g,b});}\\
{\tt hatchsep={\sl expr};}\\
{\tt hatchspec={\sl attributes};}\\
- {\tt angle={\sl expr};}%
+ {\tt angle={\sl expr};}
e.g.,
{\tt hatchbox(outlined "blue",{},dashed outlined "green" thick 0.4)};\\
also
@@ -1251,8 +1273,8 @@
{Heater element with curved sides\seesect{Twoterminal:}.
{\tt R} means right orientation;
{\tt T} truncates leads to the width of the body.
- The {\sl keys} for the body are
- {\tt lgth={\sl expr};}%
+ The {\sl keys} for the body are\\
+ {\tt lgth={\sl expr};}
{\tt wdth={\sl expr};} (default {\tt lgth*2/5});
{\tt cycles={\sl expr};}%
{\tt line={\sl attributes};} (e.g., {\tt dotted, dashed, outlined})}%
@@ -1259,8 +1281,8 @@
\macrodef{heater}{heater}{({\sl linespec, ndivisions|keys, wid, ht,
boxspec}|[E[R][T]])}%
{cct}%
- {Heater element\seesect{Twoterminal:}. If arg 5 contains {\tt E,}%
- draws an {\tt heatere({\sl linespec, keys,} [R][T]),}%
+ {Heater element\seesect{Twoterminal:}. If arg 5 contains {\tt E,}
+ draws an {\tt heatere({\sl linespec, keys,} [R][T]),}
otherwise a
{\tt heatert({\sl linespec, nparts, wid, ht, boxspec})}}%
\macrodef{heatert}{heatert}{({\sl linespec, nparts|keys, wid, ht, boxspec})}%
@@ -1267,10 +1289,10 @@
{cct}%
{Two-terminal rectangular heater element\seesect{Twoterminal:}.
The {\sl keys} for the body are
- {\tt parts={\sl expr};}%
- {\tt lgth={\sl expr};}%
+ {\tt parts={\sl expr};}
+ {\tt lgth={\sl expr};}
{\tt wdth={\sl expr};} (default {\tt lgth*2/5});
- {\tt box={\sl body attributes};}%
+ {\tt box={\sl body attributes};}
(e.g., {\tt dotted, dashed, outlined, shaded}).
Args 3--5 are unused if any key is given}%
\macrodef{hexadecimal\_}{hexadecimal_}{($n$, [$m$])}%
@@ -1301,8 +1323,9 @@
\macrodef{ht\_}{ht_}{}%
{gen}%
{height relative to current direction}%
-%
+
\Letter{I}%
+
\macrodef{ifdpic}{ifdpic}{({\sl if true},{\sl if false})}%
{gen}%
{test if dpic has been specified as pic processor}%
@@ -1314,8 +1337,7 @@
{gen}%
{test if the second argument is a substring of the first; also
{\tt ifinstr({\sl string},{\sl string},{\sl if true},{\sl
- string},{\sl string},{\sl if true}, $\ldots$ {\sl if false})}%
- }%
+ string},{\sl string},{\sl if true}, $\ldots$ {\sl if false})} }%
\macrodef{ifmfpic}{ifmfpic}{({\sl if true},{\sl if false})}%
{gen}%
{test if mfpic has been specified as pic post-processor}%
@@ -1381,12 +1403,13 @@
{corrected (old) gpic $int()$ function}%
\macrodef{IOdefs}{IOdefs}{(\linespec,{\sl label},[P|N]*,L|R) }%
{log}%
- {Define locations {\sl label}{\tt 1}, $\ldots$ {\sl label}{\tt n}%
+ {Define locations {\sl label}{\tt 1}, $\ldots$ {\sl label}{\tt n}
along the line; {\tt P}: label only;
{\tt N}: with {\tt NOT\_circle};
{\tt R}: circle to right of current direction }%
-%
+
\Letter{J}%
+
\macrodef{jack}{jack}{(U|D|L|R|{\sl degrees},{\sl chars})}%
{cct}%
{arg1: drawing direction; string arg2: {\tt R}: right orientation,
@@ -1402,9 +1425,9 @@
{ Two-terminal solder jumper with named body parts.
The {\sl chars} character sequence specifies the jumper components,
and normally begins with {\tt C} and ends with {\tt D.} The character
- {\tt E} is an empty (blank) gap, {\tt J} is a filled gap, {\tt B}%
- is a box component. The components are named {\sl T1, T2, \ldots}%
- Examples: {\tt CED} is a simple open jumper (the default); {\tt CJD}%
+ {\tt E} is an empty (blank) gap, {\tt J} is a filled gap, {\tt B}
+ is a box component. The components are named {\sl T1, T2, \ldots}
+ Examples: {\tt CED} is a simple open jumper (the default); {\tt CJD}
closed; {\tt CEBED} three-contact open; {\tt CJBED} three-contact
open and closed.
The {\sl keys} are: {\tt type=}{\sl chars} as previously;
@@ -1412,14 +1435,16 @@
{\tt wdth=}{\sl expr};
{\tt name=}{\sl chars} (the body name)%
\seesect{Twoterminal:}}%
-%
+
\Letter{K}%
+
\macrodef{KelvinR}{KelvinR}{({\sl cycles},[R],{\sl cycle wid})}%
{cct}%
- {IEEE resistor in a {\tt [ ]} block with Kelvin taps {\sl T1} and {\sl T2}%
+ {IEEE resistor in a {\tt [ ]} block with Kelvin taps {\sl T1} and {\sl T2}
\seesect{Composite:}}%
-%
+
\Letter{L}%
+
\macrodef{lamp}{lamp}{(\linespec, [R][T])}%
{cct}%
{Two-terminal incandescent lamp. {\tt T} truncates leads to the body width.
@@ -1426,7 +1451,7 @@
\seesect{Twoterminal:}}%
\macrodef{langle}{langle}{({\sl Start, End})}%
{gen}%
- {Angle in radians from horizontal of the line from {\sl Start}%
+ {Angle in radians from horizontal of the line from {\sl Start}
to {\sl End}.}%
\macrodef{larrow}{larrow}{({\sl label},{\tt ->|<-},{\sl dist})}%
{cct}%
@@ -1459,7 +1484,7 @@
\macrodef{length3D}{length3D}{(x,y,z)}%
{3D}%
{Euclidean length of triple x,y,z}%
-\macrodef{LEtangent}{LEtangent}{({\sl Pos1, Centre, ellips wid, ellipse ht}%
+\macrodef{LEtangent}{LEtangent}{({\sl Pos1, Centre, ellips wid, ellipse ht,}
[R])}%
{gen}%
{ Left (right if arg5=R) tangent point of line
@@ -1498,23 +1523,21 @@
{set line thickness in points}%
\macrodef{lin\_leng}{lin_leng}{({\sl line-reference})}%
{gen}%
- {length of a line, equivalent to {\sl line-reference}{\tt .len}%
+ {length of a line, equivalent to {\sl line-reference}{\tt .len}
with dpic}%
\macrodef{ljust\_}{ljust_}{}%
{gen}%
{ljust with respect to current direction}%
-\macrodef{llabel}{llabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
- [{\sl block name}])}%
+\macrodef{llabel}{llabel}{( {\sl label}, {\sl label}, {\sl label},
+ {\sl relative position}, {\sl block name})}%
{cct}%
{Triple label on the left of the body of an element with respect to the
current direction \seesect{Labels:}. Labels are placed at the
- beginning, centre, and end of the last {\tt []} block (or a named
- {\tt []} block). Each label is treated as math by default, but is
- copied literally if it is in double quotes or defined by sprintf.
- {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
- right} to supplement the default relative position. The fifth
- argument is the optional name of the {\tt []} block to be labelled,
- which is {\tt last []} by default}%
+ beginning, centre, and end of the last {\tt []} block (or a {\tt []} block
+ named or enumerated in arg5). Each label is treated as math by
+ default, but is copied literally if it is in double quotes or defined
+ by sprintf. {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,}
+ or {\tt right} to supplement the default relative position.}%
\macrodef{loc\_}{loc_}{({\sl x}, {\sl y})}%
{gen}%
{location adjusted for current direction}%
@@ -1531,7 +1554,7 @@
\macrodef{loop}{loop}{({\sl initial assignments, test, loop end, statements})}%
{dpictools}%
{$\;\;$ C-like loop. Commas in arg3 and arg4 must
- be in quotes or parentheses. Example:
+ be in quotes or parentheses. Example:\\
{\tt loop(i=1, i<=3, i+=1, print i)} prints 1, 2, 3.}%
\macrodef{Loopover\_}{Loopover_}{(`{\sl variable}',{\sl actions},{\sl
value1, value2, $\ldots$})}%
@@ -1543,7 +1566,7 @@
{\sl fill},
{\sl zero ht})} {gen}%
{for lollipop graphs: filled circle with stem to
- (xcoord,zeroht)}%
+ {\tt ({\sl xcoord,zeroht})}}%
\macrodef{lp\_xy}{lp_xy}{}%
{log}%
{coordinates used by {\tt lg\_pin}}%
@@ -1564,8 +1587,9 @@
\macrodef{L\_unit}{L_unit}{}%
{log}%
{logic-element grid size}%
-%
+
\Letter{M}%
+
\macrodef{m4\_arrow}{m4_arrow}{(\linespec,{\sl ht},{\sl wid})}%
{gen}%
{arrow with adjustable head, filled when possible}%
@@ -1597,8 +1621,7 @@
{memristor element\seesect{Twoterminal:}}%
\macrodef{microphone}{microphone}{( A|U|D|L|R|{\sl degrees, size, attributes})}%
{cct}%
- {microphone; if arg1 = A: upright mic, otherwise arg1 sets
- direction
+ {microphone; if arg1 = A: upright mic, otherwise arg1 sets direction
of standard microphone with {\sl In1} to {\sl In3} defined
\seesect{Composite:}}%
\macrodef{Min}{Min}{({\sl arg, arg, $\ldots$})}%
@@ -1615,7 +1638,7 @@
({\sl Position1,Position2,Position3,length,line attributes})}%
{gen}%
{e.g., {\tt mitre\_(A,B,C)} draws angle ABC with legs
- of length arg4 (default {\tt linethick bp\_\_/2}); sets {\tt Here}%
+ of length arg4 (default {\tt linethick bp\_\_/2}); sets {\tt Here}
to Position2
\seesect{Corners:}}%
\macrodef{mm\_\_}{mm__}{}%
@@ -1656,7 +1679,7 @@
numbers, {\tt H} display hexadecimal pin numbers, {\tt X} do not
print pin numbers, {\tt N[{\sl n}]} puts Sel or Sel$0$ .. Sel$n$
at the top (i.e., to the left of the drawing direction), {\tt
- S[{\sl n}]} puts the Sel inputs at the bottom (default) {\tt OE}%
+ S[{\sl n}]} puts the Sel inputs at the bottom (default) {\tt OE}
({\tt N}: negated) {\tt OE} pin \seesect{Logicgates:}}%
\macrodef{Mux\_wid}{Mux_wid}{}%
{cct}%
@@ -1664,8 +1687,9 @@
\macrodef{Mx\_pins}{Mx_pins}{}%
{log}%
{max number of gate inputs without wings}%
-%
+
\Letter{N}%
+
\macrodef{NAND\_gate}{NAND_gate}{({\tt {\sl n}, [N][B],
[{\sl wid}, [{\sl ht}]], {\sl attributes}})}%
{log}%
@@ -1756,8 +1780,9 @@
Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
normal or negated inputs.
\seesect{Logicgates:}}%
-%
+
\Letter{O}%
+
\macrodef{opamp}{opamp}{\tt (\linespec,{\sl label, label, size|keys, chars,
other commands})}%
{cct}%
@@ -1794,13 +1819,14 @@
{\tt [N]P}: XOR arc;\\
{\tt [N]O}: output; C=center.\\
Otherwise, arg1 can be a sequence of letters {\tt P|N} to define
- normal or negated inputs. If arg5 contains {\tt shaded rgbstring(...)}%
+ normal or negated inputs. If arg5 contains {\tt shaded rgbstring(...)}
the arguments of {\tt rgbstring} may not contain parentheses.}%
\macrodef{OR\_rad}{OR_rad}{}%
{log}%
{radius of OR input face in {\tt L\_unit}s}%
-%
+
\Letter{P}%
+
\macrodef{parallel\_}{parallel_}{(\char96{\sl elementspec}\char39,%
\char96{\sl elementspec}\char39 $\ldots$)}%
{cct}%
@@ -1843,10 +1869,10 @@
\macrodef{pi\_}{pi_}{}%
{gen}%
{$\pi$}%
-\macrodef{plug}{plug}{(U|D|L|R|{\sl degrees},[2|3][R])}%
+\macrodef{plug}{plug}{\smash{(U|D|L|R|{\sl degrees},[2|3][R])}}%
{cct}%
- {arg1: drawing direction; string arg2: {\tt R} right orientation,
- {\tt 2|3} number of conductors \seesect{Composite:}}%
+ {Phone plug; arg1: drawing direction; arg2: {\tt R} right orientation,
+ {\tt 2|3} number of conductors\seesect{Composite:}}%
\macrodef{pmod}{pmod}{({\sl integer}, {\sl integer})}%
{gen}%
{+ve $\hbox{mod}(M,N)$ e.g., $\hbox{\tt pmod}(-3,5)=2$}%
@@ -1865,19 +1891,22 @@
{\tt line={\sl line attributes};} (e.g., {\tt dashed shaded "blue"}),
{\tt rot={\sl degrees};} (angle of first internal vertex {\tt V[0]}),
{\tt side|rad={\sl expression};} size by side length or by radius.
+ {\tt radv={\sl expression};} radius of rounded vertices. If this is
+ nonzero then any fill has to be by {\tt rgbfill(r,g,b,polygon(...)).}
The internal defined points are the centre {\tt C} and vertices
- {\tt V[0]} $\ldots$ {\tt V[{\sl n}-1]}. }%
+ {\tt V[0]} $\ldots$ {\tt V[{\sl n}]}. }%
\macrodef{posarray}{posarray}{({\sl Name, Position1, Position2, \ldots})}%
{dpictools}%
{$\;\;$ Populate a singly-subscripted array of positions:
- {\tt {\sl Name}[1]:{\sl Position1;}%
+ {\tt {\sl Name}[1]:{\sl Position1;}
{\sl Name}[2]={\sl Position2;} \ldots}.}%
\macrodef{posarray2}{posarray2}{({\sl Name, expr, Position1, Position2,
\ldots})}%
{dpictools}%
{$\;\;$ Populate a doubly-subscripted array of positions:
- {\tt {\sl Name}[{\sl expr},1]={\sl Position1;}%
+ {\tt {\sl Name}[{\sl expr},1]={\sl Position1;}
{\sl Name}[{\sl expr},2]={\sl Position2;} \ldots}.}%
+
\macrodef{potentiometer}{potentiometer}{(\linespec,%
{\sl cycles},{\sl fractional pos},{\sl length},$\cdots$)} {cct}%
{resistor with taps T1, T2, $\ldots$
@@ -1905,7 +1934,7 @@
\macrodef{PtoL}{PtoL}{({\sl position}, U|D|L|R|{\sl degrees}, {\sl length}) }%
{gen}%
{Evaluates to {\tt from {\sl position} to
- {\sl position} + Rect\_({\sl length, angle}) }%
+ {\sl position} + Rect\_({\sl length, angle}) }
from the polar-coordinate data in the arguments }%
\macrodef{pt\_\_}{pt__}{}%
{gen}%
@@ -1918,7 +1947,7 @@
{gen}%
{Key-value definition.
If {\sl string} contains the substring
- {\sl key}{\tt =}{\sl expr} then macro {\tt m4{\sl key}}%
+ {\sl key}{\tt =}{\sl expr} then macro {\tt m4{\sl key}}
is defined using {\tt pushdef()} to
expand to {\tt ({\sl expr})}, or to {\tt ({\sl default value})} if the
substring is missing. Arg 1 can contain several such substrings separated
@@ -1927,10 +1956,15 @@
\seesect{Macroarguments:}}%
\macrodef{pushkeys\_}{pushkeys_}{({\sl string, key sequence})}%
{gen}%
- {Multiple key-value definitions. Arg 2 is a semicolon-separated
- sequence of terms of the form {\tt {\sl key}:{\sl default value}:[N]}%
+ {Multiple key-value definitions. Arg2 is a semicolon-separated
+ sequence of terms of the form {\tt {\sl key}:{\sl default-value}[:N]}
which must contain no semicolons and the default values contain no colons.
+ A key may not be the tail of another key.
Macro {\tt pushkey\_} is applied to each of the terms in order.
+ Quote arg2 for robustness and, if an argument depends on a previous
+ argument, add quotes to delay expansion; for example
+ {\tt pushkeys\_(\char96\$1\char39,\char96{}hght:0.5;
+ wdth:m4\char96\char39hght/2\char39)}.
\seesect{Macroarguments:}}%
\macrodef{pvcell}{pvcell}{({\sl linespec, width, height, attributes})}%
{cct}%
@@ -1938,8 +1972,9 @@
\macrodef{px\_\_}{px__}{}%
{gen}%
{absolute SVG screen pixels}%
-%
+
\Letter{R}%
+
\macrodef{randn}{randn}{({\sl array name, $n,$ mean, stddev})}%
{dpictools}%
{$\;\;$ Assign $n$ Gaussian random numbers in array
@@ -1973,6 +2008,7 @@
{\tt SOR}: slow operating and release;\\
{\tt SR}: slow release;\\
{\tt HS}: high speed;\\
+ {\tt S}: diagonal slash;\\
{\tt NAC}: unaffected by AC current;\\
{\tt AC}: AC current;\\
{\tt ML}: mechanically latched;\\
@@ -1997,19 +2033,20 @@
\macrodef{resetrgb}{resetrgb}{}%
{gen}%
{cancel {\tt r\_, g\_, b\_} color definitions}%
-\macrodef{resistor}{resistor}{(\linespec, n|E, {\sl chars}, {\sl cycle wid})}%
+\macrodef{resistor}{resistor}{(\linespec, n, {\sl chars}, {\sl cycle wid})}%
{cct}%
{resistor, n cycles (default 3), {\sl chars:}\\
{\tt AC}: general complex element,\\
{\tt E}: {\tt ebox},\\
{\tt ES}: {\tt ebox} with slash,\\
+ {\tt F}: FDNR (frequency-dependent negative resistor),\\
{\tt Q}: offset,\\
{\tt H}: squared,\\
{\tt N}: IEEE,\\
{\tt B}: not burnable,\\
{\tt V}: varistor variant,\\
- {\tt R}: right-oriented,\\
- {\sl cycle width} (default {\tt dimen\_}$/6$)
+ {\tt R}: right-oriented;\\
+ Arg4: {\sl cycle width} (default {\tt dimen\_}$/6$)
\seesect{Twoterminal:}}%
\macrodef{resized}{resized}{({\sl factor},`{\sl macro name}',args)}%
{cct}%
@@ -2048,10 +2085,11 @@
{dpictools}%
{$\;\;$ rgb color triple to hsv with {\sl h} range 0 to 360.}%
\macrodef{RightAngle}{RightAngle}{({\sl Pos1, Pos2, Pos3, line len,
- attributes})} {gen}%
- {Draw a right-angle symbol at {\sl Pos2}, of size
- given by arg4. Arg5 =
- line attributes, e.g., {\tt outlined "gray"}}%
+ attributes})}%
+ {gen}%
+ {Draw a right-angle symbol at {\sl Pos2}, of size given by arg4.
+ Arg5 = line attributes, e.g., {\tt outlined "gray"} or e.g. to add a dot,
+ {\tt ;dot(at last line.c)}}%
\macrodef{right\_}{right_}{}%
{gen}%
{set current direction right \seesect{Placing:}}%
@@ -2058,18 +2096,16 @@
\macrodef{rjust\_}{rjust_}{}%
{gen}%
{right justify with respect to current direction}%
-\macrodef{rlabel}{rlabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
- [{\sl block name}])}%
+\macrodef{rlabel}{rlabel}{( {\sl label}, {\sl label}, {\sl label},
+ {\sl relative position}, {\sl block name})}%
{cct}%
{Triple label on the right of the body of an element with respect to the
current direction \seesect{Labels:}. Labels are placed at the
- beginning, centre, and end of the last {\tt []} block (or a named
- {\tt []} block). Each label is treated as math by default, but is
- copied literally if it is in double quotes or defined by sprintf.
- {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
- right} to supplement the default relative position. The fifth
- argument is the optional name of the {\tt []} block to be labelled,
- which is {\tt last []} by default}%
+ beginning, centre, and end of the last {\tt []} block (or a {\tt []} block
+ named or enumerated in arg5). Each label is treated as math by
+ default, but is copied literally if it is in double quotes or defined
+ by sprintf. {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,}
+ or {\tt right} to supplement the default relative position.}%
\macrodef{rot3Dx}{rot3Dx}{({\sl radians,x,y,z})}%
{3D} {rotates x,y,z about x axis}%
\macrodef{rot3Dy}{rot3Dy}{({\sl radians,x,y,z})}%
@@ -2076,10 +2112,10 @@
{3D} {rotates x,y,z about y axis}%
\macrodef{rot3Dz}{rot3Dz}{({\sl radians,x,y,z})}%
{3D} {rotates x,y,z about z axis}%
-\macrodef{rotbox}{rotbox}{({\sl wid,ht,type},[r|t={\sl val}])}%
+\macrodef{rotbox}{rotbox}{({\sl wid,ht,attributes},[r|t={\sl val}])}%
{gen}%
{box oriented in current direction in {\tt [ ]} block;
- {\sl type=} e.g. {\tt dotted shaded "green".} Defined internal
+ {\sl attributes:} e.g. {\tt dotted shaded "green".} Defined internal
locations: N, E, S, W (and NE, SE, NW, SW if arg4 is blank). If arg4
is {\tt r=}{\sl val} then corners have radius {\sl val}. If arg4 is
{\tt t=}{\sl val} then a spline with tension {\sl val} is used to draw
@@ -2097,8 +2133,7 @@
{rotate {\sl x,y} by theta radians}%
\macrodef{round}{round}{(at {\sl location,line thickness,attributes})}%
{gen}%
- {filled circle for rounded corners; attributes={\tt colored
- "gray"}%
+ {filled circle for rounded corners; attributes={\tt colored "gray"}
for example; leaves {\tt Here} unchanged if arg1 is blank
\seesect{Corners:}}%
\macrodef{rpoint\_}{rpoint_}{(\linespec)}%
@@ -2148,13 +2183,14 @@
\macrodef{rvec\_}{rvec_}{({\sl x},{\sl y})}%
{gen}%
{location relative to current direction}%
-%
+
\Letter{S}%
+
\macrodef{sarrow}{sarrow}{(\linespec,{\sl keys})}%
{gen}%
{Single-segment, single-headed special arrows with {\sl keys}:\\
{\tt type=}{\tt O[pen]} (default)
- | {\tt D[iamond]} | {\tt C[rowfoot]} | {\tt P[lain]}%
+ | {\tt D[iamond]} | {\tt C[rowfoot]} | {\tt P[lain]}
| {\tt R[ight]} | {\tt L[eft]} {\tt ;}\\
{\tt wdth=}{\sl expression}{\tt ;} (default {\tt arrowwid})\\
{\tt lgth=}{\sl expression}{\tt ;} (default {\tt arrowht})\\
@@ -2169,8 +2205,9 @@
\macrodef{s\_box}{s_box}{({\sl text},{\sl expr1},$\cdots$)}%
{gen}%
{generate dimensioned text string using {\tt\char92{}boxdims} from
- {\tt boxdims.sty}. Two or more args are passed to {\tt sprintf()}%
+ {\tt boxdims.sty}. Two or more args are passed to {\tt sprintf()}
(default 90) degrees \seesect{Interaction:}}%
+
\macrodef{sbs}{sbs}{({\sl linespec, chars, label})}%
{cct}%
{Wrapper to place an SBS thyristor as a two-terminal element with
@@ -2191,17 +2228,22 @@
\seesect{Semiconductors:}}%
\macrodef{s\_dp}{s_dp}{({\sl name},{\sl default})}%
{gen}%
- {depth of the most recent (or named) {\tt s\_box}%
+ {depth of the most recent (or named) {\tt s\_box}
\seesect{Interaction:}}%
\macrodef{series\_}{series_}{({\sl elementspec}, {\sl elementspec},
$\ldots$)}%
{cct}%
{ Series combination in a {\tt []} block of elements
- with shortened default length. An {\sl elementspec} is of the
- form {\tt [{\sl Label}:] {\sl element}; [{\sl attributes}]},
- where an {\sl attribute} is of the form {\tt [llabel($\ldots$);] |
- [rlabel($\ldots$);] [b\_current($\ldots$);]}. Internal points {\tt
- Start}, {\tt End}, and {\tt C} are defined
+ with shortened default length.
+ Each argument is an elementspec of the form\\
+ {\tt[Sep={\sl val};][{\sl Label}:]{\sl element};[{\sl attributes}]} where
+ an {\sl attribute} is of the form\\
+ {\tt[llabel($\ldots$);]|[rlabel($\ldots$);]|[b\_current($\ldots$);]}.\\
+ An argument may also be {\tt series\_($\ldots$)} or {\tt
+ parallel\_($\ldots$)} {\em without} attributes or quotes.
+ An element may have normal arguments but should not
+ change the drawing direction.
+ Internal points {\tt Start}, {\tt End}, and {\tt C} are defined
\seesect{Seriesandparallel:} }%
\macrodef{se\_}{se_}{}%
{gen}%
@@ -2217,7 +2259,7 @@
\macrodef{setkey\_}{setkey_}{({\sl string, key, default,}[N])}%
{gen}%
{Key-value definition, like {\tt pushkey\_()} but the resulting
- macro is defined using {\tt define()} rather than {\tt pushdef().}%
+ macro is defined using {\tt define()} rather than {\tt pushdef().}
\seesect{Macroarguments:}}%
\macrodef{setkeys\_}{setkeys_}{({\sl string, key sequence})}%
{gen}%
@@ -2251,11 +2293,10 @@
\macrodef{sfgbelow}{sfgbelow}{}%
{cct}%
{like below but with extra space}%
-\macrodef{sfg\_init}{sfg_init}{({\sl default line len, node rad,
-arrowhd len,
- arrowhd wid}), (reads {\tt libcct.m4})} {cct}%
- {initialization of signal
- flow graph macros}%
+\macrodef{sfg\_init}{sfg_init}{({\sl default line len, node rad, arrowhd len,
+ arrowhd wid}), (reads {\tt libcct.m4})}
+ {cct}%
+ {initialization of signal flow graph macros}%
\macrodef{sfgline}{sfgline}{(\linespec,{\sl text},{\tt
sfgabove|sfgbelow|ljust|rjust},{\sl line attributes})}%
{cct}%
@@ -2265,7 +2306,7 @@
circle attributes})}%
{cct}%
{small circle default white interior, with text label. The default
- label position is inside if the diameter is bigger than {\tt textht}%
+ label position is inside if the diameter is bigger than {\tt textht}
and {\tt textwid}; otherwise it is {\tt sfgabove.} Options such as
color, fill, or line thickness can be given, e.g.,
{\tt thick 0.8 outlined "red" shaded "orange"}. }%
@@ -2279,11 +2320,19 @@
\macrodef{shade}{shade}{({\sl gray value},{\sl closed line specs})}%
{gen}%
{Fill arbitrary closed curve. Note: when producing pdf via pdflatex, line
- thickness changes within this macro must be made via the {\tt linethick}%
+ thickness changes within this macro must be made via the {\tt linethick}
environment variable rather than by the {\tt thickness} line attribute}%
\macrodef{shadebox}{shadebox}{(box {\sl attributes, shade width})}%
{gen}%
{Box with edge shading. Arg2 is in points. See also {\tt shaded} }%
+\macrodef{shadedball}{shadedball}{({\sl radius, highlight radius,
+ highlight degrees, initial gray, final gray} | ({\sl rf,gf,bf}))}%
+ {3D}%
+ { Shaded ball in {\tt [ ]} box.
+ The highlight is by default at {\sl radius}*3/5 and angle 110 deg
+ (or arg2 deg); if setlight has been invoked then its azimuth and
+ elevation arguments determine highlight position. Arg5 can be a
+ parenthesized rgb color.}
\macrodef{ShadedPolygon}{ShadedPolygon}{({\sl vertexseq, line attributes,
degrees, colorseq})} {gen}%
{Draws the polygon specified in arg1 and
@@ -2293,28 +2342,42 @@
(or names) of the polygon in cw or ccw order. A {\sl colorseq} is of
the form 0, r0,g0,b0, {\sl frac1},r1,g1,b1, {\sl frac2},r2,g2,b2,
\ldots 1,rn,gn,bn with $0 < \hbox{\sl frac1} < \hbox{\sl frac2} \ldots 1$ }%
-\macrodef{ShadeObject}{ShadeObject}{({\sl drawroutine name, n, colorseq})}%
+\macrodef{ShadeObject}{ShadeObject}{({\sl drawroutine, n, colorseq})}%
{dpictools}%
- {$\;\;$ Fill an area in a {\tt []} block with graded color
+ {$\;\;$
+ Fill an area in a {\tt []} block with graded color
defined by {\sl colorseq,} an indexed sequence of rgb colors:
- {\sl 0,r0,g0,b0,}%
- {\sl frac1,r1,g1,b1,}%
- {\sl frac2,r2,g2,b2,}%
+ \fra{0}{\sl,r0,g0,b0,}
+ \fra{1}{\sl,r1,g1,b1,}
\ldots
- {\sl 1,rn,gn,bn}%
- with $0 < \hbox{\sl frac1}$ $< \hbox{\sl frac2} <$ $\ldots < 1.$ The macro
- {\sl drawroutine{\tt(}frac, r, g, b{\tt)}} typically draws a colored line
+ \fra{n}{\sl,rn,gn,bn} with\\
+ $0 \leq \fra{0} < \fra{1}$
+ $< \fra{2} <$
+ $\ldots$
+ $\fra{n} \leq 1.$\\
+ (Often $\fra{0} = 0$ and $\fra{n} = 1.$)
+ The dpic macro\\
+ {\sl drawroutine{\tt(}frac, r, g, b{\tt)}}\\
+ typically draws a colored line
and must be defined according to the area to be filled.
- The routine is called $n{+}1$ times for
- $\hbox{\sl frac}= 0, 1/n, 2/n, \ldots 1$ with rgb arguments interpolated
- in hsv space between {\sl colorseq} points.
+ This routine is called $n{+}1$ times for
+ $\fra{}= \fra{0},\;$
+ $\fra{0} + 1/n\times(\fra{n}{-}\fra{0}),$
+ $\fra{0} + 2/n\times(\fra{n}{-}\fra{0}),$
+ \ldots
+ \fra{n}\\
+ (i.e., often
+ $\fra{} = 0, 1/n, 2/n, \ldots 1$)\\
+ with rgb
+ arguments interpolated in hsv space between {\sl colorseq} points
+ (which are specified in rgb-space).
Example (shade a box with 101 graded-color lines):\\
{\tt B: box\\
define HorizShade \lbr\ line right B.wid \textbackslash\\
- $\;$ thick B.ht/100/(1bp\_\_) from (0,-(\$1)*B.ht) \textbackslash\\
- $\;$ outlined rgbstring(\$2,\$3,\$4) \rbr;}%
- {\tt ShadeObject(HorizShade,100, 0,1,0,0, 1,0,0,1) \textbackslash\\
- $\;$ at B}.}%
+ $\;$ from (0,-(\char36{}1)*B.ht) \textbackslash\\
+ $\;$ outlined rgbstring(\char36{}2,\char36{}3,\char36{}4) \rbr;}\\
+ {\tt ShadeObject(HorizShade, B.ht/lthick, 0,1,0,0, 1,0,0,1) at B}.
+ }%
\macrodef{shadowed}{shadowed}{(box|circle|ellipse|line,
{\sl position spec, keys})}%
{gen}%
@@ -2321,7 +2384,7 @@
{ Object with specified shadow. {\sl possspec} is e.g.,
{\tt with .w at ...} or {\tt at} {\sl position}.
The {\sl keys} are
- {\tt attrib=}{\sl object attributes}{\tt ;}%
+ {\tt attrib=}{\sl object attributes}{\tt ;}
{\tt shadowthick=}{\sl expr}{\tt ;} (default {\tt linethick*)}5/4),
{\tt shadowcolor=}{\sl string}{\tt ;} (default {\tt "gray"}),
{\tt shadowangle=}{\sl expr}{\tt ;} (default $-45$)
@@ -2370,6 +2433,7 @@
e.g., to draw a dashed sine curve, amplitude {\sl a},
of {\sl n} cycles of length {\sl x} from {\sl A}, {\tt
sinusoid(a,twopi\_*n/x,-pi\_/2,0,x,dashed) with .Start at A}}%
+
\macrodef{sl\_box}{sl_box}{({\sl stem linespec, keys, stem object})}%
{SLD}%
{One-terminal SLD element: argument 1 is a \linespec\ to define the stem
@@ -2402,7 +2466,7 @@
{\tt C} for a curved breaker; adding a {\tt D} puts drawout elements
in the input and output leads.
Otherwise, the arguments are as for
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
\seesect{SingleLine:}}%
\macrodef{sl\_busbar}{sl_busbar}{({\sl linespec, np, keys})}%
{SLD}%
@@ -2469,10 +2533,10 @@
Argument 3 is null for no breaker in the stem, {\tt C} for a default
closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
these marks, or
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
key-value pairs defining box attributes for the breaker
(default name {\sl Br})
- \label{sl_disk}%
+ \label{sl_disk}
\seesect{SingleLine:}}%
\macrodef{sl\_drawout}{sl_drawout}{({\sl linespec, keys,} R)}%
{SLD}%
@@ -2479,9 +2543,9 @@
{Two-terminal SLD element: argument 1 is a \linespec\ as for ordinary
two-terminal elements.
- Argument 2 contains semicolon (;)-separated key-value body attributes:
+ Argument 2 contains semicolon (;)-separated key-value body attributes:\\
{\tt type=T} (for truncated leads);
- {\tt lgth={\sl{}expr},}%
+ {\tt lgth={\sl{}expr},}
{\tt wdth={\sl{}expr}} (body size);
{\tt name={\sl{}Name}} (default {\sl Body});
{\tt line={\sl{}pic line attributes}}; (e.g., {\tt thick 2})
@@ -2498,7 +2562,7 @@
Argument 3 is null for no breaker in the stem, {\tt C} for a default
closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
these marks, or
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
key-value pairs defining box attributes for the breaker
(default name {\sl Br})
\seesect{SingleLine:}}%
@@ -2518,7 +2582,7 @@
Argument 3 is null for no breaker in the stem, {\tt C} for a default
closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
these marks, or
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
key-value pairs defining box attributes for the breaker
(default name {\sl Br})
\seesect{SingleLine:}}%
@@ -2525,12 +2589,13 @@
\macrodef{sl\_inverter}{sl_inverter}{({\sl ttbox args})}%
{SLD}%
{Two-terminal SLD element: the arguments are as for
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
\seesect{SingleLine:}}%
+
\macrodef{sl\_lamp}{sl_lamp}{({\sl stem linespec, keys, breaker})}%
{SLD}%
{One-terminal SLD element: the arguments are as for
- \MR{sl_disk}{\tt sl\_disk}%
+ \MR{sl_disk}{\tt sl\_disk}
\seesect{SingleLine:}}%
\macrodef{sl\_load}{sl_load}{({\sl stem linespec, keys, breaker})}%
{SLD}%
@@ -2549,7 +2614,7 @@
Argument 3 is null for no breaker in the stem, {\tt C} for a default
closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
these marks, or
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
key-value pairs defining box attributes for the breaker
(default name {\sl Br})
\seesect{SingleLine:}}%
@@ -2571,7 +2636,7 @@
Argument 3 is null for no breaker in the stem, {\tt C} for a default
closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
these marks, or
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
key-value pairs defining box attributes for the breaker
(default name {\sl Br})
\seesect{SingleLine:}}%
@@ -2587,8 +2652,7 @@
Argument 3 is null for no breaker in the input lead, {\tt C} for a default
closed breaker, {\tt O} for an open breaker, {\tt X,} {\tt /,} or \bsl\ for
- these marks, or
- key-value pairs as above defining breaker attributes
+ these marks, or key-value pairs as above defining breaker attributes
except that the default breaker name is {\sl BrI}.
Argument 4 defines the breaker in the output lead as for argument 3
@@ -2597,7 +2661,7 @@
\macrodef{sl\_rectifier}{sl_rectifier}{({\sl ttbox args})}%
{SLD}%
{Two-terminal SLD element: the arguments are as for
- \MR{sl_ttbox}{\tt sl\_ttbox}%
+ \MR{sl_ttbox}{\tt sl\_ttbox}
\seesect{SingleLine:}}%
\macrodef{sl\_slash}{sl_slash}{(at {\sl position, keys,}%
[$n$:]R|L|U|D|{\sl degrees})}%
@@ -2625,8 +2689,8 @@
Argument 3 is colon (:)-separated sequence of up to three breaker
attribute specifications for the input, output, and teriary breaker
- in order. A null or blank means no breaker, {\tt tt\_breaker}%
- specifications otherwise. Default breaker names are {\sl BrI}%
+ in order. A null or blank means no breaker, {\tt tt\_breaker}
+ specifications otherwise. Default breaker names are {\sl BrI}
and {\sl BrO} as for
{\tt sl\_transformer,} and {\sl Br} for the third breaker.
@@ -2699,7 +2763,7 @@
Argument 4 defines the breaker in the output lead as for argument 3
except that the default breaker name is {\sl BrO}.
- \label{sl_ttbox}%
+ \label{sl_ttbox}
\seesect{SingleLine:}}%
\macrodef{s\_name}{s_name}{}%
{gen}%
@@ -2713,37 +2777,39 @@
{dpictools}%
{$\;\;$ Trapezoid formed from a box with top corners displaced right by
$x$ offset and right corners displaced up by $y$ offset.}%
-\macrodef{source}{source}{(\linespec,
- V|v|tv|I|i|ti|ii|AC|B|F|G|H|J|Q|L|N|P|S[C[r]]|E[r]]|T|X|U|{\sl other}, {\sl
- diameter},R)}%
+\macrodef{source}{source}{(\linespec, {\sl char or chars}, {\sl diameter},R,
+ {\sl body attributes, body name})}%
{cct}%
- {source, arg2 blank or:\\
- {\tt V}: voltage source;\\
- {\tt v}: alternate voltage source;\\
- {\tt tv}: truncated-bar alternate voltage source;\\
- {\tt I}: current source;\\
- {\tt i}: alternate current source;\\
- {\tt ti}: truncated-bar alternate current source;\\
- {\tt ii}: double arrow current source; AC: AC source;\\
+ {Source; arg2 blank or:\\
+ {\tt AC}: AC source;\\
{\tt B}: bulb;\\
{\tt F}: fluorescent;\\
{\tt G}: generator;\\
{\tt H}: step function;\\
+ {\tt I}: current source;\\
+ {\tt i}: alternate current source;\\
+ {\tt ii}: double arrow current source;\\
+ {\tt ti}: truncated-bar alternate current source;\\
{\tt L}: lamp;\\
{\tt N}: neon;\\
+ {\tt NA}: neon 2;\\
+ {\tt NB}: neon 3;\\
{\tt P}: pulse;\\
{\tt Q}: charge;\\
{\tt R}: ramp;
- {\tt r}: right orientation;
{\tt S}: sinusoid;\\
- {\tt SC}: quarter arc;\\
- {\tt SE}: arc;\\
+ {\tt SC}: quarter arc, {\tt SCr} right orientation;\\
+ {\tt SE}: arc, {\tt SEr} right orientation;\\
{\tt T}: triangle;\\
{\tt U}: square-wave;\\
+ {\tt V}: voltage source;\\
{\tt X}: interior X;\\
+ {\tt v}: alternate voltage source;\\
+ {\tt tv}: truncated-bar alternate voltage source;\\
other: custom interior label or waveform;\\
arg 4: R: reversed polarity;\\
- arg 5 modifies the circle with e.g., color or fill
+ arg 5 modifies the circle (body) with e.g., color or fill;\\
+ arg 6 names the body {\tt [ ]} block
\seesect{Twoterminal:}}%
\macrodef{speaker}{speaker}{( U|D|L|R|{\sl degrees},{\sl size},H,attributes)}%
{cct}%
@@ -2775,8 +2841,7 @@
{Stack arg 2, arg 3, ... onto the named stack up to a blank arg}%
\macrodef{stackcopy\_}{stackcopy_}{(`{\sl name 1}',`{\sl name 2}')}%
{gen}%
- {Copy stack 1 into stack 2, preserving the order of pushed
- elements}%
+ {Copy stack 1 into stack 2, preserving the order of pushed elements}%
\macrodef{stackdo\_}{stackdo}{(`{\sl stackname}',{\sl commands})}%
{gen}%
{Empty the stack to the first blank entry, performing arg 2}%
@@ -2838,8 +2903,9 @@
\macrodef{sw\_}{sw_}{}%
{gen}%
{.sw with respect to current direction}%
-%
+
\Letter{T}%
+
\macrodef{tapped}{tapped}{(`{\sl two-terminal element}',
[{\sl arrowhd} | type={\sl arrowhd};name={\sl Name}],
{\sl fraction, length, fraction, length,} $\cdots$)}%
@@ -2871,13 +2937,13 @@
block. The permissible {\sl chars} are:
{\tt > | >{}> | < | <{}< | A | AA | M | O | OF}.
Type {\tt O} draws a node (circle); {\tt OF} a filled circle.
- Type {\tt M} is a black bar; {\tt A} is an open arc end; type {\tt AA}%
+ Type {\tt M} is a black bar; {\tt A} is an open arc end; type {\tt AA}
a double open arc. Type {\tt >} (the default) is an arrow-like output
connector; {\tt <} and {\tt <<} input connectors. Arg 3 is arrowhead
width or circle diameter when key-value pairs are not used.
If keys are specified, they are {\tt type=}{\sl chars} as previously;
{\tt wdth=}{\sl expr}; {\tt lgth=}{\sl expr}; {\tt sep=}{\sl expr};
- {\tt head=}{\sl attributes except} {\tt lgth, wdth.}%
+ {\tt head=}{\sl attributes except} {\tt lgth, wdth.}
The key {\tt sep=} is the double-head separation
\seesect{Composite:}}%
\macrodef{testexpr}{testexpr}{({\sl variable, expr1, expr2, \ldots})}%
@@ -2894,8 +2960,8 @@
{cct}%
{ Thermocouple drawn to the left (by default) of the
{\sl linespec} line. A {\tt T} argument truncates the leads so
- only the two branches appear. {\tt R=}%
- right orientation. \seesect{Twoterminal:}}%
+ only the two branches appear. {\tt R=} right orientation.
+ \seesect{Twoterminal:}}%
\macrodef{thicklines\_}{thicklines_}{({\sl number})}%
{gen}%
{set line thickness in points}%
@@ -2972,7 +3038,7 @@
{terminal strip, chars:
I (invisible terminals), C (default circle terminals), D (dot terminals),
O (omitted separator lines), {\tt wid=}value{\tt ;} total strip width,
- {\tt ht=}value{\tt ;} strip height, {\tt box={\sl shaded etc.};}%
+ {\tt ht=}value{\tt ;} strip height, {\tt box={\sl shaded etc.};}
\seesect{Composite:}}%
\macrodef{ttmotor}{ttmotor}{({\sl linespec, string, diameter, brushwid,
brushht})}%
@@ -2981,8 +3047,9 @@
\macrodef{twopi\_}{twopi_}{}%
{gen}%
{$2\pi$}%
-%
+
\Letter{U}%
+
\macrodef{ujt}{ujt}{(\linespec,R,P,E)}%
{cct}%
{unijunction transistor, right, P-channel, envelope
@@ -2995,8 +3062,9 @@
\macrodef{up\_}{up_}{}%
{gen}%
{set current direction up \seesect{Placing:}}%
-%
+
\Letter{V}%
+
\macrodef{variable}{variable}{(`{\sl element}', {\sl chars}, [+|-]{\sl angle},
{\sl length}, at position)}%
% {\tt [A|P|L|[u]N|[u]NN][C|S]},
@@ -3019,8 +3087,7 @@
{The $x, y$ coordinate pair of the position}%
\macrodef{Vdiff\_}{Vdiff_}{({\sl position},{\sl position})}%
{gen}%
- {{\tt Vdiff\_(A,B)} evaluates to {\tt A-(B)} with dpic, {\tt
- A-(B.x,B.y)}%
+ {{\tt Vdiff\_(A,B)} evaluates to {\tt A-(B)} with dpic, {\tt A-(B.x,B.y)}
with gpic}%
\macrodef{vec\_}{vec_}{({\sl x},{\sl y})}%
{gen}%
@@ -3041,8 +3108,7 @@
{unit-vector pair CCW-perpendicular to linear object}%
\macrodef{Vperp}{Vperp}{({\sl position name}, {\sl position name})}%
{gen}%
- {unit-vector pair CCW-perpendicular to line joining two named
- positions}%
+ {unit-vector pair CCW-perpendicular to line joining two named positions}%
\macrodef{vrot\_}{vrot_}{({\sl x},{\sl y},{\sl xcosine},{\sl ycosine})}%
{gen}%
{rotation operator}%
@@ -3054,11 +3120,11 @@
{The vector in arg 1 multiplied by the scalar in arg 2}%
\macrodef{Vsum\_}{Vsum_}{({\sl position},{\sl position})}%
{gen}%
- {{\tt Vsum\_(A,B)} evaluates to {\tt A+B} with dpic, {\tt
- A+(B.x,B.y)}%
+ {{\tt Vsum\_(A,B)} evaluates to {\tt A+B} with dpic, {\tt A+(B.x,B.y)}
with gpic}%
-%
+
\Letter{W}%
+
\macrodef{while\_}{while_}{(`{\sl test}',`{\sl actions}')}%
{gen}%
{Integer m4 while loop}%
@@ -3082,8 +3148,9 @@
\macrodef{XOR\_off}{XOR_off}{}%
{log}%
{XOR and NXOR offset of input face}%
-%
+
\Letter{X}%
+
\macrodef{xtal}{xtal}{(\linespec,{\sl keys})}%
{cct}%
{Quartz crystal. The {\sl keys} are
@@ -3102,7 +3169,9 @@
\macrodef{xtract}{xtract}{({\sl string, substr1, substr2, $\ldots$})}%
{gen}%
{returns substrings if present}%
+
\Letter{Y}%
+
\macrodef{Ysymbol}{Ysymbol}{(at {\sl position},keys,
U|D|L|R|{\sl degrees}) (default {\tt U} for up)}%
{cct}%
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/quick.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/quick.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/quick.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,16 +1,14 @@
.PS # Pic input begins with .PS
cct_init # Read in macro definitions and set defaults
elen = 0.75 # Variables are allowed; default units are inches
-Origin: Here # Position names are capitalized
- source(up_ elen); llabel(-,v_s,+)
- resistor(right_ elen); rlabel(,R,)
+Vs: source(up_ elen); llabel(-,v_s,+) # Name and label the source
+ resistor(right_ elen); rlabel(,R,) # Semicolon and line end are equivalent
dot
{ # Save the current position and direction
- capacitor(down_ to (Here,Origin)) #(Here,Origin) = (Here.x,Origin.y)
- rlabel(+,v,-); llabel(,C,)
+ capacitor(down_ Vs.len); rlabel(+,v,-); llabel(,C,)
dot
} # Restore position and direction
line right_ elen*2/3
- inductor(down_ Here.y-Origin.y); rlabel(,L,); b_current(i)
- line to Origin
+ inductor(down_ Vs.len); rlabel(,L,); b_current(i)
+ line to (Vs,Here) # (Vs,Here) = (Vs.x,Here.y)
.PE # Pic input ends
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/relaycoilMan.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/relaycoilMan.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/doc/relaycoilMan.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,44 +1,46 @@
+
.PS
-# relaycoil.m4
+# relaycoilMan.m4
cct_init
spc = dimen_/3
{ relaycoil; S: `"\tt relaycoil"' at last [].s+(0,-16bp__)
- {`"\sl V1"' wid 10bp__ at last [].V1 rjust
- `"\sl V2"' at last [].V2 ljust }
- K: relaycoil(NX,,,,fill_(0.9)) with .nw at last [].ne+(spc*4,0)
- `"\tt (NX,{,},{,}"' at (last [],S) `"\tt fill\_(0.9))"'
+ { "\sl V1" wid 10bp__ at last [].V1 rjust
+ "\sl V2" at last [].V2 ljust }
+ relaycoil(S) with .nw at last [].ne+(spc*2,0); "\tt (S)" at (last [],S)
+ K: relaycoil(NX) with .nw at last [].ne+(spc*3,0); "\tt (NX)" at (last [],S)
{ thinlines_
- spline <- from K.A1 left 7bp__ then up 4bp__ left 4bp__;`"\sl A1"' rjust
- arrow <- from K.A2 left 10bp__;`"\sl A2"' rjust
- spline <- from K.A3 left 7bp__ then down 4bp__ left 4bp__;`"\sl A3"' rjust
- spline <- from K.B1 right 7bp__ then up 4bp__ right 4bp__;`"\sl B1"' ljust
- arrow <- from K.B2 right 10bp__;`"\sl B2"' ljust
- spline <- from K.B3 right 7bp__ then down 4bp__ right 4bp__;`"\sl B3"' ljust
+ spline <- from K.A1 left 7bp__ then up 4bp__ left 4bp__; "\sl A1" rjust
+ arrow <- from K.A2 left 10bp__; "\sl A2" rjust
+ spline <- from K.A3 left 7bp__ then down 4bp__ left 4bp__; "\sl A3" rjust
+ spline <- from K.B1 right 7bp__ then up 4bp__ right 4bp__; "\sl B1" ljust
+ arrow <- from K.B2 right 10bp__; "\sl B2" ljust
+ spline <- from K.B3 right 7bp__ then down 4bp__ right 4bp__; "\sl B3" ljust
thicklines_
}
- relaycoil(AXSR) with .nw at last [].ne+(spc*5,0);`"\tt (AXSR)"' at (last [],S)
- {`"\sl V1"' at last [].V1 rjust;`"\sl V2"' at last [].V2 rjust }
- relaycoil(BXSR) with .nw at last [].ne+(spc*2,0);`"\tt (BXSR)"' at (last [],S)
- {`"\sl V1"' at last [].V1 ljust;`"\sl V2"' at last [].V2 ljust }
- relaycoil(SR) with .nw at last [].ne+(spc*3,0);`"\tt (SR)"' at (last [],S)
- relaycoil(SO) with .nw at last [].ne+(spc,0);`"\tt (SO)"' at (last [],S)
- relaycoil(SOR) with .nw at last [].ne+(spc,0);`"\tt (SOR)"' at (last [],S)
- relaycoil(PC) with .nw at last [].ne+(spc,0);`"\tt (PC)"' at (last [],S)
+ relaycoil(AXSR) with .nw at last [].ne+(spc*4,0); "\tt (AXSR)" at (last [],S)
+ { "\sl V1" at last [].V1 rjust; "\sl V2" at last [].V2 rjust }
+ relaycoil(BXSR) with .nw at last [].ne+(spc*2,0); "\tt (BXSR)" at (last [],S)
+ { "\sl V1" at last [].V1 ljust; "\sl V2" at last [].V2 ljust }
+ relaycoil(SR) with .nw at last [].ne+(spc*2,0); "\tt (SR)" at (last [],S)
+ spx = spc*3/4
+ relaycoil(SO) with .nw at last [].ne+(spx,0); "\tt (SO)" at (last [],S)
+ relaycoil(SOR) with .nw at last [].ne+(spx,0); "\tt (SOR)" at (last [],S)
+ relaycoil(PC) with .nw at last [].ne+(spx,0); "\tt (PC)" at (last [],S)
}
spc = dimen_/4
{
move down_ 3/4; right_
- relaycoil(HS); S:`"\tt (HS)"' at last [].s+(0,-12bp__)
- relaycoil(NAC) with .nw at last [].ne+(spc,0);`"\tt (NAC)"' at (last [],S)
- relaycoil(AC) with .nw at last [].ne+(spc,0);`"\tt (AC)"' at (last [],S)
- relaycoil(ML) with .nw at last [].ne+(spc,0);`"\tt (ML)"' at (last [],S)
- relaycoil(PO) with .nw at last [].ne+(spc,0);`"\tt (PO)"' at (last [],S)
- relaycoil(RM) with .nw at last [].ne+(spc,0);`"\tt (RM)"' at (last [],S)
- relaycoil(RH) with .nw at last [].ne+(spc,0);`"\tt (RH)"' at (last [],S)
- relaycoil(TH) with .nw at last [].ne+(spc,0);`"\tt (TH)"' at (last [],S)
- relaycoil(EL) with .nw at last [].ne+(spc,0);`"\tt (EL)"' at (last [],S)
- relaycoil(MR) with .sw at last [].se+(spc,0);`"\tt (MR)"' at (last [],S)
+ relaycoil(HS); S: "\tt (HS)" at last [].s+(0,-12bp__)
+ relaycoil(NAC) with .nw at last [].ne+(spc,0); "\tt (NAC)" at (last [],S)
+ relaycoil(AC) with .nw at last [].ne+(spc,0); "\tt (AC)" at (last [],S)
+ relaycoil(ML) with .nw at last [].ne+(spc,0); "\tt (ML)" at (last [],S)
+ relaycoil(PO) with .nw at last [].ne+(spc,0); "\tt (PO)" at (last [],S)
+ relaycoil(RM) with .nw at last [].ne+(spc,0); "\tt (RM)" at (last [],S)
+ relaycoil(RH) with .nw at last [].ne+(spc,0); "\tt (RH)" at (last [],S)
+ relaycoil(TH) with .nw at last [].ne+(spc,0); "\tt (TH)" at (last [],S)
+ relaycoil(EL) with .nw at last [].ne+(spc,0); "\tt (EL)" at (last [],S)
+ relaycoil(MR) with .sw at last [].se+(spc,0); "\tt (MR)" at (last [],S)
}
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/dpictools.pic
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/dpictools.pic 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/dpictools.pic 2024-05-30 19:57:12 UTC (rev 71389)
@@ -3,7 +3,7 @@
# m4 macro NeedDpicTools or the pic statement copy "HOMELIB_/dpictools.pic"
# when HOMELIB_ is defined or, generically, copy "<path>dpictools.pic"
-# Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under #
+# Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under #
# the LaTeX Project Public Licence in file Licence.txt. The files of #
# this distribution may be redistributed or modified provided that this #
# copyright notice is included and provided that modifications are clearly #
@@ -370,52 +370,57 @@
DefineRGBColor($1,r_CMYKRGB,g_CMYKRGB,b_CMYKRGB) }
# ShadeObject(DrawRoutineName, n, colorseq)
-# colorseq = 0,r0,g0,b0,
-# frac1,r1,g1,b1,
-# frac2,r2,g2,b2,
+# colorseq = frac0,r0,g0,b0,
+# frac1,r1,g1,b1,
# ...
-# 1,rn,gn,bn
-# with 0 < frac1 < frac2 < ... < 1
+# fracn,rn,gn,bn
+# with 0 <= frac0 < frac1 < ... < fracn <= 1
+# (Often frac0 = 0 and fracn = 1)
#
# calls DrawRoutineName(frac,r,g,b)
-# n+1 times for frac = 0, 1/n, 2/n, ... 1
+# n+1 times for frac =
+# frac0, frac0+1/n*(fracn-frac0),
+# frac0+2/n*(fracn-frac0), ... fracn
+# (i.e., often frac = 0, 1/n, 2/n, ... 1)
# with rgb args interpolated (in hsv space)
# between colorseq points
-#
# eg B: box; define HorizShade { line right B.wid thick B.ht/100/(1bp__) \
# from (0,-($1)*B.ht) outlined rgbstring($2,$3,$4) }
# ShadeObject(HorizShade, 100, 0,1,0,0, 1,0,0,1) at B
#
-define ShadeObject { [ Origin: Here; nSteps = abs($2)
- nextP = $3; nextR = $4; nextG = $5; nextB = $6
+define ShadeObject { [ Origin: Here; nSteps = max(abs($2),1)
+ nextF = $3; nextR = $4; nextG = $5; nextB = $6; lastF = nextF; frac0 = nextF
+ fracn = frac0; nextarg = 3; for done = 0 to 1 do { if nextarg < $+ then \
+ { exec sprintf("fracn = $%g",nextarg); nextarg +=4; done = 0 } }
+ if frac0 <= fracn then { $1(frac0,nextR,nextG,nextB) }
nextarg = 7
- thisP = nextP
- if $2 < 0 then { rgbtohsv(nextR,nextG,nextB,nextH,nextS,nextV) } \
- else { rgbtohsv(nextR^2,nextG^2,nextB^2,nextH,nextS,nextV) }
- if nextP*nSteps >= 1 then { nextP = 0 }
- $1(nextP,nextR,nextG,nextB)
- for stepnum = 1 to nSteps do {
- if stepnum > nextP*nSteps then {
- thisP = nextP; thisH = nextH; thisS = nextS; thisV = nextV
- exec sprintf("nextP = $%g; nextR = $%g; nextG = $%g; nextB = $%g",\
- nextarg,nextarg+1,nextarg+2,nextarg+3);
- nextarg +=4 }
- if nextP != thisP then {
- rgbtohsv(nextR^2,nextG^2,nextB^2,nextH,nextS,nextV)
- if thisS == 0 then { thisH = nextH }
- if nextS == 0 then { nextH = thisH }
- if thisH-nextH > 180 then { nextH += 360 } \
- else { if nextH-thisH > 180 then { thisH +=360 } } }
- if nextP > thisP then {
- x = (stepnum/nSteps-thisP)/(nextP-thisP)
- currP = thisP*(1-x) + nextP*x
- currH = thisH*(1-x) + nextH*x
- currS = thisS*(1-x) + nextS*x
- currV = thisV*(1-x) + nextV*x
- hsvtorgb(currH,currS,currV,cRsq,cGsq,cBsq)
- if $2 < 0 then { $1(currP,cRsq,cGsq,cBsq) } \
- else { $1(currP,sqrt(cRsq),sqrt(cGsq),sqrt(cBsq)) } }
- }
+ if $2 < 0 then { rgbtohsv(nextR,nextG,nextB, nextH,nextS,nextV) } \
+ else { rgbtohsv(nextR^2,nextG^2,nextB^2, nextH,nextS,nextV) }
+ for stepnum = 0 to nSteps do {
+ currF = frac0+stepnum/nSteps*(fracn-frac0)
+ if currF >= nextF then {
+ if nextarg >= $+ then { stepnum = nSteps } \
+ else { lastF = nextF; lastH = nextH; lastS = nextS; lastV = nextV
+ exec sprintf("nextF = $%g; nextR = $%g; nextG = $%g; nextB = $%g",\
+ nextarg,nextarg+1,nextarg+2,nextarg+3);
+ nextarg +=4 } }
+ if stepnum <= nSteps then {
+ if nextF != lastF then {
+ rgbtohsv(nextR^2,nextG^2,nextB^2,nextH,nextS,nextV)
+ if lastS == 0 then { lastH = nextH }
+ if nextS == 0 then { nextH = lastH }
+ if lastH-nextH > 180 then { nextH += 360 } \
+ else { if nextH-lastH > 180 then { lastH +=360 } } }
+ if nextF > lastF then {
+ x = (currF-lastF)/(nextF-lastF)
+ currH = lastH*(1-x) + nextH*x
+ currS = lastS*(1-x) + nextS*x
+ currV = lastV*(1-x) + nextV*x
+ hsvtorgb(currH,currS,currV,cRsq,cGsq,cBsq)
+ if (currF >= frac0) && (currF <= fracn) then {
+ if $2 < 0 then { $1(currF,cRsq,cGsq,cBsq) } \
+ else { $1(currF,sqrt(abs(cRsq)),sqrt(abs(cGsq)),sqrt(abs(cBsq))) } } }
+ } }
exec sprintf("$%g",nextarg)
] }
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Alogix.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Alogix.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Alogix.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -19,14 +19,14 @@
# Draw a tree of gates only. The ~ has been
# replaced by NOT gates.
definergbcolor(lightblue,0.72,0.72,0.9)
-B: Autologix(Or(And(B,Not(C)),And(Not(A),B,C)),N,shaded "lightblue") \
+G: Autologix(Or(And(B,Not(C)),And(Not(A),B,C)),N,shaded "lightblue") \
with .sw at A.e+(1.3,-0.5)
- "{\sl Out}" at B.Out above ljust
- `"\shortstack[l]{\tt B: Autologix( \\ \tt \
+ "{\sl G.Out}" at G.Out above ljust
+ `"\shortstack[l]{\tt G: Autologix( \\ \tt \
Or(And(B,Not(C)),And(Not(A),B,C)),N,\\ \tt \
- shaded \"lightblue\")}"' wid 242pt__ ht 20pt__ at B.s+(0,-0.3)
- for_(1,4,1,`"{\sf\small\sl B.In`'m4x}" at B.In`'m4x rjust')
- "{\sf\small\sl B.In5}" at B.In5+(0,-1.5bp__) rjust
+ shaded \"lightblue\")}"' wid 242pt__ ht 20pt__ at G.s+(0,-0.3)
+ for_(1,4,1,`"{\sf\small\sl G.In`'m4x}" at G.In`'m4x rjust')
+ "{\sf\small\sl G.In5}" at G.In5+(0,-1.5bp__) rjust
# Here is how to include an arbitrary circuit
# (an SR-flipflop, for example)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/AmpTable.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/AmpTable.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/AmpTable.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,23 +1,25 @@
.PS
# `Amptable.m4'
cct_init
+divert(-1)
+
+divert(0)dnl
+
movewid = 2pt__
-{
+{
{amp ; move ; "{\tt `amp'}" ljust}
- move down 0.4; right_
- {amp(,0.3) ; move ; "\tt `amp'(,0.3)" ljust}
- }
move right_ 2.0
-{ {delay(,,fill_(0.9)) ; move ;
+ {amp(,5mm__) ; move ; "\tt `amp'(,5mm\_\_)" ljust}
+ move right_ 2.0
+ {integrator ; move ; "\tt `integrator'" ljust}
+ }
+ move down 0.5; right_
+{
+ {delay(,,fill_(0.9)) ; move ;
"`\tt\shortstack[l]{delay(,{,}\\ fill\_(0.9))}'" ljust}
- move down 0.4; right_
- {delay(,0.2) ; move ; "{\tt `delay'(,0.2)}" ljust}
- }
-
move right_ 2.0
-{ {integrator ; move ; "\tt `integrator'" ljust}
- move down 0.5; right_
- {integrator(,0.3) ; move ; "\tt `integrator'(,0.3)" wid 82pt__ ljust}
- }
+ {delay(,,type=S;body=shaded "blue!25"); move
+ "{\tt `delay'(,,type=S;}" ljust "{\tt body=shaded \"blue!25\")}" ljust}
+ }
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Buttons.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Buttons.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Buttons.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -3,7 +3,6 @@
gen_init
NeedDpicTools
-
divert(-1)
#################################################################
@@ -67,7 +66,7 @@
linedensity = ifelse(`$4',,150/scale,`$4')
nsteps=10
define BxBshadow {
- box ht boxh wid boxw rad boxh/2 \
+ B: box ht boxh wid boxw rad boxh/2 \
outlined rgbstring($`'2,$`'3,$`'4) at (0,($`'1)*4*linethick bp__)
}
Q: ShadeObject(BxBshadow,nsteps,
@@ -74,29 +73,14 @@
0, 1,1,1,
1, r3,g3,b3)
# Shaded body
- lthk = boxh/nsteps/(1bp__)
- define BxBshade {
- v = boxh*(1-($`'1))
- h = (boxw-boxh)/2+sqrt((boxh/2)^2-(v-boxh/2)^2)
- line from (-h,v) to (h,v) thick lthk outlined rgbstring($`'2,$`'3,$`'4)
- }
- nsteps = boxh*linedensity
- C: ShadeObject(BxBshade,nsteps,
- 0, r1, g1, b1,
- 0.45,r2, g2, b2,
- 1, r3, g3, b3) with .n at Q.n
+ C: ColoredV(box,
+ (( 0,r1,g1,b1, 0.45,r2,g2,b2, 1,r3,g3,b3)):boxh/(Q.B.thick bp__)*2,
+ wid boxw ht boxh rad boxh/2 invis) with .n at Q.n
# Shaded highlight
- bh = boxh*0.4
- bw = boxw*4/4.5
- define BxBhighlight {
- v = bh*(1-($`'1)); h = (bw-bh)/2+sqrt((bh/2)^2-(v-bh/2)^2)
- line from (-h,v) to (h,v) thick lthk outlined rgbstring($`'2,$`'3,$`'4)
- }
- nsteps = bh*linedensity
- ShadeObject(BxBhighlight,nsteps,
- 0,1,1,1,
- 8/nsteps,1,1,1,
- 1, r2,g2,b2) with .n at Q.n+(0,-boxh/20)
+ bh = boxht*0.4
+ ColoredV(box,((0,1,1,1, 8/(bh*linedensity),1,1,1, 1,r2,g2,b2)),
+ ht bh wid boxw*4/4.5 rad bh/2 invis) \
+ with .n at Q.n+(0,-boxh/20)
`$5']')
#################################################################
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Chips.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Chips.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Chips.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -9,8 +9,11 @@
ic4017
{"\sf 4017" at last [].Chip.sw below ljust}
move
- ic4510
- {"\sf 4510" at last [].Chip.sw below ljust}
+# ic4510
+# {"\sf 4510" at last [].Chip.sw below ljust}
+# move
+ ic555
+ {"\sf 555" at last [].Chip.sw below ljust}
move
icVS1053
{"\sf VS1053" at last [].Chip.sw below ljust}
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Consumption.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Consumption.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Consumption.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -473,14 +473,18 @@
rs_box(Population) at dtop(1975,0.9)
define(`text_ang',90)
+ command "\newcommand{\pct}{$\mskip\thinmuskip$\char37}"
brpos = 2016
Q:s_box(`$\left.\vbox to 1.50in{}\right\}$') with .w at dtop(brpos,1.04)
- Label: rs_box(`\shortstack{90\,\%\\ nonrenewable}') with .w at Q.e
+# Label: rs_box(`\shortstack{90\,\%\\ nonrenewable}') with .w at Q.e
+ Label: rs_box(`90\pct') at Q.e+(5bp__,0)
+ rs_box(`nonrenewable') with .w at last "".e+(2bp__,0)
s_box(`$\left.\vbox to 0.2in{}\right\}$') with .w at dtop(brpos+0.5,0.1)
- rs_box(`\shortstack[l]{10\,\%\\ renewable}') \
- with .sw at (Label.w,dtop(brpos,0.05))
+# rs_box(`\shortstack[l]{10\,\%\\ renewable}')
+ rs_box(`10\pct') with .sw at (Label.w,dtop(brpos,0.05))
+ rs_box(`renewable') with .sw at last "".se+(2bp__,0)
linethick_(0.6)
arrow <- from dtop(1998,1.55) left 0.15 up 0.2
@@ -519,6 +523,6 @@
#print maxpswid-(last [].wid-maxx)
#print (last [].wid,last [].ht)
-showbox_
+#showbox_
}
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Dini.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Dini.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Dini.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -6,7 +6,7 @@
# https://tex.stackexchange.com/questions/516734/plot-dinis-surface
threeD_init
NeedDpicTools
-scale = 1.5
+scale = 2.0
[
viewazimuth = 0 # View angles in degrees
viewelevation = 20
@@ -190,5 +190,58 @@
for_(2,5,1,`to Project((v[x[m4x],1]),(v[x[m4x],2]),(v[x[m4x],3]))\')\
to Project((v[x[1],1]),(v[x[1],2]),(v[x[1],3])) thick 0.2 fill_(0)
}
-] scaled 2.5 with .sw at last [].se+(1,0)
+] scaled 2.5 with .sw at last [].se+(0.5,0)
+[
+#.PE
+#.PS
+## BlueBall.m4
+## https://latex.org/forum/viewtopic.php?f=5&t=30639
+#threeD_init
+#NeedDpicTools
+
+ ballrad = 2.5
+ cylrad = ballrad*0.87
+ hht =sqrt(ballrad^2-cylrad^2)
+ azimuth = 0
+ elevation = atan2(hht,cylrad)*rtod_ # disks touch at C
+ setview(azimuth,elevation)
+ sinelev = sind(elevation)
+
+ linethick_(1)
+ C: shadedball(ballrad,,,,(0,1,1)) at (0,0)
+ Op: C+Project(0,0,hht)
+ O: C+Project(0,0,-hht)
+ line dashed from Op+( cylrad,0) down Op.y-O.y
+ line dashed from Op+(-cylrad,0) down Op.y-O.y
+
+ define(`Normal',`cosd(`$1')*cylrad,sind(`$1')*cylrad,-hht')
+ define Cylvis { $`'2 = dot3D(Normal($`'1),View3D) }
+ findroot(Cylvis,5,170,1e-8,rA)
+ A: Project(Normal(rA))
+ B: O+(-(A.x-O.x),A.y-O.y)
+ aA = atan2(A.y-O.y,(A.x-O.x)*sinelev)
+ ellipsearc(cylrad*2,cylrad*2*sinelev,aA,-pi_-aA,0,cw) with .C at O
+ ellipsearc(cylrad*2,cylrad*2*sinelev,-pi_-aA-4*dtor_,aA+4*dtor_,,cw,dashed) \
+ with .C at O
+ ellipsearc(cylrad*2,cylrad*2*sinelev,-aA,pi_+aA,0,cw) with .C at Op
+ ellipsearc(cylrad*2,cylrad*2*sinelev,pi_+aA+4*dtor_,-aA-4*dtor_,,cw,dashed) \
+ with .C at Op
+
+ dot(at C); # "$T$" at last [].w rjust below
+ dot(at O); # "$O$" at last [].s below
+ dot(at A); # "$A$" at last [].s ljust below
+ dot(at B); # "$B$" at last [].s rjust below
+ dot(at Op); # "$O'$" at last [].n above
+ Ap: dot(at Op+(A-O)); # "$A'$" at Ap.n ljust above
+ Bp: dot(at Op+(B-O)); # "$B'$" at Bp.n rjust above
+
+ linethick_(0.4)
+ line dashed from Ap to A then to O then to Op
+ line dashed from A to C
+ line dashed from Bp to B
+ V: Between_(O,A,0.15)
+ U: C+Project(0,0,-hht+0.15)
+ line from U to U+(V-O) then to V
+ ] with .w at last [].e+(0.5,0)
+
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/EVplugs.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/EVplugs.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/EVplugs.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -14,7 +14,7 @@
twdth=expr; # tab width
thgt=expr; # tab hght
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
L1=attributes; # L1 attributes ...
N=attributes;
@@ -23,8 +23,8 @@
CP=attributes; '
define(`pEVskale',25.4) dnl default plug size (20 mm)
define(`EV_J1772',`[ pushkeys_(`$1', `wdth:20/pEVskale;
- twdth:3.5/20*m4wdth; thgt:1.5/20*m4wdth; diamLNP:6/20*m4wdth;
- thick:2; inthick:1.5; BG::N; L1::N; N::N; PE::N; PP::N; CP::N; ')
+ twdth:3.5/20*m4`'wdth; thgt:1.5/20*m4`'wdth; diamLNP:6/20*m4`'wdth;
+ thick:2; thickin:1.5; BG::N; L1::N; N::N; PE::N; PP::N; CP::N; ')
tang = atan2(m4twdth/2,m4wdth/2)*rtod_
TS: (Rect_(m4wdth/2,-90-tang)); TE: (Rect_(m4wdth/2,-90+tang))
Tab: line thick m4thick from TS down_ m4thgt \
@@ -31,13 +31,13 @@
then to TE-(0,m4thgt) then to TE m4BG
Arc: arc thick m4thick to TS with .c at (0,0) m4BG
round(at TS,last arc.thick); round(at TE,last arc.thick)
- L1: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4,150)) m4L1
- N: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4, 30)) m4N
- PE: circle diam m4diamLNP thick m4inthick at (0,-m4wdth/4) m4PE
- PP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,210)) m4PP
- CP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,-30)) m4CP
+ L1: circle diam m4diamLNP thick m4thickin at (Rect_(m4wdth/4,150)) m4L1
+ N: circle diam m4diamLNP thick m4thickin at (Rect_(m4wdth/4, 30)) m4N
+ PE: circle diam m4diamLNP thick m4thickin at (0,-m4wdth/4) m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4thickin at (Rect_(m4wdth/3,210)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4thickin at (Rect_(m4wdth/3,-30)) m4CP
`$2' popdef(`m4CP',`m4PP',`m4PE',`m4N',`m4L1',`m4BG',
- `m4wdth',`m4diamLNP',`m4twdth',`m4thgt',`m4thick',`m4inthick') ]')
+ `m4wdth',`m4diamLNP',`m4twdth',`m4thgt',`m4thick',`m4thickin') ]')
`EV_J3068(keys,shade)
EV charging plug in a [] block
@@ -46,7 +46,7 @@
twdth=expr; # tab width
thgt=expr; # tab hght
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
L1|L2|L3=attributes; # pin attributes ...
N=attributes;
@@ -55,7 +55,7 @@
CP=attributes;
arg2= R:G:B background fill color '
define(`EV_J3068',`[ pushkeys_(`$1',
- `wdth:25/pEVskale; diamLNP:m4wdth*0.25; thick:2; inthick:1.5;
+ `wdth:25/pEVskale; diamLNP:m4`'wdth*0.25; thick:2; thickin:1.5;
BG::N; L1::N; L2::N; L3::N; N::N; PE::N; PP::N; CP::N; ')
C: Here
NE: C+(Rect_(m4wdth/2,45)); NW: C+(Rect_(m4wdth/2,135))
@@ -68,14 +68,14 @@
arc thick m4thick to Ac+(0,m4diamLNP/2) with .c at Ac m4BG
Top: line thick m4thick to (NW+NE-Ac, Here) m4BG
arc thick m4thick to NW with .c at Here+(0,-m4diamLNP/2) m4BG
- PE: circle diam m4diamLNP thick m4inthick at C m4PE
- PP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,45)) m4PP
- CP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,135)) m4CP
- L1: circle diam m4diamLNP thick m4inthick at C+(m4wdth*.3,0) m4L1
- L2: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-60)) m4L2
- L3: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-120)) m4L3
- N: circle diam m4diamLNP thick m4inthick at C-(m4wdth*.3,0) m4N
- `$3' popdef(`m4wdth',`m4diamLNP',`m4thick',`m4inthick',
+ PE: circle diam m4diamLNP thick m4thickin at C m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4thickin at C+(Rect_(m4wdth/3,45)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4thickin at C+(Rect_(m4wdth/3,135)) m4CP
+ L1: circle diam m4diamLNP thick m4thickin at C+(m4wdth*.3,0) m4L1
+ L2: circle diam m4diamLNP thick m4thickin at C+(Rect_(m4wdth*.3,-60)) m4L2
+ L3: circle diam m4diamLNP thick m4thickin at C+(Rect_(m4wdth*.3,-120)) m4L3
+ N: circle diam m4diamLNP thick m4thickin at C-(m4wdth*.3,0) m4N
+ `$3' popdef(`m4wdth',`m4diamLNP',`m4thick',`m4thickin',
`m4BG',`m4L1',`m4L2',`m4L3',`m4N',`m4PE',`m4PP',`m4CP') ]')
`EV_CCS1(J1772 keys,DC keys)
@@ -84,20 +84,20 @@
diamPM=expr; # diam of DC+, DC- circles
sep=expr; # separation of Jack and DC
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
DCplus=attributes;
DCminus=attributes; '
define(`EV_CCS1',`[
J: EV_J1772(`$1')
- pushkeys_(`$2',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
- sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ pushkeys_(`$2',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4`'hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; thickin:J.PE.thick;
BG::N; DCplus::N; DCminus::N;')
DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 m4BG
- DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
- DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ DCplus: circle thick m4thickin diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4thickin diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
] with .n at J.s+(0,-m4sep)
- popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4thickin',`m4BG',
`m4DCplus',`m4DCminus')
]')
@@ -107,7 +107,7 @@
diamPM=expr; # diam of DC+, DC- circles
sep=expr; # separation of Jack and DC
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
DCplus=attributes;
DCminus=attributes;
@@ -114,15 +114,15 @@
arg2= R:G:B background fill color '
define(`EV_CCS2',`[
J: EV_J3068(`$1',`$2')
- pushkeys_(`$3',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
- sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ pushkeys_(`$3',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4`'hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; thickin:J.PE.thick;
BG::N; DCplus::N; DCminus::N;')
DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 dnl
m4BG ifelse(`$2',,,`shaded rgbstring(patsubst(`$2',:,`,'))')
- DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
- DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ DCplus: circle thick m4thickin diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4thickin diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
] with .n at J.s+(0,-m4sep)
- popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4thickin',`m4BG',
`m4DCplus',`m4DCminus')
]')
@@ -130,12 +130,12 @@
EV charging plug in a [] block
keys: wdth=expr; # plug width
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # background shaded gray etc
DCplus=|DCminusNS=|FG=|NC=|SS1=|DCP=|PP=|
CL=|CH=|SS2=attributes # pin attributes ...'
define(`EV_CHAdeMO',`[ pushdef(`m4sk',33/140/pEVskale) pushkeys_(`$1',
- `wdth:140*m4sk; thick:m4wdth*9/140/(1bp__); inthick:m4thick*1.5/9;
+ `wdth:140*m4sk; thick:m4`'wdth*9/140/(1bp__); thickin:m4`'thick*1.5/9;
BG::N; DCplus::N; DCminus::N;N::N;S::N;
FG::N; NC::N; SS1::N; DCP::N; PP::N; CL::N; CH::N; SS2::N')
C: circle thick m4thick diam m4wdth-m4thick bp__ m4BG
@@ -144,18 +144,18 @@
line thick m4thick*0.6 from C+(Rect_(C.rad+m4thick bp__*3/4,138)) \
to C+(Rect_(C.rad+m4thick bp__*3/4,130)) then right m4thick bp__ m4BG
idiam = (m4wdth-m4thick bp__*2)*47/(27+47*2)
- N: circle diam idiam thick m4inthick with .n at C.n-(0,m4thick bp__/2) m4N
- S: circle diam idiam thick m4inthick with .s at C.s+(0,m4thick bp__/2) m4S
- E: circle diam idiam thick m4inthick at Cintersect(N,N.diam,S,S.diam) m4DCminus
- W: circle diam idiam thick m4inthick at Cintersect(S,S.diam,N,N.diam) m4DCplus
+ N: circle diam idiam thick m4thickin with .n at C.n-(0,m4thick bp__/2) m4N
+ S: circle diam idiam thick m4thickin with .s at C.s+(0,m4thick bp__/2) m4S
+ E: circle diam idiam thick m4thickin at Cintersect(N,N.diam,S,S.diam) m4DCminus
+ W: circle diam idiam thick m4thickin at Cintersect(S,S.diam,N,N.diam) m4DCplus
foreach_(`Z',
- `line thick m4inthick up Z.diam*0.6 right Z.diam*0.6 with .c at Z
- line thick m4inthick up Z.diam*0.6 left Z.diam*0.6 with .c at Z',N,S)
+ `line thick m4thickin up Z.diam*0.6 right Z.diam*0.6 with .c at Z
+ line thick m4thickin up Z.diam*0.6 left Z.diam*0.6 with .c at Z',N,S)
foreach_(`L',`L: circle diam idiam/4 thick linethick/2 \
at N+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',FG,NC,DCP,SS1)
foreach_(`L',`L: circle diam idiam/4 thick linethick/2 \
at S+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',PP,CL,SS2,CH)
- `$3' popdef(`m4sk',`m4wdth',`m4thick',`m4inthick',`m4BG',
+ `$3' popdef(`m4sk',`m4wdth',`m4thick',`m4thickin',`m4BG',
`m4DCplus',`m4DCminus',`m4N',`m4S',
`m4FG',`m4NC',`m4SS1',`m4DCP',`m4PP',`m4CL',`m4CH',`m4SS2') ]')
@@ -173,7 +173,7 @@
Gndinner=attributes;
PP=attributes;
CP=attributes; '
-define(`EV_NAC',`[ pushkeys_(`$1', `wdth:1.6; diamL:m4wdth*0.28; BG::N;
+define(`EV_NAC',`[ pushkeys_(`$1', `wdth:1.6; diamL:m4`'wdth*0.28; BG::N;
L1::N; L1inner::N; L2::N; L2inner::N; Gndinner::N; inner::N;
Gnd::N; PP::N; CP::N; ')
sN = 1/pEVskale*m4wdth/1.6 # drawing coord scale factor
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Fuses.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Fuses.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Fuses.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -42,7 +42,7 @@
jumper(,CJBED) ; {"`\tt $\ldots$(,CJBED)'" at last line.c+(0,-0.2) }
move
jumper(,body=outlined "gray" shaded "gray";)
- "`\tt $\ldots$(,body=outlined \"gray\" \textbackslash'" \
+ "`\tt $\ldots$(,body=outlined \"gray\" \textbackslash'" wid 168bp__ \
at last line.start+(0,-20bp__) ljust \
"`\tt \hphantom{body=}shaded \"gray\";)'" ljust
}
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Geometry.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Geometry.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Geometry.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -144,7 +144,7 @@
Y: LCintersect(HZ,CC4,C4.rad,R); "$Y$" at Y above
X: LCintersect(HZ,CC2,C2.rad); "$X$" at X above rjust
- Loopover_(`P',`dot(at P)',X,Y,Z)
+ foreach_(`P',`dot(at P)',X,Y,Z)
line dashed from X to Y chop -linewid/2
RightAngle(A,Z,Y)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Incleps.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Incleps.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Incleps.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -10,6 +10,9 @@
define(`backarrow',`darrow(`$1',,,2pt__,6pt__,6pt__,<-|)')
S: s_box(`\includegraphics[width=3in]{Incl}')
+# A blank box the size of the included eps figure:
+#S: s_box("\hskip %gin\vrule width 0pt height %gin",\
+# boxdim(InclA,w),boxdim(InclA,v))
ifgpic(`S: box invis ht s_ht wid s_wd with .c at S.n')
thinlines_
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Makefile 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Makefile 2024-05-30 19:57:12 UTC (rev 71389)
@@ -36,6 +36,11 @@
#PIC = $$HOME/dpic/pascaldev/test/dpic
#PIC = $$HOME/dpic/pascal/test/dpic
+# Quiet mode for MiKTeX:
+# QLATEX = latex --quiet
+# Quiet mode for texlive:
+QLATEX = latex -interaction=batchmode
+
#MODE = -p
MODE = -g
@@ -62,11 +67,11 @@
Audio.tex Bip.tex Btree.tex Buttons.tex Byte.tex \
Capacitors.tex CanLogic.tex Chips.tex Conn.tex Connectors.tex \
Contacts.tex Contact.tex control.tex Crow.tex \
- csc.tex Csource.tex Decoder.tex \
+ cbresistor.tex csc.tex Csource.tex Decoder.tex \
Demultiplexer.tex diamond.tex Dini.tex Diodes.tex Drive.tex \
EEP.tex Emarrows.tex Escher.tex EVplugs.tex \
- ex00.tex ex01.tex ex02.tex ex03.tex ex04.tex ex05.tex ex06.tex ex08.tex \
- ex09.tex ex10.tex ex11.tex ex12.tex ex15.tex ex16.tex ex17.tex ex18.tex \
+ ex01.tex ex02.tex ex03.tex ex04.tex ex05.tex ex06.tex ex08.tex \
+ ex09.tex ex10.tex ex11.tex ex12.tex ex15.tex ex16.tex ex18.tex \
ex21.tex exp.tex fet.tex Flow.tex Fuses.tex \
Geometry.tex GrayCode.tex graysurf.tex Grounds.tex \
Headers.tex Heathkit.tex \
@@ -78,9 +83,9 @@
Quantum.tex quick.tex \
random.tex Rectifiers.tex recycle.tex relaycoil.tex Relay.tex \
Resistors.tex Rotbox.tex \
- Schottky.tex sfg.tex shadowed.tex shapes.tex ShiftR.tex Sierpinski.tex \
- Sixpole.tex \
- Smithchart.tex Sources.tex SQUID.tex Switches.tex \
+ Schottky.tex Sevensegment.tex sfg.tex Shadowed.tex shapes.tex \
+ ShiftR.tex Sierpinski.tex Sixpole.tex \
+ Smithchart.tex Sources.tex Switches.tex \
Tgate.tex Three.tex thyristor.tex TTLnand.tex Tubediags.tex \
UNO.tex ujt.tex Variable.tex Windings.tex worm.tex Xform.tex XOR.tex
@@ -135,10 +140,10 @@
@touch $(DIMFILE) F_$*.dim
$(M4) pstricks.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -p > $*.tex
@$(LTXFILE) > F_$*.tex
- latex --quiet F_$*
+ $(QLATEX) F_$*
touch F_$*.dim $(DIMFILE)
$(M4) pstricks.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -p > $*.tex
- latex --quiet F_$*
+ $(QLATEX) F_$*
mv F_$*.dvi $*.dvi
rm -f F_*
.dvi.ps:
@@ -148,7 +153,7 @@
@touch $(DIMFILE) F_$*.dim
$(M4) pstricks.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -p > $*.tex
@$(LTXFILE) > F_$*.tex
- latex --quiet F_$*
+ $(QLATEX) F_$*
dvips $(DVIPSOPTS) F_$* -o $*.ps
chmod 644 $*.ps
rm -f F_*
@@ -156,9 +161,9 @@
@touch $(DIMFILE) F_$*.dim
$(M4) pstricks.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -p > $*.tex
@$(LTXFILE) > F_$*.tex
- latex --quiet F_$*
+ $(QLATEX) F_$*
$(M4) pstricks.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -p > $*.tex
- latex --quiet F_$*
+ $(QLATEX) F_$*
dvips F_$* -T128cm,28cm -o $*.ps
# Recent changes to PSTricks(?) have clashed with the use of TeXtoEPS
# so use ps2epsi
@@ -171,9 +176,9 @@
@touch $(DIMFILE) F_$*.dim
$(M4) pgf.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -g > $*.tex
@$(PDFLTXSRC) > F_$*.tex
- pdflatex --quiet F_$*
+ pdf$(QLATEX) F_$*
$(M4) pgf.m4 $(DIMFILE) F_$*.dim $*.m4 | $(PIC) -g > $*.tex
- pdflatex --quiet F_$*
+ pdf$(QLATEX) F_$*
mv F_$*.pdf $*.pdf
rm -f F_*
.m4.png:
@@ -192,7 +197,8 @@
# rm $*.pdf
.m4.svg:
make $*.pdf
- dvisvgm --pdf $*.pdf $*.svg
+# dvisvgm --pdf $*.pdf $*.svg
+ pdf2svg $*.pdf $*.svg
chmod 644 $*.svg
# rm $*.pdf
@@ -244,25 +250,25 @@
tst:
@$(LTXFILE) | sed -e 's/{\.tex}/{test.tex}/' > tst.tex
- make CONF=pstricks.m4 PIC=dpic MODE=-p test.tex; latex --quiet tst
+ make CONF=pstricks.m4 PIC=dpic MODE=-p test.tex; $(QLATEX) tst
rm -f test.tex test.pic
- make CONF=pstricks.m4 PIC=dpic MODE=-p test.tex; latex --quiet tst
+ make CONF=pstricks.m4 PIC=dpic MODE=-p test.tex; $(QLATEX) tst
dvips $(DVIPSOPTS) tst -o tst.ps
tst1:
@$(LTXFILE) | sed -e 's/{\.tex}/{test.tex}/' > tst.tex
- make CONF=pstricks.m4 PIC=dpic MODE=-p test.tex; latex --quiet tst
+ make CONF=pstricks.m4 PIC=dpic MODE=-p test.tex; $(QLATEX) tst
dvips $(DVIPSOPTS) tst -o tst.ps
tikz:
@$(LTXFILE) | sed -e 's/{\.tex}/{test.tex}/' -e 's/pstricks/tikz/' > tst.tex
- make CONF=pgf.m4 PIC=dpic MODE=-g test.tex; latex --quiet tst
+ make CONF=pgf.m4 PIC=dpic MODE=-g test.tex; $(QLATEX) tst
dvips $(DVIPSOPTS) tst -o tst.ps
gpic:
@$(LTXFILE) | sed -e 's/{\.tex}/{test.tex}/' > tst.tex
rm -f test.tex test.pic
- make CONF=gpic.m4 PIC=pic MODE=-t test.tex; latex --quiet tst
+ make CONF=gpic.m4 PIC=pic MODE=-t test.tex; $(QLATEX) tst
dvips $(DVIPSOPTS) tst -o tst.ps
echopics:
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/MoreTable.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/MoreTable.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/MoreTable.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -72,5 +72,5 @@
{xtal(,type=R;outerdiam=0.2) ; move ;"`{\tt xtal(,type=R)}'" ljust}
}
-] with .nw at Heater.sw+(0,-0.3)
+] with .nw at Heater.sw+(0,-0.4)
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Quantum.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Quantum.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Quantum.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -17,6 +17,7 @@
arc cw from C+(-r,0) to C+(r,0) with .c at C
arrow from C+(-r/4,0) to C+(0.9*r,0.9*r) ]')
+[
X: Bus(,shaded rgbstring(0.5,0.5,1) "X")
A1: Bus(from X.start+(0,-boxht*3/2), shaded "red" "A")
A2: Bus(from 2 between X.start and A1.start,shaded "red" "A")
@@ -27,5 +28,27 @@
Meter with .e at X.end
box wid boxwid*1.2 ht boxht*1.2 fill_(1) "$R_{\psi}^{\pi/2}$" \
at A2.end-(4.5*boxwid,0)
+]
+#.PE
+#.PS
+# SQUID.m4
+cct_init
+
+[
+down_
+#source
+S1: SQUID
+ "J1" at S1.J1 above rjust
+ "J2" at S1.J2 above ljust
+
+S2: SQUID(3,dimen_*1.5,-120) at S1.e+(elen_,0)
+ "J1" at S2.J1 above rjust
+ "J2" at S2.J2 below ljust
+ "J3" at S2.J3 above ljust
+ arcrad = S2.C.rad*0.7
+ arc from S2.c+(Rect_(arcrad,-135)) to S2.c+(Rect_(arcrad,-45)) \
+ with .c at S2.C ->
+ ] with .w at last [].e+(boxht,0)
+
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Resistors.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Resistors.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Resistors.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -5,36 +5,32 @@
movewid = 2 pt__
hm = 2.05
vm = 0.28
-{ {resistor ; move ;"`{\tt resistor}'" ljust}
+{ {A:resistor ; move ;"`{\tt resistor}'" ljust}
move right_ hm
- {resistor(,,Q) ; move ;"`\tt resistor(,{,}Q) '" ljust}
+ {Q:resistor(,5,Q) ; move ;"`\tt $\ldots$(,5{,}Q) '" ljust}
move right_ hm
- {resistor(,,V) ; move ;"`{\tt resistor(,{,}V)}'" ljust}
+ {V:resistor(,,V) ; move ;"`{\tt $\ldots$(,{,}V)}'" ljust}
}
move down vm; right_
-{ {resistor(,,ES) ; move ;"`\tt resistor(,{,}ES) '" ljust}
+{ {ES:resistor(,,ES); move ;"`\tt $\ldots$(,{,}ES) '" ljust}
move right_ hm
- {resistor(,,H) ; move ;"`\tt resistor(,{,}H) '" ljust}
+ {H:resistor(,4,H) ; move ;"`\tt $\ldots$(,4{,}H) '" ljust}
move right_ hm
- {resistor(,,AC) ; move ;"`{\tt resistor(,{,}AC)}'" ljust}
+ {AC:resistor(,,AC) ; move ;"`{\tt $\ldots$(,{,}AC)}'" ljust}
}
move down vm; right_
-{ {resistor(,5,B) ; move ;"`{\tt resistor(,5,B)}'" ljust}
+{ {B:resistor(,,B) ; move ;"`{\tt $\ldots$(,{,}B)}'" ljust}
move right_ hm
- {resistor(,,E) ; move
- "`\shortstack[l]{\tt resistor(,{,}E)\\ {\tt $\equiv$ ebox}}'" ljust}
+ {F:resistor(,,F) ; move ;"`\tt $\ldots$(,{,}F) '" ljust}
move right_ hm
- {ebox(,0.5,0.3) ; move ;"`{\tt ebox(,0.5,0.3)}'" ljust}
+ {E:resistor(,,E) ; move ; "`\tt $\ldots$(,{,}E) $\equiv$ ebox'" ljust}
}
- move down vm; right_
+ move down vm*1.1; right_
{ {ebox(,,,0.9) ; move ;"`{\tt ebox(,{,},0.9)}'" ljust}
move right_ hm
- {ebox(,,,,shaded "yellow") ; move
- "`{\tt ebox(,{,},{,}shaded \"yellow\")}'" ljust}
+ {ebox(,wdth=0.2;box=dashed shaded "green";text="H") ; move
+ "`\shortstack[l]{\tt ebox(,wdth=0.2;box=dashed shaded \"green\";\\' \
+ `\tt text=\"H\")}'" ljust}
}
- move down vm; right_
-{ {ebox(,wdth=0.2;box=dashed shaded "green";text="X") ; move
- "`{\tt ebox(,wdth=0.2;box=dashed shaded \"green\";text=\"X\")}'" ljust}
-}
.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/SQUID.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/SQUID.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/SQUID.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,22 +0,0 @@
-.PS
-# SQUID.m4
-cct_init
-
-divert(-1)
-divert(0)dnl
-
-down_
-#source
-S1: SQUID
- "J1" at S1.J1 above rjust
- "J2" at S1.J2 above ljust
-
-S2: SQUID(3,dimen_*1.5,-120) at S1.e+(elen_,0)
- "J1" at S2.J1 above rjust
- "J2" at S2.J2 below ljust
- "J3" at S2.J3 above ljust
- arcrad = S2.C.rad*0.7
- arc from S2.c+(Rect_(arcrad,-135)) to S2.c+(Rect_(arcrad,-45)) \
- with .c at S2.C ->
-
-.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sevensegment.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sevensegment.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sevensegment.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,82 @@
+.PS
+# Sevensegment.m4
+# https://tex.stackexchange.com/questions/644009/seven-segments-anchors-how-to-use-them
+gen_init
+divert(-1)
+ `sevensegment(keys)
+ Seven-segment display in a [] block. keys:
+ hght=expr; (default boxht)
+ wdth=expr; (default hght*3.3/5.85)
+ slant=fraction; top is skewed slant fraction of ht
+ segwid=expr; segment width
+ gap=expr; gap between segments
+ bevel=fraction; corner truncation
+ on=attributes; "on" segment attributes
+ off=attributes; "off" segment attributes
+ code=[0-8][.]; displayed number .=decimal point
+ or
+ code=Xddddddd[.] where each d=0 or 1 to define
+ Segment1 to Segment7 off or on
+ Segments are labeled Seg1 Seg2 ... Seg7
+ and the decimal point is Seg8'
+define(`sevensegment', # hght, wdth, slant, segwid, gap, bevel, on, off, code
+ `[ pushkeys_(`$1',`hght:boxht; wdth:m4`'hght*3.3/5.85; slant:0;
+ segwid:0.75/3.2*m4`'wdth; gap:0.12/3.2*m4`'wdth; bevel:0.4;
+ on:outlined "red" shaded "red":N; off:outlined "lightgray":N;
+ code:00000010:N;')
+ gapch = m4gap/2*sqrt(2)
+ ifinstr(m4code,.,`define(`m4tmp',substr(m4code,0,decr(len(m4code))))dnl
+ pushdef(`dodp',1)poppushdef(`m4code',m4tmp)')dnl
+ ifinstr(m4code,X,`pushdef(`opcode',substr(m4code,1))',
+ `foreach_(`m4cd',`pushdef(`Cd'decr(m4Lx),m4cd)',1111110,0110000,1101101,
+ 1111001,0110011,1011011,1011111,1110000,1111111,1111011)dnl
+ pushdef(`opcode',Cd`'m4code)')dnl
+ for_(1,7,1,`pushdef(`attrib'm4x,
+ ifelse(substr(opcode,decr(m4x),1),1,`m4on',`m4off'))')dnl
+ Seg1: m4segment(R,m4bevel,m4bevel,attrib1) \
+ with .S at m4slu(0,m4hght-m4segwid)
+ inner = distance(Seg1.SW,Seg1.SE) + gapch*2
+ Seg2: m4segment(D,0.5,m4bevel,attrib2) with .S at \
+ m4slu(m4wdth/2-m4segwid,m4hght-m4segwid-inner/2)
+ Seg3: m4segment(D,m4bevel,0.5,attrib3) with .S at \
+ m4slu(m4wdth/2-m4segwid,m4segwid+inner/2)
+ Seg4: m4segment(L,m4bevel,m4bevel,attrib4) with .S at m4slu(0,m4segwid)
+ Seg5: m4segment(U,0.5,m4bevel,attrib5) with .S at \
+ m4slu(-m4wdth/2+m4segwid,m4segwid+inner/2)
+ Seg6: m4segment(U,m4bevel,0.5,attrib6) with .S at \
+ m4slu(-m4wdth/2+m4segwid,m4hght-m4segwid-inner/2)
+ Seg7: m4segment(R,0.5,0.5,attrib7) with .c at m4slu(0,m4hght/2)
+ ifelse(dodp,1,`Seg8: circle diam m4segwid m4on \
+ at m4slu(Seg3.e.x+m4segwid/2+m4gap,Seg4.s.y+m4segwid/2)') popdef(`dodp')
+ popdef(`m4hght',`m4wdth',`m4slant',`m4segwid',`m4gap',`m4bevel',
+ `m4on',`m4off',`m4code',`opcode')dnl
+ for_(1,7,1,`popdef(`attrib'm4x)') for_(0,9,1,`popdef(`Cd'm4x)')dnl
+ ]')
+define(`m4segment',`[ setdir_(`$1')
+ m4seven_pos(SE,E,NE,,`$2'); m4seven_pos(SW,W,NW,-,`$3')
+ resetdir_
+ S: 1/2 between SW and SE
+ Line: line from m4slu(S.x,S.y) to m4slu(SE.x,SE.y) then to m4slu(E.x,E.y) \
+ then to m4slu(NE.x,NE.y) then to m4slu(NW.x,NW.y) then to m4slu(W.x,W.y) \
+ then to m4slu(SW.x,SW.y) then to m4slu(S.x,S.y) `$4' ] ')
+define(`m4seven_pos',
+ `AA: (`$4'(m4wdth/2-m4segwid-gapch),0); `$1': rot_(AA.x,AA.y,rp_ang)
+ BA: AA + (`$4'1,1)*m4segwid*(1-`$5'); `$2': rot_(BA.x,BA.y,rp_ang)
+ CA: BA - (`$4'1,-1)*m4segwid*`$5'; `$3': rot_(CA.x,CA.y,rp_ang) ')
+define(`m4slu',`(`$1'+(`$2')*m4slant,`$2')')
+
+divert(0)dnl
+
+
+[
+ S: sevensegment(code=4.;hght=1)
+ { for_(1,8,1,`"m4x" at S.Seg`'m4x') }
+ move right 0.25
+ P: sevensegment(code=X1100011;off=invis;hght=1)
+ ]
+[
+ for_(0,9,1,`sevensegment(code=m4x`'ifelse(m4x,1,.);slant=1/4;off=invis)
+ move movewid/4')
+ ] with .nw at last [].sw+(0,-boxht/3)
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sevensegment.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Shadowed.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Shadowed.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Shadowed.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,63 @@
+.PS
+# Shadowed.m4
+gen_init
+NeedDpicTools
+
+Boxes: [
+movewid = movewid/2
+B1: shadowed(,,
+ shadowthick=lthick*4; shadowcolor="lightgray"; shadowangle=-60; \
+ attrib=fill_(0.85) "box")
+
+move
+R: shadowed(box,, rad=6bp__; shadowthick=lthick*4; \
+ attrib=wid boxht*2 shaded "orange" outlined "red" thick 2 \
+ `"\tt box\char44\char44" "\tt rad=6bp\_\_"')
+
+move
+C: shadowed(circle,,
+ shadowthick=lthick*4;shadowcolor="blue";\
+ attrib=outlined "green" shaded "green" diam 0.75 "circle")
+
+move
+ E: shadowed(ellipse,,
+ shadowthick=lthick*4; attrib=ht boxwid wid boxht shaded "yellow" \
+ dashed "ellipse")
+
+ b = boxht
+ move to (E.e.x+b,E.s.y)
+ F: shadowed(line,,
+ attrib=left b then up b right b then down b right b then to Here \
+ shaded "orange" outlined "red" thick 3;shadowthick=4.5bp__;\
+ shadowangle=45)
+ "line" at F.n+(0,-0.3)
+]
+
+Others:[
+movewid = movewid*0.4
+
+ cmyktorgb(96,0,0,0,r,g,b)
+ ColoredV(circle,(r,g,b), rad 0.4 "Hello" outlined "cyan")
+
+move
+ s = 0.5; v = 0.8
+ hsvtorgb(0,s,v,r0,g0,b0)
+ hsvtorgb(90,s,v,r1,g1,b1)
+ hsvtorgb(180,s,v,r2,g2,b2)
+ ColoredV(box,((0,r0,g0,b0, 0.5,r1,g1,b1, 1,r2,g2,b2)),
+ outlined "blue" rad 0.1 ht 2*boxht "Hmm...")
+
+move
+ ColoredV(ellipse,(g,r,b),wid 0.75 ht 1 outlined "magenta" "OK")
+
+move
+ ColoredV(ellipse,,outlined "magenta" shaded "yellow" "Goodbye")
+
+move
+ ColoredV(box,
+ ((0,0,0,0, 0.25,0,0,0, 0.251,1,1,1, 0.8,1,1,1, 0.801,1,0,0, 1,1,0,0)),
+ ht 3/4 wid 1 rad 3/32)
+ "\textcolor{white}{Heading}" at last [].n below
+] with .nw at Boxes.sw #+(0,-moveht)
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Shadowed.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sources.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sources.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Sources.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -19,18 +19,17 @@
{source(,SC) ; move ; "`\tt source(,SC)'" ljust} NL
{source(,AC); move ; "`\tt source(,AC)'" ljust} NL
{source(,X) ; move ; "`\tt source(,X)'" ljust} NL
- {source(,F) ; move ; "`\tt source(,F)'" ljust} NL
{source(,G) ; move ; "`\tt source(,G)'" ljust} NL
{source(,Q) ; move ; "`\tt source(,Q)'" ljust} NL #(0.3)
+ {source(,F) ; move ; "`\tt source(,F)'" ljust} NL
+ {geiger(,,,,fill_(0.9)); move;
+ "`\tt \shortstack[l]{geiger(,{,},{,}\\ fill\_(0.9))}'" ljust} NL
}
move right_ 2.0
{
-# {source(,,0.4) ; move ; "`\tt source(,{,}0.4)'" ljust} NL(0.35)
{source(,,0.4,,shaded "yellow") ; move ;
"`\tt\shortstack[l]{source(,{,}0.4,{,}\\ shaded \"yellow\")}'" ljust} NL(0.35)
-# {source(,P) ; move ; "`\tt source(,P)'" ljust} NL
- {source(,P,,,fill_(0.9)) ; move ;
- "`\tt\shortstack[l]{source(,P,{,},\\ fill\_(0.9))}'" ljust} NL
+ {source(,P) ; move ; "`\tt source(,P)'" ljust} NL
{source(,U) ; move ; "`\tt source(,U)'" ljust} NL
{source(,H) ; move ; "`\tt source(,H)'" ljust} NL
{source(,R) ; move ; "`\tt source(,R)'" ljust} NL
@@ -38,17 +37,18 @@
{source(,SCr) ; move ; "`\tt source(,SCr)'" ljust} NL
{source(,T) ; move ; "`\tt source(,T)'" ljust} NL
{source(,L) ; move ; "`\tt source(,L)'" ljust} NL
- {source(,B) ; move ; "`\tt source(,B)'" ljust} NL
+ {source(,B) ; move ; "`\tt source(,B)'" ljust} NL(moveht*0.8)
{nullator ; move ; "`\tt nullator'" ljust} NL(moveht*0.8)
{norator ; move ; "`\tt norator'" ljust} NL(moveht*0.9)
{ttmotor(,G) ; move ; "`\tt ttmotor(,G)'" ljust} NL(moveht*1.1)
- {proximity ; move ; "`\tt \shortstack[l]{proximity\\ = consource(,P)}'" ljust}
+ {battery ; move ; "`\tt battery'" ljust} NL(0.3)
+ {battery(,3,R) ; move ; "`\tt battery(,3,R)'" ljust} #NL(0.35)
}
move right_ 2.0
{source(,N) ; move ; "`\tt source(,N)'" ljust} NL
+ {source(,NA) ; move ; "`\tt source(,NA)'" ljust} NL
+ {source(,NB) ; move ; "`\tt source(,NB)'" ljust} NL
{source(,"\rm mA");move; "`\tt source(,\"mA\")'" ljust} NL(0.31)
-# {source(,"mA");move; "`\tt source(,'" ljust \
-# "`\tt \enskip \"mA\")'" ljust} NL(0.31)
{consource ; move ; "`\tt consource'" ljust} NL(0.32)
{consource(,I) ; move ; "`\tt consource(,I)'" ljust} NL(0.32)
{consource(,i) ; move ; "`\tt consource(,i)'" ljust} NL(0.32)
@@ -57,8 +57,8 @@
{consource(,V) ; move ; "`\tt consource(,V)'" ljust} NL(0.32)
{consource(,v) ; move ; "`\tt consource(,v)'" ljust} NL(0.3)
{consource(,tv) ; move ; "`\tt consource(,tv)'" ljust} NL(0.3)
- {battery ; move ; "`\tt battery'" ljust} NL(0.3)
- {battery(,3,R) ; move ; "`\tt battery(,3,R)'" ljust} #NL(0.35)
+ {proximity ; move ;
+ "`\tt \shortstack[l]{proximity\\ = consource(,P)}'" ljust} NL(0.35)
iflatex(`ifpsfrag(,`latexcommand(})')')
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Switches.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Switches.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/Switches.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -138,7 +138,7 @@
"\tt circle=\"M\")" ljust}
move right_
dswitch(,,WBcDIGC,circle="M")
- {"\tt (,{,}WBcDIGC," ljust at last line.start+(0,-15bp__) \
+ {"\tt (,{,}WBcDIGC," wid 72bp__ ljust at last line.start+(0,-15bp__) \
"\tt circle=\"M\")" ljust}
}
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/cbresistor.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/cbresistor.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/cbresistor.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,80 @@
+.PS
+# cbresistor.m4
+# https://tex.stackexchange.com/questions/709339/create-command-with-decoration-in-tikz
+# https://www.google.com/search?client=firefox-b-d&q=resistor+color+code
+cct_init
+divert(-1)
+
+ `cbresistor(linespec, keys)
+ keys:
+ lgth=expr; wdth=expr;
+ body=body attributes, e.g. shaded "green"
+ type=A|B; pinched body shape
+ colors=color:color:...;
+ Up to 6 colors, a color may be nul '
+define(`cbresistor',`eleminit_(`$1')
+ pushkeys_(`$2',`lgth:dimen_/2; wdth:dimen_/5; body::N; colors::N; type::N')dnl
+{line to rvec_(max(0,rp_len/2-m4lgth/2),0) thick linethick*3/2; M4cbW: Here
+ ifelse(m4type,B,
+ `[L:rotbox(m4lgth*3/23, m4wdth, shaded "darkgray" m4body,r=m4wdth/20)
+ C:rotbox(m4lgth*17/23, m4wdth*9/10, shaded "darkgray" m4body) \
+ with .W at L.E
+ R:rotbox(m4lgth*3/23, m4wdth, shaded "darkgray" m4body,r=m4wdth/20) \
+ with .W at C.E] with .L.W at Here; move to last [].R.E',
+ `rotbox(m4lgth, m4wdth, shaded "darkgray" m4body) with .W at Here')
+ ifelse(m4colors,,,`define(`m4bw',(m4lgth/23))dnl
+ definergbcolor(silver,0.75,0.75,0.75)
+ definergbcolor(gold,1,215/255,0)
+ stacksplit_(`cbrstack',m4colors,:)stackreverse_(`cbrstack')dnl
+ stackargs_(`m4pos',22,17,12,7,5,2)dnl
+ stackdo_(`cbrstack',`ifelse(cbrstack,nul,,
+ `{ move to M4cbW+vec_(m4pos*m4bw-m4bw/2,0)
+ define(`m4ctr',ifelse(m4type,B,eval((m4pos>3)*(m4pos<20)),0))dnl
+ line m4colorfix(outlined,cbrstack) thick m4bw*1.8/(1bp__) \
+ from rvec_(0,-ifelse(m4ctr,1,0.9*)m4wdth/2) \
+ to rvec_(0, ifelse(m4ctr,1,0.9*)m4wdth/2)
+ ifelse(ifelse(cbrstack,silver,1,cbrstack,gold,1),1,
+ `line outlined rgbstring(0.8,0.8,0.8) thick last line.thick \
+ from 0.2 along_(last line) to 0.4 along_(last line)
+ line outlined "white" thick last line.thick \
+ from 0.25 along_(2nd last line) to 0.3 along_(2nd last line)')
+ }')
+ popdef(`m4pos')') stackdo_(`m4pos')')
+ line to rvec_(max(0,rp_len/2-m4lgth/2),0) thick linethick*3/2}
+ popdef(`m4lgth',`m4wdth',`m4body',`m4colors',`m4type')dnl
+ line to rvec_(rp_len,0) invis ')
+
+divert(0)dnl
+
+linewid = 3/2*linewid
+ifsvg(definergbcolor(Dandelion,0.95,0.65,0.2))
+ifsvg(definergbcolor(Peach,0.76,0.5,0.1))
+
+define(`dpr',
+ `{ cbresistor(,type=B;
+ body=m4colorfix(shaded,Dandelion) m4colorfix(outlined,Peach);
+ colors=`$2') }
+ {iflatex(`sprintf("\SI{%g}{\ohm}",`$1')')ifsvg("``$1'svg_Omega'") \
+ at last line.end+(10bp__,-5bp__) rjust}
+ move right_ moveht*5/6; down_ ')
+
+ define(`elen_',(3/2*linewid))
+ define(`dimen_',(5/4*linewid))
+ down_
+ foreach_(`pair',`dpr(patsubst(pair,-,`,'):nul:black:silver)',
+ 10-brown:black,
+ 12-brown:red,
+ 15-brown:green,
+ 18-brown:gray,
+ 22-red:red,
+ 27-red:Violet,
+ 33-orange:orange,
+ 39-orange:white,
+ 47-yellow:Violet,
+ 56-green:blue,
+ 68-blue:gray,
+ 82-gray:red)
+ dpr(100,brown:black:nul:brown:gold)
+ {"iflatex(\SI{5}{\percent},5 %)" at last line.end+(10bp__,-15bp__) rjust}
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/cbresistor.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/AmpTableDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/AmpTableDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/AmpTableDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,25 +1,24 @@
.PS
-# `Amptable.m4'
+# `AmptableDPV.m4'
cct_init(svg_font(sans-serif,11bp__))
textwid = 0.7
movewid = 2pt__
-{
+{
{amp ; move ; "`amp'" ljust}
- move down 0.4; right_
- {amp(,0.3) ; move ; "`amp'(,0.3)" ljust}
- }
move right_ 2.0
-{ {delay ; move ; "`delay'" ljust}
- move down 0.4; right_
- {delay(,0.2) ; move ; "`delay'(,0.2)" ljust}
- }
-
+ {amp(,5mm__) ; move ; "`amp(,5mm__)'" ljust}
move right_ 2.0
-{ {integrator ; move ; "`integrator'" ljust}
+ {integrator ; move ; "`integrator'" ljust}
+ }
move down 0.5; right_
- {integrator(,0.3) ; move ; "`integrator'(,0.3)" wid 1.2 at Here ljust}
- }
+{
+ {delay(,,fill_(0.9)) ; move ;
+ "`delay(,,'" ljust "`fill_(0.9))'" ljust}
+ move right_ 2.0
+ {delay(,,type=S;body=shaded rgbstring(0.75,0.75,1)); move
+ "`delay(,,type=S;" ljust "body=shaded rgbstring(0.75,0.75,1)')" ljust}
+ }
command "</g>" # end font
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/DiniDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/DiniDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/DiniDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -3,9 +3,10 @@
# This diagram can be produced using, e.g.
# m4 pdf.m4 Dini.m4 | dpic -d > Dini.pdf
+# https://tex.stackexchange.com/questions/516734/plot-dinis-surface
threeD_init
NeedDpicTools
-scale = 1.5
+scale = 2.0
[
viewazimuth = 0 # View angles in degrees
viewelevation = 20
@@ -189,5 +190,58 @@
for_(2,5,1,`to Project((v[x[m4x],1]),(v[x[m4x],2]),(v[x[m4x],3]))\')\
to Project((v[x[1],1]),(v[x[1],2]),(v[x[1],3])) thick 0.2 fill_(0)
}
-] scaled 2.5 with .sw at last [].se+(1,0)
+] scaled 2.5 with .sw at last [].se+(0.5,0)
+[
+#.PE
+#.PS
+## BlueBall.m4
+## https://latex.org/forum/viewtopic.php?f=5&t=30639
+#threeD_init
+#NeedDpicTools
+
+ ballrad = 2.5
+ cylrad = ballrad*0.87
+ hht =sqrt(ballrad^2-cylrad^2)
+ azimuth = 0
+ elevation = atan2(hht,cylrad)
+ setview(azimuth,elevation*rtod_)
+ sinelev = sin(elevation)
+
+ linethick_(1)
+ C: shadedball(ballrad,,,,(0,1,1)) at (0,0)
+ Op: C+Project(0,0,hht)
+ O: C+Project(0,0,-hht)
+ line dashed from Op+( cylrad,0) down Op.y-O.y
+ line dashed from Op+(-cylrad,0) down Op.y-O.y
+
+ define(`Normal',`cosd(`$1')*cylrad,sind(`$1')*cylrad,-hht')
+ define Cylvis { $`'2 = dot3D(Normal($`'1),View3D) }
+ findroot(Cylvis,5,170,1e-8,rA)
+ A: Project(Normal(rA))
+ B: O+(-(A.x-O.x),A.y-O.y)
+ aA = atan2(A.y-O.y,(A.x-O.x)*sinelev)
+ ellipsearc(cylrad*2,cylrad*2*sinelev,aA,-pi_-aA,0,cw) with .C at O
+ ellipsearc(cylrad*2,cylrad*2*sinelev,-pi_-aA-4*dtor_,aA+4*dtor_,,cw,dashed) \
+ with .C at O
+ ellipsearc(cylrad*2,cylrad*2*sinelev,-aA,pi_+aA,0,cw) with .C at Op
+ ellipsearc(cylrad*2,cylrad*2*sinelev,pi_+aA+4*dtor_,-aA-4*dtor_,,cw,dashed) \
+ with .C at Op
+
+ dot(at C); # "$T$" at last [].w rjust below
+ dot(at O); # "$O$" at last [].s below
+ dot(at A); # "$A$" at last [].s ljust below
+ dot(at B); # "$B$" at last [].s rjust below
+ dot(at Op); # "$O'$" at last [].n above
+ Ap: dot(at Op+(A-O)); # "$A'$" at Ap.n ljust above
+ Bp: dot(at Op+(B-O)); # "$B'$" at Bp.n rjust above
+
+ linethick_(0.4)
+ line dashed from Ap to A then to O then to Op
+ line dashed from A to C
+ line dashed from Bp to B
+ V: Between_(O,A,0.15)
+ U: C+Project(0,0,-hht+0.15)
+ line from U to U+(V-O) then to V
+ ] with .w at last [].e+(0.5,0)
+
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/EVplugsDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/EVplugsDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/EVplugsDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -14,7 +14,7 @@
twdth=expr; # tab width
thgt=expr; # tab hght
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
L1=attributes; # L1 attributes ...
N=attributes;
@@ -23,8 +23,8 @@
CP=attributes; '
define(`pEVskale',25.4) dnl default plug size (20 mm)
define(`EV_J1772',`[ pushkeys_(`$1', `wdth:20/pEVskale;
- twdth:3.5/20*m4wdth; thgt:1.5/20*m4wdth; diamLNP:6/20*m4wdth;
- thick:2; inthick:1.5; BG::N; L1::N; N::N; PE::N; PP::N; CP::N; ')
+ twdth:3.5/20*m4`'wdth; thgt:1.5/20*m4`'wdth; diamLNP:6/20*m4`'wdth;
+ thick:2; thickin:1.5; BG::N; L1::N; N::N; PE::N; PP::N; CP::N; ')
tang = atan2(m4twdth/2,m4wdth/2)*rtod_
TS: (Rect_(m4wdth/2,-90-tang)); TE: (Rect_(m4wdth/2,-90+tang))
Tab: line thick m4thick from TS down_ m4thgt \
@@ -31,13 +31,13 @@
then to TE-(0,m4thgt) then to TE m4BG
Arc: arc thick m4thick to TS with .c at (0,0) m4BG
round(at TS,last arc.thick); round(at TE,last arc.thick)
- L1: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4,150)) m4L1
- N: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4, 30)) m4N
- PE: circle diam m4diamLNP thick m4inthick at (0,-m4wdth/4) m4PE
- PP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,210)) m4PP
- CP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,-30)) m4CP
+ L1: circle diam m4diamLNP thick m4thickin at (Rect_(m4wdth/4,150)) m4L1
+ N: circle diam m4diamLNP thick m4thickin at (Rect_(m4wdth/4, 30)) m4N
+ PE: circle diam m4diamLNP thick m4thickin at (0,-m4wdth/4) m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4thickin at (Rect_(m4wdth/3,210)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4thickin at (Rect_(m4wdth/3,-30)) m4CP
`$2' popdef(`m4CP',`m4PP',`m4PE',`m4N',`m4L1',`m4BG',
- `m4wdth',`m4diamLNP',`m4twdth',`m4thgt',`m4thick',`m4inthick') ]')
+ `m4wdth',`m4diamLNP',`m4twdth',`m4thgt',`m4thick',`m4thickin') ]')
`EV_J3068(keys,shade)
EV charging plug in a [] block
@@ -46,7 +46,7 @@
twdth=expr; # tab width
thgt=expr; # tab hght
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
L1|L2|L3=attributes; # pin attributes ...
N=attributes;
@@ -55,7 +55,7 @@
CP=attributes;
arg2= R:G:B background fill color '
define(`EV_J3068',`[ pushkeys_(`$1',
- `wdth:25/pEVskale; diamLNP:m4wdth*0.25; thick:2; inthick:1.5;
+ `wdth:25/pEVskale; diamLNP:m4`'wdth*0.25; thick:2; thickin:1.5;
BG::N; L1::N; L2::N; L3::N; N::N; PE::N; PP::N; CP::N; ')
C: Here
NE: C+(Rect_(m4wdth/2,45)); NW: C+(Rect_(m4wdth/2,135))
@@ -68,14 +68,14 @@
arc thick m4thick to Ac+(0,m4diamLNP/2) with .c at Ac m4BG
Top: line thick m4thick to (NW+NE-Ac, Here) m4BG
arc thick m4thick to NW with .c at Here+(0,-m4diamLNP/2) m4BG
- PE: circle diam m4diamLNP thick m4inthick at C m4PE
- PP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,45)) m4PP
- CP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,135)) m4CP
- L1: circle diam m4diamLNP thick m4inthick at C+(m4wdth*.3,0) m4L1
- L2: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-60)) m4L2
- L3: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-120)) m4L3
- N: circle diam m4diamLNP thick m4inthick at C-(m4wdth*.3,0) m4N
- `$3' popdef(`m4wdth',`m4diamLNP',`m4thick',`m4inthick',
+ PE: circle diam m4diamLNP thick m4thickin at C m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4thickin at C+(Rect_(m4wdth/3,45)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4thickin at C+(Rect_(m4wdth/3,135)) m4CP
+ L1: circle diam m4diamLNP thick m4thickin at C+(m4wdth*.3,0) m4L1
+ L2: circle diam m4diamLNP thick m4thickin at C+(Rect_(m4wdth*.3,-60)) m4L2
+ L3: circle diam m4diamLNP thick m4thickin at C+(Rect_(m4wdth*.3,-120)) m4L3
+ N: circle diam m4diamLNP thick m4thickin at C-(m4wdth*.3,0) m4N
+ `$3' popdef(`m4wdth',`m4diamLNP',`m4thick',`m4thickin',
`m4BG',`m4L1',`m4L2',`m4L3',`m4N',`m4PE',`m4PP',`m4CP') ]')
`EV_CCS1(J1772 keys,DC keys)
@@ -84,20 +84,20 @@
diamPM=expr; # diam of DC+, DC- circles
sep=expr; # separation of Jack and DC
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
DCplus=attributes;
DCminus=attributes; '
define(`EV_CCS1',`[
J: EV_J1772(`$1')
- pushkeys_(`$2',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
- sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ pushkeys_(`$2',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4`'hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; thickin:J.PE.thick;
BG::N; DCplus::N; DCminus::N;')
DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 m4BG
- DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
- DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ DCplus: circle thick m4thickin diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4thickin diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
] with .n at J.s+(0,-m4sep)
- popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4thickin',`m4BG',
`m4DCplus',`m4DCminus')
]')
@@ -107,7 +107,7 @@
diamPM=expr; # diam of DC+, DC- circles
sep=expr; # separation of Jack and DC
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # shaded gray etc
DCplus=attributes;
DCminus=attributes;
@@ -114,15 +114,15 @@
arg2= R:G:B background fill color '
define(`EV_CCS2',`[
J: EV_J3068(`$1',`$2')
- pushkeys_(`$3',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
- sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ pushkeys_(`$3',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4`'hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; thickin:J.PE.thick;
BG::N; DCplus::N; DCminus::N;')
DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 dnl
m4BG ifelse(`$2',,,`shaded rgbstring(patsubst(`$2',:,`,'))')
- DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
- DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ DCplus: circle thick m4thickin diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4thickin diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
] with .n at J.s+(0,-m4sep)
- popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4thickin',`m4BG',
`m4DCplus',`m4DCminus')
]')
@@ -130,12 +130,12 @@
EV charging plug in a [] block
keys: wdth=expr; # plug width
thick=expr; # outer line thickness (pt)
- inthick=expr; # inner line thickness (pt)
+ thickin=expr; # inner line thickness (pt)
BG=attributes; # background shaded gray etc
DCplus=|DCminusNS=|FG=|NC=|SS1=|DCP=|PP=|
CL=|CH=|SS2=attributes # pin attributes ...'
define(`EV_CHAdeMO',`[ pushdef(`m4sk',33/140/pEVskale) pushkeys_(`$1',
- `wdth:140*m4sk; thick:m4wdth*9/140/(1bp__); inthick:m4thick*1.5/9;
+ `wdth:140*m4sk; thick:m4`'wdth*9/140/(1bp__); thickin:m4`'thick*1.5/9;
BG::N; DCplus::N; DCminus::N;N::N;S::N;
FG::N; NC::N; SS1::N; DCP::N; PP::N; CL::N; CH::N; SS2::N')
C: circle thick m4thick diam m4wdth-m4thick bp__ m4BG
@@ -144,18 +144,18 @@
line thick m4thick*0.6 from C+(Rect_(C.rad+m4thick bp__*3/4,138)) \
to C+(Rect_(C.rad+m4thick bp__*3/4,130)) then right m4thick bp__ m4BG
idiam = (m4wdth-m4thick bp__*2)*47/(27+47*2)
- N: circle diam idiam thick m4inthick with .n at C.n-(0,m4thick bp__/2) m4N
- S: circle diam idiam thick m4inthick with .s at C.s+(0,m4thick bp__/2) m4S
- E: circle diam idiam thick m4inthick at Cintersect(N,N.diam,S,S.diam) m4DCminus
- W: circle diam idiam thick m4inthick at Cintersect(S,S.diam,N,N.diam) m4DCplus
+ N: circle diam idiam thick m4thickin with .n at C.n-(0,m4thick bp__/2) m4N
+ S: circle diam idiam thick m4thickin with .s at C.s+(0,m4thick bp__/2) m4S
+ E: circle diam idiam thick m4thickin at Cintersect(N,N.diam,S,S.diam) m4DCminus
+ W: circle diam idiam thick m4thickin at Cintersect(S,S.diam,N,N.diam) m4DCplus
foreach_(`Z',
- `line thick m4inthick up Z.diam*0.6 right Z.diam*0.6 with .c at Z
- line thick m4inthick up Z.diam*0.6 left Z.diam*0.6 with .c at Z',N,S)
+ `line thick m4thickin up Z.diam*0.6 right Z.diam*0.6 with .c at Z
+ line thick m4thickin up Z.diam*0.6 left Z.diam*0.6 with .c at Z',N,S)
foreach_(`L',`L: circle diam idiam/4 thick linethick/2 \
at N+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',FG,NC,DCP,SS1)
foreach_(`L',`L: circle diam idiam/4 thick linethick/2 \
at S+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',PP,CL,SS2,CH)
- `$3' popdef(`m4sk',`m4wdth',`m4thick',`m4inthick',`m4BG',
+ `$3' popdef(`m4sk',`m4wdth',`m4thick',`m4thickin',`m4BG',
`m4DCplus',`m4DCminus',`m4N',`m4S',
`m4FG',`m4NC',`m4SS1',`m4DCP',`m4PP',`m4CL',`m4CH',`m4SS2') ]')
@@ -173,7 +173,7 @@
Gndinner=attributes;
PP=attributes;
CP=attributes; '
-define(`EV_NAC',`[ pushkeys_(`$1', `wdth:1.6; diamL:m4wdth*0.28; BG::N;
+define(`EV_NAC',`[ pushkeys_(`$1', `wdth:1.6; diamL:m4`'wdth*0.28; BG::N;
L1::N; L1inner::N; L2::N; L2inner::N; Gndinner::N; inner::N;
Gnd::N; PP::N; CP::N; ')
sN = 1/pEVskale*m4wdth/1.6 # drawing coord scale factor
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/GeometryDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/GeometryDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/GeometryDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -145,7 +145,7 @@
Y: LCintersect(HZ,CC4,C4.rad,R); "Y" at Y above
X: LCintersect(HZ,CC2,C2.rad); "X" at X above rjust
- Loopover_(`P',`dot(at P)',X,Y,Z)
+ foreach_(`P',`dot(at P)',X,Y,Z)
line dashed from X to Y chop -linewid/2
RightAngle(A,Z,Y)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Makefile 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Makefile 2024-05-30 19:57:12 UTC (rev 71389)
@@ -4,9 +4,9 @@
M4LIBS = svg.m4 DPVconfig.m4
M4LIBS = svg.m4
M4 = m4
-# PDFCONVERT = pdf2svg
+PDFCONVERT = pdf2svg
# The current dvisvgm outputs CRLF line endings
-PDFCONVERT = dvisvgm
+# PDFCONVERT = dvisvgm
# To process a single file, copy it to test.m4 and type "make tst"
# to produce tstDPV.html
@@ -17,6 +17,10 @@
#DPIC = ../dpic/bison/dpic
#DPIC = ../dpic/bi*dev/dpic
+# Quiet mode for MiKTeX or texlive
+# QLATEX = latex --quiet
+QLATEX = latex -interaction=batchmode
+
# To test the Windows executable. Change these as needed for the operating
# system. NOTE: cscDPV.m4 and Connectors.m4 use awk and sed which
# do not work at present with the Windows version.
@@ -41,13 +45,15 @@
echo "\begin{document}" >> F_$*.tex
echo "\input $*.tex" >> F_$*.tex
echo "\end{document}" >> F_$*.tex
- pdflatex --quiet F_$*
+ pdf$(QLATEX) F_$*
$(M4) pgf.m4 F_$*.dim $*.m4 > $*.pic
$(DPIC) -g $*.pic >> $*.tex
- pdflatex --quiet F_$*
+ pdf$(QLATEX) F_$*
if test "$(PDFCONVERT)" = "pdf2svg" ; then \
+ echo "Using pdf2svg" ; \
pdf2svg F_$*.pdf $*.xsvg && cat $*.xsvg | tr -d '\r' > $*.svg ; \
else \
+ echo "Using dvisvgm" ; \
dvisvgm --pdf F_$*.pdf && cat F_$**.svg | tr -d '\r' > $*.svg ; \
cp $*.svg $*.xsvg ; \
fi
@@ -72,14 +78,14 @@
NLGDPV.svg NPDTDPV.svg NportDPV.svg OpampDPV.svg OptoisoDPV.svg \
PconnDPV.svg PlateDPV.svg PushPullDPV.svg QuantumDPV.svg \
RectifiersDPV.svg RelayDPV.svg ResistorsDPV.svg RotboxDPV.svg\
- SchottkyDPV.svg ShiftRDPV.svg SierpinskiDPV.svg \
- SixpoleDPV.svg SourcesDPV.svg SQUIDDPV.svg SwitchesDPV.svg \
+ SchottkyDPV.svg SevensegmentDPV.svg ShiftRDPV.svg SierpinskiDPV.svg \
+ SixpoleDPV.svg SourcesDPV.svg Spec555DPV.svg SwitchesDPV.svg \
TTLnandDPV.svg TgateDPV.svg ThreeDPV.svg \
TubediagsDPV.svg VariableDPV.svg WindingsDPV.svg XformDPV.svg \
- controlDPV.svg cscDPV.svg diamondDPV.svg ex00DPV.svg \
+ cbresistorDPV.svg controlDPV.svg cscDPV.svg diamondDPV.svg \
ex01DPV.svg ex02DPV.svg ex03DPV.svg ex04DPV.svg ex05DPV.svg ex06DPV.svg \
ex08DPV.svg ex09DPV.svg ex10DPV.svg ex11DPV.svg ex12DPV.svg \
- ex15DPV.svg ex16DPV.svg ex17DPV.svg ex18DPV.svg ex21DPV.svg \
+ ex15DPV.svg ex16DPV.svg ex18DPV.svg ex21DPV.svg \
expDPV.svg fetDPV.svg graysurfDPV.svg keyboardDPV.svg lcctDPV.svg \
pwrsupplyDPV.svg quickDPV.svg randomDPV.svg recycleDPV.svg relaycoilDPV.svg \
roseDPV.svg sfgDPV.svg shapesDPV.svg SmithchartDPV.svg paletteDPV.svg \
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/QuantumDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/QuantumDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/QuantumDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -17,6 +17,7 @@
arc cw from C+(-r,0) to C+(r,0) with .c at C
arrow from C+(-r/4,0) to C+(0.9*r,0.9*r) ]')
+[
X: Bus(,shaded rgbstring(0.5,0.5,1) "X")
A1: Bus(from X.start+(0,-boxht*3/2), shaded "red" "A")
A2: Bus(from 2 between X.start and A1.start, shaded "red" "A")
@@ -27,5 +28,27 @@
Meter with .e at X.end
box wid boxwid*1.2 ht boxht*1.2 fill_(1) at A2.end-(4.5*boxwid,0) \
"svg_it(R)svg_sub(svg_psi)svg_sup(svg_pi/2,,,-1.2ex)"
+ ]
+#.PE
+#.PS
+# SQUIDDPV.m4
+[
+cct_init(svg_font(sans-serif,11bp__))
+
+down_
+S1: SQUID
+ "J1" at S1.J1 above rjust wid 15bp__
+ "J2" at S1.J2 above ljust
+
+S2: SQUID(3,dimen_*1.5,-120) at S1.e+(elen_,0)
+ "J1" at S2.J1 above rjust
+ "J2" at S2.J2 below ljust
+ "J3" at S2.J3 above ljust
+ arcrad = S2.C.rad*0.7
+ arc from S2.c+(Rect_(arcrad,-135)) to S2.c+(Rect_(arcrad,-45)) \
+ with .c at S2.C ->
+ ] with .w at last [].e+(boxht,0)
+
+ command "</g>" # end font
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ResistorsDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ResistorsDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ResistorsDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -2,46 +2,37 @@
# `ResistorsDPV.m4'
cct_init(svg_font(sans-serif,11pt__))
textwid = 1.5
+
movewid = 2 pt__
hm = 2.1
vm = 0.28
-
-hm = 2.05
-vm = 0.28
{
{resistor ; move ; svgLink(NportDPV.svg,"`resistor'" ljust)}
move right_ hm
- {resistor(,,Q) ; move ; "`resistor(,,Q) '" ljust}
+ {resistor(,5,Q) ; move ;"`...(,5,Q) '" ljust}
move right_ hm
- {resistor(,,V) ; move ; "`resistor(,,V) '" ljust}
+ {resistor(,,V) ; move ;"`...(,,V)'" ljust}
}
move down vm; right_
-{
- {resistor(,,ES) ; move ; "`resistor(,,ES) '" ljust}
+{ {resistor(,,ES) ; move ;"`...(,,ES) '" ljust}
move right_ hm
- {resistor(,,H) ; move ; "`resistor(,,H) '" ljust}
+ {resistor(,4,H) ; move ;"`...(,4,H) '" ljust}
move right_ hm
- {resistor(,,AC) ; move ; "`resistor(,,AC) '" ljust}
+ {resistor(,,AC) ; move ;"`...(,,AC)'" ljust}
}
move down vm; right_
-{
- {resistor(,5,B) ; move ; "`resistor(,5,B) '" ljust}
+{ {resistor(,,B) ; move ;"`...(,,B)'" ljust}
move right_ hm
- {resistor(,,E) ; move
- "`resistor(,,E)'" ljust " svg_equiv `ebox'" ljust}
+ {resistor(,,F) ; move ;"`...(,,F) '" ljust}
move right_ hm
- {ebox(,0.5,0.3) ; move ;"`ebox(,0.5,0.3) '" ljust}
+ {resistor(,,E) ; move ;"`...(,,E) svg_equiv ebox'" ljust}
}
- move down vm; right_
-{
- {ebox(,,,0.6) ; move ; "`ebox(,,,0.6) '" ljust}
+ move down vm*1.1; right_
+{ {ebox(,,,0.9) ; move ;"`ebox(,,,0.9)'" ljust}
move right_ hm
- {ebox(,,,,shaded "yellow") ; move ;"`ebox(,,,,shaded \"yellow\") '" ljust}
-}
- move down vm; right_
-{
{ebox(,wdth=0.2;box=dashed shaded "green";text="X") ; move
- "`ebox(,wdth=0.2;box=dashed shaded \"green\";text=\"X\")'" ljust}
+ "`ebox(,wdth=0.2;box=dashed shaded \"green\";'" ljust \
+ "`text=\"X\")'" ljust}
}
command "</g>" # end font
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SQUIDDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SQUIDDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SQUIDDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,19 +0,0 @@
-.PS
-# SQUIDDPV.m4
-cct_init(svg_font(sans-serif,11bp__))
-
-down_
-S1: SQUID
- "J1" at S1.J1 above rjust wid 15bp__
- "J2" at S1.J2 above ljust
-
-S2: SQUID(3,dimen_*1.5,-120) at S1.e+(elen_,0)
- "J1" at S2.J1 above rjust
- "J2" at S2.J2 below ljust
- "J3" at S2.J3 above ljust
- arcrad = S2.C.rad*0.7
- arc from S2.c+(Rect_(arcrad,-135)) to S2.c+(Rect_(arcrad,-45)) \
- with .c at S2.C ->
-
- command "</g>" # end font
-.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SevensegmentDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SevensegmentDPV.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SevensegmentDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,82 @@
+.PS
+# Sevensegment.m4
+# https://tex.stackexchange.com/questions/644009/seven-segments-anchors-how-to-use-them
+gen_init
+divert(-1)
+ `sevensegment(keys)
+ Seven-segment display in a [] block. keys:
+ hght=expr; (default boxht)
+ wdth=expr; (default hght*3.3/5.85)
+ slant=fraction; top is skewed slant fraction of ht
+ segwid=expr; segment width
+ gap=expr; gap between segments
+ bevel=fraction; corner truncation
+ on=attributes; "on" segment attributes
+ off=attributes; "off" segment attributes
+ code=[0-8][.]; displayed number .=decimal point
+ or
+ code=Xddddddd[.] where each d=0 or 1 to define
+ Segment1 to Segment7 off or on
+ Segments are labeled Seg1 Seg2 ... Seg7
+ and the decimal point is Seg8'
+define(`sevensegment', # hght, wdth, slant, segwid, gap, bevel, on, off, code
+ `[ pushkeys_(`$1',`hght:boxht; wdth:m4`'hght*3.3/5.85; slant:0;
+ segwid:0.75/3.2*m4`'wdth; gap:0.12/3.2*m4`'wdth; bevel:0.4;
+ on:outlined "red" shaded "red":N; off:outlined "lightgray":N;
+ code:00000010:N;')
+ gapch = m4gap/2*sqrt(2)
+ ifinstr(m4code,.,`define(`m4tmp',substr(m4code,0,decr(len(m4code))))dnl
+ pushdef(`dodp',1)poppushdef(`m4code',m4tmp)')dnl
+ ifinstr(m4code,X,`pushdef(`opcode',substr(m4code,1))',
+ `foreach_(`m4cd',`pushdef(`Cd'decr(m4Lx),m4cd)',1111110,0110000,1101101,
+ 1111001,0110011,1011011,1011111,1110000,1111111,1111011)dnl
+ pushdef(`opcode',Cd`'m4code)')dnl
+ for_(1,7,1,`pushdef(`attrib'm4x,
+ ifelse(substr(opcode,decr(m4x),1),1,`m4on',`m4off'))')dnl
+ Seg1: m4segment(R,m4bevel,m4bevel,attrib1) \
+ with .S at m4slu(0,m4hght-m4segwid)
+ inner = distance(Seg1.SW,Seg1.SE) + gapch*2
+ Seg2: m4segment(D,0.5,m4bevel,attrib2) with .S at \
+ m4slu(m4wdth/2-m4segwid,m4hght-m4segwid-inner/2)
+ Seg3: m4segment(D,m4bevel,0.5,attrib3) with .S at \
+ m4slu(m4wdth/2-m4segwid,m4segwid+inner/2)
+ Seg4: m4segment(L,m4bevel,m4bevel,attrib4) with .S at m4slu(0,m4segwid)
+ Seg5: m4segment(U,0.5,m4bevel,attrib5) with .S at \
+ m4slu(-m4wdth/2+m4segwid,m4segwid+inner/2)
+ Seg6: m4segment(U,m4bevel,0.5,attrib6) with .S at \
+ m4slu(-m4wdth/2+m4segwid,m4hght-m4segwid-inner/2)
+ Seg7: m4segment(R,0.5,0.5,attrib7) with .c at m4slu(0,m4hght/2)
+ ifelse(dodp,1,`Seg8: circle diam m4segwid m4on \
+ at m4slu(Seg3.e.x+m4segwid/2+m4gap,Seg4.s.y+m4segwid/2)') popdef(`dodp')
+ popdef(`m4hght',`m4wdth',`m4slant',`m4segwid',`m4gap',`m4bevel',
+ `m4on',`m4off',`m4code',`opcode')dnl
+ for_(1,7,1,`popdef(`attrib'm4x)') for_(0,9,1,`popdef(`Cd'm4x)')dnl
+ ]')
+define(`m4segment',`[ setdir_(`$1')
+ m4seven_pos(SE,E,NE,,`$2'); m4seven_pos(SW,W,NW,-,`$3')
+ resetdir_
+ S: 1/2 between SW and SE
+ Line: line from m4slu(S.x,S.y) to m4slu(SE.x,SE.y) then to m4slu(E.x,E.y) \
+ then to m4slu(NE.x,NE.y) then to m4slu(NW.x,NW.y) then to m4slu(W.x,W.y) \
+ then to m4slu(SW.x,SW.y) then to m4slu(S.x,S.y) `$4' ] ')
+define(`m4seven_pos',
+ `AA: (`$4'(m4wdth/2-m4segwid-gapch),0); `$1': rot_(AA.x,AA.y,rp_ang)
+ BA: AA + (`$4'1,1)*m4segwid*(1-`$5'); `$2': rot_(BA.x,BA.y,rp_ang)
+ CA: BA - (`$4'1,-1)*m4segwid*`$5'; `$3': rot_(CA.x,CA.y,rp_ang) ')
+define(`m4slu',`(`$1'+(`$2')*m4slant,`$2')')
+
+divert(0)dnl
+
+
+[
+ S: sevensegment(code=4.;hght=1)
+ { for_(1,8,1,`"m4x" at S.Seg`'m4x') }
+ move right 0.25
+ P: sevensegment(code=X1100011;off=invis;hght=1)
+ ]
+[
+ for_(0,9,1,`sevensegment(code=m4x`'ifelse(m4x,1,.);slant=1/4;off=invis)
+ move movewid/4')
+ ] with .nw at last [].sw+(0,-boxht/3)
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SevensegmentDPV.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SourcesDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SourcesDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/SourcesDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -8,51 +8,57 @@
{
{source ; move ; "`source'" ljust} NL
{source(,I) ; move ; "`source(,I)'" ljust} NL
- {source(,i) ; move ; "`source(,i)'" ljust} NL
- {source(,ti) ; move ; "`source(,ti)'" ljust} NL
- {source(,i) ; move ; "`source(,ii)'" ljust} NL
+ {C:source(,i) ; move ; "`source(,i)'" ljust} NL
+ {D:source(,ti) ; move ; "`source(,ti)'" ljust} NL
+ {source(,ii) ; move ; "`source(,ii)'" ljust} NL
{source(,V) ; move ; "`source(,V)'" ljust} NL
{source(,v) ; move ; "`source(,v)'" ljust} NL
{source(,tv) ; move ; "`source(,tv)'" ljust} NL
+ {source(,SC) ; move ; "`source(,SC)'" ljust} NL
{source(,AC); move ; "`source(,AC)'" ljust} NL
{source(,X) ; move ; "`source(,X)'" ljust} NL
+ {source(,G) ; move ; "`source(,G)'" ljust} NL
+ {source(,Q) ; move ; "`source(,Q)'" ljust} NL #(0.3)
{source(,F) ; move ; "`source(,F)'" ljust} NL
- {source(,G) ; move ; "`source(,G)'" ljust} NL
- {source(,Q) ; move ; "`source(,Q)'" ljust}
+ {geiger(,,,,fill_(0.9)); move;
+ "`geiger(,,,,'" ljust "`fill_(0.9))'" ljust} NL
}
move right_ 2.0
+
{
-# {source(,,0.4) ; move ; "`source(,,0.4)'" ljust} NL(0.35)
{source(,,0.4,,shaded "yellow") ; move ;
- "`source(,,0.4,," ljust "shaded \"yellow\")'" ljust} NL(0.35)
-# {source(,P) ; move ; "`source(,P)'" ljust} NL
- {source(,P,,,fill_(0.9)) ; move ;
- "`source(,P,,," ljust "fill_(0.9))'" ljust} NL
+ "`source(,,0.4,,'" ljust "`shaded \"yellow\")'" ljust} NL(0.35)
+ {source(,P) ; move ; "`source(,P)'" ljust} NL
{source(,U) ; move ; "`source(,U)'" ljust} NL
{source(,H) ; move ; "`source(,H)'" ljust} NL
{source(,R) ; move ; "`source(,R)'" ljust} NL
{source(,S) ; move ; "`source(,S)'" ljust} NL
+ {source(,SCr) ; move ; "`source(,SCr)'" ljust} NL
{source(,T) ; move ; "`source(,T)'" ljust} NL
{source(,L) ; move ; "`source(,L)'" ljust} NL
- {source(,B) ; move ; "`source(,B)'" ljust} NL
+ {source(,B) ; move ; "`source(,B)'" ljust} NL(moveht*0.8)
{nullator ; move ; "`nullator'" ljust} NL(moveht*0.8)
{norator ; move ; "`norator'" ljust} NL(moveht*0.9)
{ttmotor(,G) ; move ; "`ttmotor(,G)'" ljust} NL(moveht*1.1)
- {proximity ; move ; "`proximity" ljust "= consource(,P)'" ljust}
+ {battery ; move ; "`battery'" ljust} NL(0.3)
+ {battery(,3,R) ; move ; "`battery(,3,R)'" ljust}
+
}
move right_ 2.0
{source(,N) ; move ; "`source(,N)'" ljust} NL
- {source(,"svg_micro(A)"); move; "`source(,\"svg_micro(A)\")'" \
- wid 1.7 at Here ljust}NL(0.31)
- {consource ; move ; "`consource'" ljust } NL(0.32)
+ {source(,NA) ; move ; "`source(,NA)'" ljust} NL
+ {source(,NB) ; move ; "`source(,NB)'" ljust} NL
+ {source(,"mA");move; "`source(,\"mA\")'" ljust} NL(0.31)
+ {consource ; move ; "`consource'" ljust} NL(0.32)
{consource(,I) ; move ; "`consource(,I)'" ljust} NL(0.32)
{consource(,i) ; move ; "`consource(,i)'" ljust} NL(0.32)
{consource(,ti) ; move ; "`consource(,ti)'" ljust} NL(0.32)
+ {source(,SE) ; move ; "`source(,SE)'" ljust} NL
{consource(,V) ; move ; "`consource(,V)'" ljust} NL(0.32)
{consource(,v) ; move ; "`consource(,v)'" ljust} NL(0.3)
{consource(,tv) ; move ; "`consource(,tv)'" ljust} NL(0.3)
- {battery ; move ; "`battery'" ljust} NL(0.3)
- {battery(,3,R) ; move ; "`battery(,3,R)'" ljust} NL(0.35)
+ {proximity ; move ;
+ "`proximity'" ljust "` = consource(,P)'" wid 80bp__ ljust} NL(0.35)
command "</g>" # end font
.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Spec555DPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Spec555DPV.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Spec555DPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,57 @@
+.PS
+# Spec555.m4
+# https://tex.stackexchange.com/questions/64801/display-ics-with-circuitikz?rq=1
+log_init
+
+define(`spec555',`[ Chip: box wid 8*lg_pinsep ht 10*lg_pinsep fill_(0.9)
+ svg_font(sans-serif,8bp__)
+ P1: 3/4<Chip.sw,Chip.se>; {"1" below rjust at P1}; "GND" above at P1
+ P5: Chip.s; {"5" below rjust at P5}; "CTRL" above at P5
+ P2: 1/8<Chip.sw,Chip.nw>; {"2" above rjust at P2}; "TRG" ljust at P2
+ P6: 3/8<Chip.sw,Chip.nw>; {"6" above rjust at P6}; "THR" ljust at P6
+ P7: 7/8<Chip.sw,Chip.nw>; {"7" above rjust at P7}; "DIS" ljust at P7
+ P3: Chip.e; {"3" above ljust at P3}; "OUT" rjust at P3
+ P4: 3/4<Chip.nw,Chip.ne>; {"4" above rjust at P4}; "svg_emsp`'RESET" below \
+ at P4
+ P8: Chip.n; {"8" above rjust at P8}; "Vcc" below at P8
+ "NE-555" at Chip.c "TIMER"
+ command "</g>"
+ line left dimen_ from P7; X:dot
+ { R1:resistor(up_ P7.y-P6.y); rlabel(,68 k`'svg_ohm); dot }
+ R2:resistor(down_ P7.y-P6.y); llabel(,68 k`'svg_ohm); dot; {line to P6}
+ line to (Here,P2); SW: dot; {line to P2}
+ line from P8 to (P8,R1.end); dot ]')
+
+ svg_font(sans-serif,10bp__)
+ T1: spec555; "U1" at T1.Chip.nw above ljust
+ T2: spec555 with .Chip.w at T1.Chip.e+(2.5*dimen_,0)
+ "U2" at T2.Chip.nw above ljust
+ {line left_ dimen_/2 from (T1.X,T1.P7); diode(down_ T1.P7.y-T1.P6.y)
+ {"D1" wid 15bp__ rjust at last [].w "1N4148" rjust wid 36bp__}
+ line to (T1.X,Here); dot}
+ capacitor(down_ elen_*1.2 from T1.SW,E+); llabel(,10 uF); dot
+ dot(at Here-(dimen_/2,0),,1); G: dot(,,1); "GND" rjust at G.w
+ capacitor(from T1.P5 to (T1.P5,G),E+); rlabel(,0.01 nF); dot
+ line from T1.P1 to (T1.P1,G); dot
+ Vcc: dot(at (G,T1.R1.end),,1); "Vcc" wid 0.3 rjust at Vcc.w
+ dot(at (T1.P4,Vcc)); line to T1.P4
+ line right_ dimen_/2 from T1.P3;
+ R3: resistor(down_ to (Here,T2.s-(0,dimen_/4))); llabel(,10 k`'svg_ohm)
+ line to (T2.P5,Here) then to T2.P5
+ dot(at (T2.X,G)); ground
+ reversed(`capacitor',up_ to (Here,T2.P5),E+); rlabel(,100 nF)
+ line to (Here,T2.P2)
+ line from T2.P1 to (T2.P1,G); dot
+ line from T2.P4 to (T2.P4,Vcc) then to Vcc chop 0 chop dotrad_
+ dot(at (T2.X,T2.R1.end)+(0,dimen_/2),,1); {line to T2.R1.end chop dotrad_}
+ "+5 V to +15V" at last [].n above
+ capacitor(right_ dimen_ from T2.P3,C); llabel(," 100 uF")
+ Pot1: potentiometer(down_ (Here.y-G.y)/2) with .Start at Here
+ "Rx" wid 0.2 at Pot1.T1 ljust
+ Sp: speaker(R,,,fill_(0.9)) with .In5 at Pot1.End
+ "1" above rjust at Sp.In5; "2" below rjust at Sp.In7
+ "E1" at Sp.In2 rjust "Speaker" rjust
+ line from Sp.In7 to (Sp.In7,G) then to G chop 0 chop dotrad_
+ command "</g>"
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/Spec555DPV.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/cbresistorDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/cbresistorDPV.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/cbresistorDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,82 @@
+.PS
+# cbresistor.m4
+# https://tex.stackexchange.com/questions/709339/create-command-with-decoration-in-tikz
+# https://www.google.com/search?client=firefox-b-d&q=resistor+color+code
+cct_init
+divert(-1)
+
+ `cbresistor(linespec, keys)
+ keys:
+ lgth=expr; wdth=expr;
+ body=body attributes, e.g. shaded "green"
+ type=A|B; pinched body shape
+ colors=color:color:...;
+ Up to 6 colors, a color may be nul '
+define(`cbresistor',`eleminit_(`$1')
+ pushkeys_(`$2',`lgth:dimen_/2; wdth:dimen_/5; body::N; colors::N; type::N')dnl
+{line to rvec_(max(0,rp_len/2-m4lgth/2),0) thick linethick*3/2; M4cbW: Here
+ ifelse(m4type,B,
+ `[L:rotbox(m4lgth*3/23, m4wdth, shaded "darkgray" m4body,r=m4wdth/20)
+ C:rotbox(m4lgth*17/23, m4wdth*9/10, shaded "darkgray" m4body) \
+ with .W at L.E
+ R:rotbox(m4lgth*3/23, m4wdth, shaded "darkgray" m4body,r=m4wdth/20) \
+ with .W at C.E] with .L.W at Here; move to last [].R.E',
+ `rotbox(m4lgth, m4wdth, shaded "darkgray" m4body) with .W at Here')
+ ifelse(m4colors,,,`define(`m4bw',(m4lgth/23))dnl
+ definergbcolor(silver,0.75,0.75,0.75)
+ definergbcolor(gold,1,215/255,0)
+ stacksplit_(`cbrstack',m4colors,:)stackreverse_(`cbrstack')dnl
+ stackargs_(`m4pos',22,17,12,7,5,2)dnl
+ stackdo_(`cbrstack',`ifelse(cbrstack,nul,,
+ `{ move to M4cbW+vec_(m4pos*m4bw-m4bw/2,0)
+ define(`m4ctr',ifelse(m4type,B,eval((m4pos>3)*(m4pos<20)),0))dnl
+ line m4colorfix(outlined,cbrstack) thick m4bw*1.8/(1bp__) \
+ from rvec_(0,-ifelse(m4ctr,1,0.9*)m4wdth/2) \
+ to rvec_(0, ifelse(m4ctr,1,0.9*)m4wdth/2)
+ ifelse(ifelse(cbrstack,silver,1,cbrstack,gold,1),1,
+ `line outlined rgbstring(0.8,0.8,0.8) thick last line.thick \
+ from 0.2 along_(last line) to 0.4 along_(last line)
+ line outlined "white" thick last line.thick \
+ from 0.25 along_(2nd last line) to 0.3 along_(2nd last line)')
+ }')
+ popdef(`m4pos')') stackdo_(`m4pos')')
+ line to rvec_(max(0,rp_len/2-m4lgth/2),0) thick linethick*3/2}
+ popdef(`m4lgth',`m4wdth',`m4body',`m4colors',`m4type')dnl
+ line to rvec_(rp_len,0) invis ')
+
+divert(0)dnl
+
+linewid = 3/2*linewid
+ifsvg(definergbcolor(Dandelion,0.95,0.65,0.2))
+ifsvg(definergbcolor(Peach,0.76,0.5,0.1))
+
+define(`dpr',
+ `{ cbresistor(,type=B;
+ body=m4colorfix(shaded,Dandelion) m4colorfix(outlined,Peach);
+ colors=`$2') }
+ {iflatex(`sprintf("\SI{%g}{\ohm}",`$1')')ifsvg("``$1'svg_Omega'") \
+ at last line.end+(10bp__,-5bp__) rjust}
+ move right_ moveht*5/6; down_ ')
+
+ define(`elen_',(3/2*linewid))
+ define(`dimen_',(5/4*linewid))
+[]
+[ down_
+ foreach_(`pair',`dpr(patsubst(pair,-,`,'):nul:black:silver)',
+ 10-brown:black,
+ 12-brown:red,
+ 15-brown:green,
+ 18-brown:gray,
+ 22-red:red,
+ 27-red:Violet,
+ 33-orange:orange,
+ 39-orange:white,
+ 47-yellow:Violet,
+ 56-green:blue,
+ 68-blue:gray,
+ 82-gray:red)
+ dpr(100,brown:black:nul:brown:gold)
+ {"iflatex(\SI{5}{\percent},5 %)" at last line.end+(10bp__,-15bp__) rjust}
+ ] with .nw at last [].ne+(30bp__,0)
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/cbresistorDPV.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ex00DPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ex00DPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/ex00DPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,94 +0,0 @@
-.PS
-# ex00.m4
-gen_init(svg_font(sans-serif,11bp__))
-
-[
-thicklines_
-ewid = 2
-eht = 0.5
-E: ellipse wid ewid ht eht
-
- [ narrows = 5
- de = ewid/narrows
- for i=0 to narrows do {
- arrow down from i*de,0 }
- ] with .s at E.n+(0,0.25)
-
- "svg_bf(B)svg_it((t))" at last [].c
-
-thinlines_
- arrow from E.c to E.ne
- box invis fill_(1) ht 0.12 wid 0.12 with .c at last arrow.c "svg_it(r)"
-
- command "</g>" # end font
-]
-[
-# ex07.m4
-#gen_init
-
-Barrel: box invis ht 0.4 wid 1.5
- up
-Face: arc rad 2.6 from Barrel.e+(2.4,-1.7/2) to Barrel.e+(2.4,1.7/2)
-
- eps = 0.03
- arc ccw rad 2.6 from Face.start-(eps,0) to Face.end-(eps,0) \
- with .c at Face.c-(eps,0)
- line from Barrel.nw to Barrel.ne then to Face.end
- line from Barrel.sw to Barrel.se then to Face.start
- arc cw from Barrel.sw to Barrel.nw rad Barrel.ht*1.2
-
-Cathode: Barrel.w+(0.3,0)
-Term: Barrel.w+(-0.25,0)
- dcath = 0.13
- dan = 0.12
-
- line from Cathode up dcath/2 left dcath/2 then to Term.x,Cathode.y+dcath/2
- dot
- line from Cathode down dcath/2 left dcath/2 then to Term.x,Cathode.y-dcath/2
- dot
-
- hole = 0.06
-Hole: line invis up hole from Cathode+(0.5,-hole/2)
- line from Hole.end up dan-hole/2 then to Term.x,Cathode.y+dan; dot
- line from Hole.start down dan-hole/2 then to Term.x,Cathode.y-dan; dot
-
- platewid = 0.25
- platesep = 0.15
-Plates: box invis wid platewid ht platesep at Barrel.e+(-platewid/2,0)
- line right platewid from Plates.nw
- line right platewid from Plates.sw
- line up 0.3 from Plates.n
- line down 0.3 from Plates.s
-
-linethick_(1.4)
-
- move to Cathode+(0.03,0)
-Spot: 0.9<Face.start,Face.end>
- arcto(Plates.c,Spot,(Plates.c.x-Cathode.x)*0.90,outlined "lightgrey" thick 2)
- line to Spot chop 0 chop -0.02 outlined "lightgrey" thick 2
-
-thinlines_
-
- arrow <- from Cathode+(0.2,0.06) up 0.5 left 0.3
- "electron" above "gun" above
-
- arrow <- from Plates.nw+(0,0.06) up 0.5 left 0.3
- "deflection" above "plates" above
-
- arrow <- from 0.5<Plates.e,Spot>+(0,0.06) up 0.5 left 0.3
- "electron beam" at Here+(-0.3,0) above
-
- spline <- from 1.015<Plates.e,Spot> right 0.1 up 0.1 then up 0.1 \
- then up 0.1 left 0.1
- "spot of light" rjust
-
- "vacuum" at 0.5<Face.start,Face.end>+(-0.4,0) rjust
-
- arrow <- from Face.start+(0.1,0.5) left 0.6*1.4 down 0.3*1.4
- "phosphor coating" rjust
-
- arrow <- from 0.2<Barrel.se,Face.start> left 0.6 down 0.3
- "glass enclosure (tube)" rjust
-
-] with .sw at last [].se+(0.5,0)
-.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPV.htmx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPV.htmx 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPV.htmx 2024-05-30 19:57:12 UTC (rev 71389)
@@ -71,18 +71,13 @@
<hr>
<p>
- This file shows diagrams in .svg format produced without the use of
- LaTeX or equivalent.
-<!--
- <A HREF="examples.html">png</A>
- versions are also available.
- The PDF equivalent can be found in examples.pdf of the distribution.
+ This file shows diagrams in .svg format produced
+ without the use of LaTeX or equivalent.
+ The diagrams have been selected and adapted from the Circuit_macros
+ examples in order to test the svg output of dpic.
</p>
-
<p>
--->
-The diagrams have been adapted from the Circuit_macros
-examples in order to test the svg output of dpic. Generating svg line
+Generating svg line
art is straightforward but formatting text is not because TeX, LaTeX,
and related word processors do not produce svg directly. Either
less-sophisticated text formatting must be employed for svg or an
@@ -136,7 +131,8 @@
Change font face and dpic m4tt`'textht</g>, m4tt`'dptextratio</g>,
and m4tt`'textoffset</g> parameters.
If arg4 is blank, the font is changed and
- requires m4tt`'command "</g>"</g> to cancel the font change.
+ requires m4tt`'command "</g>"</g> at the end
+ to cancel the font change.
<br>
Note:
Nominal height = text height in drawing units; actual height =
@@ -305,7 +301,8 @@
<br><br>
(<a href="quick.txt" TYPE="text/plain" TARGET="_blank"
alt="quick">quick.m4</a>):
-SVG produced from quick.pdf by dvisvgm changecom(,)&`#'8194;changecom(`#')
+SVG produced from quick.pdf by dvisvgm or pdf2svg
+ changecom(,)&`#'8194;changecom(`#')
</p>
</td>
</table>
@@ -390,6 +387,9 @@
cfig(PconnDPV,
The m4tt`'pconnex</g> macro)
+cfig(cbresistorDPV,
+ Color-coded through-hole resistors)
+
cfig(EVplugsDPV,
Electric vehicle charging plug patterns make extensive
use of key=value pairs to set options)
@@ -430,6 +430,9 @@
The macro
m4tt`'winding(L|R`,'diam`,'pitch`,'turns`,'core wid`,'core color)</g>)
+cfig(Spec555DPV,
+ A 555 timer example)
+
cfig(ex01DPV,
Two simple labeled circuits)
@@ -448,9 +451,6 @@
cfig(QuantumDPV,
A quantum circuit)
-cfig(SQUIDDPV,
- Superconducting quantum interface device (drawing direction down))
-
cfig(SixpoleDPV,
A six-pole filter)
@@ -469,10 +469,6 @@
cfig(MCDPV,
A three-phase switched AC-AC converter and a DC-DC converter)
-cfig(ex17DPV,
- A repetitive network created by Pic looping and
- a skewed circuit used to test the macro m4tt`'parallel_</g>)
-
cfig(ex12DPV,
A CMOS NAND gate`,' a test circuit`,' and an XMOSFET example)
@@ -586,9 +582,6 @@
cfig(XORDPV,
Realizations of the XOR function using m4tt`'Autologix</g>)
-cfig(ex00DPV,
- Line diagrams)
-
cfig(EEPDPV,
Part of a single-line diagram of a power distribution system
using draft elements)
@@ -603,6 +596,10 @@
cfig(controlDPV,
Control-system block diagrams)
+cfig(SevensegmentDPV,
+ A customizable seven-segment display showing the numbered segments with
+ a custom shape and the numerals from 0 to 9)
+
cfig(ByteDPV,
Elementary splines)
@@ -690,7 +687,7 @@
More objects drawn in relief)
cfig(DiniDPV,
- Dini surface and an icosahedron)
+ Dini surface`,' an icosahedron`,' and a sphere with inscribed cylinder)
cfig(SierpinskiDPV,
The Sierpinski triangle and a Cayley graph:
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPVs.htmx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPVs.htmx 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/examplesDPVs.htmx 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,14 +1,3 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<HTML>
-<HEAD>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<!--meta http-equiv="Content-Script-Type" content="text/javascript"-->
-<TITLE>SVG Examples: Circuit_macros Version XXX</TITLE>
-<meta name="keywords" content="HTML"
-content='Circuit elements, basic circuits, logic circuits and other diagrams,
-electric circuits, resistor, capacitor, inductor, diode, sources, amplifier,
-integrator, fuse, switch, antenna, opamp, transformer, relay, contact, jack,
plug, FET, UJT, thyristor, bipolar transistor, nport, windings, timer,
optical isolator, rectifier, bistable, oscillator, CMOS, MOSFET, power supply,
NAND gate, controlled source, synchronous machine, digital circuit, signal-flow
@@ -132,7 +121,8 @@
Change font face and dpic m4tt`'textht</g>, m4tt`'dptextratio</g>,
and m4tt`'textoffset</g> parameters.
If arg4 is blank, the font is changed and
- requires m4tt`'command "</g>"</g> to cancel the font change.
+ requires m4tt`'command "</g>"</g> at the end
+ to cancel the font change.
<br>
Note:
Nominal height = text height in drawing units; actual height =
@@ -384,6 +374,9 @@
cfig(PconnDPV,
The m4tt`'pconnex</g> macro)
+cfig(cbresistorDPV,
+ Color-coded through-hole resistors)
+
cfig(EVplugsDPV,
Electric vehicle charging plug patterns make extensive
use of key=value pairs to set options)
@@ -448,9 +441,6 @@
cfig(QuantumDPV,
A quantum circuit)
-cfig(SQUIDDPV,
- Superconducting quantum interface device (drawing direction down))
-
cfig(SixpoleDPV,
A six-pole filter)
@@ -469,10 +459,6 @@
cfig(MCDPV,
A three-phase switched AC-AC converter and a DC-DC converter)
-cfig(ex17DPV,
- A repetitive network created by Pic looping and
- a skewed circuit used to test the macro m4tt`'parallel_</g>)
-
cfig(ex12DPV,
A CMOS NAND gate`,' a test circuit`,' and an XMOSFET example)
@@ -590,9 +576,6 @@
cfig(XORDPV,
Realizations of the XOR function using m4tt`'Autologix</g>)
-cfig(ex00DPV,
- Line diagrams)
-
')
cfig(EEPDPV,
Part of a single-line diagram of a power distribution system
@@ -613,6 +596,10 @@
cfig(ByteDPV,
Elementary splines)
+cfig(SevensegmentDPV,
+ A customizable seven-segment display showing the numbered segments with
+ a custom shape and the numerals from 0 to 9)
+
ifelse(0,1,`
cfig(RotboxDPV,
The macro
@@ -698,7 +685,7 @@
More objects drawn in relief)
cfig(DiniDPV,
- Dini surface and an icosahedron)
+ Dini surface`,' an icosahedron`,' and a sphere with inscribed cylinder)
cfig(SierpinskiDPV,
The Sierpinski triangle and a Cayley graph:
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/quickDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/quickDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/quickDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -4,18 +4,16 @@
elen = 0.75 # Variables are allowed; default units are inches
move right 0.4
-Origin: Here # Position names are capitalized
- svgLink(SourcesDPV.svg,source(up_ elen))
+ svgLink(SourcesDPV.svg,Vs: source(up_ elen))
llabel(-,svg_it(v`'svg_sub(s)),+)
svgLink(ResistorsDPV.svg,resistor(right_ elen)); rlabel(,svg_it(R),)
dot
{ # Save current position and direction
- capacitor(down_ to (Here,Origin)) #(Here,Origin) = (Here.x,Origin.y)
- rlabel(+,svg_it(v),-); llabel(,svg_it(C))
+ capacitor(down_ Vs.len); rlabel(+,svg_it(v),-); llabel(,svg_it(C))
dot
} # Restore position and direction
line right_ elen*2/3
{move right 0.2}
- inductor(down_ Here.y-Origin.y); rlabel(,svg_it(L),); b_current("svg_it(i)")
- line to Origin
+ inductor(down_ Vs.len); rlabel(,svg_it(L),); b_current("svg_it(i)")
+ line to (Vs,Here) # (Vs,Here) = (Vs.x,Here.y)
.PE # Pic input ends
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/relaycoilDPV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/relaycoilDPV.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/dpv/relaycoilDPV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,5 +1,5 @@
.PS
-# relaycoil.m4
+# relaycoilDPV.m4
cct_init
spc = dimen_/3
@@ -6,7 +6,8 @@
{ relaycoil; S: "svg_tt(`relaycoil')" at last [].s+(0,-20bp__)
{ "svg_it(V1)" wid 15bp__ at last [].V1 rjust
"svg_it(V2)" at last [].V2 ljust }
- K: relaycoil(NX) with .nw at last [].ne+(spc*4,0); "svg_tt((NX))" \
+ relaycoil(S) with .nw at last [].ne+(spc*2,0); "svg_tt((S))" at (last [],S)
+ K: relaycoil(NX) with .nw at last [].ne+(spc*3,0); "svg_tt((NX))" \
at (last [],S)
{ thinlines_
spline <- from K.A1 left 7bp__ then up 4bp__ left 4bp__
@@ -21,27 +22,30 @@
"svg_it(B3)" ljust
thicklines_
}
- relaycoil(AXSR) with .nw at last [].ne+(spc*5,0); "svg_tt((AXSR))" \
+ relaycoil(AXSR) with .nw at last [].ne+(spc*4,0); "svg_tt((AXSR))" \
at (last [],S)
{ "svg_it(V1)" at last [].V1 rjust; "svg_it(V2)" at last [].V2 rjust }
relaycoil(BXSR) with .nw at last [].ne+(spc*2,0); "svg_tt((BXSR))" \
at (last [],S)
{ "svg_it(V1)" at last [].V1 ljust; "svg_it(V2)" at last [].V2 ljust }
- relaycoil(SR) with .nw at last [].ne+(spc*4,0); "svg_tt((SR))" at (last [],S)
- relaycoil(SO) with .nw at last [].ne+(spc,0); "svg_tt((SO))" at (last [],S)
- relaycoil(SOR) with .nw at last [].ne+(spc,0); "svg_tt((SOR))" at (last [],S)
+ relaycoil(SR) with .nw at last [].ne+(spc*2,0); "svg_tt((SR))" at (last [],S)
+ spx = spc*3/4
+ relaycoil(SO) with .nw at last [].ne+(spx,0); "svg_tt((SO))" at (last [],S)
+ relaycoil(SOR) with .nw at last [].ne+(spx,0); "svg_tt((SOR))" at (last [],S)
+ relaycoil(PC) with .nw at last [].ne+(spx,0); "svg_tt((PC))" at (last [],S)
}
{
move down_ 3/4; right_
relaycoil(HS); S: "svg_tt((HS))" at last [].s+(0,-12bp__)
- relaycoil(NAC) with .nw at last [].ne+(spc,0); "svg_tt((NAC))" at (last [],S)
- relaycoil(AC) with .nw at last [].ne+(spc,0); "svg_tt((AC))" at (last [],S)
- relaycoil(ML) with .nw at last [].ne+(spc,0); "svg_tt((ML))" at (last [],S)
- relaycoil(PO) with .nw at last [].ne+(spc,0); "svg_tt((PO))" at (last [],S)
- relaycoil(RM) with .nw at last [].ne+(spc,0); "svg_tt((RM))" at (last [],S)
- relaycoil(RH) with .nw at last [].ne+(spc,0); "svg_tt((RH))" at (last [],S)
- relaycoil(TH) with .nw at last [].ne+(spc,0); "svg_tt((TH))" at (last [],S)
- relaycoil(EL) with .nw at last [].ne+(spc,0); "svg_tt((EL))" at (last [],S)
+ relaycoil(NAC) with .nw at last [].ne+(spx,0); "svg_tt((NAC))" at (last [],S)
+ relaycoil(AC) with .nw at last [].ne+(spx,0); "svg_tt((AC))" at (last [],S)
+ relaycoil(ML) with .nw at last [].ne+(spx,0); "svg_tt((ML))" at (last [],S)
+ relaycoil(PO) with .nw at last [].ne+(spx,0); "svg_tt((PO))" at (last [],S)
+ relaycoil(RM) with .nw at last [].ne+(spx,0); "svg_tt((RM))" at (last [],S)
+ relaycoil(RH) with .nw at last [].ne+(spx,0); "svg_tt((RH))" at (last [],S)
+ relaycoil(TH) with .nw at last [].ne+(spx,0); "svg_tt((TH))" at (last [],S)
+ relaycoil(EL) with .nw at last [].ne+(spx,0); "svg_tt((EL))" at (last [],S)
+ relaycoil(MR) with .sw at last [].se+(spx,0); "svg_tt((MR))" at (last [],S)
}
.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex00.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex00.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex00.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,91 +0,0 @@
-.PS
-# ex00.m4
-gen_init
-
-[
-thicklines_
-ewid = 2
-eht = 0.5
-E: ellipse wid ewid ht eht
-
- [ narrows = 5
- de = ewid/narrows
- for i=0 to narrows do {
- arrow down from i*de,0 }
- ] with .s at E.n+(0,0.25)
-
- "{\bf B$(t)$}" at last [].c
-
-thinlines_
- arrow from E.c to E.ne
- box invis fill_(1) ht 0.12 wid 0.12 with .c at last arrow.c "$r$"
-]
-[
-# ex07.m4
-# gen_init
-
-Barrel: box invis ht 0.4 wid 1.5
- up
-Face: arc rad 2.6 from Barrel.e+(2.4,-1.7/2) to Barrel.e+(2.4,1.7/2)
-
- eps = 0.03
- arc ccw rad 2.6 from Face.start-(eps,0) to Face.end-(eps,0) \
- with .c at Face.c-(eps,0)
- line from Barrel.nw to Barrel.ne then to Face.end
- line from Barrel.sw to Barrel.se then to Face.start
- arc cw from Barrel.sw to Barrel.nw rad Barrel.ht*1.2
-
-Cathode: Barrel.w+(0.3,0)
-Term: Barrel.w+(-0.25,0)
- dcath = 0.13
- dan = 0.12
-
- line from Cathode up dcath/2 left dcath/2 then to Term.x,Cathode.y+dcath/2
- dot
- line from Cathode down dcath/2 left dcath/2 then to Term.x,Cathode.y-dcath/2
- dot
-
- hole = 0.06
-Hole: line invis up hole from Cathode+(0.5,-hole/2)
- line from Hole.end up dan-hole/2 then to Term.x,Cathode.y+dan; dot
- line from Hole.start down dan-hole/2 then to Term.x,Cathode.y-dan; dot
-
- platewid = 0.25
- platesep = 0.15
-Plates: box invis wid platewid ht platesep at Barrel.e+(-platewid/2,0)
- line right platewid from Plates.nw
- line right platewid from Plates.sw
- line up 0.3 from Plates.n
- line down 0.3 from Plates.s
-
-linethick_(1.4)
- move to Cathode+(0.03,0)
-Spot: 0.9<Face.start,Face.end>
- arcto(Plates.c,Spot,(Plates.c.x-Cathode.x)*0.90,outlined "gray")
- line to Spot chop 0 chop -0.02 outlined "gray"
-
-thinlines_
-
- arrow <- from Cathode+(0.2,0.06) up 0.5 left 0.3
- "{\sl electron}" above "{\sl gun}" above
-
- arrow <- from Plates.nw+(0,0.06) up 0.5 left 0.3
- "{\sl deflection}" above "{\sl plates}" above
-
- arrow <- from 0.5<Plates.e,Spot>+(0,0.06) up 0.5 left 0.3
- "{\sl electron beam}" at Here+(-0.3,0) above
-
- spline <- from 1.015<Plates.e,Spot> right 0.1 up 0.1 then up 0.1 \
- then up 0.1 left 0.1
- "{\sl spot of light}sp_" rjust
-
- "{\sl vacuum}sp_" at 0.5<Face.start,Face.end>+(-0.4,0) rjust
-
- arrow <- from Face.start+(0.1,0.5) left 0.6*1.4 down 0.3*1.4
- "{\sl phosphor coating}sp_" rjust
-
- arrow <- from 0.2<Barrel.se,Face.start> left 0.6 down 0.3
- "{\sl glass enclosure (tube)}sp_" rjust
-
-] with .sw at last [].se+(0.5,0)
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex17.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex17.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ex17.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,43 +0,0 @@
-.PS
-# ex17.m4
-cct_init
-
-[
-nrows = 4
-ncols = 9
-linewid = linewid*0.6 # everything smaller
-define(`elen_',linewid) # shorter default length
-
- for j = 1 to nrows do {
- { for i = 1 to ncols do {
- Point_(-120) resistor
- Point_( 0) inductor
- Point_( 120) capacitor
- if i < ncols then {Point_(0) diode} }
- }
- Point_(-120) move to rvec_(elen_,0)
- { for i = 1 to ncols do {
- Point_(-60) capacitor
- Point_( 60) resistor }
- }
- Point_(-60) move to rvec_(elen_,0)
- }
- Point_(0) for i = 1 to ncols-1 do { inductor }
-]
-
-[ # an exercise of the `parallel_' macro:
- down_ # for labelling
- Point_(-80) # skew current direction
-
- parallel_(Sep=1.75*dimen_;
- parallel_(
- `capacitor(,C); rlabel(,,C_2)',
- `resistor; rlabel(,R_2)' ),
- parallel_(
- `resistor; rlabel(,R_1); move to rvec_(-dimen_/5,0)
- inductor(,W); rlabel(,L_1)',
- `reversed(`source',to rvec_(elen_,0),V,sourcerad_*2.5); rlabel(,v_s)' )
- )
-
-] with .sw at last [].se+(elen_,0)
-.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/examples.pdf
===================================================================
(Binary files differ)
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ant.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ant.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ant.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,30 +0,0 @@
-.PS
-# Ant.m4 (Langton's ant)
-# https://tex.stackexchange.com/questions/361838/how-to-create-a-langtons-ant-in-latex/361891
-# https://en.wikipedia.org/wiki/Langton%27s_ant
-gen_init
-NeedDpicTools
- picwid = 5
- D: (0,0); DD: (1,0); t[D] = 0
- minx = 0; miny = 0; maxx = 0; maxy = 0
- for i = 0 to 10500 do {
- if (t[D]%2) == 0 then { DD: (-DD.y,DD.x) } else { DD: (DD.y,-DD.x) }
- t[D] += 1
- D: D+DD
- if D.x > maxx then { maxx = D.x; for y = miny to maxy do { t[maxx,y] = 0 }} \
- else { if D.x < minx then {
- minx = D.x; for y = miny to maxy do { t[minx,y] = 0 }}}
- if D.y > maxy then { maxy = D.y; for x = minx to maxx do { t[x,maxy] = 0 }} \
- else { if D.y < miny then {
- miny = D.y; for x = minx to maxx do { t[x,miny] = 0 }}}
- }
- boxwid = picwid/(maxx-minx)
- boxht = picwid/(maxy-miny)
- if boxht > boxwid then { boxht = boxwid } else { boxwid = boxht }
- circlerad = boxht/2
- hue = 240; val = 1
- for i = minx to maxx do { for j = miny to maxy do {
- if t[i,j]!=0 then { sat = (t[i,j]%20)/20
- hsvtorgb(hue,sat,val,r,g,b)
- circle colored rgbstring(r,g,b) at (-i,j)*boxwid } }}
-.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Asymptotes.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Asymptotes.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Asymptotes.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,93 @@
+.PS
+# Asymptotes.m4
+# https://tex.stackexchange.com/questions/706340/create-an-asymptotes-summary-diagram-for-a-function
+gen_init
+
+definergbcolor(armygreen,0.29,0.33,0.13)
+definergbcolor(vlightgray,0.95,0.95,0.95)
+boxrad = 7bp__
+
+define(`greenbox',`box wid 90bp__ \
+ outlined "armygreen!90" shaded "armygreen!90" \
+ "{\color{white} `$1'}" ')
+
+define(`graybox',`box thick 0.4 outlined "gray" shaded "vlightgray" \
+ `$1'')
+
+ changequote(,) command "\newcommand{\eace}{\'e}
+ \newcommand{\squote}{\char39}
+ \newcommand{\dequation}{d'\'equation}"
+ changequote(`,)
+
+foreach_(`txt',`L`'m4Lx: graybox(wid 72bp__ ht 130 bp__ \
+ "\parbox{72bp}{\begin{centering}
+ {\sf txt \\ \vfill\vbox{}}
+ \end{centering}}")
+ ifelse(m4Lx,6,,`move 10bp__')',
+
+ `$(C_f)$ admet\\ Une asymptote\\ horizontale\\ \dequation:\\
+ $y = a$\\ au voisinage\\ de $\infty$',
+
+ `$(C_f)$ admet\\ Une asymptote\\ oblique\\ \dequation:\\
+ $y = ax+b$\\ au voisinage\\ de $\infty$',
+
+ `\hbox{}\vspace*{0.5\baselineskip}
+ $(C_f)$ admet\\ Une branche\\ parabolique\\ de direction\\
+ la droite\\ \dequation:\\
+ $y = ax$\\ au voisinage\\ de $\infty$',
+
+ `$(C_f)$ admet\\ Une branche\\ parabolique\\ de direction\\
+ l\squote{}axe des\\ ordonn\eace{}s\\ au voisinage\\ de $\infty$',
+
+ `$(C_f)$ admet\\ Une branche\\ parabolique\\ de direction\\
+ l\squote{}axe des\\ abscisses\\ au voisinage\\ de $\infty$',
+
+ `\vspace*{1ex}$(C_f)$ admet\\ Une \\ asymptote\\ verticale\\
+ \dequation:\\[1ex]
+ $x = a$\\ \hbox{}\hfill\hbox{}')
+
+ M: [ M1: graybox(wid 105bp__ \
+ "$\lim\limits_{x\rightarrow\infty} [f(x)-ax] = b$")
+ move 3bp__
+ M2: graybox(wid 105bp__ \
+ "$\lim\limits_{x\rightarrow\infty} [f(x)-ax] = \infty$")
+ ] with .s at ((L2.x+L4.x)/2,L2.n.y+boxht)
+
+ U:[ foreach_(`txt',`U`'m4Lx:graybox(wid 100bp__ ifelse(m4Lx,1,`+20bp__') "txt")
+ ifelse(m4Lx,4,,`move 2bp__')',
+ `$\lim\limits_{x\rightarrow\infty} [f(x)-(ax{+}b)] = 0$',
+ `\(\lim\limits_{x\rightarrow\infty} \frac{f(x)}{x} =
+ \raisebox{-0.5ex}{$a \atop {(a \neq 0)}$}\)',
+ `\(\lim\limits_{x\rightarrow\infty} \frac{f(x)}{x} = \infty \)',
+ `\(\lim\limits_{x\rightarrow\infty} \frac{f(x)}{x} = 0 \)')
+ ] with .s at ((L1.x+L6.x)/2,M.n.y+boxht)
+
+ T1: greenbox($\lim\limits_{x\rightarrow\infty} f(x) = a$) \
+ with .s at (L1.x,U.n.y+boxht)
+ T2: greenbox($\lim\limits_{x\rightarrow\infty} f(x) = \infty$) \
+ with .s at ((L1.x+L6.x)/2,T1.s.y)
+ T3: greenbox($\lim\limits_{x\rightarrow a} f(x) = \infty$) \
+ with .e at (L6.e.x,T2.y)
+
+ linethick_(1)
+ arrow from (U.w.x-5bp__,T1.s.y) down T1.s.y-L1.n.y
+ A: (T2.w.x,T2.s.y+boxrad); B1: U.U1.n+(boxht,0)
+ move to A; arcto((B1,A),B1,boxrad*3/2); arrow to B1
+ A: (U.U3.w.x+boxrad,T2.s.y); arrow from A to (A,U.U3.n)
+ B2: (1/2 between M.M1.e and M.M2.w,U.U2.n)
+ line from A+(-5bp__,0) down_ 10bp__ then left 10bp__
+ arcto((B2,Here),B2,boxrad*3/2); arrow to B2
+ B3: (L5.e.x-2*boxrad,U.U4.n.y)
+ line from A+( 5bp__,0) down_ 10bp__ then right_ 10 bp__
+ arcto((B3,Here),B3,boxrad*3/2); arrow to B3
+ arrow from (B3,U.U4.s) to (B3,L5.n)
+ arrow from (U.U4.e.x+5bp__,T3.s.y) down T3.s.y-L6.n.y
+ line from U.U2.s+(-5bp__,0) down_ 10bp__ then left_ 10bp__
+ arcto((M.M1.n,Here),M.M1.n,boxrad*3/2); arrow to M.M1.n
+ arrow from (Here,M.M1.s) down M.M1.s.y-L2.n.y
+ line from U.U2.s+( 5bp__,0) down_ 10bp__ then right_ 10bp__
+ arcto((M.M2.n,Here),M.M2.n,boxrad*3/2); arrow to M.M2.n
+ arrow from (L3.e.x-boxrad*3/2,M.M2.s.y) down M.M2.s.y-L3.n.y
+ arrow from (M.M2.e.x+5bp__,U.U3.s.y) down U.U3.s.y-L4.n.y
+ arrow from (M.w.x-5bp__,U.U1.s.y) down U.U1.s.y-L2.n.y
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Asymptotes.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Birds.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Birds.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Birds.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,36 @@
+.PS
+# Birds.m4
+gen_init
+
+scale = 50
+linethick = 2*linethick
+
+define bird {[
+ line shaded "$1" from (0,0) to \
+ (10,-5) to (19,8) to (35,7) to (38,-12)+(0,2) to (60,0) to\
+ (75,23) to (80,40) to (52,37)+(2,2) to (74,50) to (52,50) to \
+ (60,60) to (38,48)+(0,2) to (35,67) to (19,68) to (10,55) to \
+ (0,60) to (-8,50) to (14,50) to (-8,37)+(2,2) to (20,40) to \
+ (15,23) to (0,0)
+E: (80,40)
+W: (20,40)
+N: (19,68)
+S: (19,8)
+ line outlined "gray" from (35,15) down 10 right 25
+ line outlined "gray" from (40,20) right 25 down 8
+ line outlined "gray" from (42,25) right 28 down 6
+ line outlined "gray" from (40,30) right 32 down 4
+ circle outlined "gray" rad 1 at (1,55)
+ circle outlined "gray" rad 4 at (24,55)
+]}
+
+ ncols = 4
+ nrows = 4
+ right
+ for i=0 to nrows-1 do {
+ for j=0 to ncols-1 do { move to (j*60,-i*60)
+ if (i+j)%2==0 then { bird(black) } else { bird(white) }
+ }
+ }
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Birds.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Bistable.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Bistable.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Bistable.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,35 @@
+.PS
+# `bistable.m4'
+cct_init # Default initialization
+
+ up_
+rgbdraw(1,0,0,
+Q1: bi_tr(,R) # Q1 upward with base to the right
+ llabel(,Q_1) ) # Label to left of last []
+rgbdraw(0,0,1,
+Q2: bi_tr with .C at Q1.C+(elen_*7/4,0) # Q2 with base to left
+ rlabel(,Q_2) )
+
+ ground(at Q1.E)
+ ground(at Q2.E)
+
+ line right_ dimen_/3 from Q1.B # Extend the base conductors
+B1: Here
+ line left_ dimen_/3 from Q2.B
+B2: Here
+
+ resistor(up_ elen_*0.75 from Q1.C); llabel(,"$R_L$" wid 0.16) # Load resistors
+ line to (Q2.C,Here) "$V_{\hbox{cc}}$" below
+ resistor(down_ to Q2.C); llabel(,R_L)
+
+ move to Q1.C+(0,dimen_/5)
+ { resistor(right_ to (B1,Here)); llabel(,R_1)
+X: line to B2 } # Label the line to be jumped
+ resistor(from (Q2.C,Here) left_ to (B2,Here)); rlabel(,R_1)
+ crossover(to B1,R,X)
+
+ resistor(down_ elen_*0.75); rlabel(,R_2) # Bias resistors
+ {"$-V_{\hbox{cc}}$" rjust}
+ line to (B2,Here)
+ resistor(up_ to B2); rlabel(,R_2)
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Bistable.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Brace.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Brace.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Brace.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,115 @@
+.PS
+# brace.m4
+gen_init
+NeedDpicTools
+
+divert(-1)
+ `bracket(linespec, end depth,
+ thickness, end thickness, attributes)
+ Square bracket along linespec
+ default depth is linewid/5
+ attributes = eg
+ thick 0.4 outlined "string" shaded "string"
+ (default black)'
+define(`bracket',`rpoint_(ifelse(`$1',,`to rvec_(linewid,0)',`$1'))
+ M4brS: last line.start; M4brE: last line.end
+ [ brdepth = ifelse(`$2',,linewid/5,`($2)')
+ brthick = ifelse(`$3',,brdepth/6,`($3)')
+ endthick = ifelse(`$4',,brthick/3,`($4)')
+ define(`m4brackattribs',
+ `ifelse(`$5',,`thick 0.4 shaded rgbstring(0,0,0)',`$5')')dnl
+ {line m4brackattribs \
+ from M4brS+vec_(0,brdepth) to M4brS+vec_(0,brdepth+brthick) \
+ then to M4brE+vec_(0,brdepth+brthick) \
+ then to M4brE \
+ then to M4brE+vec_(-endthick,0) \
+ then to M4brE+vec_(-endthick,brdepth) \
+ then to M4brS+vec_( endthick,brdepth) \
+ then to M4brS+vec_( endthick,0) \
+ then to M4brS \
+ then to M4brS+vec_(0,brdepth) }
+ S: M4brS
+ ] with .S at Here')
+
+ `brace(linespec,depth,arm thickness,attributes)
+ Curly brace along linespec
+ default depth is linewid/5
+ attributes = eg
+ thick 0.4 outlined "string" shaded "string"
+ (default black)'
+define(`brace',`rpoint_(ifelse(`$1',,`to rvec_(linewid,0)',`$1'))
+ M4brS: last line.start; M4brE: last line.end
+ [ brdepth = ifelse(`$2',,linewid/5,`$2')
+ brthick = ifelse(`$3',,brdepth/6,`$3')
+ define(`m4braceattribs',
+ `ifelse(`$4',,`thick 0.4 shaded rgbstring(0,0,0)',`$4')')dnl
+ tension = 0.55
+ halfwid = distance(M4brS,M4brE)
+ smallrad = brdepth-brthick
+ bigrad = brdepth+brthick
+ for sgn=1 to -1 by -2 do {
+ S: rvec_(sgn*halfwid/2,0)
+ A: S+vec_(0,smallrad/2)
+ B: vec_(0,smallrad/2)
+ T: vec_(0,brdepth)
+ C: vec_(0,bigrad/2)
+ D: vec_(sgn*halfwid/2,bigrad/2)
+ {spline tension m4braceattribs \
+ from S to tension between S and A \
+ then to tension between A-vec_(sgn*bigrad/2,0) and A \
+ then to A-vec_(sgn*bigrad/2,0) \
+ then to B+vec_(sgn*bigrad/2,0) \
+ then to tension between B+vec_(sgn*bigrad/2,0) and B \
+ then to tension between T and B \
+ then to T \
+ then to tension between T and C \
+ then to tension between C+vec_(sgn*bigrad/2,0) and C \
+ then to C+vec_(sgn*bigrad/2,0) \
+ then to D-vec_(sgn*bigrad/2,0) \
+ then to tension between D-vec_(sgn*bigrad/2,0) and D \
+ then to tension between S and D \
+ then to S }
+ }
+ E: (0,0)
+] with .E at 0.5 between M4brS and M4brE')
+divert(0)dnl
+
+ del = 0.2
+ maxht = 2
+ minht = 0.3
+ n = 16
+ hmax = 360
+R1: [
+ for i=0 to n-1 do {
+ x = i/n
+ y = minht*(1-x)+maxht*x
+ hsvtorgb(x*hmax,1,1,r,g,b)
+ brace(from ( -i*del,-y/2) up y,,,thick 0.4 shaded rgbstring(r,g,b))
+ brace(from ((i+1)*del, y/2) down y,,,thick 0.4 \
+ outlined rgbstring(r,g,b) shaded rgbstring(r,g,b))
+ }
+ ]
+R2: [
+ for i=0 to n-1 do {
+ x = i/n
+ y = minht*(1-x)+maxht*x
+ hsvtorgb(x*hmax,1,1,r,g,b)
+ brace(from ( -i*del,-y/2) up y,5bp__+x*20bp__,2bp__+x*13bp__,thick 0.4 \
+ shaded rgbstring(r,g,b))
+ brace(from ((i+1)*del, y/2) down y,5bp__+x*20bp__,2bp__+x*13bp__,thick 0.4 \
+ outlined rgbstring(r,g,b) shaded rgbstring(r,g,b))
+ }
+ ] with .n at R1.s+(0,-0.2)
+R3: [
+ for i=0 to n-1 do {
+ x = i/n
+ y = minht*(1-x)+maxht*x
+ hsvtorgb(x*hmax,1,1,r,g,b)
+ bracket(from ( -i*del,-y/2) up y, 5bp__+x*20bp__, 2bp__+x*13bp__,,
+ thick 0.4 shaded rgbstring(r,g,b))
+ bracket(from ((i+1)*del, y/2) down y, 5bp__+x*20bp__, 2bp__+x*13bp__,,
+ thick 0.4 outlined rgbstring(r,g,b) shaded rgbstring(r,g,b))
+ }
+ ] with .n at R2.s+(0,-0.2)
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Brace.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ccurve.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ccurve.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Ccurve.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,14 +0,0 @@
-.PS
-# Ccurve.m4
-gen_init
-scale = 1.5
-# Gosper C curve
-
-`define' c_curve {if $3==0 then { continue by ($1,$2) } else {
- c_curve( ($1-$2)/2, ($1+$2)/2, $3-1)
- c_curve( ($1+$2)/2, ($2-$1)/2, $3-1)}}
-
-line from 0,4 to 0,4
-c_curve(0,4,10)
-
-.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chaos.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chaos.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chaos.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,39 @@
+.PS
+# chaos.m4
+# Example simulation of chaos equations.
+gen_init
+scale = 10
+define(`FF',`dnl
+ `$4' = `$1'+dt*10*(-`$1'+`$2')
+ `$5' = `$2'+dt*(28*`$1'-`$2'-`$1'*`$3')
+ `$6' = `$3'+dt*(-8*`$3'/3+`$1'*`$2') ')
+[
+x0 = 1
+y0 = 0
+z0 = 0
+dt = 0.005
+nN = 100
+for i = 1 to nN do {
+ for j = 1 to 8 do {
+ FF(x0,y0,z0,x1,y1,z1)
+ FF(x1,y1,z1,x2,y2,z2)
+ FF(x2,y2,z2,x3,y3,z3)
+ FF(x3,y3,z3,x4,y4,z4)
+ spline from x0,y0 to x1,y1 then to x2,y2 then to x3,y3 then to x4,y4
+ x0 = x4; y0 = y4; z0 = z4
+ }
+ }
+arrow from (-15,0) to (15,0); "$x$" ljust
+line up 1 from (10,0); "$ 10$" at last line.start below
+line up 1 from (-10,0); "$-10$" at last line.start below
+arrow from (0,-15) to (0,15); "$y$" above
+line right 1 from (0,10); "$ 10$" at last line.start rjust
+line right 1 from (0,-10); "$-10$" at last line.start rjust
+"$ 0$" at (0,0) below rjust
+]
+`"\parbox{2.5in}{\begin{eqnarray*}
+ \dot{x}_1 & = & 10(-x_1+x_2)\\
+ \dot{x}_2 & = & 28x_1-x_2-x_1x_3\\
+ \dot{x}_3 & = & -8x_3/3+x_1x_2
+ .\end{eqnarray*}}"' at last [].s below
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chaos.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chuck.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chuck.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Chuck.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -216,11 +216,5 @@
r_dimen(from D[3]+(0,-14) right 35,0,35)
r_dimen(from (0,D[3].y-14) right 35,0,35)
-# arrow <- down 30 left 30 from D[3] chop 16/2 chop 0 then left 5
-# "16 DRILL 23 CBORE" rjust "4 HOLES" rjust
-
-# arrow <- from (-305/2,30.6+10+2) up 5 left 5 then up 13
-# s_box(SEE (A)) with .sw at Here+(-5pt__,2pt__)
-
command "}%"
.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ClassDAmp.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ClassDAmp.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ClassDAmp.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -9,7 +9,7 @@
dot(at Q1.S)
{ line up_ dimen_/4
dot(,,1); "ifsvg(`svg_it(V)svg_sub(DD)',`$V_{\hbox{\scriptsize DD}}$')" \
- at last [].n+(0,0.05) above }
+ at last [].e ljust }
line left_ dimen_*2/3
SW: switch(left_ dimen_,`$1',D); ifelse(`$1',,`rlabel(,SW1)',`llabel(,SW2)')
Q2: mosfet(up_ dimen_*5/4,,TFSDPyQuB) with .D at Q1.D
@@ -27,7 +27,7 @@
]')
S1: String
-S2: String(R) with .Q1.S at S1.Q2.D+(0,-2*elen_)
+S2: String(R) with .Q1.S at S1.Q2.D+(0,-3/2*elen_)
I1: line left_ dimen_/2 from S1.Comp.In1
sinusoid(dimen_/4,twopi_/(dimen_/2),-pi_/2,0,dimen_/2) \
with .Start at I1.end-(textoffset,0)
@@ -51,7 +51,7 @@
dot
{ line up_ dimen_/2; diode(to (NO,Here),Z); line to NO }
{ capacitor(down_ dimen_); ground(,T,S)
- llabel(,iflatex(C_{\hbox{\scriptsize On}},ifsvg(svg_it(R)`'svg_sub(On)))) }
+ llabel(iflatex(C_{\hbox{\scriptsize On}},ifsvg(svg_it(R)`'svg_sub(On)))) }
line dashed to (S1.SW,Here)
arrow <-> dashed from S1.SW to S2.SW chop dimen_/4
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cruller.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cruller.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cruller.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,67 +0,0 @@
-.PS
-# Cruller.m4
-threeD_init
-NeedDpicTools
-scale = 2.54
-
-define(`lobe',`(sind(6*(`$1'))+4)/5*2.25')
-
- viewazimuth = 20 # Set view angles in degrees
- viewelevation = 30
- setview(viewazimuth,viewelevation,0)
-
- dt = 3 # major angle degrees per facet
- ds = 10 # minor angle degrees per facet
-
- tradius = 6
-define(`cruller',`rot3Dz((`$1')*dtor_,
- sum3D(0,tradius,0,0,Rect_(lobe(`$2'+2*(`$1')),`$2')))')
-
-define(`tvisible',`dot3D(View3D,
- cross3D(diff3D(cruller(`$1'+dt/2,`$2'),cruller(`$1',`$2')),
- diff3D(cruller(`$1',`$2'+ds/2),cruller(`$1',`$2'))))')
-
- # create the arrays and sort
- n = 0
- for t = dt to 360+dt/2 by dt do {
- for s=ds/2 to 360.1 by ds do {
- if tvisible(t,s) > -0.01 then {
- n +=1
- t[n] = t
- s[n] = s
- d[n] = dot3D(cruller(t,s),view3D1,view3D2,view3D3) # view distance
- ix[n] = n
- }
- } }
-# prval(n)
- dpquicksort(d,1,n,ix)
-
- # Background
-Bne: (9,6)
-Bsw: (-9,-6)
-B: 0.5 between Bne and Bsw
-iflatex(`line fill_(0.75) \
- from (Bsw,Bne) to Bsw then to (Bne,Bsw) then to Bne then to (Bsw,Bne)',
- `ShadedPolygon((Bsw,Bne):Bsw:(Bne,Bsw):Bne,,-30,
- 0,1,1,1,
- .5,.1,.4,0,
- 1,0,0,0) at B')
- # draw the facets
-thinlines_
-[
- rgbtohsv(0.6,0.4,0,h,s,v)
- for i = 1 to n do {
- tc = t[ix[i]]; sc = s[ix[i]]
- SE: (Project(cruller(tc+dt/2,sc-ds/2)))
- SW: (Project(cruller(tc-dt/2,sc-ds/2)))
- NW: (Project(cruller(tc-dt/2,sc+ds/2)))
- NE: (Project(cruller(tc+dt/2,sc+ds/2)))
- f = ((dcosine3D(3,cruller(tc,sc))/2.25+1)/2)^2
- hsvtorgb(h,(1-f)*s,1,r,g,b)
- line outlined rgbstring(r,g,b) shaded rgbstring(r,g,b) ifpdf( invis ) \
- from SE to SW then to NW then to NE then to SE }
- ] at B
-
-thicklines_
-
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Cylinder.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,43 +0,0 @@
-.PS
-# Cylinder.m4
-gen_init(SIdefaults) # lengths are in mm
-
-define(`cylinder',`[ angle = ifelse(`$3',,20,`$3')
- w = ifelse(`$1',,boxwid,`$1')
- h = ifelse(`$2',,boxht,`$2')
- B: ellipse wid w ht sind(angle)*w
- S: box invis wid w ht h fill_(1) with .s at B
- line from S.nw to S.sw
- line from S.ne to S.se
- T: ellipse wid w ht sind(angle)*w at B+(0,h)
- ]')
-
-define Cylinder { [ dtor = atan2(1,0)/90
- if "$1"=="" then { w = boxwid } else { w = $1 }
- if "$2"=="" then { h = boxht } else { h = $2 }
- if "$3"=="" then { angle = 20 } else { angle = $3 }
- B: ellipse wid w ht sin(angle*dtor)*w
- S: box invis wid w ht h fill 1 with .s at B
- line from S.nw to S.sw
- line from S.ne to S.se
- T: ellipse wid w ht sin(angle*dtor)*w at B+(0,h)
- ] }
-
-M4: [
- cylinder
- move
- cylinder(,,15)
- move
- cylinder(3,50)
- ]
-"M4 macro" at last [].s below
-
-Pic: [
- Cylinder
- move
- Cylinder(,,15)
- move
- Cylinder(3,50)
- ] with .w at M4.e+(5,0)
-"pic macro" at last [].s below
-.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/HSV.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/HSV.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/HSV.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,26 @@
+.PS
+# hsv.m4
+gen_init
+NeedDpicTools
+
+define grid { (($2)*boxwid,($1)*boxht) }
+r = 0
+g = 0
+b = 1
+rgbtohsv(r,g,b,h,s,v)
+nstep = 4
+{ for j=0 to nstep do {
+ sprintf("%g",j/nstep) at ((0.5+j)*boxwid,-boxht/2) below } }
+ { "S" at ((0.5+nstep/2)*boxwid, -boxht) }
+{ for i=0 to nstep do { sprintf("%g",i/nstep) at (-boxht/3,(i)*boxht) } }
+ { "V" at (-boxht,(nstep/2)*boxht) \
+ "or" \
+ "L" }
+right_
+for v = 0 to nstep do {
+ { for s = 0 to nstep do { hsvtorgb(h,s/nstep,v/nstep,r,g,b)
+ box shaded rgbstring(r,g,b) } }
+ move up_ boxht; right_ }
+
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/HSV.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Highgain.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Highgain.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Highgain.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -48,23 +48,23 @@
[
R: darrow(right linewid,,,,,,|-)
- { s_box($R$) dabove(at R.start+(5pt__,0)) }
+ { "$R$" dabove(at R.start+(5pt__,0)) }
Sum: circle invis "$\sum$"
darrow(right_ linewid*5/4)
- { s_box($E$) dabove(at last line) }
+ { "$E$" dabove(at last line) }
vectorsize(p,at 1/4 along_(last line))
Gain: shadebox(box "$G = \diag\mat{g_i}$" wid boxwid*1.5 ht boxht*0.75 )
darrow(,,,,,,!-)
- { s_box($U^{\prime}$) dabove(at last line) }
+ { "$U^{\prime}$" dabove(at last line) }
Compensator: shadebox(box wid boxwid*1.5 "\sl Compensator" "$K(s)$")
darrow(right_ linewid*5/4,,,,,,!-)
vectorsize(m,at 1/4 along_(last line))
- { s_box($U$) dabove(at last line) }
+ { "$U$" dabove(at last line) }
Plant: shadebox(box "\sl Plant" "$H(s)$" )
dline(right_ linewid*3/4 from Plant.e,,,,!-)
vectorsize(p,at last line)
Y: dtee(R)
- {s_box($Y$) dabove}
+ {"$Y$" dabove}
darrow(right_ linewid*2/3,t)
dline(down boxht from Y,t)
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Koch.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Koch.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Koch.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,33 +0,0 @@
-.PS
-# Koch snowflake
-gen_init
-
- leng = 4
- X: 3,5
- nsides = 3; rot[1] = 0; rot[2] = -120; rot[3] = -120
- depth=4
-
- for i=1 to depth do {
- for j=1 to nsides do { tmp[j] = rot[j] }
- leng = leng/3
- k = 0
- for j=1 to nsides do {
- rot[k+1] = tmp[j]
- rot[k+2] = 60
- rot[k+3] = -120
- rot[k+4] = 60
- k += 4
- }
- nsides = k
- }
-
- a = 0
- line from X to X
- for i=1 to nsides do {
- a += rot[i]
-# X: X+(Rect_(leng,a))
-# continue to X
- continue by (Rect_(leng,a))
- }
-
-.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Makefile 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Makefile 2024-05-30 19:57:12 UTC (rev 71389)
@@ -51,7 +51,7 @@
DVIPSOPTS = -G0 -t letter
DIMFILE = $(DOC).dim
-BS = tr '|' '\134'
+TRSLASH = tr '|' '\134'
# Might be needed (change latex commands to $(LTX) )
# LTX = latex --shell-escape
@@ -62,13 +62,13 @@
|usepackage{times,boxdims,siunitx,amssymb,tikz}\n\
|setlength{|textwidth}{8in} |setlength{|textheight}{10.5in}\n\
|setlength{|hoffset}{-2cm} |setlength{|voffset}{-3cm}\n\
-|begin{document}\n" | $(BS)
+|begin{document}\n" | $(TRSLASH)
PDFLTXSRC=printf "|documentclass[11pt]{standalone}\n\
|usepackage{times,boxdims,siunitx,amssymb,tikz,geometry}\n\
|geometry{paperwidth=15in,paperheight=14in,margin=1in}\n\
|pagestyle{empty}|thispagestyle{empty}\n\
-|begin{document}|noindent|input{"$*".tex}|end{document}\n" | $(BS)
+|begin{document}|noindent|input{"$*".tex}|end{document}\n" | $(TRSLASH)
LTXFILE=printf "|documentclass[11pt]{article}\n\
|usepackage[dvipsnames]{xcolor}\n\
@@ -81,7 +81,7 @@
|newbox|graph\n\
|begin{document}\n\
|noindent|input{"$*".tex}|box|graph\n\
-|end{document}\n" | $(BS)
+|end{document}\n" | $(TRSLASH)
.SUFFIXES: .ps .dvi .tex .m4 .pic .eps .png .pdf .svg .tif .gif
.m4.pic:
@@ -158,33 +158,39 @@
#########################################################################
-$(DOC).pdf:
+$(DOC).pdf: texfiles
@$(XTRASRC) > extras.tex
touch extras.dim
-for fl in `ls *.m4` ; do \
file=`basename $$fl .m4` ; \
- echo $$file.m4 ; \
- $(M4) pgf.m4 extras.dim $$file.m4 | $(PIC) -g > $$file.tex ; \
- printf "\n\n|noindent|parbox{|textwidth}{\n" | $(BS) >> extras.tex ; \
- printf "|input{$$file.tex}\n" | $(BS) >> extras.tex ; \
+ printf "\n\n|noindent|parbox{|textwidth}{\n" | $(TRSLASH) >> extras.tex; \
+ printf "|input{$$file.tex}\n" | $(TRSLASH) >> extras.tex ; \
printf "\n $$file.m4\n}\n|vspace{|baselineskip}" \
- | sed -e 's/_/|_/g' | $(BS) >> extras.tex ; \
+ | sed -e 's/_/|_/g' | $(TRSLASH) >> extras.tex ; \
done
- printf "\n|end{document}\n" | $(BS) >> extras.tex
+ printf "\n|end{document}\n" | $(TRSLASH) >> extras.tex
pdflatex extras
- -for file in $(XBOXDIMS) ; do \
- rm -f $$file.tex ; \
- $(M4) pgf.m4 extras.dim $$file.m4 | $(PIC) -g > $$file.tex ; \
- done
- pdflatex extras
+# -for file in $(XBOXDIMS) ; do \
+# rm -f $$file.tex ; \
+# $(M4) pgf.m4 extras.dim $$file.m4 | $(PIC) -g > $$file.tex ; \
+# done
+# pdflatex extras
+texfiles:
+ touch extras.dim
+ for fl in `ls *.m4` ; do \
+ file=`basename $$fl .m4` ; \
+ echo $$file.m4 ; \
+ $(M4) pgf.m4 extras.dim $$file.m4 | $(PIC) -g > $$file.tex ; done
+ touch texfiles
+
$(DOC).ps: psmode $(DOC).dvi
psmode:
- printf "|usepackage{pstricks,pst-grad}\n" | $(BS) > mode.tex
+ printf "|usepackage{pstricks,pst-grad}\n" | $(TRSLASH) > mode.tex
pdfmode:
- printf "|usepackage{tikz}\n" | $(BS) > mode.tex
+ printf "|usepackage{tikz}\n" | $(TRSLASH) > mode.tex
$(DOC).dvi: $(DOC).tex files.tex header.tex psmode
touch $(DOC).dim
@@ -208,4 +214,4 @@
dvips $(DVIPSOPTS) tst -o tst.ps
clean:
- rm -f *.ps *.pdf *.tex *.dim *.pic *.log *.dms *.aux *.svg
+ rm -f *.ps *.pdf *.tex *.dim *.pic *.log *.dms *.aux *.svg texfiles
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Parallel-series.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Parallel-series.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Parallel-series.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,15 @@
+.PS
+# parallel-series.m4
+# https://tex.stackexchange.com/questions/709074/how-to-plot-a-block-diagram-with-tikz
+cct_init
+
+ dot; line right_ dimen_/2
+ parallel_(
+ parallel_(
+ `ebox(,wdth=0.2;text="$x_1$")',
+ `Sep=dimen_*3/4;ebox(,wdth=0.2;text="$x_2$")'),
+ Sep=dimen_;series_(
+ `ebox(,wdth=0.2;text="$x_3$")',
+ `ebox(,wdth=0.2;text="$x_4$")'))
+ line right_ dimen_/2; dot
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Parallel-series.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Person.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Person.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Person.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,45 @@
+.PS
+# person.m4
+gen_init
+
+divert(-1)
+ `person(
+ hght=expr;wdth=expr;fill="colorname")
+ e.g. person(hght=1;fill="gray")'
+define(`person',
+ `[ pushkeys_(`$1',hght:linewid;wdth:m4hght*2/5;fill:"black":N)dnl
+ bodywid = m4wdth/2
+ bodyrad = bodywid/8
+ bodyht = (m4hght - bodywid - bodywid/16 + bodyrad*2)/2
+ tmplth = linethick; linethick = 0
+ Head: circle diam bodywid colored m4fill
+ Body: box rad bodyrad ht bodyht wid bodywid colored m4fill \
+ with .n at Head.s+(0,-Head.diam/16)
+ armwid = bodywid/3
+ Armleft: box wid armwid rad armwid/2 ht Body.ht-bodyrad colored m4fill \
+ with .w at Body.e + (armwid/2,0)
+ Armright: box same with .e at Body.w + (-armwid/2,0)
+ Legleft: box wid bodywid/2.5 rad armwid/2 ht Body.ht colored m4fill \
+ with .n at (Body.w,Body.s)+(bodywid/5,bodyrad*2)
+ Legright: box same with .n at (Body.e,Body.s)+(-bodywid/5,bodyrad*2)
+ linethick_(tmplth) popdef(`m4hght',`m4wdth',`m4fill') ]')
+
+divert(0)dnl
+
+ linewid = 3*linewid
+ movewid = 0.2
+
+ setrgb(0.54,0.81,0.94,babyblue)
+ person(fill="babyblue")
+ move
+ person(wdth=linewid*3/4;fill="babyblue")
+ move
+ person(wdth=linewid;fill="babyblue")
+ move
+ person
+ move
+ resetrgb
+ person(hght=1;fill="gray")
+
+ line up linewid with .c at last [].e+(linewid/10,0)
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Person.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/README_extras
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/README_extras 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/README_extras 2024-05-30 19:57:12 UTC (rev 71389)
@@ -11,4 +11,4 @@
This directory is assumed to be a subdirectory of the examples directory
in order to include the necessary definition files.
-Type "make" and, to clean up, "make clean".
+Type "make" to create extras.pdf and, to clean up, "make clean".
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Rotellipse.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Rotellipse.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Rotellipse.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,20 @@
+.PS
+# `rotellipse.m4'
+gen_init
+
+[
+ E: ellipse shaded "red" outlined "blue"
+
+ A: rotellipse(1,1,outlined "red" shaded "blue") with .w at E.e
+ Point_(45)
+ B: rotellipse(,,dotted fill_(0.9))
+ C: rotellipse(,,colored "red") with .s at last [].n
+ thinlines_
+ showbox_(A)
+ showbox_(B)
+ showbox_(C)
+ thicklines_
+
+] with .sw at 1,1
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Rotellipse.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/SampleFlow.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/SampleFlow.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/SampleFlow.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -2,11 +2,11 @@
# SampleFlow.m4
darrow_init
-boxwid = 1.9
-boxht = 1.0
+boxwid = 1.15
+boxht = 0.6
linethick = 1.2
- define(`dlthick',0.25)
+ define(`dlthick',0.125)
define(`dfillcolor',`0.7,0.7,0.7')
define rbox {box rad boxht/10}
@@ -17,7 +17,7 @@
dleft
darrow(to last box.w) } }
- command "{\sf\huge"
+ command "{\sf"
B1: rbox
{ "Sample" ljust indent "Acquisition" ljust }
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Spec555.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Spec555.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Spec555.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,56 @@
+.PS
+# Spec555.m4
+# https://tex.stackexchange.com/questions/64801/display-ics-with-circuitikz?rq=1
+log_init
+
+define(`spec555',`[ Chip: box wid 8*lg_pinsep ht 10*lg_pinsep fill_(0.9)
+ command "{\scriptsize\sf"
+ P1: "1" at 3/4<Chip.sw,Chip.se> below rjust; "GND" above
+ P5: "5" at Chip.s below rjust ; "CTRL" above
+ P2: "2" at 1/8<Chip.sw,Chip.nw> above rjust; "TRG" ljust
+ P6: "6" at 3/8<Chip.sw,Chip.nw> above rjust; "THR" ljust
+ P7: "7" at 7/8<Chip.sw,Chip.nw> above rjust; "DIS" ljust
+ P3: "3" at Chip.e above ljust ; "OUT" rjust
+ P4: "4" at 3/4<Chip.nw,Chip.ne> above rjust; "\phantom{M}RESET" below
+ P8: "8" at Chip.n above rjust ; "Vcc" below
+ "NE-555" at Chip.c "TIMER"
+ command "}%"
+ line left dimen_ from P7; X:dot
+ { R1:resistor(up_ P7.y-P6.y); rlabel(,\SI{68}{\kilo\ohm}); dot }
+ R2:resistor(down_ P7.y-P6.y); llabel(,\SI{68}{\kilo\ohm}); dot; {line to P6}
+ line to (Here,P2); SW: dot; {line to P2}
+ line from P8 to (P8,R1.end); dot ]')
+
+ command "{\small\sf"
+ T1: spec555; "U1" at T1.Chip.nw above ljust
+ T2: spec555 with .Chip.w at T1.Chip.e+(2.5*dimen_,0)
+ "U2" at T2.Chip.nw above ljust
+ {line left_ dimen_/2 from (T1.X,T1.P7); diode(down_ T1.P7.y-T1.P6.y)
+ rlabel(,\shortstack{D1\\1N4148})
+ line to (T1.X,Here); dot}
+ capacitor(down_ elen_ from T1.SW,E+); llabel(,\SI{10}{\micro\farad}); dot
+ dot(at Here-(dimen_/2,0),,1); G: dot(,,1); "GND" rjust at G.w
+ capacitor(from T1.P5 to (T1.P5,G),E+); rlabel(,\SI{0.01}{\nano\farad}); dot
+ line from T1.P1 to (T1.P1,G); dot
+ Vcc: dot(at (G,T1.R1.end),,1); "Vcc" rjust at Vcc.w
+ dot(at (T1.P4,Vcc)); line to T1.P4
+ line right_ dimen_/2 from T1.P3;
+ R3: resistor(down_ to (Here,T2.s-(0,dimen_/4))); llabel(,\SI{10}{\kilo\ohm})
+ line to (T2.P5,Here) then to T2.P5
+ dot(at (T2.X,G)); ground
+ reversed(`capacitor',up_ to (Here,T2.P5),E+); rlabel(,\SI{100}{\nano\farad})
+ line to (Here,T2.P2)
+ line from T2.P1 to (T2.P1,G); dot
+ line from T2.P4 to (T2.P4,Vcc) then to Vcc chop 0 chop dotrad_
+ dot(at (T2.X,T2.R1.end)+(0,dimen_/2),,1); {line to T2.R1.end chop dotrad_}
+ "$+$\SI{5}{\volt} to $+$\SI{15}{\volt}" at last [].n above
+ capacitor(right_ dimen_ from T2.P3,C); llabel(,\SI{100}{\micro\farad})
+ Pot1: potentiometer(down_ (Here.y-G.y)/2) with .Start at Here
+ "Rx" at Pot1.T1 ljust
+ Sp: speaker(R,,,fill_(0.9)) with .In5 at Pot1.End
+ "1" above rjust at Sp.In5; "2" below rjust at Sp.In7
+ "\shortstack{E1\\Speaker}" at Sp.In2 rjust
+ line from Sp.In7 to (Sp.In7,G) then to G chop 0 chop dotrad_
+ command "}%"
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Spec555.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Squiggle.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Squiggle.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Squiggle.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,26 @@
+.PS
+# squiggle.m4
+gen_init
+
+divert(-1)
+dnl Should this macro be in libgen.m4 or would that be just adding clutter?
+
+ `squiggle(linespec,
+ amplitude,wavelength,attributes)'
+ `squiggly line (sinusoid), e.g.
+ squiggle(up_ 1 right_ 2,,,outlined "red")'
+define(`squiggle',`rpoint_(ifelse(`$1',,linewid,`$1'))
+ m4dist = lin_leng(last line)
+ m4cycles = int(m4dist/(ifelse(`$3',,0.25*scale,`$3'))+0.5)
+ define(`squiggleampl',`ifelse(`$2',,0.04*scale,`$2')')dnl
+ define(`squigglefreq',`(twopi_*m4cycles/m4dist)')dnl
+ sinusoid(squiggleampl,squigglefreq,-twopi_/4,0,m4dist,`$4') \
+ with .Origin at last line.start
+ move to last line.end')
+divert(0)dnl
+
+squiggle(up_ 1 right_ 2,,,outlined "red")
+squiggle(up 2 right_ 2,0.1,0.15,outlined "red" <-> wid 0.06 ht 0.05)
+squiggle(right_ 1,,,thick 2 dotted outlined "blue" )
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Squiggle.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Venus.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Venus.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Venus.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,74 @@
+.PS
+# venus.m4
+# https://tex.stackexchange.com/questions/576423/a-more-precise-dance-of-planets-with-metapost-and-tikz
+# https://tex.stackexchange.com/questions/575986/dance-of-venus-and-variations-in-tikz-pgf
+
+gen_init
+NeedDpicTools
+maxpsht = 20
+
+thinlines_
+
+define(`venus',
+`setkeys_(`$1',
+ outerlength:4;
+ innerlength:2.8933;
+ outerrate:8;
+ innerrate:13;
+ maxtimes:2880;
+ increment:2;
+ changephase:0 )
+ sizefactor = 165/200
+ nmaxtimes = 360*m4outerrate
+ for x=0 to nmaxtimes by m4increment do {
+ if "$2" != "" then { hue = \
+ abs(sind(360*x/nmaxtimes*abs(m4innerrate-m4outerrate)+m4changephase-60))
+ hsvtorgb(hue*360,1,1,r,g,b)
+ line from (Rect_(m4outerlength,x))*sizefactor \
+ to (Rect_(m4innerlength,x/m4outerrate*m4innerrate))*sizefactor \
+ outlined rgbstring(r,g,b) } \
+ else {
+ line from (Rect_(m4outerlength,x))*sizefactor \
+ to (Rect_(m4innerlength,x/m4outerrate*m4innerrate))*sizefactor
+ }
+ } ')
+
+AA:[
+ sizefactor = 1/2.54
+ define(`venusA',`[
+ setkeys_(`$1',
+ iterations:270;
+ outerdistance:5.41;
+ innerdistance:7.48;
+ outerperiod:123;
+ innerperiod:200;
+ step:5)
+ for x=0 to m4iterations by m4step do {
+ line from (Rect_(m4outerdistance,x))*sizefactor \
+ to (Rect_(m4innerdistance,x/m4outerperiod*m4innerperiod))*sizefactor \
+ outlined "gray"
+ }
+ ]')
+
+# 3 columns, 5 rows
+ sizefactor /= 3
+ Orig:(0,0)
+ for i=1 to 5 do {
+ iteri = 180 + (i-1)*540
+ for j=1 to 3 do {
+ if (i==1) && (j==1) then { iter = 270 } \
+ else { iter = iteri + (j-1)*180 }
+ V[i,j]: venusA(iterations=iter) with .sw at Orig
+ sprintf("%g",iter) at last [] #colored rgbstring(1,0,0)
+ Orig: V[i,j].se
+ }
+ Orig: V[i,1].sw-(0,V[i,1].ht)
+ }
+ ]
+
+BB:[
+ venus(outerrate=8;innerrate=17;increment=2;innerlength=3.5;changephase=60,T)
+ ] at AA
+# ] with .nw at AA.sw+(0,-0.5)
+
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/Venus.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/birds.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/birds.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/birds.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,36 +0,0 @@
-.PS
-# Birds.m4
-gen_init
-
-scale = 50
-linethick = 2*linethick
-
-define bird {[
- line shaded "$1" from (0,0) to \
- (10,-5) to (19,8) to (35,7) to (38,-12)+(0,2) to (60,0) to\
- (75,23) to (80,40) to (52,37)+(2,2) to (74,50) to (52,50) to \
- (60,60) to (38,48)+(0,2) to (35,67) to (19,68) to (10,55) to \
- (0,60) to (-8,50) to (14,50) to (-8,37)+(2,2) to (20,40) to \
- (15,23) to (0,0)
-E: (80,40)
-W: (20,40)
-N: (19,68)
-S: (19,8)
- line outlined "gray" from (35,15) down 10 right 25
- line outlined "gray" from (40,20) right 25 down 8
- line outlined "gray" from (42,25) right 28 down 6
- line outlined "gray" from (40,30) right 32 down 4
- circle outlined "gray" rad 1 at (1,55)
- circle outlined "gray" rad 4 at (24,55)
-]}
-
- ncols = 4
- nrows = 4
- right
- for i=0 to nrows-1 do {
- for j=0 to ncols-1 do { move to (j*60,-i*60)
- if (i+j)%2==0 then { bird(black) } else { bird(white) }
- }
- }
-
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/bistable.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/bistable.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/bistable.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,35 +0,0 @@
-.PS
-# `bistable.m4'
-cct_init # Default initialization
-
- up_
-rgbdraw(1,0,0,
-Q1: bi_tr(,R) # Q1 upward with base to the right
- llabel(,Q_1) ) # Label to left of last []
-rgbdraw(0,0,1,
-Q2: bi_tr with .C at Q1.C+(elen_*7/4,0) # Q2 with base to left
- rlabel(,Q_2) )
-
- ground(at Q1.E)
- ground(at Q2.E)
-
- line right_ dimen_/3 from Q1.B # Extend the base conductors
-B1: Here
- line left_ dimen_/3 from Q2.B
-B2: Here
-
- resistor(up_ elen_*0.75 from Q1.C); llabel(,"$R_L$" wid 0.16) # Load resistors
- line to (Q2.C,Here) "$V_{\hbox{cc}}$" below
- resistor(down_ to Q2.C); llabel(,R_L)
-
- move to Q1.C+(0,dimen_/5)
- { resistor(right_ to (B1,Here)); llabel(,R_1)
-X: line to B2 } # Label the line to be jumped
- resistor(from (Q2.C,Here) left_ to (B2,Here)); rlabel(,R_1)
- crossover(to B1,R,X)
-
- resistor(down_ elen_*0.75); rlabel(,R_2) # Bias resistors
- {"$-V_{\hbox{cc}}$" rjust}
- line to (B2,Here)
- resistor(up_ to B2); rlabel(,R_2)
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/brace.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/brace.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/brace.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,115 +0,0 @@
-.PS
-# brace.m4
-gen_init
-NeedDpicTools
-
-divert(-1)
- `bracket(linespec, end depth,
- thickness, end thickness, attributes)
- Square bracket along linespec
- default depth is linewid/5
- attributes = eg
- thick 0.4 outlined "string" shaded "string"
- (default black)'
-define(`bracket',`rpoint_(ifelse(`$1',,`to rvec_(linewid,0)',`$1'))
- M4brS: last line.start; M4brE: last line.end
- [ brdepth = ifelse(`$2',,linewid/5,`($2)')
- brthick = ifelse(`$3',,brdepth/6,`($3)')
- endthick = ifelse(`$4',,brthick/3,`($4)')
- define(`m4brackattribs',
- `ifelse(`$5',,`thick 0.4 shaded rgbstring(0,0,0)',`$5')')dnl
- {line m4brackattribs \
- from M4brS+vec_(0,brdepth) to M4brS+vec_(0,brdepth+brthick) \
- then to M4brE+vec_(0,brdepth+brthick) \
- then to M4brE \
- then to M4brE+vec_(-endthick,0) \
- then to M4brE+vec_(-endthick,brdepth) \
- then to M4brS+vec_( endthick,brdepth) \
- then to M4brS+vec_( endthick,0) \
- then to M4brS \
- then to M4brS+vec_(0,brdepth) }
- S: M4brS
- ] with .S at Here')
-
- `brace(linespec,depth,arm thickness,attributes)
- Curly brace along linespec
- default depth is linewid/5
- attributes = eg
- thick 0.4 outlined "string" shaded "string"
- (default black)'
-define(`brace',`rpoint_(ifelse(`$1',,`to rvec_(linewid,0)',`$1'))
- M4brS: last line.start; M4brE: last line.end
- [ brdepth = ifelse(`$2',,linewid/5,`$2')
- brthick = ifelse(`$3',,brdepth/6,`$3')
- define(`m4braceattribs',
- `ifelse(`$4',,`thick 0.4 shaded rgbstring(0,0,0)',`$4')')dnl
- tension = 0.55
- halfwid = distance(M4brS,M4brE)
- smallrad = brdepth-brthick
- bigrad = brdepth+brthick
- for sgn=1 to -1 by -2 do {
- S: rvec_(sgn*halfwid/2,0)
- A: S+vec_(0,smallrad/2)
- B: vec_(0,smallrad/2)
- T: vec_(0,brdepth)
- C: vec_(0,bigrad/2)
- D: vec_(sgn*halfwid/2,bigrad/2)
- {spline tension m4braceattribs \
- from S to tension between S and A \
- then to tension between A-vec_(sgn*bigrad/2,0) and A \
- then to A-vec_(sgn*bigrad/2,0) \
- then to B+vec_(sgn*bigrad/2,0) \
- then to tension between B+vec_(sgn*bigrad/2,0) and B \
- then to tension between T and B \
- then to T \
- then to tension between T and C \
- then to tension between C+vec_(sgn*bigrad/2,0) and C \
- then to C+vec_(sgn*bigrad/2,0) \
- then to D-vec_(sgn*bigrad/2,0) \
- then to tension between D-vec_(sgn*bigrad/2,0) and D \
- then to tension between S and D \
- then to S }
- }
- E: (0,0)
-] with .E at 0.5 between M4brS and M4brE')
-divert(0)dnl
-
- del = 0.2
- maxht = 2
- minht = 0.3
- n = 16
- hmax = 360
-R1: [
- for i=0 to n-1 do {
- x = i/n
- y = minht*(1-x)+maxht*x
- hsvtorgb(x*hmax,1,1,r,g,b)
- brace(from ( -i*del,-y/2) up y,,,thick 0.4 shaded rgbstring(r,g,b))
- brace(from ((i+1)*del, y/2) down y,,,thick 0.4 \
- outlined rgbstring(r,g,b) shaded rgbstring(r,g,b))
- }
- ]
-R2: [
- for i=0 to n-1 do {
- x = i/n
- y = minht*(1-x)+maxht*x
- hsvtorgb(x*hmax,1,1,r,g,b)
- brace(from ( -i*del,-y/2) up y,5bp__+x*20bp__,2bp__+x*13bp__,thick 0.4 \
- shaded rgbstring(r,g,b))
- brace(from ((i+1)*del, y/2) down y,5bp__+x*20bp__,2bp__+x*13bp__,thick 0.4 \
- outlined rgbstring(r,g,b) shaded rgbstring(r,g,b))
- }
- ] with .n at R1.s+(0,-0.2)
-R3: [
- for i=0 to n-1 do {
- x = i/n
- y = minht*(1-x)+maxht*x
- hsvtorgb(x*hmax,1,1,r,g,b)
- bracket(from ( -i*del,-y/2) up y, 5bp__+x*20bp__, 2bp__+x*13bp__,,
- thick 0.4 shaded rgbstring(r,g,b))
- bracket(from ((i+1)*del, y/2) down y, 5bp__+x*20bp__, 2bp__+x*13bp__,,
- thick 0.4 outlined rgbstring(r,g,b) shaded rgbstring(r,g,b))
- }
- ] with .n at R2.s+(0,-0.2)
-
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/chaos.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/chaos.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/chaos.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,39 +0,0 @@
-.PS
-# chaos.m4
-# Example simulation of chaos equations.
-gen_init
-scale = 10
-define(`FF',`dnl
- `$4' = `$1'+dt*10*(-`$1'+`$2')
- `$5' = `$2'+dt*(28*`$1'-`$2'-`$1'*`$3')
- `$6' = `$3'+dt*(-8*`$3'/3+`$1'*`$2') ')
-[
-x0 = 1
-y0 = 0
-z0 = 0
-dt = 0.005
-nN = 100
-for i = 1 to nN do {
- for j = 1 to 8 do {
- FF(x0,y0,z0,x1,y1,z1)
- FF(x1,y1,z1,x2,y2,z2)
- FF(x2,y2,z2,x3,y3,z3)
- FF(x3,y3,z3,x4,y4,z4)
- spline from x0,y0 to x1,y1 then to x2,y2 then to x3,y3 then to x4,y4
- x0 = x4; y0 = y4; z0 = z4
- }
- }
-arrow from (-15,0) to (15,0); "$x$" ljust
-line up 1 from (10,0); "$ 10$" at last line.start below
-line up 1 from (-10,0); "$-10$" at last line.start below
-arrow from (0,-15) to (0,15); "$y$" above
-line right 1 from (0,10); "$ 10$" at last line.start rjust
-line right 1 from (0,-10); "$-10$" at last line.start rjust
-"$ 0$" at (0,0) below rjust
-]
-`"\parbox{2.5in}{\begin{eqnarray*}
- \dot{x}_1 & = & 10(-x_1+x_2)\\
- \dot{x}_2 & = & 28x_1-x_2-x_1x_3\\
- \dot{x}_3 & = & -8x_3/3+x_1x_2
- .\end{eqnarray*}}"' at last [].s below
-.PE
Added: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ex17.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ex17.m4 (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ex17.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -0,0 +1,43 @@
+.PS
+# ex17.m4
+cct_init
+
+[
+nrows = 4
+ncols = 9
+linewid = linewid*0.6 # everything smaller
+define(`elen_',linewid) # shorter default length
+
+ for j = 1 to nrows do {
+ { for i = 1 to ncols do {
+ Point_(-120) resistor
+ Point_( 0) inductor
+ Point_( 120) capacitor
+ if i < ncols then {Point_(0) diode} }
+ }
+ Point_(-120) move to rvec_(elen_,0)
+ { for i = 1 to ncols do {
+ Point_(-60) capacitor
+ Point_( 60) resistor }
+ }
+ Point_(-60) move to rvec_(elen_,0)
+ }
+ Point_(0) for i = 1 to ncols-1 do { inductor }
+]
+
+[ # an exercise of the `parallel_' macro:
+ down_ # for labelling
+ Point_(-80) # skew current direction
+
+ parallel_(Sep=1.75*dimen_;
+ parallel_(
+ `capacitor(,C); rlabel(,,C_2)',
+ `resistor; rlabel(,R_2)' ),
+ parallel_(
+ `resistor; rlabel(,R_1); move to rvec_(-dimen_/5,0)
+ inductor(,W); rlabel(,L_1)',
+ `reversed(`source',to rvec_(elen_,0),V,sourcerad_*2.5); rlabel(,v_s)' )
+ )
+
+] with .sw at last [].se+(elen_,0)
+.PE
Property changes on: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/ex17.m4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/hsv.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/hsv.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/hsv.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,26 +0,0 @@
-.PS
-# hsv.m4
-gen_init
-NeedDpicTools
-
-define grid { (($2)*boxwid,($1)*boxht) }
-r = 0
-g = 0
-b = 1
-rgbtohsv(r,g,b,h,s,v)
-nstep = 4
-{ for j=0 to nstep do {
- sprintf("%g",j/nstep) at ((0.5+j)*boxwid,-boxht/2) below } }
- { "S" at ((0.5+nstep/2)*boxwid, -boxht) }
-{ for i=0 to nstep do { sprintf("%g",i/nstep) at (-boxht/3,(i)*boxht) } }
- { "V" at (-boxht,(nstep/2)*boxht) \
- "or" \
- "L" }
-right_
-for v = 0 to nstep do {
- { for s = 0 to nstep do { hsvtorgb(h,s/nstep,v/nstep,r,g,b)
- box shaded rgbstring(r,g,b) } }
- move up_ boxht; right_ }
-
-
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/person.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/person.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/person.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,45 +0,0 @@
-.PS
-# person.m4
-gen_init
-
-divert(-1)
- `person(
- hght=expr;wdth=expr;fill="colorname")
- e.g. person(hght=1;fill="gray")'
-define(`person',
- `[ pushkeys_(`$1',hght:linewid;wdth:m4hght*2/5;fill:"black":N)dnl
- bodywid = m4wdth/2
- bodyrad = bodywid/8
- bodyht = (m4hght - bodywid - bodywid/16 + bodyrad*2)/2
- tmplth = linethick; linethick = 0
- Head: circle diam bodywid colored m4fill
- Body: box rad bodyrad ht bodyht wid bodywid colored m4fill \
- with .n at Head.s+(0,-Head.diam/16)
- armwid = bodywid/3
- Armleft: box wid armwid rad armwid/2 ht Body.ht-bodyrad colored m4fill \
- with .w at Body.e + (armwid/2,0)
- Armright: box same with .e at Body.w + (-armwid/2,0)
- Legleft: box wid bodywid/2.5 rad armwid/2 ht Body.ht colored m4fill \
- with .n at (Body.w,Body.s)+(bodywid/5,bodyrad*2)
- Legright: box same with .n at (Body.e,Body.s)+(-bodywid/5,bodyrad*2)
- linethick_(tmplth) popdef(`m4hght',`m4wdth',`m4fill') ]')
-
-divert(0)dnl
-
- linewid = 3*linewid
- movewid = 0.2
-
- setrgb(0.54,0.81,0.94,babyblue)
- person(fill="babyblue")
- move
- person(wdth=linewid*3/4;fill="babyblue")
- move
- person(wdth=linewid;fill="babyblue")
- move
- person
- move
- resetrgb
- person(hght=1;fill="gray")
-
- line up linewid with .c at last [].e+(linewid/10,0)
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/rotellipse.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/rotellipse.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/rotellipse.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,20 +0,0 @@
-.PS
-# `rotellipse.m4'
-gen_init
-
-[
- E: ellipse shaded "red" outlined "blue"
-
- A: rotellipse(1,1,outlined "red" shaded "blue") with .w at E.e
- Point_(45)
- B: rotellipse(,,dotted fill_(0.9))
- C: rotellipse(,,colored "red") with .s at last [].n
- thinlines_
- showbox_(A)
- showbox_(B)
- showbox_(C)
- thicklines_
-
-] with .sw at 1,1
-
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/squiggle.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/squiggle.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/squiggle.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,26 +0,0 @@
-.PS
-# squiggle.m4
-gen_init
-
-divert(-1)
-dnl Should this macro be in libgen.m4 or would that be just adding clutter?
-
- `squiggle(linespec,
- amplitude,wavelength,attributes)'
- `squiggly line (sinusoid), e.g.
- squiggle(up_ 1 right_ 2,,,outlined "red")'
-define(`squiggle',`rpoint_(ifelse(`$1',,linewid,`$1'))
- m4dist = lin_leng(last line)
- m4cycles = int(m4dist/(ifelse(`$3',,0.25*scale,`$3'))+0.5)
- define(`squiggleampl',`ifelse(`$2',,0.04*scale,`$2')')dnl
- define(`squigglefreq',`(twopi_*m4cycles/m4dist)')dnl
- sinusoid(squiggleampl,squigglefreq,-twopi_/4,0,m4dist,`$4') \
- with .Origin at last line.start
- move to last line.end')
-divert(0)dnl
-
-squiggle(up_ 1 right_ 2,,,outlined "red")
-squiggle(up 2 right_ 2,0.1,0.15,outlined "red" <-> wid 0.06 ht 0.05)
-squiggle(right_ 1,,,thick 2 dotted outlined "blue" )
-
-.PE
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/venus.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/venus.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/extras/venus.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,74 +0,0 @@
-.PS
-# venus.m4
-# https://tex.stackexchange.com/questions/576423/a-more-precise-dance-of-planets-with-metapost-and-tikz
-# https://tex.stackexchange.com/questions/575986/dance-of-venus-and-variations-in-tikz-pgf
-
-gen_init
-NeedDpicTools
-maxpsht = 20
-
-thinlines_
-
-define(`venus',
-`setkeys_(`$1',
- outerlength:4;
- innerlength:2.8933;
- outerrate:8;
- innerrate:13;
- maxtimes:2880;
- increment:2;
- changephase:0 )
- sizefactor = 165/200
- nmaxtimes = 360*m4outerrate
- for x=0 to nmaxtimes by m4increment do {
- if "$2" != "" then { hue = \
- abs(sind(360*x/nmaxtimes*abs(m4innerrate-m4outerrate)+m4changephase-60))
- hsvtorgb(hue*360,1,1,r,g,b)
- line from (Rect_(m4outerlength,x))*sizefactor \
- to (Rect_(m4innerlength,x/m4outerrate*m4innerrate))*sizefactor \
- outlined rgbstring(r,g,b) } \
- else {
- line from (Rect_(m4outerlength,x))*sizefactor \
- to (Rect_(m4innerlength,x/m4outerrate*m4innerrate))*sizefactor
- }
- } ')
-
-AA:[
- sizefactor = 1/2.54
- define(`venusA',`[
- setkeys_(`$1',
- iterations:270;
- outerdistance:5.41;
- innerdistance:7.48;
- outerperiod:123;
- innerperiod:200;
- step:5)
- for x=0 to m4iterations by m4step do {
- line from (Rect_(m4outerdistance,x))*sizefactor \
- to (Rect_(m4innerdistance,x/m4outerperiod*m4innerperiod))*sizefactor \
- outlined "gray"
- }
- ]')
-
-# 3 columns, 5 rows
- sizefactor /= 3
- Orig:(0,0)
- for i=1 to 5 do {
- iteri = 180 + (i-1)*540
- for j=1 to 3 do {
- if (i==1) && (j==1) then { iter = 270 } \
- else { iter = iteri + (j-1)*180 }
- V[i,j]: venusA(iterations=iter) with .sw at Orig
- sprintf("%g",iter) at last [] #colored rgbstring(1,0,0)
- Orig: V[i,j].se
- }
- Orig: V[i,1].sw-(0,V[i,1].ht)
- }
- ]
-
-BB:[
- venus(outerrate=8;innerrate=17;increment=2;innerlength=3.5;changephase=60,T)
- ] at AA
-# ] with .nw at AA.sw+(0,-0.5)
-
-.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/files.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/files.tex 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/files.tex 2024-05-30 19:57:12 UTC (rev 71389)
@@ -158,6 +158,14 @@
\src{Pconn.m4}.}
}
+\ifmpost\else\bfig{
+ \centerline{\getpic{cbresistor}}
+ \caption{Color-coded through-hole resistors. All are
+ 10 percent tolerance except for the last,
+ which illustrates 5 percent
+ \src{cbresistor.m4}.}
+ }\fi
+
\ifmpost\else\ifpostscript\else\bfig{
\centerline{\getpic{EVplugs}}
\caption{Electric vehicle charging plug patterns make extensive
@@ -265,17 +273,12 @@
\bfig{
\centerline{\getpic{Quantum}}
- \caption{A quantum circuit
+ \caption{A quantum circuit and a
+ superconducting quantum interface device (drawing direction down)
\src{Quantum.m4}.}
}
\bfig{
- \centerline{\getpic{SQUID}}
- \caption{Superconducting quantum interface device (drawing direction down)
- \src{SQUID.m4}.}
- }
-
-\bfig{
\centerline{\getpic{Sixpole}}
\caption{A six-pole filter
\src{Sixpole.m4}.}
@@ -308,13 +311,6 @@
}
\bfig{
- \centerline{\getpic{ex17}}
- \caption{A repetitive network created by Pic looping and
- a skewed circuit used to test the macro {\tt parallel\_}
- \src{ex17.m4}.}
- }
-
-\bfig{
\centerline{\getpic{ex12}}
\caption{ A CMOS NAND gate, a test circuit, and an XMOSFET example
\src{ex12.m4}.}
@@ -521,12 +517,6 @@
\src{XOR.m4}.}
}
-\bfig{
- \centerline{\getpic{ex00}}
- \caption{Line diagrams
- \src{ex00.m4}.}
- }
-
\ifmpost\else\ifpostscript\else\bfig{
\centerline{\getpic{EEP}}
\caption{A test of experimental single-line diagram macros
@@ -541,8 +531,8 @@
\bfig{
\centerline{\getpic{GrayCode}}
- \caption{Gray code 10-bit encoder disk pattern and a crossbar switch
- illustrating the power of looping and branching
+ \caption{The power of looping and branching:
+ Gray code 10-bit encoder disk pattern and a crossbar switch
\src{GrayCode.m4}.}
}
@@ -559,6 +549,13 @@
}
\bfig{
+ \centerline{\getpic{Sevensegment}}
+ \caption{A customizable seven-segment display showing the
+ numbered segments, a custom shape, and the numerals from 0 to 9
+ \src{Sevensegment.m4}.}
+ }
+
+\bfig{
\centerline{\getpic{Rotbox}}
\caption{The macro
{\tt rotbox(}{\sl wid,ht,type,}{\tt [r|t=}{\sl val}{\tt ])}
@@ -567,12 +564,12 @@
}
\ifmpost\else\ifpostscript\else\bfig{
- \centerline{\getpic{shadowed}}
+ \centerline{\getpic{Shadowed}}
\caption{Embellishments: the top row illustrates
{\tt shadowed(box|circle|ellipse|line,[at {\sl position}],{\sl keys})}
and the second row
{\tt ColoredV(box|circle|ellipse,({\sl r,g,b})|(({\sl colorseq})),{\sl attributes})}
- \src{shadowed.m4}.}
+ \src{Shadowed.m4}.}
}\fi\fi
\bfig{
@@ -661,7 +658,7 @@
\ifpostscript%
\bfig{% For psfrag
\includegraphics[width=\textwidth]{rose.eps} %\centerline{\getpic{rose}}%ignore%
- \caption{The left object, used for testing {\tt dipic,} is redrawn from%ignore%
+ \caption{The left object, used for testing {\tt dpic,} is redrawn from%ignore%
a detail of the set design for the musical {\it Dracula.} This %ignore%
consumes much \LaTeX\ main memory but can be produced directly %ignore%
as pdf using \hbox{\tt dpic -d}, as svg using \hbox{\tt dpic -v}, %ignore%
@@ -712,7 +709,7 @@
\bfig{
\centerline{\getpic{Dini}}
- \caption{Dini surface and an icosahedron
+ \caption{Dini surface, an icosahedron, and a sphere with inscribed cylinder
\src{Dini.m4}.}
}
@@ -789,10 +786,10 @@
\caption{Overlaying a figure with line graphics %ignore%
\src{Incleps.m4}.}
}
-\else\ifpostscript\else% Postscript with psfrag (.eps.gz not allowed)
+\else\ifpostscript\else% Postscript with psfrag (.eps.gz not allowed)
\bfig{%
\centerline{\boxdims{InclA}{%ignore%
- \includegraphics[width=3in]{Incl.eps}}%
+ \includegraphics[width=3in]{Incl.eps}}% the background picture
\hspace*{-3in}\includegraphics{Incleps.eps}}%
\caption{Overlaying a figure with line graphics %ignore%
\src{Incleps.m4}.}}
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ics.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ics.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/ics.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -78,29 +78,38 @@
lg_pin(Chip.se_+(0,9*lg_pinsep),Y7,Pin7,eN,7)
`$1']')
+define(`ic555',`[ Chip: DIP_chip_outline(8)
+ foreach_(`x',
+ `lg_pin(Chip.nw-(0,lg_pinsep*m4Lx),x,Pin`'m4Lx,w,m4Lx)',
+ GND, TR, OUT, RESET)
+ foreach_(`x',
+ `lg_pin(Chip.se+(0,lg_pinsep*m4Lx),x,Pin`'eval(m4Lx+4),e,eval(m4Lx+4))',
+ CTRL, THR, DIS, Vcc)
+ `$1']')
+
define(`ic4017',`[ Chip: DIP_chip_outline(16)
- Loopover_(`x',
+ foreach_(`x',
`lg_pin(Chip.nw-(0,lg_pinsep*m4Lx),x,Pin`'m4Lx,w,m4Lx)',
PL, Q3, I3, I0, CLE, Q0, TC, GND)
- Loopover_(`x',
+ foreach_(`x',
`lg_pin(Chip.se+(0,lg_pinsep*m4Lx),x,Pin`'eval(m4Lx+8),e,eval(m4Lx+8))',
MR, U/D, Q1, I1, I2, Q2, CLK, Vcc)
`$1']')
define(`ic4510',`[ Chip: DIP_chip_outline(16)
- Loopover_(`x',
+ foreach_(`x',
`lg_pin(Chip.nw-(0,lg_pinsep*m4Lx),x,Pin`'m4Lx,w,m4Lx)',
PL, Q3, I3, I0, CLE, Q0, TC, GND)
- Loopover_(`x',
+ foreach_(`x',
`lg_pin(Chip.se+(0,lg_pinsep*m4Lx),x,Pin`'eval(m4Lx+8),e,eval(m4Lx+8))',
MR, U/D, Q1, I1, I2, Q2, CLK, Vcc)
`$1']')
define(`icVS1053',`[ Chip: DIP_chip_outline(32)
- Loopover_(`x',
+ foreach_(`x',
`lg_pin(Chip.nw-(0,lg_pinsep*m4Lx),x,Pin`'m4Lx,w,m4Lx)',
LOUT,ROUT,GBUF,AGND,AGND,DREG,Vcc,3V3,GND,MISO,MOSI,sclk,RST,CS,DCS,DCS)
- Loopover_(`x',
+ foreach_(`x',
`lg_pin(Chip.se+(0,lg_pinsep*m4Lx),x,Pin`'eval(m4Lx+16),e,eval(m4Lx+16))',
SDCD,RX,TX,7,6,5,4,3,2,1,0,GND,3V3,AGND,MIC`$-$',MIC`$+$')
`$1']')
@@ -114,13 +123,13 @@
#
plen = ifelse(`$4',,`2*L_unit',`$4')
#
-Loopover_(`x',`ifelse(x,nul,,
+foreach_(`x',`ifelse(x,nul,,
`Pin`'eval(5+m4Lx): line left_ plen from Connector.nw-(0,(5+m4Lx)*lg_pinsep)
{ "x" ljust at last line.start }')',
IOREF, RESET,$+${3}V3,$+${5}V, GND, GND, VIN,
nul, A0, A1, A2, A3, A4, A5)
#
-Loopover_(`x',`ifelse(x,nul,,
+foreach_(`x',`ifelse(x,nul,,
`Pin`'eval(22-m4Lx): line right_ plen from Connector.ne-(0,m4Lx*lg_pinsep)
{ "x" rjust at last line.start }')',
SCL, SDA, AREF, GND, D13, D12, ic_tilde`'D11, ic_tilde`'D10, ic_tilde`'D9, D8,
@@ -137,13 +146,13 @@
#
plen = ifelse(`$4',,`2*L_unit',`$4')
#
-Loopover_(`x',`ifelse(x,nul,,
+foreach_(`x',`ifelse(x,nul,,
`Pin`'eval(5+m4Lx): line left_ plen from Connector.nw-(0,(5+m4Lx)*lg_pinsep)
{ "x" ljust at last line.start }')',
IOREF, RESET,$+${3}V3,$+${5}V, GND, GND, VIN,
nul, A0, A1, A2, A3, A4, A5)
#
-Loopover_(`x',`ifelse(x,nul,,
+foreach_(`x',`ifelse(x,nul,,
`Pin`'eval(22-m4Lx): line right_ plen from Connector.ne-(0,m4Lx*lg_pinsep)
{ "x" rjust at last line.start }')',
SCL, SDA, AREF, GND,
@@ -150,9 +159,9 @@
ic_tilde`'D13, D12, ic_tilde`'D11, ic_tilde`'D10, ic_tilde`'D9, D8,
nul, D7, ic_tilde`'D6, ic_tilde`'D5, D4, ic_tilde`'D3, D2, TX D1, RX D0)
#
- `$4'] ')
+ `$4'] ') # `ArduinoLeonardo'
- `RPi( wid,ht,pinlen )'
+ `RPi( wid,ht,pinlen )' # Raspberry Pi connector
define(`RPi',`[
define(`m4bwid',`ifelse(`$1',,`34*L_unit',`$1')')dnl
define(`m4bht',`ifelse(`$2',,`21*lg_pinsep',`$2')')dnl
@@ -160,13 +169,13 @@
GPIO: box wid m4bwid ht m4bht
plen = ifelse(`$4',,`6*L_unit',`$4')
#
-define A_LeftGPIO {
+define A_LeftGPIO { dnl pin downcount, internal label , pin no above line
exec sprintf("Pin%g: line left_ plen from GPIO.nw-(0,%g)",\
2*(`$'1)-1,(`$'1)*lg_pinsep)
{ "`$'3" ljust at last line.start }
"`$'2" at last line.c above }
#
-Loopover_(`x',`ifelse(x,nul,,`A_LeftGPIO(m4Lx,patsubst(x,;,`,'))')',
+foreach_(`x',`ifelse(x,nul,,`A_LeftGPIO(m4Lx,patsubst(x,;,`,'))')',
;3V3,
2;SDA1, 3;SCL1, 4;GPIO\_GCLK,
;GND,
@@ -178,13 +187,13 @@
5;, 6;, 13;, 19;, 26;,
;GND )
#
-define A_RightGPIO {
+define A_RightGPIO { dnl pin downcount, internal label , pin no above line
exec sprintf("Pin%g: line right_ plen from GPIO.ne-(0,%g)",\
2*(`$'1),(`$'1)*lg_pinsep)
{ "`$'3" rjust at last line.start }
"`$'2" at last line.c above }
#
-Loopover_(`x',`ifelse(x,nul,,`A_RightGPIO(m4Lx,patsubst(x,;,`,'))')',
+foreach_(`x',`ifelse(x,nul,,`A_RightGPIO(m4Lx,patsubst(x,;,`,'))')',
;5V,
;5V,
;GND,
@@ -199,7 +208,7 @@
;GND,
16;, 20;, 21; )
#
- `$4'] ')
+ `$4'] ') # `RPi'
`USB_C_Socket( wid, ht, pinlen )'
define(`USB_C_Socket',`[
@@ -209,7 +218,7 @@
Base: box wid m4bwid ht m4bht rad 5/3*lg_pinsep
plen = ifelse(`$4',,`6*L_unit',`$4')
#
- Loopover_(`x',
+ foreach_(`x',
`B`'eval(13-m4Lx): dnl
line left_ plen from Base.n-(m4bwid/2,(m4Lx+0.5)*lg_pinsep)
{"x" ljust at last line.start}',
@@ -216,7 +225,7 @@
GND, RX1`$+$', RX1`$-$', VBUS, SBU2, D`$-$', D`$+$', CC2, VBUS, TX2`$-$',
TX2`$+$', GND)
#
- Loopover_(`x',
+ foreach_(`x',
`A`'m4Lx: line right_ plen from Base.n+(m4bwid/2,-(m4Lx+0.5)*lg_pinsep)
{"x" rjust at last line.start}',
GND, TX1`$+$', TX1`$-$', VBUS, CC1, D`$+$', D`$-$', SBU1, VBUS, RX2`$-$',
@@ -235,7 +244,7 @@
then left m4bwid*2/3 then to Here]
plen = ifelse(`$4',,`6*L_unit',`$4')
#
- Loopover_(`x',
+ foreach_(`x',
`Pin`'m4Lx: line left_ plen from Base.nw-(0,m4bwid/3+m4Lx*lg_pinsep)
{"x" ljust at last line.start}
"m4Lx" at last line.c above',
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/keyboard.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/keyboard.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/keyboard.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -19,8 +19,8 @@
top=attribs; # top attributes '
define(`kbdkey',
`pushkeys_(`$2',
- wdth:kbd_u; hght:kbd_u*14/13+lthick; rad:kbd_u/10;
- shadewid:kbdshadewid; base:fill_(0.3):N; top:fill_(0.9):N)dnl
+ `wdth:kbd_u; hght:kbd_u*14/13+lthick; rad:kbd_u/10;
+ shadewid:kbdshadewid; base:fill_(0.3):N; top:fill_(0.9):N')dnl
[ Base: box wid m4wdth ht m4hght rad m4rad m4base
Top: box wid m4wdth-2*m4shadewid ht m4hght-m4shadewid-lthick \
rad m4rad*(kbd_u-2*m4shadewid)/(kbd_u) with .n \
@@ -53,7 +53,7 @@
top=attribs; # top attributes '
define(`enterkey',
`pushkeys_(`$2',
- wdth:kbd_u*2.26;
+ `wdth:kbd_u*2.26;
hght:kbd_u*14/13*2+kbdrowsep+linethick bp__;
bhght: kbd_u*14/13;
twdth: kbd_u*3/2;
@@ -60,7 +60,7 @@
rad:kbd_u/10;
shadewid:kbdshadewid;
base:fill_(0.3):N;
- top:fill_(0.9):N)dnl
+ top:fill_(0.9):N')dnl
[ ltx = lthick; r = m4rad*(kbd_u-2*m4shadewid)/(kbd_u)
# thick outer
linethick = (m4shadewid+r)/(1bp__); lth2 = lthick/2
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/mf/cct.mf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/mf/cct.mf 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/mf/cct.mf 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,5 +1,5 @@
% cct.mf, generated by Mfpic, v1.10 2012/12/03,
-% from TeX source "font" on 2024/01/01 at 16:59
+% from TeX source "font" on 2024/05/30 at 10:30
numeric mfpicversion; mfpicversion := 110;
if unknown mode: mode := localfont; fi
if unknown mag: mag := 1000/1000; fi
@@ -299,7 +299,7 @@
store (curpath)
drawn
-circle ((-0.3084,-0),0.002767);
+circle ((-0.3084,0),0.002767);
resizedrawpen (0.8bp);
@@ -426,7 +426,7 @@
%----------------------------<9>
unitlen := 1.0pt#;
xscale := 72; yscale := 72;
-bounds (0, 0.333333, -0, 0.03125);
+bounds (0, 0.333333, 0, 0.03125);
beginmfpic(9); % line 124 in the TeX source.
@@ -441,19 +441,19 @@
store (curpath)
drawn
-arcplr ((0.072917,0),-180,-360,0.03125);
+arcplr ((0.072917,0),180,0,0.03125);
store (curpath)
drawn
-arcplr ((0.135417,0),-180,-360,0.03125);
+arcplr ((0.135417,0),180,0,0.03125);
store (curpath)
drawn
-arcplr ((0.197917,0),180,-0,0.03125);
+arcplr ((0.197917,0),180,0,0.03125);
store (curpath)
drawn
-arcplr ((0.260417,0),-180,-360,0.03125);
+arcplr ((0.260417,0),180,0,0.03125);
store (curpath)
drawn
@@ -491,11 +491,11 @@
store (curpath)
drawn
-arcplr ((-0,-0.197917),90,-90,0.03125);
+arcplr ((0,-0.197917),90,-90,0.03125);
store (curpath)
drawn
-arcplr ((-0,-0.260417),90,-90,0.03125);
+arcplr ((0,-0.260417),90,-90,0.03125);
store (curpath)
drawn
@@ -525,7 +525,7 @@
store (curpath)
drawn
-arcplr ((-0.072917,0),0,-180,0.03125);
+arcplr ((-0.072917,0),-0,-180,0.03125);
store (curpath)
drawn
@@ -1402,12 +1402,12 @@
store (curpath)
drawn
polyline (false)
-((0.145833,0),
-(0.145833,0.0625),
-(0.1875,0.0625),
-(0.1875,-0.0625),
-(0.145833,-0.0625),
-(0.145833,0));
+((0.104167,0),
+(0.104167,0.0625),
+(0.229167,0.0625),
+(0.229167,-0.0625),
+(0.104167,-0.0625),
+(0.104167,0));
store (curpath)
drawn
@@ -1450,12 +1450,12 @@
store (curpath)
drawn
polyline (false)
-((0,-0.145833),
-(0.0625,-0.145833),
-(0.0625,-0.1875),
-(-0.0625,-0.1875),
-(-0.0625,-0.145833),
-(0,-0.145833));
+((0,-0.104167),
+(0.0625,-0.104167),
+(0.0625,-0.229167),
+(-0.0625,-0.229167),
+(-0.0625,-0.104167),
+(0,-0.104167));
store (curpath)
drawn
@@ -3197,7 +3197,7 @@
store (curpath)
drawn
-arcplr ((0,0.1375),-180,-360,0.175);
+arcplr ((0,0.1375),180,0,0.175);
store (curpath)
drawn
@@ -3379,19 +3379,19 @@
store (curpath)
drawn
-arcplr ((0.072917,-0.104167),-180,-360,0.03125);
+arcplr ((0.072917,-0.104167),180,0,0.03125);
store (curpath)
drawn
-arcplr ((0.135417,-0.104167),-180,-360,0.03125);
+arcplr ((0.135417,-0.104167),180,0,0.03125);
store (curpath)
drawn
-arcplr ((0.197917,-0.104167),180,-0,0.03125);
+arcplr ((0.197917,-0.104167),180,0,0.03125);
store (curpath)
drawn
-arcplr ((0.260417,-0.104167),-180,-360,0.03125);
+arcplr ((0.260417,-0.104167),180,0,0.03125);
store (curpath)
drawn
@@ -3423,15 +3423,15 @@
store (curpath)
drawn
-arcplr ((0.197917,0.104167),0,-180,0.03125);
+arcplr ((0.197917,0.104167),-0,-180,0.03125);
store (curpath)
drawn
-arcplr ((0.135417,0.104167),0,-180,0.03125);
+arcplr ((0.135417,0.104167),-0,-180,0.03125);
store (curpath)
drawn
-arcplr ((0.072917,0.104167),0,-180,0.03125);
+arcplr ((0.072917,0.104167),-0,-180,0.03125);
store (curpath)
drawn
@@ -4844,7 +4844,7 @@
store (curpath)
drawn
polyline (false)
-((0,-0.151089),
+((-0,-0.151089),
(0.122222,-0.151089));
store (curpath)
@@ -5204,7 +5204,7 @@
store (curpath)
drawn
polyline (false)
-((0,-0.151089),
+((-0,-0.151089),
(0.122222,-0.151089));
store (curpath)
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/quick.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/quick.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/quick.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,16 +1,14 @@
.PS # Pic input begins with .PS
cct_init # Read in macro definitions and set defaults
elen = 0.75 # Variables are allowed; default units are inches
-Origin: Here # Position names are capitalized
- source(up_ elen); llabel(-,v_s,+)
- resistor(right_ elen); rlabel(,R,)
+Vs: source(up_ elen); llabel(-,v_s,+) # Name and label the source
+ resistor(right_ elen); rlabel(,R,) # Semicolon and line end are equivalent
dot
{ # Save the current position and direction
- capacitor(down_ to (Here,Origin)) #(Here,Origin) = (Here.x,Origin.y)
- rlabel(+,v,-); llabel(,C,)
+ capacitor(down_ Vs.len); rlabel(+,v,-); llabel(,C,)
dot
} # Restore position and direction
line right_ elen*2/3
- inductor(down_ Here.y-Origin.y); rlabel(,L,); b_current(i)
- line to Origin
+ inductor(down_ Vs.len); rlabel(,L,); b_current(i)
+ line to (Vs,Here) # (Vs,Here) = (Vs.x,Here.y)
.PE # Pic input ends
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/relaycoil.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/relaycoil.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/relaycoil.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -6,7 +6,8 @@
{ relaycoil; S: `"\tt relaycoil"' at last [].s+(0,-16bp__)
{ "\sl V1" wid 10bp__ at last [].V1 rjust
"\sl V2" at last [].V2 ljust }
- K: relaycoil(NX) with .nw at last [].ne+(spc*4,0); "\tt (NX)" at (last [],S)
+ relaycoil(S) with .nw at last [].ne+(spc*2,0); "\tt (S)" at (last [],S)
+ K: relaycoil(NX) with .nw at last [].ne+(spc*3,0); "\tt (NX)" at (last [],S)
{ thinlines_
spline <- from K.A1 left 7bp__ then up 4bp__ left 4bp__; "\sl A1" rjust
arrow <- from K.A2 left 10bp__; "\sl A2" rjust
@@ -16,14 +17,15 @@
spline <- from K.B3 right 7bp__ then down 4bp__ right 4bp__; "\sl B3" ljust
thicklines_
}
- relaycoil(AXSR) with .nw at last [].ne+(spc*5,0); "\tt (AXSR)" at (last [],S)
+ relaycoil(AXSR) with .nw at last [].ne+(spc*4,0); "\tt (AXSR)" at (last [],S)
{ "\sl V1" at last [].V1 rjust; "\sl V2" at last [].V2 rjust }
relaycoil(BXSR) with .nw at last [].ne+(spc*2,0); "\tt (BXSR)" at (last [],S)
{ "\sl V1" at last [].V1 ljust; "\sl V2" at last [].V2 ljust }
- relaycoil(SR) with .nw at last [].ne+(spc*3,0); "\tt (SR)" at (last [],S)
- relaycoil(SO) with .nw at last [].ne+(spc,0); "\tt (SO)" at (last [],S)
- relaycoil(SOR) with .nw at last [].ne+(spc,0); "\tt (SOR)" at (last [],S)
- relaycoil(PC) with .nw at last [].ne+(spc,0); "\tt (PC)" at (last [],S)
+ relaycoil(SR) with .nw at last [].ne+(spc*2,0); "\tt (SR)" at (last [],S)
+ spx = spc*3/4
+ relaycoil(SO) with .nw at last [].ne+(spx,0); "\tt (SO)" at (last [],S)
+ relaycoil(SOR) with .nw at last [].ne+(spx,0); "\tt (SOR)" at (last [],S)
+ relaycoil(PC) with .nw at last [].ne+(spx,0); "\tt (PC)" at (last [],S)
}
spc = dimen_/4
{
Deleted: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/shadowed.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/shadowed.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/shadowed.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,60 +0,0 @@
-.PS
-# shadowed.m4
-gen_init
-NeedDpicTools
-divert(-1)
-
-divert(0)dnl
-
-Boxes: [
-movewid = movewid/2
-B1: shadowed(,,
- rad=0bp__; shadowthick=lthick*4; shadowcolor="lightgray"; shadowangle=-60; \
- attrib=fill_(0.85) "box")
-
-move
-R: shadowed(box,, rad=6bp__; shadowthick=lthick*4; \
- attrib=wid boxht*2 shaded "orange" outlined "red" thick 2 \
- `"\tt box\char44\char44" "\tt rad=6bp\_\_"')
-
-move
-C: shadowed(circle,,
- shadowthick=lthick*4;shadowcolor="blue";\
- attrib=outlined "green" shaded "green" diam 0.75 "circle")
-
-move
- E: shadowed(ellipse,,
- shadowthick=lthick*4; attrib=ht boxwid wid boxht shaded "yellow" \
- dashed "ellipse")
-
- b = boxht
- move to (E.e.x+b,E.s.y)
- F: shadowed(line,,
- attrib=left b then up b right b then down b right b then to Here \
- shaded "orange" outlined "red" thick 3;shadowthick=4.5bp__;\
- shadowangle=45)
- "line" at F.n+(0,-0.3)
-]
-
-Others:[
-movewid = movewid*0.4
-
- cmyktorgb(96,0,0,0,r,g,b)
- ColoredV(circle,(r,g,b), rad 0.4 "Hello" outlined "cyan")
-
-move
- s = 0.5; v = 0.8
- hsvtorgb(0,s,v,r0,g0,b0)
- hsvtorgb(90,s,v,r1,g1,b1)
- hsvtorgb(180,s,v,r2,g2,b2)
- ColoredV(box,((0,r0,g0,b0, 0.5,r1,g1,b1, 1,r2,g2,b2)),
- outlined "blue" rad 0.1 ht 2*boxht "Hmm...")
-
-move
- ColoredV(ellipse,(g,r,b),wid 0.75 ht 1 outlined "magenta" "OK")
-
-move
- ColoredV(ellipse,,outlined "magenta" shaded "yellow" "Goodbye")
-] with .nw at Boxes.sw #+(0,-moveht)
-
-.PE
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/xfig/xfiglib.fig
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/xfig/xfiglib.fig 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/examples/xfig/xfiglib.fig 2024-05-30 19:57:12 UTC (rev 71389)
@@ -75,7 +75,7 @@
5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 1500 263 1500 300 1463 263 1500 225
-6
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 1437 525 1438 225
+ 1437 525 1437 225
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
1400 525 1400 225
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
@@ -135,11 +135,11 @@
6 3300 75 3450 675
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
3375 675 3375 425
-6 3300 325 3450 425
+6 3300 300 3450 450
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
3425 425 3325 425
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 6
- 3375 400 3300 400 3300 350 3450 350 3450 400 3375 400
+ 3375 450 3300 450 3300 300 3450 300 3450 450 3375 450
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
3425 325 3325 325
-6
@@ -297,9 +297,11 @@
6 1650 1575 2250 2025
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
1650 1800 1775 1800
+6 1775 1590 2125 2010
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 4
1915 2010 1775 2010 1775 1590 1915 1590
5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 1915 1800 1915 1590 2125 1800 1915 2010
+-6
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
2125 1800 2250 1800
-6
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/gpic.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/gpic.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/gpic.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
gpic.m4 Initialization for gpic.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -3,7 +3,7 @@
operations on argument triples representing
3D vectors or colors.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -244,12 +244,13 @@
`shadedball( rad,
highlight rad, highlight degrees,
- initial shade, final shade )
+ initial gray, final gray | (rf,gf,bf) )
The highlight is by default at
radius rad*3/5 and angle 110 deg
(or arg2 deg); if setlight has been
- invoked then the highlight is as
- given by its azimuth and elevation arguments'
+ invoked then its azimuth and elevation arguments
+ determine highlight position.
+ Arg5 can be a parenthesized rgb color '
define(`shadedball',`[ C: (0,0); r = ifelse(`$1',,circlerad,`$1')
ifdef(`setlight_',
`H: (project(sprod3D(r,light3D1,light3D2,light3D3)))
@@ -256,14 +257,21 @@
hr = distance(C,H)',
`hr = ifelse(`$2',,r*3/5,`$2'); ha = ifelse(`$3',,110,`$3')
H: (cosd(ha)*hr,sind(ha)*hr)')
- u0 = ifelse(`$4',,1,`$4'); uf = ifelse(`$5',,0.25,`$5')
+ rgbtohsv(ifelse(`$4',,`1,1,1',``$4',`$4',`$4''),h0,s0,v0)
+ pushdef(`rgbf',`ifelse(`$5',,`(0.25,0.25,0.25)pushdef(`oneshade',1)',
+ substr(`$5',0,1)substr(`$5',decr(len(`$5')),1),(),`$5'pushdef(`oneshade',0),
+ `(`$5',`$5',`$5')pushdef(`oneshade',1)')')
+ rgbtohsv(patsubst(rgbf,`^ *('\|`) *$'),hf,sf,vf)
rm = r+hr; n = int(rm/(linethick bp__))
- for i=1 to n-1 do { x = i/n*rm; u = u0+(i/n)^2*(uf-u0)
+ for i=1 to n-1 do { x = i/n*rm; ifelse(oneshade,1,
+ `hs = h0+(i/n)^2*(hf-h0); ss = s0+(i/n)^2*(sf-s0); vs = v0+(i/n)^2*(vf-v0)
+ hsvtorgb(hs,ss,vs,ri,gi,bi)',
+ `hsvtorgb(hf,(i/n)^2,vf,ri,gi,bi)')
if x <= (r-hr) then {
- circle rad x thick linethick*1.6 outlined rgbstring(u,u,u) at H } \
- else { arc cw thick linethick*ifpgf(2,1.6) outlined rgbstring(u,u,u) \
+ circle rad x thick linethick*1.6 outlined rgbstring(ri,gi,bi) at H } \
+ else { arc cw thick linethick*ifpgf(2,1.6) outlined rgbstring(ri,gi,bi) \
from Cintersect(H,x,C,r) to Cintersect(H,x,C,r,R) with .c at H } }
- circle rad r ifpgf(+linethick bp__/2) at C
- `$6']')
+ circle rad r ifpgf(+linethick bp__/2) outlined rgbstring(ri,gi,bi) at C
+ `$6' popdef(`rgbf',`oneshade') ]')
divert(0)dnl
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/libSLD.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/libSLD.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/libSLD.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -2,7 +2,7 @@
libSLD.m4 Draft macros for single-line diagram elements
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/libcct.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
libcct.m4
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -206,132 +206,126 @@
{[box invis ht_ m4cht wid_ m4cwd ] at rvec_(rp_len/2,0)}
line to rvec_(rp_len,0) invis ')')
- `resistor( linespec, cycles, chars, cycle wid)
- cycles: default 3
- chars : AC: complex element
- E: ebox
- ES: ebox with slash
- Q: offset
- H: squared
- N: IEEE (default)
- B: not burnable
- V: varistor variant
- R: to right of drawing direction
- arg4: cycle width (default dimen_/6)'
+ `resistor( linespec, cycles, chars, cycle wid )
+ chars: AC: complex element
+ E: ebox
+ ES: ebox with slash
+ F: FDNR (freq-dependent neg resistor)
+ Q: offset
+ H: squared
+ N: IEEE (default)
+ B: not burnable
+ V: varistor variant
+ R: to right of drawing direction'
define(`resistor',
-`define(`m4h',`ifelse(`$4',,`dimen_/6',`($4)')/4')dnl
- ifinstr(
- `$2',E, # This is obsolete but kept for now
+`eleminit_(`$1'); M4S: last line.start; M4E: last line.end
+ define(`m4type',ifelse(`$3',,N,`$3',R,N,`$3')`')dnl
+ define(`m4neg',sc_draw(`m4type',R,-))dnl
+ define(`m4cycles',`ifelse(`$2',,3,(`$2'))')dnl
+ define(`m4cyclewid',`ifelse(`$4',,(dimen_/6),`($4)')')dnl
+ define(`m4lgth',`(m4cycles*m4cyclewid)')dnl
+ ifelse(
+ `$2',E, # This is obsolete but kept for now
`ebox(`$1',shift(shift($@)))',
- `$3',ES,
- `ebox(`$1')
- {line from last line.c+vec_( m4lgth*0.3, m4wdth/2) \
- to last line.c+vec_(-m4lgth*0.3,-m4wdth/2)}
- line invis from 2nd last line.start to 2nd last line.end',
- `$3',E,
- `ebox(`$1')',
- `$3',V,
- `M4_varistor($@)',
- `$3',AC,
- `ebox(`$1')
- { ACsymbol(at last [],m4h*3.5,m4h*2,R)
- [] wid 2nd last [].wid ht 2nd last [].ht at 2nd last [] }',
- `define(`dna_',ifelse(`$3',,N,`$3',R,N,`$3')`')dnl
- eleminit_(`$1')
- sc_draw(`dna_',N,
- `define(`m4n',`ifelse(`$2',,6,`eval(2*($2))')')dnl Default resistor:
- define(`m4v',2)dnl
- if m4h*m4n*2 > rp_len then { eleminit_(to rvec_(m4h*m4n*2,0)) }
- tr_xy_init(last line.c, m4h, sc_draw(`dna_',R,-))dnl
- { line from last line.start to tr_xy(-m4n,0)\
- for_(2,m4n,2,
- `then to tr_xy(eval(2*m4x-3-m4n), m4v) \
- then to tr_xy(eval(2*m4x-1-m4n),-m4v) \')dnl
- then to tr_xy(m4n, 0) \
- then to last line.end
- [box invis ht_ m4h*m4v*2 wid_ m4h*m4n*2] at 2nd last line.c
- }')
- sc_draw(`dna_',Q,
- `define(`m4n',`ifelse(`$2',,6,`eval(2*($2))')')dnl
- define(`m4v',2)dnl
- if m4h*m4n*2 > rp_len then { eleminit_(to rvec_(m4h*m4n*2,0)) }
- tr_xy_init(last line.c, m4h, sc_draw(`dna_',R,-))dnl
- { line from last line.start to tr_xy(-m4n,0)\
- for_(2,m4n,2,
- `then to tr_xy(eval(2*m4x-2-m4n), m4v*2) \
- then to tr_xy(eval(2*m4x-m4n),0) \')dnl
- then to tr_xy(m4n, 0) \
- then to last line.end
- [box invis ht_ m4h*m4v*2 wid_ m4h*m4n*2] at 2nd last line.c + ta_xy(0,m4v)
- }')
- sc_draw(`dna_',H,
- `define(`m4n',`ifelse(`$2',,5,`eval(2*($2)-1)')')dnl
- define(`m4hh',`m4h*6/5')dnl
- define(`m4v',7/3)dnl
- if m4hh*m4n*2 > rp_len then { eleminit_(to rvec_(m4hh*m4n*2,0)) }
- tr_xy_init(last line.c, m4hh, sc_draw(`dna_',R,-))dnl
- { line from last line.start to tr_xy(-m4n,0)\
- for_(-m4n,m4n,2,
- `ifelse(eval(((m4x+m4n)/2)%2),0,
- `then to tr_xy(m4x,m4v) \
- then to tr_xy(eval(m4x+2),m4v) \',
- `then to tr_xy(m4x,0) \
- ifelse(m4x,m4n,,`then to tr_xy(eval(m4x+2),0)')\')')dnl
- then to tr_xy(m4n, 0) \
- then to last line.end
- [box invis ht_ m4hh*m4v wid_ m4hh*m4n*2] at 2nd last line.c+(0,m4hh*m4v/2)
- }')
- sc_draw(`dna_',B,
- `resistor(`$1',`$2',dna_,`$4'); M4LBC: last line.c
- m4lbwd = last [].wid_+lthick*2; m4lbht = last [].ht_+lthick*2
- [lbox(m4lbwd,m4lbht,thick 0.4)] with .c at M4LBC
- [lbox(m4lbwd+2bp__,m4lbht+2bp__,thick 0.4)] with .c at M4LBC ')
-#
- line invis from 2nd last line.start to 2nd last line.end ')')
+ m4type,N,
+ `define(`m4nN',`eval(2*m4cycles)')dnl Default resistor:
+ define(`m4v',2)dnl
+ if m4lgth > rp_len then { eleminit_(to rvec_(m4lgth,0)) }
+ tr_xy_init(last line.c, m4cyclewid/4, m4neg)dnl
+ { line from last line.start to tr_xy(-m4nN,0)\
+ for_(2,m4nN,2,
+ `then to tr_xy(eval(2*m4x-3-m4nN), m4v) \
+ then to tr_xy(eval(2*m4x-1-m4nN),-m4v) \')dnl
+ then to tr_xy(m4nN, 0) \
+ then to last line.end # This could be replaced for obtuse directions:
+ [box invis ht_ m4cyclewid*m4v/2 wid_ m4cyclewid*m4nN/2] at 2nd last line.c
+ }',
+ m4type,Q,
+ `define(`m4nQ',`eval(2*m4cycles)') define(`m4v',2)dnl
+ if m4cyclewid*m4nQ/2 > rp_len then {
+ eleminit_(to rvec_(m4cyclewid*m4nQ/2,0)) }
+ tr_xy_init(last line.c, m4cyclewid/4, m4neg)dnl
+ { line from last line.start to tr_xy(-m4nQ,0)\
+ for_(2,m4nQ,2,
+ `then to tr_xy(eval(2*m4x-2-m4nQ), m4v*2) \
+ then to tr_xy(eval(2*m4x-m4nQ),0) \')dnl
+ then to tr_xy(m4nQ, 0) \
+ then to last line.end
+ [box invis ht_ m4cyclewid*m4v/2 wid_ m4cyclewid*m4nQ/2] \
+ at 2nd last line.c + ta_xy(0,m4v)
+ }',
+ m4type,ES,
+ `ebox(`$1',m4lgth,dimen_/5)
+ {line from last line.c+vec_( dimen_/2*0.3, dimen_/5/2) \
+ to last line.c+vec_(-dimen_/2*0.3,-dimen_/5/2)}',
+ m4type,F,
+ `define(`m4cht',`dimen_/3') define(`m4cwd',`m4cht*0.9')dnl
+ {line to rvec_(rp_len/2-m4cwd/2,0)
+ {[for i=0 to m4cycles do {line from vec_(i*m4cwd/m4cycles,0) \
+ to vec_(i*m4cwd/m4cycles,m4cht)}] at rvec_(m4cwd/2,0)}
+ line from rvec_(m4cwd,0) to rvec_(rp_len/2+m4cwd/2,0)}',
+ m4type,H,
+ `define(`m4nH',`eval(2*m4cycles-1)')dnl
+ define(`m4hh',`m4cyclewid*6/5/4') define(`m4v',7/3)dnl
+ if m4hh*m4nH/2 > rp_len then { eleminit_(to rvec_(m4hh*m4nH/2,0)) }
+ tr_xy_init(last line.c, m4hh, m4neg)dnl
+ { line from last line.start to tr_xy(-m4nH,0)\
+ for_(-m4nH,m4nH,2,
+ `ifelse(eval(((m4x+m4nH)/2)%2),0,
+ `then to tr_xy(m4x,m4v) \
+ then to tr_xy(eval(m4x+2),m4v) \',
+ `then to tr_xy(m4x,0) \
+ ifelse(m4x,m4nH,,`then to tr_xy(eval(m4x+2),0)')\')')dnl
+ then to last line.end
+ [move from tr_xy(-m4nH,0) to tr_xy(m4nH,0) \
+ then to tr_xy(m4nH,m4v) then to tr_xy(-m4nH,m4v)] \
+ at 2nd last line.c+vec_(0,m4neg`'m4hh*m4v/2) }',
+ m4type,V,
+ `define(`m4ht',`(m4lgth/2)')dnl
+ {line to rvec_(max(0,rp_len/2-m4lgth/2),0)
+ {[m4fshade(m4fill,line to rvec_(0,ifinstr(`$3',R,,-)m4ht/2) \
+ then to rvec_(m4lgth,ifinstr(`$3',R,-)m4ht/2) \
+ then to rvec_(m4lgth,0) then to Here)] at rvec_(m4lgth/2,0) }
+ line from rvec_(m4lgth,0) to rvec_(max(0,rp_len/2+m4lgth/2),0) } ',
+ m4type,B,
+ `resistor(`$1',`$2',sc_draw(`m4type',B),`$4'); M4LBC: last line.c
+ m4lbwd = last [].wid_+lthick*2; m4lbht = last [].ht_+lthick*2
+ [lbox(m4lbwd,m4lbht,thick 0.4)] with .c at M4LBC
+ [lbox(m4lbwd+lthick*4,m4lbht+lthick*4,thick linethick/2)] with .c at M4LBC',
+ m4type,AC,
+ `ebox(`$1')
+ { ACsymbol(at last [],m4cyclewid*3.5/4,m4cyclewid/2,R)
+ [] wid 2nd last [].wid ht 2nd last [].ht at 2nd last [] } ')
+ ifelse(m4type,E,`ebox(`$1')',
+ `line invis from M4S to M4E') ')
-define(`M4_varistor',`eleminit_(`$1')
- define(`m4wd',`dimen_/2')dnl
- define(`m4ht',`dimen_/4')dnl
- {line to rvec_(max(0,rp_len/2-m4wd/2),0)
- {m4fshade(m4fill,line to rvec_(0,ifinstr(`$3',R,,-)m4ht/2) \
- then to rvec_(m4wd/2,0) \
- then to Here)}
- move to rvec_(m4wd,0)
- m4fshade(m4fill,line to rvec_(0,ifinstr(`$3',R,-)m4ht/2) \
- then to rvec_(-m4wd/2,0) \
- then to Here)
- line to rvec_(max(0,rp_len/2-m4wd/2),0) }
- {[box invis ht_ m4ht wid_ m4wd] at rvec_(rp_len/2,0)}
- line to rvec_(rp_len,0) invis ')
-
`potentiometer(linespec, cycles,
fractional pos, length, fractional pos, length,...)
Resistor in a block, tapped at fractional positions
with specified (possibly negative) arrow lengths.
- Taps are labelled T1, T2, ...
- Uses side effects of resistor macro'
+ Taps are labelled T1, T2, ...'
define(`potentiometer',`[R: resistor(`$1',`$2')
- Start: R.start; End: R.end; C: 0.5 between Start and End
+ define(`m4n',`ifelse(`$2',,3,(`$2'))')dnl
+ Start: R.start; End: R.end; C: R.c
m4pot_arrows(1,ifelse(`$3',,0.5,`$3'),ifelse(`$4',,`dimen_*5/12',`$4'),
- shift(shift(shift(shift($@)))))] ')
-define(`m4pot_arrows',`ifelse(`$2',,,`
- x = (`$2')*2*m4n+1; x = (int(x)%4)+(x-int(x))
- M4_Tmp: `$2' between last [].c-vec_(prod_(m4n,m4h),0) \
- and last [].c+vec_(prod_(m4n,m4h),0)
- T`$1': M4_Tmp + vec_(0,ifelse(`$3',,`dimen_*5/12',`$3'))
- { arrow from T`$1' to M4_Tmp+vec_(0,m4h*m4v*(1-(x-2)*sign(x-2))) }
+ shift(shift(shift(shift($@)))))] ')
+define(`m4pot_arrows',`ifelse(`$2',,,`FrP: C+vec_((`$2'-0.5)*m4n*dimen_/6,0)
+ T`$1': FrP + vec_(0,ifelse(`$3',,`dimen_*5/12',`$3'))
+ x = (`$2')*4*m4n+1; x = (int(x)%4)+(x-int(x))
+ {arrow from T`$1' to FrP+vec_(0,dimen_/12*(1-(x-2)*sign(x-2)))}
m4pot_arrows(incr($1),shift(shift(shift($@))))')')
`KelvinR(cycles,[R],cycle wid)
IEEE resistor with kelvin taps added
- if arg1 is blank then a [] block is used'
+ if arg1 is blank then a [] block is used
+ Uses m4nN and tr_xy from resistor'
define(`KelvinR',`[
- M4R: resistor(,`$1',,`$3') define(`m4kRm',`ifinstr(`$2',R,-,+)')
- { dot(at tr_xy(-m4n,0),lthick)
- line to tr_xy(-m4n-1,m4kRm`'2) then to tr_xy(-m4n-1,m4kRm`'4)
+ M4R: resistor(,`$1',,`$3') define(`m4KRm',`ifinstr(`$2',R,-,+)')
+ { dot(at tr_xy(-m4nN,0),lthick)
+ line to tr_xy(-m4nN-1,m4KRm`'2) then to tr_xy(-m4nN-1,m4KRm`'4)
T1: Here
- dot(at tr_xy(m4n,0),lthick)
- line to tr_xy(m4n+1,m4kRm`'2) then to tr_xy(m4n+1,m4kRm`'4)
+ dot(at tr_xy(m4nN,0),lthick)
+ line to tr_xy(m4nN+1,m4KRm`'2) then to tr_xy(m4nN+1,m4KRm`'4)
T2: Here }
Start: M4R.start; End: M4R.end; C: M4R.c
`$4' ]') ')
@@ -375,20 +369,21 @@
`addtaps([ahead | type=ahead;name=Name],
fractional pos, length, fractional pos, length,...)
+ ahead = blank or one of . - <- -> <->
Tap names are Tap1, Tap2, ... or
- Name1, Name2, ... if specified
- ahead = blank or one of . - <- -> <-> '
+ Name1, Name2, ... if specified'
define(`addtaps',`
ifelse(`$2',,`undefine(`m4tap_x')popdef(`m4type',`m4name')',
`ifdef(`m4tap_x',`define(`m4tap_x',incr(m4tap_x))',
- `define(`m4tap_x',1) M4tap_w: last [].w_; M4tap_e: last [].e_
+ `define(`m4tap_x',1) dnl 1st time through
+ M4tap_w: last [].w_; M4tap_e: last [].e_
pushkeys_(`$1',type::N; name:Tap:N)dnl
- ifelse(m4type,,`ifinstr(`$1',=,,`define(`m4type',`$1')')')dnl
+ ifelse(m4type,,`ifinstr(`$1',=,,`poppushdef(`m4type',`$1')')')dnl
M4tap_xy: (last [].wid_,last [].ht_)')
{define(`m4tapl',`ifelse(`$3',,`dimen_/3',`$3')')dnl
move to (`$2' between M4tap_w and M4tap_e) + vec_(0,sign(m4tapl)*M4tap_xy.y/2)
- ifinstr(m4type,.,`{dot(,lthick)}define(`m4type')');dnl
- line ifelse(m4type,-,,m4type) to rvec_(0,m4tapl)
+ ifinstr(m4type,.,`{dot(,lthick)}');dnl
+ line ifelse(m4type,.,,m4type,-,,m4type) to rvec_(0,m4tapl)
m4name`'m4tap_x: Here }
addtaps(,shift(shift(shift($@))))')')
@@ -565,20 +560,30 @@
define(`m4trdot',`{`$6'dot(at (0.5 between `$1' and `$2') \
+vec_(`$3'(`$4'+m4hlw)/2,`$5'dimen_/16), dotrad_/2)}')
- `delay( linespec, width, attributes )'
+ `delay( linespec, width, attributes or keys )
+ keys:
+ wdth=expr;
+ lgth=expr;
+ type=A|S;
+ body=attributes; e.g. shaded '
define(`delay',`eleminit_(`$1')
- define(`m4ht',`ifelse(`$2',,`delay_rad_*2',`($2)')')dnl
- define(`m4wd',`m4ht*5/6')dnl
- { line to rvec_(rp_len/2-m4wd/2,0)
- { line from rvec_(m4ht/3,-m4ht/2) \
- to rvec_(0,-m4ht/2)\
- then to rvec_(0,m4ht/2) \
- then to rvec_(m4ht/3,m4ht/2) `$3'
- arc cw from Here to rvec_(0,-m4ht) with .c at rvec_(0,-m4ht/2) `$3' }
- move to rvec_(m4wd,0)
- line to rvec_(rp_len/2-m4wd/2,0) }
- { [box invis ht_ m4ht wid_ m4wd ] at rvec_(rp_len/2,0)}
- line to rvec_(rp_len,0) invis ')
+ pushkeys_(`$3',`wdth:ifelse(`$2',,delay_rad_*2,`$2'); lgth:m4`'wdth*5/6;
+ type:A:N; body::N;') dnl
+ ifinstr(`$3',=,,`ifelse(m4body,,`poppushdef(`m4body',`$3')')')dnl
+ ifelse(m4type,S,`popdef(`m4lgth',`m4wdth')dnl
+ pushkeys_(`$3',`lgth:dimen_*6/5; wdth:m4`'lgth/4')')dnl
+ { line to rvec_(rp_len/2-m4lgth/2,0)
+ {ifelse(m4type,A,`[ W: Here
+ line from rvec_(m4wdth/3,-m4wdth/2) to rvec_(0,-m4wdth/2) \
+ then to rvec_(0,m4wdth/2) then to rvec_(m4wdth/3,m4wdth/2) m4body
+ arc cw to rvec_(0,-m4wdth) with .c at rvec_(0,-m4wdth/2) m4body ]',
+ m4type,S,
+ `rotbox(m4lgth,m4wdth,m4body,r=m4wdth/2,
+ {rotbox(m4wdth/4,m4wdth,) with .W at rvec_(-m4lgth+m4wdth/2,0)})')\
+ with .W at Here }
+ line from rvec_(m4lgth,0) to rvec_(rp_len/2+m4lgth/2,0) }
+ line to rvec_(rp_len,0) invis dnl
+ popdef(`m4wd',`m4wdth',`m4type',`m4body') ')
`xtal( linespec, keys ) (2-terminal crystal)
keys:
@@ -594,15 +599,15 @@
outer= outer circle attributes; (dotted ...)
inner= inner circle attributes; (shaded ...)'
define(`xtal',`eleminit_(`$1') pushkey_(`$2',type,N,N)
- ifelse(m4type,R,`pushkeys_(`$2',`outerdiam:dimen_/3; innerdiam:m4outerdiam*0.4;
- outer::N; inner::N') define(`m4wd',m4outerdiam) ',
+ ifelse(m4type,R,`pushkeys_(`$2',`outerdia:dimen_/3;innerdia:m4`'outerdia*0.4;
+ outer::N; inner::N;') define(`m4wd',m4outerdia) ',
`pushkeys_(`$2',`wdth:dimen_/4; lgth:m4wdth*2/3; bxwd:m4lgth/2; box::N;')dnl
define(`m4wd',m4lgth) ')
{ line to rvec_(rp_len/2-m4wd/2,0)
{[ Orig: Here; ifelse(m4type,R,
- `{circle diam m4outerdiam at rvec_(m4outerdiam/2,0) m4outer}
- {circle diam m4innerdiam at rvec_(m4outerdiam/2,0) m4inner}
- popdef(`m4type',`m4outerdiam',`m4innerdiam',`m4outer',`m4inner') ',
+ `{circle diam m4outerdia at rvec_(m4outerdia/2,0) m4outer}
+ {circle diam m4innerdia at rvec_(m4outerdia/2,0) m4inner}
+ popdef(`m4type',`m4outerdia',`m4innerdia',`m4outer',`m4inner') ',
`{line from rvec_(0,-m4wdth/3) \
to rvec_(0,m4wdth/3)}
{ move to rvec_(m4lgth/2-m4bxwd/2,0)
@@ -631,7 +636,8 @@
ii = double arrowhead current source;
AC = AC source; B = bulb; F = fluorescent; G =
generator; H = step function; L = lamp;
- N = neon; P = pulse; Q = charge; R = ramp; r = right
+ N = neon; NA = neon 2; NB = neon 3;
+ P = pulse; Q = charge; R = ramp; r = right
orientation; S = sinusoid; SC = quarter arc; SE =
arc; T = triangle; U = square-wave; X = interior X;
other = custom interior label or waveform;
@@ -691,14 +697,28 @@
then to rvec_(m4h/2,0)
round
line to rvec_(m4h*3/4,0)}',
+ `$2',NA,`{ line from rvec_(-m4h,0) \
+ to rvec_(-m4h/5,0)
+ { line to rvec_(0,m4h) with .c at Here } }
+ { line from rvec_(m4h,0) \
+ to rvec_(m4h/5,0)
+ { line to rvec_(0,m4h) with .c at Here } }
+ { dot(at rvec_(-m4h/2,-m4h/2)) } ',
+ `$2',NB,`{ line from rvec_(-m4h,0) \
+ to rvec_(-m4h/2,0)
+ { line to rvec_(0,m4h) with .c at Here } }
+ { line from rvec_(m4h,0) \
+ to rvec_(m4h/2,0)
+ { dot(,,1) } }
+ { dot(at rvec_(0,-m4h/2)) } ',
`$2',N,`{ {line from rvec_(-m4h,0) \
to rvec_(-m4h/2,0)}
for_(70,250,180,
`{ line from rvec_(Rect_(m4h/2,-m4x)) \
- to rvec_(Rect_(m4h/2,m4x))
+ to rvec_(Rect_(m4h/2,m4x))
round }
{ arc cw from rvec_(Rect_(m4h/2,m4x)) \
- to rvec_(Rect_(m4h/2,-m4x)) \
+ to rvec_(Rect_(m4h/2,-m4x)) \
with .c at Here
round }')
{line from rvec_(m4h/2,0) \
@@ -834,6 +854,18 @@
{[box invis ht_ 2*csdim_ wid_ 2*csdim_] at rvec_(rp_len/2,0)}
line to rvec_(rp_len,0) invis ')')
+ `geiger( linespec, r, diameter, R, attributes, body name)
+ Arguments as for source except arg2 r = right orientation '
+define(`geiger',`pushdef(`m4h',ifelse(`$3',,`sourcerad_',`($3)/2'))dnl
+ pushdef(`m4R',`ifelse(`$4',R,+180)')dnl
+ source(`$1',F,shift(shift($@)))
+ {dot(at rvec_(-rp_len/2,0)+vec_(Rect_(m4h*2/3,ifelse(`$2',r,,-)110 m4R)))}
+ {"iflatex($+$,+)" at rvec_(-rp_len/2,0) \
+ +vec_(Rect_(m4h*3/2,ifelse(`$2',r,,-)30 m4R))}
+ {em_arrows(ND,rp_ang*rtod_ ifelse(`$2',r,+,-)135 m4R,m4h) with .Head \
+ at rvec_(-rp_len/2,0)+vec_(Rect_(m4h*5/4,ifelse(`$2',r,-)45 m4R))} dnl
+ popdef(`m4h',`m4R') ')
+
`Proxim(size, U|D|L|R|degrees, attributes)
Proximity symbol
Arg2 default: current direction'
@@ -888,7 +920,7 @@
`ebox(linespec, length, ht, greyvalue,
box attributes)
- Length and ht (of the elemet) are relative to
+ Length and ht (of the element) are relative to
the direction of linespec'
Alternative:
`ebox(linespec, keys)
@@ -902,23 +934,23 @@
line to rvec_(max(0,rp_len/2-m4lgth/2),0); M4ebC: rvec_(m4lgth/2,0)
lbox(m4lgth,m4wdth,m4box)
ifelse(m4text,,,`{m4text at M4ebC};')',
- `define(`m4lgth',`ifelse(`$2',,dimen_/2,`$2')')dnl
- define(`m4wdth',`ifelse(`$3',,dimen_/5,`$3')')dnl
+ `pushdef(`m4lgth',`ifelse(`$2',,dimen_/2,`$2')')dnl
+ pushdef(`m4wdth',`ifelse(`$3',,dimen_/5,`$3')')dnl
line to rvec_(max(0,rp_len/2-m4lgth/2),0)
ifelse(`$4',,`lbox(m4lgth,m4wdth,`$5')',
`m4fshade(`$4',lbox(m4lgth,m4wdth,`$5'))')')
line to rvec_(max(0,rp_len/2-m4lgth/2),0)}
{[ box invis ht_ m4wdth wid_ m4lgth ] at rvec_(rp_len/2,0)}
- ifinstr(`$2',=,`popdef(`m4lgth',`m4wdth',`m4text',`m4box')')dnl
+ popdef(`m4wdth',`m4lgth')ifinstr(`$2',=,`popdef(`m4text',`m4box')')dnl
line to rvec_(rp_len,0) invis ')
`fuse( linespec, chars, wid, ht, attributes )
chars dA|B|C|D|S|SB|HB|HC or dA (=D)'
define(`fuse',`eleminit_(`$1')
- define(`m4fusetype',`ifelse(`$2',,A,`$2',D,dA,`$2')')dnl
- define(`m4ht',ifelse(`$4',,`dimen_/5'ifinstr(`$2',H,*5/3),`($4)'))dnl
- define(`m4d',ifinstr(`$2',H,`m4ht/5',0))dnl
- define(`m4wd',ifelse(`$3',,`m4ht*2',`($3)'))dnl
+ pushdef(`m4fusetype',`ifelse(`$2',,A,`$2',D,dA,`$2')')dnl
+ pushdef(`m4ht',ifelse(`$4',,`dimen_/5'ifinstr(`$2',H,*5/3),`($4)'))dnl
+ pushdef(`m4d',ifinstr(`$2',H,`m4ht/5',0))dnl
+ pushdef(`m4wd',ifelse(`$3',,`m4ht*2',`($3)'))dnl
{line to rvec_(max(0,rp_len/2-m4wd/2),0)
sc_draw(`m4fusetype',HB,
`{move to rvec_(m4d,0); lbox(m4wd-2*m4d,m4ht-2*m4d)}
@@ -959,6 +991,7 @@
move to rvec_(m4wd,0); line to rvec_(max(0,rp_len/2-m4wd/2),0)')
}
{[box invis ht_ m4ht wid_ m4wd] at rvec_(rp_len/2,0)}
+ popdef(`m4wd',`m4d',`m4ht',`m4fusetype')dnl
line to rvec_(rp_len,0) invis ')
`arrester( linespec, [G|E|S][D[L|R]],
@@ -1113,7 +1146,7 @@
cycles=expr;
line=attributes'
define(`heatere',
-`pushkeys_(`$2',`lgth:dimen_/2; wdth:m4lgth*2/5; cycles:3; line::N;')dnl
+`pushkeys_(`$2',`lgth:dimen_/2; wdth:m4`'lgth*2/5; cycles:3; line::N;')dnl
ifinstr(`$3',R,`pushdef(`m4ng',-)pushdef(`m4cw')pushdef(`m4ccw',cw)',
`pushdef(`m4ng') pushdef(`m4cw',cw)pushdef(`m4ccw')')dnl
eleminit_(ifinstr(`$3',T,m4wdth,`$1'))
@@ -1738,16 +1771,16 @@
`integrator( linespec,size,attributes )'
define(`integrator',`eleminit_(`$1')
define(`m4wd',`ifelse(`$2',,`dimen_',`($2)')')dnl
- {line from rvec_(m4wd/4,m4wd/2) \
+ {[ In: Here
+ {line from rvec_(m4wd/4,m4wd/2) \
to rvec_(0,m4wd/2) \
then to rvec_(0,-m4wd/2) \
then to rvec_(m4wd/4,-m4wd/2) `$3' }
- {line from rvec_(m4wd*5/4,0) \
- to rvec_(m4wd/4,m4wd/2) \
- then to rvec_(m4wd/4,-m4wd/2) \
- then to rvec_(m4wd*5/4,0) `$3' }
+ line from rvec_(m4wd*5/4,0) \
+ to rvec_(m4wd/4,m4wd/2) \
+ then to rvec_(m4wd/4,-m4wd/2) \
+ then to rvec_(m4wd*5/4,0) `$3' ; Out: Here ] with .In at Here}
{line from rvec_(m4wd*5/4,0) to rvec_(max(rp_len,m4wd*5/4),0) }
- { [box invis ht_ m4wd wid_ m4wd*5/4] at rvec_(m4wd*5/8,0) }
line to rvec_(max(rp_len,m4wd*5/4),0) invis ')
`opamp(linespec,
@@ -1765,7 +1798,7 @@
T: truncated point '
define(`opamp',
`[ pushdef(`m4dlgth',`ifinstr(`$4',=,dimen_,ifelse(`$4',,dimen_,`($4)'))')dnl
- pushkeys_(`$4',body::N; lgth:m4dlgth; wdth:m4lgth;)dnl
+ pushkeys_(`$4',`body::N; lgth:m4dlgth; wdth:m4`'lgth;')dnl
pushdef(`dna_',`$5')dnl
eleminit_(`$1',max(elen_-m4lgth/4,m4lgth))
W: Here
@@ -2224,23 +2257,23 @@
`tgate( linespec, [B][R|L] ) Transmission gate
B= box form
L= left orientation'
-define(`tgate',`[ eleminit_(`$1') define(`m4tgm',ifinstr(`$2',L,-))
+define(`tgate',`[ eleminit_(`$1') pushdef(`m4tgm',ifinstr(`$2',L,-))
A: last line.start
B: last line.end
C: last line.center
ifinstr(`$2',B,
- `ebox(from A to B)
- Gb: C+vec_(0,m4tgm`'m4wdth/2)
+ `ebox(from A to B,,dimen_/5)
+ Gb: C+vec_(0,m4tgm`'dimen_/5/2)
L1: line from 2 between Gb and C to 4 between Gb and C',
- `m4gen_d(uLAQuR)
+ `m4gen_d(uLAQuR) pushdef(`m4dv',`dimen_/6')pushdef(`m4dh',sqrt(3)*m4dv/2)
Circle: circle thick max(4pt__,linethick/2) rad m4dh/4 \
at C+vec_(0,m4tgm`'m4dh/4*4/3)
L2: line from last circle+vec_(0,m4tgm`'m4dh/4) \
to C+vec_(0,m4tgm`'m4dh*3/2)
Gb: Here
- L3: line from C to C-vec_(0,m4tgm`'m4dh) ')
+ L3: line from C to C-vec_(0,m4tgm`'m4dh) popdef(`m4dv',`m4dh')')
G: Here
- `$3']')
+ `$3' popdef(`m4tgm')]')
`ptrans( linespec, [R|L] ) Pass transistor
L= left orientation'
define(`ptrans',`[ eleminit_(`$1') define(`m4ptm',ifinstr(`$2',L,-))
@@ -2739,7 +2772,9 @@
sc_draw(dna string, chars, iftrue, iffalse)'
define(`sc_draw',`m4_dna(`$1',`$2')ifelse(m4I_,-1,`$4',`$3')')
- `Element labels at the start, centre, and end
+ `(r|l|c)label( label, label, label,
+ relative position, block name )
+ Element labels at the start, centre, and end
of the last [] block (or a named [] block)
in the current direction. Labels are
spaced and treated as math, but copied
@@ -2799,16 +2834,16 @@
ifinstr(`$6',L,ljust,`$6',R,rjust) dnl
ifinstr(`$6',A,above,`$6',B,below) };') ifsvg(`changecom(`#',)')')
- `eleminit_( linespec, default length )
- compute element direction and length.
- Eleminit_ defines the position, length,
- and angle of two-terminal elements. It calls
- rpoint_ with its linespec or circuit-element
- default. The rpoint_ macro draws the invisible
- line determined by its argument, calculates the
- length and angle, and gives the angle to the
- point_ macro to set the rotation parameters used
- by vec_ and rvec_.'
+ `eleminit_( linespec, default length )
+ compute element direction and length.
+ eleminit_ defines the position, length,
+ and angle of two-terminal elements. It calls
+ rpoint_ with its linespec or circuit-element
+ default. The rpoint_ macro draws the invisible
+ line determined by its argument, calculates the
+ length and angle, and gives the angle to the
+ point_ macro to set the rotation parameters used
+ by vec_ and rvec_.'
define(`eleminit_',
`rpoint_(ifelse(`$1',,`to rvec_(ifelse(`$2',,`elen_',`$2'),0)',`$1'))')
@@ -2866,48 +2901,6 @@
] with .Start at Here; move to last [].End
')
-ifelse(0,1,` dnl ignore the following two macro defs ##################
- `par_( element, element, separation )
- Parallel combination of two branches that have
- the same direction and length. The
- branch arguments must be quoted, e.g.
- par_(`resistor',`capacitor',dimen_)'
-` ***WARNING: this macro is considered obsolete'
-define(`par_',`[Start: Here; r = ifelse(`$3',,`dimen_',`$3')
- { move to Start + vec_(0,r/2); $1 }
- line from Start + vec_(0,r/2) \
- to Start + vec_(0,-r/2) ; $2
- line to rvec_(0,r)
- End: last line.c; `$4'] with .Start at Here
- move to last [].End')
-
- `gpar_( element, element, separation )
- Parallel combination of two branches that have
- the same direction, e.g.:
- down_; gpar_(
- resistor;llabel(,R_1);resistor;llabel(,R_2),
- capacitor;rlabel(,C))
- This macro trades simplicity for generality
- and robustness to gpic'
-` ***WARNING: this macro is considered obsolete'
-define(`gpar_',
- `[ M4_B1: Here; `$1'; M4_E1: Here
- M4_C: 0.5 between M4_B1 and M4_E1; eleminit_(from M4_B1 to M4_E1)
- E2:[ M4_B: Here; `$2'; M4_E: Here; `$4'] \
- with .c at M4_C + (rect_(ifelse(`$3',,`dimen_',`$3'),rp_ang-pi_/2))
- M4_B2: E2.M4_B; M4_E2: E2.M4_E
- s = distance(M4_B2,M4_E2)
- if rp_len*s == 0 then { r = 1 } else { r = (1+max(rp_len/s, s/rp_len))/2 }
- if rp_len < s then { Tmp:M4_B2; M4_B2:M4_B1; M4_B1:Tmp
- Tmp:M4_E2; M4_E2:M4_E1; M4_E1:Tmp }
- line from M4_B2 to r between M4_E2 and M4_B2
- Start: 0.5 between Here and M4_B1; line to M4_B1
- line from M4_E2 to r between M4_B2 and M4_E2
- End: 0.5 between Here and M4_E1
- C: 0.5 between Start and End; line to M4_E1 ] with .Start at Here
- move to last [].End ')
-') dnl end of ignore ########################
-
define(`m4sepdefault',`dimen_') `Default separation in the parallel_ macro'
define(`m4lendefault',`dimen_') `Default length in the series_ macro'
@@ -3180,6 +3173,7 @@
SO slow operating
SOR slow operating and release
SR slow release
+ S diagonal slash
HS high speed
NAC unaffected by AC current
AC AC current
@@ -3230,6 +3224,8 @@
sc_draw(`rcdna_',HS,
`{ move to rvec_(0,-(m4ht*5/8)); lbox(m4wd,m4ht/4) }
{ move to rvec_(m4wd/2,-(m4ht/2)); line to rvec_(0,-m4ht/4)} ')
+ sc_draw(`rcdna_',S,
+ `{ line from rvec_(0,m4ht/2) to rvec_(m4wd,-m4ht/2)}')
sc_draw(`rcdna_',NAC,
`{ m4fshade(0,lbox(m4wd/4,m4ht)) }
{ move to rvec_(m4wd*3/4,0); m4fshade(0,lbox(m4wd/4,m4ht)) } ')
@@ -3549,8 +3545,8 @@
move to Box.nw+(0,-d); down_
m4portpins(-plg,d*r,d,W,`$8')
# `North side'
- ifelse(`$3',,,`define(`m4n',`($3)')
- d = Box.wid/(m4n*(r+1)+1)
+ define(`m4n',`($3)')
+ ifelse(`$3',,,`d = Box.wid/(m4n*(r+1)+1)
move to Box.nw+(d,0); right_
m4portpins(plg,d*r,d,N,`$8')')
# `East side'
@@ -3559,11 +3555,11 @@
move to Box.ne+(0,-d); down_
m4portpins(plg,d*r,d,E,`$8')
# `South side'
- ifelse(`$5',,,`define(`m4n',`($5)')
- d = Box.wid/(m4n*(r+1)+1)
+ define(`m4n',`($5)')
+ ifelse(`$5',,,`d = Box.wid/(m4n*(r+1)+1)
move to Box.sw+(d,0); right_
m4portpins(-plg,d*r,d,S,`$8')')
- `$9']')
+ `$9' undefine(`m4n')]')
define(`m4portpins',`for_(1,m4n,1,
`{ if (`$1' != 0) then { line to rvec_(0,`$1') }
`$4'`'m4x`'a: ifelse(xtract(`$5',N),N,Here,`dot') }
@@ -3599,8 +3595,8 @@
define(`proximity',`consource(`$1',P)')
`nullator(linespec, wid, ht, attributes)'
define(`nullator',`eleminit_(`$1')
- define(`m4wd',ifelse(`$2',,`dimen_/2',`($2)'))dnl
- define(`m4ht',ifelse(`$3',,`dimen_/4',`($3)'))dnl
+ pushdef(`m4wd',ifelse(`$2',,`dimen_/2',`($2)'))dnl
+ pushdef(`m4ht',ifelse(`$3',,`dimen_/4',`($3)'))dnl
{line to rvec_(max(0,rp_len/2-m4wd/2),0)
move to rvec_(m4wd/2,0)
{ spline ifdpic(0.58) from rvec_(ifdpic(0,-m4wd/20),m4ht/2) \
@@ -3617,11 +3613,11 @@
line from rvec_(m4wd/2,0) \
to rvec_(max(0,rp_len/2),0)}
{[box invis ht_ m4ht wid_ m4wd] at rvec_(rp_len/2,0)}
- line to rvec_(rp_len,0) invis ')
+ line to rvec_(rp_len,0) invis popdef(`m4wd',`m4ht') ')
`norator(linespec, wid, ht, attributes)'
define(`norator',`eleminit_(`$1')
- define(`m4wd',ifelse(`$2',,`dimen_/2',`($2)'))dnl
- define(`m4ht',ifelse(`$3',,`dimen_/4',`($3)'))dnl
+ pushdef(`m4wd',ifelse(`$2',,`dimen_/2',`($2)'))dnl
+ pushdef(`m4ht',ifelse(`$3',,`dimen_/4',`($3)'))dnl
{line to rvec_(max(0,rp_len/2-m4wd/2),0)
move to rvec_(m4wd/2,0)
for i=-1 to 1 by 2 do { {
@@ -3633,7 +3629,7 @@
line from rvec_(m4wd/2,0) \
to rvec_(max(0,rp_len/2),0)}
{[box invis ht_ m4ht wid_ m4wd] at rvec_(rp_len/2,0)}
- line to rvec_(rp_len,0) invis ')
+ line to rvec_(rp_len,0) invis popdef(`m4wd',`m4ht') ')
`ACsymbol(at position, len, ht, [n:][A]U|D|L|R|degrees,
attributes)
@@ -3736,8 +3732,8 @@
move to Box.nw+(0,-d); down_
m4termpins(-plg,d,W,`$7')
# `North side'
- ifelse(`$3',,,`define(`m4n',`($3)')
- d = Box.wid/(m4n+1)
+ define(`m4n',`($3)') ifelse(`$3',,,
+ `d = Box.wid/(m4n+1)
move to Box.nw+(d,0); right_
m4termpins(plg,d,N,`$7')')
# `East side'
@@ -3750,7 +3746,7 @@
d = Box.wid/(m4n+1)
move to Box.sw+(d,0); right_
m4termpins(-plg,d,S,`$7')
- `$8']')
+ `$8' undefine(`m4n')]')
define(`m4termpins',`for_(1,m4n,1,
`{ if (`$1' != 0) then { line to rvec_(0,`$1') }
`$3'`'m4x: ifelse(xtract(`$4',N),N,Here,`dot') }
@@ -3759,8 +3755,8 @@
`speaker(U|D|L|R|degrees, vert size, type, attributes)
type=H horn'
define(`speaker',`[setdir_($1,R)
- define(`m4v',`ifelse(`$2',,`dimen_/3',`($2)/4')')dnl
- define(`m4h',`m4v*sqrt(2)')dnl
+ pushdef(`m4v',`ifelse(`$2',,`dimen_/3',`($2)/4')')dnl
+ pushdef(`m4h',`m4v*sqrt(2)')dnl
ifelse(`$3',H,
`{H1: line from rvec_(m4h,m4v/2) \
to rvec_(m4h*3/2,m4v*7/8) \
@@ -3779,11 +3775,11 @@
In5: rvec_(m4h*3/4,m4v)
In6: rvec_(m4h/4,-m4v)
In7: rvec_(m4h*3/4,-m4v)
- `$5'; resetdir_ ]')
+ `$5'; resetdir_ popdef(`m4v',`m4h') ]')
`bell(U|D|L|R|degrees, vert size, attributes)'
define(`bell',`[setdir_($1,R)
- define(`m4h',`ifelse(`$2',,`dimen_/2',`($2)')')dnl
+ pushdef(`m4h',`ifelse(`$2',,`dimen_/2',`($2)')')dnl
{lbox(m4h,m4h,`$3')}
{Box: box invis ht_ m4h wid_ m4h at rvec_(m4h/2,0)}
{Circle: circle diameter m4h at rvec_(m4h*3/2,0) `$3'}
@@ -3790,13 +3786,13 @@
In1: rvec_(0,m4h/4)
In2: Here
In3: rvec_(0,-m4h/4)
- `$4'; resetdir_ ]')
+ `$4'; resetdir_ popdef(`m4h') ]')
`microphone(A|U|D|L|R|degrees, vert size,
attributes)
Arg1= A, upright mic
Thanks to Arnold Knott'
define(`microphone',`ifinstr(`$1',A,
- `[ define(`m4sfact',`(ifelse(`$2',,dimen_,(`$2'))*8/5)')
+ `[ pushdef(`m4sfact',`(ifelse(`$2',,dimen_,(`$2'))*8/5)')
circlerad = m4sfact/1000
cspace = m4sfact/100
bwd = m4sfact/10
@@ -3812,9 +3808,9 @@
for j=-1 to 1 do {
{ circle at Here+(3*j*cspace,(abs(j)-3)*cspace) }
if j != 0 then {{ circle at Here+(j*3/2*cspace,0) }} }
- move up 5*cspace }; ]',
+ move up 5*cspace }; popdef(`m4sfact')]',
`[setdir_($1,R)
- define(`m4h',`ifelse(`$2',,`dimen_/2',`($2)')')dnl
+ pushdef(`m4h',`ifelse(`$2',,`dimen_/2',`($2)')')dnl
{L1: line from rvec_(m4h,-m4h/2) \
to rvec_(m4h,m4h/2)}
{Circle: circle diameter m4h at rvec_(m4h/2,0) `$3'}
@@ -3821,13 +3817,13 @@
In1: rvec_(m4h*(2-sqrt(3))/4,m4h/4)
In2: Here
In3: rvec_(m4h*(2-sqrt(3))/4,-m4h/4)
- `$4'; resetdir_ ]')')
+ `$4'; resetdir_ popdef(`m4h') ]')')
`buzzer(U|D|L|R|degrees, vert size,[C],
attributes)'
define(`buzzer',`[setdir_($1,R)
ifelse(`$3',,
- `define(`m4h',`ifelse(`$2',,`dimen_/2',`($2)')')dnl
+ `pushdef(`m4h',`ifelse(`$2',,`dimen_/2',`($2)')')dnl
{L1: line from rvec_(m4h,0) \
to rvec_(m4h,m4h/2) \
then to rvec_(0,m4h/2) \
@@ -3839,20 +3835,20 @@
to rvec_(m4h,m4h/2)+vec_(Rect_(m4h,-75))}
In1: rvec_(0,m4h/4)
In2: Here
- In3: rvec_(0,-m4h/4)',
- `$3',C,`define(`m4h',`ifelse(`$2',,`(dimen_/3)',`(($2)/2)')')dnl
+ In3: rvec_(0,-m4h/4) popdef(`m4h')',
+ `$3',C,`pushdef(`m4h',`ifelse(`$2',,`(dimen_/3)',`(($2)/2)')')dnl
{Face: line from rvec_(m4h,-m4h) \
to rvec_(m4h,m4h)}
{arc ccw from Face.end to Face.start with .c at Face.c `$4'}
In1: rvec_(m4h-sqrt(m4h^2-(m4h/3)^2),m4h/3)
In2: Here
- In3: rvec_(m4h-sqrt(m4h^2-(m4h/3)^2),-m4h/3)')
+ In3: rvec_(m4h-sqrt(m4h^2-(m4h/3)^2),-m4h/3) popdef(`m4h') ')
`$5'; resetdir_ ]')
`earphone(U|D|L|R|degrees, size, [C][R],
attributes)
earphone pair if arg3 contains C'
define(`earphone',`[ setdir_($1,R)
- define(`m4h',`ifelse(`$2',,`dimen_',`($2)')')dnl
+ pushdef(`m4h',`ifelse(`$2',,`dimen_',`($2)')')dnl
ifinstr(`$3',C,
`L: circle diam m4h*0.4 `$4'
R: circle diam m4h*0.4 at L+vec_(m4h,0) `$4'
@@ -3868,7 +3864,7 @@
In1: rvec_(0,m4h/8)
In2: Here
In3: rvec_(0,-m4h/8)')
- `$5'; resetdir_ ]')
+ `$5'; resetdir_ popdef(`m4h') ]')
`Signal-flow graph macros: labeled node,
directed labeled chopped straight line,
@@ -4023,9 +4019,7 @@
define(`tstrip',`[ setdir_(`$1')
define(`m4n',`ifelse(`$2',,4,`eval($2)')')dnl
ifelse(eval(m4n<1),1,`define(`m4n',1)')dnl
- pushkeys_(`$3',ht:dimen_/2; wid:m4n*m4ht*0.6; box::N;)
-# pushkey_(`$3',ht,dimen_/2)dnl
-# pushkey_(`$3',wid,m4n*m4ht*0.6)dnl
+ pushkeys_(`$3',`ht:dimen_/2; wid:m4n*m4`'ht*0.6; box::N;')
{Box: [shade(1,lbox(m4wid,m4ht,m4box))] }
bw = m4wid/(m4n)
ifinstr(`$3',O,,`for i=1 to m4n-1 do {
@@ -4122,12 +4116,11 @@
with respect to the current drawing direction. The
default diameter is dimen_'
define(`SQUID',
-`[ define(`m4sqn',`ifelse(`$1',,2,`$1')')dnl
- define(`m4ssz',`ifelse(`$2',,`dimen_',`$2')')dnl
- define(`m4sof',`ifelse(`$3',,-90,`$3')')dnl
- define(`m4ssg',`ifelse(`$4',,+,`$4',ccw,+,-)(m4x-1)/(m4sqn)*360')dnl
- define(`m4sxlen',C.rad/4)dnl
-
+`[ pushdef(`m4sqn',`ifelse(`$1',,2,`$1')')dnl
+ pushdef(`m4ssz',`ifelse(`$2',,`dimen_',`$2')')dnl
+ pushdef(`m4sof',`ifelse(`$3',,-90,`$3')')dnl
+ pushdef(`m4ssg',`ifelse(`$4',,+,`$4',ccw,+,-)(m4x-1)/(m4sqn)*360')dnl
+ pushdef(`m4sxlen',C.rad/4)dnl
C: circle diam m4ssz
for_(1,m4sqn,1,
`move to C+vec_(Rect_(C.rad,m4sof`'m4ssg))
@@ -4136,7 +4129,7 @@
to rvec_(Rect_(m4sxlen,m4sof`'m4ssg+225)) }
{ line from rvec_(Rect_(m4sxlen,m4sof`'m4ssg-45)) \
to rvec_(Rect_(m4sxlen,m4sof`'m4ssg-225)) }')
- `$5' ]')
+ `$5' popdef(`m4sqn',`m4ssz',`m4sof',`m4ssg',`m4sxlen') ]')
`==============================================================================
Customizations:
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/libgen.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/libgen.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/libgen.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -2,7 +2,7 @@
libgen.m4 Base macros for dpic and gpic diagrams
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -156,7 +156,7 @@
hght=expr; arrowhead height
wdth=expr; arrowhead width'
define(`sfg_init',`cct_init
- pushkeys_(`$1',blen:m4bxx; rad:m4rxx; hght:m4hxx; wdth:m4wxx)dnl
+ pushkeys_(`$1',`blen:m4bxx; rad:m4rxx; hght:m4hxx; wdth:m4wxx')dnl
sfg_wid = ifelse(m4blen,(m4bxx),ifelse(`$1',,linewid/3*2.75,`$1'),m4blen)
sfg_rad = ifelse(m4rad,(m4rxx),ifelse(`$2',,1/32,`$2'),m4rad)
sfg_aht = ifelse(m4hght,(m4hxx),ifelse(`$3',,1/16,`$3'),m4hght)
@@ -192,7 +192,7 @@
`$2')')
define(`m4announceprocessor',`dnl Do not change the format of the next line:
-`#' `$1' Version 10.5: ifelse(m4picprocessor,gpic,`Gpic',
+`#' `$1' Version 10.6: ifelse(m4picprocessor,gpic,`Gpic',
m4postprocessor,pstricks,`PSTricks',
m4postprocessor,pgf,`TikZ PGF',
m4postprocessor,mfpic,`Mfpic',
@@ -872,7 +872,8 @@
identifier:default value:N
containing up to 3 fields separated by arg 4
(default :). The separators may not appear
- elsewhere in the terms.'
+ elsewhere in the terms and a key must not
+ be the tail of another key.'
define(`pushkeys_',`Loopover_(`M4Z',
`pushkey_(`$1',patsubst(M4Z,ifelse(`$4',,:,`$4'),`,'))dnl',
patsubst(`$2',ifelse(`$3',,;,`$3'),`,'))')
@@ -884,7 +885,8 @@
identifier:default value:N
containing up to 3 fields separated by arg 4
(default :). The separators may not appear
- elsewhere in the terms.'
+ elsewhere in the terms and a key must not
+ be the tail of another key.'
define(`setkeys_',`Loopover_(`M4Z',
`setkey_(`$1',patsubst(M4Z,ifelse(`$4',,:,`$4'),`,'))dnl',
patsubst(`$2',ifelse(`$3',,;,`$3'),`,'))')
@@ -960,7 +962,7 @@
circle=attributes; '
define(`dotrad_',(0.02*scale))
define(`dot',`[ define(`m4ft',`ifelse(`$3',,0,(`$3'))')dnl
- pushkeys_(`$2',rad:m4nul:N;circle:fill_(m4ft):N)dnl
+ pushkeys_(`$2',`rad:m4nul:N;circle:fill_(m4ft):N')dnl
ifelse(m4rad,m4nul,`popdef(`m4rad')pushdef(`m4rad',
`ifinstr(`$2',=,`dotrad_',`ifelse(`$2',,`dotrad_',(`$2'))')')')dnl
ifdef(`r_',`rgbfill(r_+(1-r_)*m4ft, g_+(1-g_)*m4ft, b_+(1-b_)*m4ft,
@@ -973,7 +975,7 @@
keys: size=expr;
line=attributes; (line attributes) '
define(`cross',`[
- pushkeys_(`$2',size:m4nul:N;line::N)dnl
+ pushkeys_(`$2',`size:m4nul:N;line::N')dnl
ifelse(m4size,m4nul,`popdef(`m4size')pushdef(`m4size',
`ifinstr(`$2',=,(0.05*scale),ifelse(`$2',,(0.05*scale),(`$2')))')')dnl
line from (0,-m4size/2) to (0,m4size/2) m4line
@@ -1009,25 +1011,28 @@
shadowed(box shaded "yellow" rad 0.1 "Text",
shadowthick=3bp__;shadowcolor="lightgray")'
define(`shadowed',`define(`m4object',`ifelse(`$1',,box,`$1')')dnl
- pushkeys_(`$3',attrib::N; rad:;
- shadowthick:lthick*5/4; shadowcolor:"gray":N; shadowangle:-45 )dnl
- ifelse(m4object,box,`box m4attrib ifelse(m4rad,,,`rad m4rad invis') `$2'
+ pushkeys_(`$3',`attrib::N; rad:;
+ shadowthick:lthick*5/4; shadowcolor:"gray":N; shadowangle:-45')dnl
+ ifelse(m4object,box,
+ `box m4attrib ifelse(m4rad,,,`rad m4rad invis') `$2'
if last box.thick < 0 then { m4shv = (m4shadowthick+lthick)/2 } \
else { m4shv=(m4shadowthick+last box.thick bp__)/2 }
+ M4T: (Rect_(m4shv,m4shadowangle))
ifelse(m4rad,,`{ line thick m4shadowthick/(1bp__) outlined m4shadowcolor \
- from last box.sw+(m4shv,-m4shv) to last box.se+(m4shv,-m4shv) \
- then to last box.ne+(m4shv,-m4shv) } ',
+ from last box.sw+(M4T.x,M4T.y) to last box.se+(M4T.x,M4T.y) \
+ then to last box.ne+(M4T.x,M4T.y) }
+ box fill_(1) m4attrib at last box.c ',
`M4C: last box.c
{ box m4attrib thick m4shadowthick/(1bp__) outlined m4shadowcolor \
- rad m4rad solid at M4C+(Rect_(m4shv,m4shadowangle)) }
+ rad m4rad solid at M4C+(M4T.x,M4T.y) }
box fill_(1) rad m4rad m4attrib at M4C ') ',
- `m4object m4attrib invis `$2'
- M4C: last m4object.c
- if last m4object.thick < 0 then { m4shv = (m4shadowthick+lthick)/2 } \
- else { m4shv=(m4shadowthick+last m4object.thick bp__)/2 }
- { m4object m4attrib thick m4shadowthick/(1bp__) outlined m4shadowcolor \
- solid at M4C+(Rect_(m4shv,m4shadowangle)) }
- m4object ifelse(m4object,line,,fill_(1)) m4attrib at M4C ')dnl
+ `m4object m4attrib invis `$2'
+ M4C: last m4object.c
+ if last m4object.thick < 0 then { m4shv = (m4shadowthick+lthick)/2 } \
+ else { m4shv=(m4shadowthick+last m4object.thick bp__)/2 }
+ { m4object m4attrib thick m4shadowthick/(1bp__) outlined m4shadowcolor \
+ solid at M4C+(Rect_(m4shv,m4shadowangle)) }
+ m4object ifelse(m4object,line,,fill_(1)) m4attrib at M4C ')dnl
popdef(`m4attrib',`m4rad',`m4shadowthick',`m4shadowcolor',`m4shadowangle') ')
`hatchbox(boxspec,hatchsep,hatchspec,angle)
@@ -1042,8 +1047,9 @@
hatchsep=expr;
hatchspec=attributes;
angle=expr; '
-define(`hatchbox',`[pushkeys_(`$1',wid:boxwid:N;ht:boxht:N;box::N;fillcolor::N;
- hatchsep:0.075*scale;hatchspec::N;angle:45)
+define(`hatchbox',`[
+ pushkeys_(`$1',`wid:boxwid:N; ht:boxht:N; box::N;fillcolor::N;
+ hatchsep:0.075*scale; hatchspec::N; angle:45')
b = ifelse(`$4',,m4angle,`$4')
a = pmod((ifelse(b,,45,b)+90),180)-90
if a >=0 then { B: box ifinstr(`$1',=,`wid m4wid ht m4ht m4box dnl
@@ -1099,12 +1105,12 @@
then to rvec_(0,neg_(m4bht)/2) \
then to rvec_(m4bwd,neg_(m4bht)/2) \
then to rvec_(m4bwd,0) `$3' dnl
- popdef(`m4bwd')popdef(`m4bht') ')
+ popdef(`m4bwd',`m4bht') ')
`rotbox(wid,ht,type attribs,[r=val|t=val])
box oriented in current direction in [] block;
wd and ht are distances between line centers.
- type=attributes eg dotted shaded "green"
+ attributes: eg dotted shaded "green"
if arg4 is r=val then the corner radius is val
if arg4 is t=val then a "superellipse"
is drawn using a spline of tension val
@@ -1174,24 +1180,29 @@
e.g. ellipsearc(2,1,0,pi_,pi_/4,,dashed)
arg5 is the angle of the ellipse wid axis
Internal locations Start, End, C'
+
+ `ellipsearc(wid,ht,startrads,endrads,
+ rotangle,cw|ccw,linetype)
+ e.g. ellipsearc(2,1,0,pi_,pi_/4,,dashed)
+ arg5 is the angle of the ellipse wid axis
+ Internal locations Start, End, C'
define(`ellipsearc',`[ C: (0,0)
- a_earc = ifelse(`$1',,ellipsewid,`($1)')/2
- b_earc = ifelse(`$2',,ellipseht,`($2)')/2
- sa_earc = ifelse(`$3',,0,`$3')
- ea_earc = ifelse(`$4',,pi_/2,`$4')
- define(`m4ca',`ifelse(`$5',,1,cos(`$5'))')dnl
- define(`m4sa',`ifelse(`$5',,0,sin(`$5'))')dnl
- ifinstr(`$6',ccw,`define(`m4cw',ccw)',
- `ifinstr(`$6',cw,`define(`m4cw',cw)',`define(`m4cw',ccw)')')
+ a = ifelse(`$1',,ellipsewid,`($1)')/2
+ b = ifelse(`$2',,ellipseht,`($2)')/2
+ sa = ifelse(`$3',,0,`$3')
+ ea = ifelse(`$4',,pi_/2,`$4')
+ pushdef(`m4ca',`ifelse(`$5',,1,cos(`$5'))')dnl
+ pushdef(`m4sa',`ifelse(`$5',,0,sin(`$5'))')dnl
+ pushdef(`m4cw',`ifinstr(`$6',ccw,c,`$6',cw,,c)'cw)dnl
ifelse(m4cw,ccw,
- `if ea_earc < sa_earc then { ea_earc += twopi_ }',
- `if ea_earc > sa_earc then { ea_earc -= twopi_ }')
- n = max(4,floor(abs((ea_earc-sa_earc)/(10*dtor_)))+1)
- for i=0 to n do { aa_earc = sa_earc+i/n*(ea_earc-sa_earc)
- P[i]: (vrot_(a_earc*cos(aa_earc),b_earc*sin(aa_earc),m4ca,m4sa)) }
+ `if ea < sa then { ea += twopi_ }',
+ `if ea > sa then { ea -= twopi_ }')
+ n = max(4,floor(abs((ea-sa)/(10*dtor_)))+1)
+ for i=0 to n do { aa = sa+i/n*(ea-sa)
+ P[i]: (vrot_(a*cos(aa),b*sin(aa),m4ca,m4sa)) }
Start: P[0]
End: P[n]
- fitcurve(P,n,`$7') ]')
+ fitcurve(P,n,`$7') `$8' popdef(`m4cw',`m4sa',`m4ca') ]')
Small space for string justification
#efine(`sp_',`ifgpic(`\hbox{$\:$}')iflatex(`\hbox{$\;$}')')
@@ -1288,19 +1299,26 @@
to M4ArcC+(rect_(m4hr,m4eang)) rad m4hr with .c at M4ArcC } }
ifelse(`$3',,,`m4lstring(`$3',"`$3'") at M4ArcC+(rect_(m4hr,m4hang))')
}')
+
`polygon(nsides,keys) regular polygon in [] block
keys: line=attribs; e.g. dashed shaded "red"
rot=degrees; angle of first vertex V[0]
side|rad=expr; size by radius or side
- Defined points: C, V[0], ... V[nsides-1]'
+ radv=expr; vertex radius
+ Defined internal points: C, V[0], ... V[nsides]'
define(`polygon',`[ C: Here; nsides=ifelse(`$1',,3,`$1')
a=360/nsides; b=(180-a)/2 # interior angles
pushkeys_(`$2',
- `line::N; rot:90; side:linewid; rad:m4side*sind(b)/sind(a);')dnl
+ `line::N; rot:90; side:linewid; radv:0; rad:m4`'side*sind(b)/sind(a);')dnl
for i=0 to nsides-1 do { V[i]: Rect_(m4rad,m4rot+a*i) }
V[nsides]: 0.5 between V[nsides-1] and V[0]
- line m4line from V[nsides] to V[0]; for i=1 to nsides do { continue to V[i] }
- `$3' popdef(`m4line',`m4rot',`m4side',`m4rad') ]')
+#for i=0 to nsides do { sprintf("%g",i) at V[i] above }
+ if m4radv!=0 then { move to V[nsides]
+ for i=0 to nsides-1 do { arcto(V[i],V[i+1],m4radv,m4line) }
+ line m4line to V[nsides] } \
+ else { line m4line from V[nsides] to V[0]; for i=1 to nsides do {
+ continue to V[i] } }
+ `$3' popdef(`m4line',`m4rot',`m4side',`m4radv',`m4rad') ]')
`shade(gray value,closed line specs)
Fill an arbitray closed curve with a gray value
@@ -1447,8 +1465,8 @@
head= attributes (shaded etc)
name=Name (default Sarrow_)'
define(`sarrow',
- `pushkeys_(`$2',
- type:O:N;head::N;shaft:m4head:N;wdth:arrowwid;lgth:arrowht;name:Sarrow_:N)dnl
+ `pushkeys_(`$2',`type:O:N; head::N; shaft:m4`'head:N; wdth:arrowwid;
+ lgth:arrowht; name:Sarrow_:N')dnl
arrow `$1' m4head invis
m4_dx = last arrow.end.x-last arrow.start.x
m4_dy = last arrow.end.y-last arrow.start.y
@@ -1681,7 +1699,8 @@
`RightAngle(Pos1,Pos2,Pos3,linelen,attributes)
Draw a right angle symbol at Pos2
arg4: size
- arg5: line attributes, e.g. outlined "gray"'
+ arg5: line attributes, e.g. outlined "gray" or
+ e.g., ;dot(at last line.c)'
define(`RightAngle',
`RightA_C: `$1'; RightA_N: `$2'; RightA_B: `$3'
define(`m4AngleLen',`ifelse(`$4',,linewid/5,`$4')')
@@ -1859,7 +1878,8 @@
`graystring(value in [0,1])'
define(`graystring',`rgbstring(`$1',`$1',`$1')')
- `ColoredV(box|circle|ellipse,(r,g,b)|((colorseq)),
+ `ColoredV(box|circle|ellipse,
+ (r,g,b) | ((colorseq))[:nlines],
attributes)
box or circle or ellipse in a [] block.
If arg2 is blank then all formatting is in
@@ -1873,10 +1893,12 @@
frac2,r2,g2,b2,
...
1,rn,gn,bn
+ The number of colorseq lines drawn can be specified
+ with the colon (default height/lthick*2).
Examples: ColoredV(circle,(1,0,0))
ColoredV(ellipse,(1,0.04,1),
wid 0.75 ht 1 outlined "magenta" "Goodbye")
- ColoredV(box,((0,1,1,0, 1,0,0,1)),
+ ColoredV(box,((0,1,1,0, 1,0,0,1)):50,
outlined "blue" rad 0.1)'
define(`ColoredV',`[NeedDpicTools pushdef(`m4obj',ifelse(`$1',,box,`$1'))
C: m4obj `$3' ifsvg(,invis) # To avoid invalid svg
@@ -1889,13 +1911,15 @@
with .c at C.n-(0,C.ht*($`'1))}',
`define m4SObjLine {line outlined rgbstring($`'2,$`'3,$`'4) right \
C.wid*sqrt(abs(1-(1-($`'1)*2)^2)) with .c at C.n-(0,C.ht*($`'1))}')
- ShadeObject(m4SObjLine,int(C.ht/lthick*5/4),\
- ifelse(index(`$2',`(('),0,`patsubst(`$2',^ *`(('\|`))' *$)',
- `0,1,1,1,1,patsubst(`$2',^ *`('\|`)' *$)')) at C')
- m4obj ifelse(`$2',,,`m4colorfix(outlined,`$2')') `$3' with .c at C
- `$5' popdef(`m4obj') ]')
+ pushdef(`linect',`ifinstr(`$2',:,`patsubst(`$2',^.*:\(.*\)$,\1)',
+ `int(C.ht/lthick*2)')')
+ ShadeObject(m4SObjLine,linect,ifelse(index(`$2',`(('),0,
+ `patsubst(`$2',`(('\|`))'.*$)',`0,1,1,1,1,patsubst(`$2',^ *`('\|`)' *$)')) \
+ with .n at C.n') popdef(`linect')
+ m4obj ifelse(`$2',,,index(`$2',`(('),0,,`m4colorfix(outlined,`$2')') `$3' at C
+ `$4' popdef(`m4obj') ]')
- `rgbstring(color triple: values in [0,1])
+ `rgbstring(color triple with values in [0,1])
(example rgbstring(0.2,0.3,0.4) )
or, when allowed by the postprocessor,
rgbstring(color name)
@@ -2017,8 +2041,10 @@
`ifpdf(`define(`$1',``'`$2' `$3' `$4'`'')',
`ifmpost(`command \
sprintf("color `$1'; `$1':=(%7.5f,%7.5f,%7.5f);",`$2',`$3',`$4')',
+`ifsvg(`define(`$1',`rgbstring(`$2',`$3',`$4')')',
`command \
sprintf("\definecolor{`$1'}{rgb}{%7.5f,%7.5f,%7.5f}%%",`$2',`$3',`$4')')')')')
+')
Pstricks conditional command
define(`psset_',`ifpstricks(`dnl
@@ -2025,8 +2051,11 @@
command sprintf("\psset{$@}%%")
')')
Internal color adjustments
- `m4colorfix(outlined|shaded,
- "colorname"|colorname|(r,g,b),sprintf(...))'
+ `m4colorfix(outlined|shaded|colored,
+ "colorname"|colorname|(r,g,b),sprintf(...))
+ Not really necessary most of the time; e.g.,
+ colored rgbstring(r,g,b)" works fine for tikz, pstricks,
+ and svg'
define(`m4colorfix',`ifelse(`$1',,,
`ifelse(`$2',,``$1' "grey"',index(`$2',`"'),0,``$1' `$2'',
index(`$2',sprintf),0,``$1' `$2'',
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/liblog.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
liblog.m4 Logic gates
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/mfpic.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/mfpic.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/mfpic.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
mfpic.m4 Initialization for mfpic.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/mpost.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/mpost.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/mpost.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
mpost.m4 Initialization for metapost.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/pdf.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/pdf.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/pdf.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
pdf.m4 Initialization for pdf output.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/pgf.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/pgf.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/pgf.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
pgf.m4 Initialization for Tikz-pgf.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/postscript.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/postscript.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/postscript.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
postscript.m4 Initialization for Postscript output.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/psfrag.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/psfrag.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/psfrag.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -2,7 +2,7 @@
psfrag.m4 Initialization for dpic -f processing:
Postscript with psfrag strings
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/pstricks.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/pstricks.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/pstricks.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
pstricks.m4 Initialization for PSTricks.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/svg.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/svg.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/svg.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
svg.m4 Initialization for svg output.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
Modified: trunk/Master/texmf-dist/doc/latex/circuit-macros/xfig.m4
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuit-macros/xfig.m4 2024-05-29 23:41:47 UTC (rev 71388)
+++ trunk/Master/texmf-dist/doc/latex/circuit-macros/xfig.m4 2024-05-30 19:57:12 UTC (rev 71389)
@@ -1,7 +1,7 @@
divert(-1)
xfig.m4 Initialization for xfig.
-* Circuit_macros Version 10.5, copyright (c) 2024 J. D. Aplevich under *
+* Circuit_macros Version 10.6, copyright (c) 2024 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
More information about the tex-live-commits
mailing list.