ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: andrea.demichele@gmail.com,
	mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: using metapost library makecirc with context.
Date: Fri, 19 Apr 2019 18:10:59 +0200	[thread overview]
Message-ID: <b5c6f013-b51f-348a-9f8d-59453c4966f6@xs4all.nl> (raw)
In-Reply-To: <87v9zaro6t.fsf@gmail.com>

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@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 16:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 15:48 Andrea De Michele
2019-04-19 16:10 ` Hans Hagen [this message]
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=b5c6f013-b51f-348a-9f8d-59453c4966f6@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=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).