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

Andrea De Michele andrea.demichele at gmail.com
Sat Apr 20 22:09:22 CEST 2019


Hans Hagen <j.hagen at xs4all.nl> writes:

> On 4/19/2019 5:48 PM, Andrea De Michele wrote:
>>
>> 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
> I searched ctab for that library and it has soem hard wired latex
> stuff in it. You can make latex.mp empty (to play safe),
>
> Load the file with:
>
> \startMPinclusions
>     string LaTeXsetup ; LaTeXsetup := "";
>     input "makecirc.mp";
>     vardef latex(expr t) = textext(t) enddef ;
> \stopMPinclusions
>
> I didn't look into the details but yoru example runs then.
>
>
> Hans
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>
Thank you,

I didn't understand the magic behind that  but it's works.

Another question: there is a library to draw electrics circuit
alternative to makecirc but more context/metafun friendly?



-- 
Andrea De Michele

-- 
Andrea De Michele



More information about the ntg-context mailing list