[NTG-context] using metapost library makecirc with context.

Andrea De Michele andrea.demichele at gmail.com
Fri Apr 19 17:48:26 CEST 2019


I'm trying to use with Context  makecirc a metapost library to draw
electric circuits, but I have problems with the labels of the circuits
element that are not displayed correctly.

FIRST EXAMPLE (No labels are displayed)
-------------
\starttext

\startMPinclusions
  input makecirc;
\stopMPinclusions


\startstaticMPfigure{circ1}
        u:= 1cm ;
        source.e((0,0u),DC,90,"\Delta V","2V") ;
        resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
        resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
        wire(S.e.p,R.a.r,udsq) ;
        wire(S.e.n,R.b.l,udsq) ;
        wire(R.a.l,R.b.r,udsq) ;
\stopstaticMPfigure
\usestaticMPfigure[circ1]

\stoptext
-----------------

SECOND EXAMPLE (In the first circuit are displayed the labels of the
second one and in the second only ?? are displayed)
-----------------
\starttext

\startstaticMPfigure{circ1}
  input makecirc;
        u:= 1cm ;
        source.e((0,0u),DC,90,"\Delta V","2V") ;
        resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
        resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
        wire(S.e.p,R.a.r,udsq) ;
        wire(S.e.n,R.b.l,udsq) ;
        wire(R.a.l,R.b.r,udsq) ;
\stopstaticMPfigure
\usestaticMPfigure[circ1]

\startstaticMPfigure{circ2}
  input makecirc;
        u:= 1cm ;
        source.e((0,0u),DC,90,"\Delta V","4V") ;
        resistor.a((2u,1u),normal,90,"R_3","3$\Omega$") ;
        resistor.b((2u,-1u),normal,90,"R_4","4$\Omega$") ;
        wire(S.e.p,R.a.r,udsq) ;
        wire(S.e.n,R.b.l,udsq) ;
        wire(R.a.l,R.b.r,udsq) ;
\stopstaticMPfigure
\usestaticMPfigure[circ2]

\stoptext


-- 
Andrea De Michele



More information about the ntg-context mailing list