ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Henning Hraban Ramm <texml@fiee.net>
Subject: Re: MetaPost Examples
Date: Wed, 1 Sep 2021 15:50:59 +0200	[thread overview]
Message-ID: <D441297E-E078-4BE5-8998-811844B58735@fiee.net> (raw)
In-Reply-To: <63346eba-15eb-301d-c38f-ee3a53873b89@xs4all.nl>


> Am 01.09.2021 um 14:45 schrieb Hans Hagen via ntg-context <ntg-context@ntg.nl>:
> 
> On 9/1/2021 2:19 PM, Henning Hraban Ramm via ntg-context wrote:
>> Hi, I’m trying to “translate” the documentation of “fiziko”* from LaTeX to ConTeXt and would like to avoid the doubling of MP code like:
>> \startMP
>>     path p;
>>     p := (0,0){dir(30)}..(5cm, 0)..{dir(30)}(10cm, 0);
>>     draw brush (p)(2minStrokeWidth*sin(offsetPathLength*pi));
>> \stopMP
>> \startMPcode
>>     path p;
>>     p := (0,0){dir(30)}..(5cm, 0)..{dir(30)}(10cm, 0);
>>     draw brush (p)(2minStrokeWidth*sin(offsetPathLength*pi));
>> \stopMPcode
>> I’m quite sure there’s a possibility with buffers, but how?
>> \startbuffer
>>     path p;
>>     p := (0,0){dir(30)}..(5cm, 0)..{dir(30)}(10cm, 0);
>>     draw brush (p)(2minStrokeWidth*sin(offsetPathLength*pi));
>> \stopbuffer
>> \typebuffer
>> ... and then how do I get the MP graphic?
> \processMPbuffer

“of course”

Thank you!

Used here: https://github.com/fiee/fiziko/blob/master/fiziko.mkiv

Hraban
___________________________________________________________________________________
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:[~2021-09-01 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 12:19 Henning Hraban Ramm via ntg-context
2021-09-01 12:45 ` Hans Hagen via ntg-context
2021-09-01 13:50   ` Henning Hraban Ramm via ntg-context [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-08-24 14:06 metapost examples Patrick Gundlach
2001-08-24 20:58 ` Arun Mangalam
2001-04-29 18:50 Marc van Dongen

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=D441297E-E078-4BE5-8998-811844B58735@fiee.net \
    --to=ntg-context@ntg.nl \
    --cc=texml@fiee.net \
    /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).