From: Hans Hagen <pragma@wxs.nl>
Cc: NTG ConTeXt <ntg-context@ntg.nl>
Subject: Re: metafont en context MPmacros
Date: Tue, 06 Aug 2002 11:57:41 +0200 [thread overview]
Message-ID: <5.1.0.14.1.20020806115131.01fb3ff8@server-1> (raw)
In-Reply-To: <655ACC2B-A89F-11D6-AB5A-003065568054@science.uva.nl>
At 08:16 PM 8/5/2002 +0200, dr. Hans van der Meer wrote:
>Ik heb een macro voor het tekenen van een figuur met MetaPost opgeslagen
>in file xyz.mp:
>def oval (.....)
> % path p wordt geconstrueerd.
> % vul pad met een bepaalde kleur
>
> % dit statement kreeg ik niet werkend met
> % input xyz waarin in een macro:
> fill p withcolor \MPcolor{SomeColor};
>
> % doorgeven in een parameter oval(..., kleur) met aanroep
> (..\MPcolor{..}) werkt wel:
> fill p withcolor kleur;
>
>Het lijkt erop dat invoegen van een bestand met "input" door ConTeXt niet
>goed mogelijk is als daarin voor/met ConTeXt gedefinieerde \MP-zaken
>voorkomen.
>
>Expliciet opnemen van de kleur definitie in een \start-stopMPenvironment
>brengt geen verbetering.
>
>Het is jammer als slechts in beperkte mate hulpbestanden kunnen worden
>ingevoegd.
>Of begrijp ik het verkeerd en had ik ook niet mogen verwachten dat het zou
>werken?
>Weet iemand misschien hoe het wel moet via een input bestand?
\startMPinclusions
color mycolor ; mycolor := \MPcolor{...}
\stopMPinclusions
will give you c to use in macros defined outside context, you can start
that file with
if unknown mycolor : color mycolor ; mycolor := red fi ;
so that it can be used independently
Het probleem van externe mp defs is dat tex ze niet parsed
Als je je eigen macros wilt maken, kun je ook iets doen als:
=== mylibrary.tex ===
\startuseMPgraphic{mylibrary}
.......
\stopuseMPgraphic
=====
en in de file die ze gebruikt:
\input mylibrary
\startMPinclusions
\useMPgraphic{mylibrary}
\stopMPinclusions
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
next prev parent reply other threads:[~2002-08-06 9:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-05 18:16 dr. Hans van der Meer
2002-08-06 9:57 ` Hans Hagen [this message]
2002-08-06 11:20 ` Hans Hagen
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=5.1.0.14.1.20020806115131.01fb3ff8@server-1 \
--to=pragma@wxs.nl \
--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).