Dear Hans, Wolfgang, and Ortared,
I draw a simple circuit diagram using the logic symbol fonts.
It is easier than what I did last year.
Here is something to consider:
As you see in the example, a line touches the bottom of the triangle. So, it
might be better to shorten the height of the triangle a little bit. There are
some documents in which the Not gate is drawn a little bit thinner.
Also, the head of OR gate is a little bit shaper than the head of AND gate in
many documents. Then it is easier to distinguish OR and AND gates.
Thank you again for providing Logic symbols as fonts.
Best regards,
Dalyoung
\usemodule[./Mathematics/meta-imp-logicsymbols.mkxl]
%\useMPlibrary[logicsymbols]
%\starttext
\startMPpage[offset=.25ex]
def connectPts(expr initP, termP,t)=
pair M; %, initP, termP;
M := t*initP+(1-t)*termP;
if xpart initP = xpart termP:
draw initP -- termP;
elseif ypart initP = ypart termP:
draw initP -- termP;
else:
draw initP -- (xpart M,ypart initP)--(xpart M,ypart termP) -- termP;
fi;
enddef;
pair A,B,C;
u := BodyFontSize ;
drawoptions(withpen pencircle scaled 1) ;
draw textext("\lAND") xysized (2u,u) shifted (5.5u,0);
draw textext("\lOR") xysized (2u,u) shifted (3u,u);
draw textext("\lOR") xysized (2u,u) shifted (3u,-u);
draw textext("\lNOT") xysized (2u,u) shifted (u,1.25u);
draw textext("\lNOT") xysized (2u,u) shifted (u,-1.25u);
A := (4u,u);
B := (4.5u,.25u);
connectPts(A,B,.5);
A := (4u,-u);
B := (4.5u,-.25u);
connectPts(A,B,.5);
draw (0,.75u) -- (2u,.75u);
draw (0,-.75u) -- (2u,-.75u);
\stopMPpage
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________