ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Andrea De Michele <andrea.demichele@gmail.com>
To: ntg-context@ntg.nl
Subject: using metapost library makecirc with context.
Date: Fri, 19 Apr 2019 17:48:26 +0200	[thread overview]
Message-ID: <87v9zaro6t.fsf@gmail.com> (raw)


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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@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
___________________________________________________________________________________

             reply	other threads:[~2019-04-19 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 15:48 Andrea De Michele [this message]
2019-04-19 16:10 ` Hans Hagen
2019-04-20 20:09   ` Andrea De Michele
2019-04-20 21:00     ` Hans Hagen
2019-04-20 21:16       ` Alan Braslau
2019-04-20 21:49         ` Hans Hagen
2019-04-21 14:02           ` Alan Braslau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9zaro6t.fsf@gmail.com \
    --to=andrea.demichele@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).