ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Asymptote or Metapost and ConTeXt parameters.
Date: Mon, 19 Dec 2016 10:10:09 +0100	[thread overview]
Message-ID: <CACyK-epCuyR0Zq+V6YuYijn3e26S5nKwq6LMEj6CaRxksv=C2w@mail.gmail.com> (raw)
In-Reply-To: <DC4D22C7-0CA2-45F1-B64B-12FFC3F10AD9@gyza.cz>


[-- Attachment #1.1: Type: text/plain, Size: 2456 bytes --]

Hello,
I do not answer the question, but I'm interested because I also use
Asymptote. The following code works with context in texlive 2016 but does
not work with standalone context.
thank you,
Fabrice
% macros=mkvi

\usemodule[filter]

\defineexternalfilter
   [ASY]
   [
     filter={asy -tex "context" -outformat pdf
             -outname \externalfilteroutputfile},
     output=\externalfilterbasefile.pdf,
     cache=yes,
     readcommand=\ReadImage,
   ]

\define[1]\ReadImage{\externalfigure[#1]}

\starttext
   Testing if we can include an asymptote image
   \startplacefigure[location={here}, title={An Asymptote figure}]
     \startASY
       import three;
size(8cm,0);
currentlight.background=black;

material White(real x, real y){
   return material(diffusepen=gray(.05+.1x+.3y),
                   emissivepen=gray(.05+.1x+.3y));
}

for(int y=0; y<=2; ++y)
    for(int x=0; x<3; ++x)
        draw(shift(2x,2y,0)*unitsphere,White(x,y));
     \stopASY
   \stopplacefigure
\stoptext


2016-12-19 8:41 GMT+01:00 Jaroslav Hajtmar <hajtmar@gyza.cz>:

> Hello ConTeXtist,
>
> I saw the opportunity to insert an Asymptote picture into Context source
> code (due filter).
>
> For example here: https://mailman.ntg.nl/pipermail/ntg-context/2015/
> 080581.html
>
>
>
> Is there a way to pass the ConTeXt parameter which influenced the creation
> of the Asymptote image? My point eg. the ability to define macros, which
> gave its parameters to Asymptote procedure or function and depending on
> these parameters, the image created by Asymptote looked differently.
>
>
>
> Before starting work on an illustrative example I am asking, whether it
> makes sense to deal with such a thing ... I suppose the impossibility of
> combining asymptote code and such Lua code (or not?).
>
>
>
> There is a similar possibility, at least in Metapost? For simpler pictures
> it would probably suffice ....
>
>
>
> Thanx
>
> Jaroslav Hajtmar
>
>
>
> ____________________________________________________________
> _______________________
> 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
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 4982 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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:[~2016-12-19  9:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19  7:41 Jaroslav Hajtmar
2016-12-19  9:10 ` Fabrice Couvreur [this message]
2016-12-19  9:43   ` Hans Hagen
2016-12-19 16:19 ` Aditya Mahajan
2016-12-20 10:34   ` Jaroslav Hajtmar
2016-12-22  4:49     ` Aditya Mahajan
2016-12-23  8:02       ` Jaroslav Hajtmar
2016-12-23 19:22         ` Aditya Mahajan
2016-12-23 20:28           ` Hans Hagen
2016-12-24  2:55           ` Jaroslav Hajtmar
2016-12-24  3:05             ` Aditya Mahajan
2016-12-20 22:14   ` Alan Braslau
2016-12-21  7:49     ` Aditya Mahajan
2017-03-19 18:01     ` Passing data back and forth between metapost and lua Aditya Mahajan
2017-03-19 18:29       ` Aditya Mahajan
2017-03-19 19:02         ` 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='CACyK-epCuyR0Zq+V6YuYijn3e26S5nKwq6LMEj6CaRxksv=C2w@mail.gmail.com' \
    --to=fabrice1.couvreur@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).