From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/89708 Path: news.gmane.org!not-for-mail From: Context NTG Newsgroups: gmane.comp.tex.context Subject: Re: Asymptote in Context Date: Fri, 2 Jan 2015 23:14:32 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0255627076==" X-Trace: ger.gmane.org 1420236919 11552 80.91.229.3 (2 Jan 2015 22:15:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Jan 2015 22:15:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 02 23:15:11 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y7AUx-0001SB-9N for gctc-ntg-context-518@m.gmane.org; Fri, 02 Jan 2015 23:15:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 906F41022E for ; Fri, 2 Jan 2015 23:15:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 19UbT3k8mQBn for ; Fri, 2 Jan 2015 23:15:09 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 15E161022F for ; Fri, 2 Jan 2015 23:14:42 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 23FDC101EA for ; Fri, 2 Jan 2015 23:14:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QxsF9-T7pmw4 for ; Fri, 2 Jan 2015 23:14:35 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 7BB5F101E8 for ; Fri, 2 Jan 2015 23:14:35 +0100 (CET) Original-Received: from mail-oi0-x241.google.com (mail-oi0-x241.google.com [IPv6:2607:f8b0:4003:c06::241]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t02MEXQb029953 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 2 Jan 2015 23:14:34 +0100 Original-Received: by mail-oi0-f65.google.com with SMTP id v63so11910918oia.0 for ; Fri, 02 Jan 2015 14:14:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=LGuSCynm7qIdM2IWe2g7fxnuakTfwyeXu2NBVRTQh3A=; b=XYJNVQ/jfwD+EIjEMUqwmivqqcso7k3pF32Qz4h6ky5bbgEHt+4LX3y7kbXGpe0X3p Rs0l8dFX98l1pWrkdD4evrfIPlcvjDQehw1Ax+JgyQksOT/NADiKtmbDZOr5gi2G9SaA Q9q7D5Fk3o/gqcgZQao3Vab+cwMs+Mffx0xfdbsR6jZVajHtPfuw/9Grjrk6D1kI3zlE xQyiR2Ly02OFhQkzqfNzDv8os1694/9hDiWsNkOIKITXOfY8BeEvY+wQJpUFmWCoarje GfvaJGbdhiWaH/97uVZgo0SwVKEsE6ChuvhHd1a6LuoCQFXUpAa8p4HI7fEVLss+0vdm Gy7g== X-Received: by 10.182.86.100 with SMTP id o4mr38637624obz.51.1420236873017; Fri, 02 Jan 2015 14:14:33 -0800 (PST) Original-Received: by 10.182.150.39 with HTTP; Fri, 2 Jan 2015 14:14:32 -0800 (PST) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4003:c06::241; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01NzaeyTb - ab2f097a493c - 20150102 Received-SPF: pass (filter4-ams.mf.surf.net: domain of contextntg@gmail.com designates 2607:f8b0:4003:c06::241 as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2607:f8b0:4003:c06::241; envelope-from=; helo=mail-oi0-x241.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:89708 Archived-At: --===============0255627076== Content-Type: multipart/alternative; boundary=089e0149cb50502e12050bb2aa7d --089e0149cb50502e12050bb2aa7d Content-Type: text/plain; charset=UTF-8 Here is an Asymptote example unitsize(1cm); draw((-.1,0) -- (2,0), arrow=Arrow(TeXHead)); draw((0,-.1) -- (0,2), arrow = Arrow(TeXHead)); draw((0,0) .. (1,1) .. (2,sqrt(2))); Below is how I have started setting this up in Context. This creates a pdf file with the drawing, but it is not included in the final docuement. \defineexternalfilter [ASY] [filtercommand={asy -tex "context" -View -outformat pdf -outname \externalfilteroutputfile\space \externalfilterinputfile}, output=\externalfilterbasefile.out, readcommand=\typefile, cache=force, location=text, continue=yes] \starttext \startASY[myplot] unitsize(1cm); draw((-.1,0) -- (2,0), arrow=Arrow(TeXHead)); draw((0,-.1) -- (0,2), arrow = Arrow(TeXHead)); draw((0,0) .. (1,1) .. (2,sqrt(2))); \stopASY \externalfigure[myplot] \stoptext Thanks Jeroen 2014-12-28 12:04 GMT+01:00 Mojca Miklavec : > Dear Aditya, > > On Sun, Dec 28, 2014 at 8:21 AM, Aditya Mahajan wrote: > > On Wed, 24 Dec 2014, Context NTG wrote: > > > >> Could anybody explain how to use Asymptote in ConTeXt with the filter > >> module. > > > > Can you post a minimal asymptote file and how it shoud be processed via > the > > command line? > > I have no time to create a nice minimal example, but here's an ugly > non-minimal example which should at least enable you to test the > interaction with the filter module. > > I also added one ConTeXt-specific command while trying to make math > fonts work properly, just replace "lucidaot" with another font in case > you don't have that one installed. > > You can run the example with > asy -tex context cylinder.asy > > (Maybe it's possible to set the tex engine inside the file as well.) > > > Bonus points if you can get PRC to work properly before TL 2015. Or if > you can make the file print properly from OS X without using Acrobat > or ghostscript/CUPS. Preview.app "forgets" to print the (smoothly > shaded) cylinder for example. > > Mojca > > > ___________________________________________________________________________________ > 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://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > > ___________________________________________________________________________________ > --089e0149cb50502e12050bb2aa7d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Here is an Asymptote example

unitsize(1cm);
dr= aw((-.1,0) -- (2,0),
arrow=3DArrow(TeXHead));
draw((0,-.1) -- (0,2), = arrow =3D
Arrow(TeXHead));
draw((0,0) .. (1,1) .. (2,sqrt(2)));


Below is how I have started setting this up in Context. This creates a= pdf file with the drawing, but it is not included in the final docuement.<= /p>


\defineexternalfilter
[ASY]
[filtercommand=3D{asy -tex &quo= t;context" -View -outformat pdf -outname \externalfilteroutputfile\spa= ce \externalfilterinputfile},
output=3D\externalfilterbasefile.out,
r= eadcommand=3D\typefile,
cache=3Dforce,
location=3Dtext,
continue= =3Dyes]

\starttext
\startASY[myplot]
unitsize(1cm);
draw((-.= 1,0) -- (2,0),
arrow=3DArrow(TeXHead));
draw((0,-.1) -- (0,2), arrow = =3D
Arrow(TeXHead));
draw((0,0) .. (1,1) .. (2,sqrt(2)));

\stop= ASY

\externalfigure[myplot]
\stoptext

<= br>
Thanks
Jeroen

2014-12-28 12:04 GMT+01:00 Mojca Miklav= ec <mojca.miklavec.lists@gmail.com>:
Dear Aditya,

On Sun, Dec 28, 2014 at 8:21 AM, Aditya Mahajan wrote:
> On Wed, 24 Dec 2014, Context NTG wrote:
>
>> Could anybody explain how to use Asymptote in ConTeXt with the fil= ter
>> module.
>
> Can you post a minimal asymptote file and how it shoud be processed vi= a the
> command line?

I have no time to create a nice minimal example, but here's an u= gly
non-minimal example which should at least enable you to test the
interaction with the filter module.

I also added one ConTeXt-specific command while trying to make math
fonts work properly, just replace "lucidaot" with another font in= case
you don't have that one installed.

You can run the example with
=C2=A0 =C2=A0 asy -tex context cylinder.asy

(Maybe it's possible to set the tex engine inside the file as well.)

Bonus points if you can get PRC to work properly before TL 2015. Or if
you can make the file print properly from OS X without using Acrobat
or ghostscript/CUPS. Preview.app "forgets" to print the (smoothly=
shaded) cylinder for example.

Mojca

_________________________________________________________= __________________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" target=3D"_blank"= >http://www.ntg.nl/mailman/listinfo/ntg-context
webpage=C2=A0 : http= ://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/contextrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

--089e0149cb50502e12050bb2aa7d-- --===============0255627076== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0255627076==--