From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106557 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Can I share METAPOST vardefs over multiple pages? Date: Mon, 16 Mar 2020 18:10:20 -0400 (EDT) Message-ID: References: <5C2B251F-E800-4146-B939-D43C278E2308@rna.nl> <07cacfef-08ed-0a40-2013-d25a5a0575b0@xs4all.nl> <916B32A2-2C23-4BF3-BD82-0FA03B30770D@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-521169188-1584396623=:3177" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="119968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (LNX 394 2020-01-19) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 16 23:10:46 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDxwc-000V8B-8q for gctc-ntg-context-518@m.gmane-mx.org; Mon, 16 Mar 2020 23:10:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 607351829B6; Mon, 16 Mar 2020 23:10:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y4XekzU_k1UH; Mon, 16 Mar 2020 23:10:28 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2EF071829C1; Mon, 16 Mar 2020 23:10:28 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 35A871829B6 for ; Mon, 16 Mar 2020 23:10:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QCxsJVmJhRI7 for ; Mon, 16 Mar 2020 23:10:26 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=141.211.125.12; helo=maleficent.mr.itd.umich.edu; envelope-from=adityam@umich.edu; receiver= Original-Received: from maleficent.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.125.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 06AD318287E for ; Mon, 16 Mar 2020 23:10:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2016-05-12; t=1584396623; bh=oTpMXWEaog3LzfEyemYFhkFd7FBD/+IxCofR9ZNNHcw=; h=Date:From:To:Subject:In-Reply-To:References; b=Qu6bQo1yg9TCerbB4UJZCyX5yILqX0tSMJtd1JxI+tqa0KMof0WNAUVfToDlU2p+V xGldkFtH0XXhmlJRy3fJCW8uMbQT+tDeSwGISNosJ7sdZH+7HFzae0RtWFjCn5uE0t M5KQvHXV/iAqNR1sX6/e6miaw2wnDeaYGm6SqiMjWTh3WDgkVNHFmxQmdT0my6bEy3 vQSh8ZjzwjThSA3JVOT0zewCmTDZyHJY0QBNkwoTOxcmfa4T6vQ6Uu3sF/wMgOlEvt RhOKV2U0I+vOwe8rdzN4WSD5YyGtxLT3HPpCIiKu+9N5V7SnO8he9W5MeJt210NHDm hi/B0QdI4tiGw== Authentication-Results: maleficent.mr.itd.umich.edu; iprev=pass policy.iprev=198.84.255.218 (198-84-255-218.cpe.teksavvy.com); auth=pass smtp.auth=adityam Original-Received: FROM adi-thinkpad.local (198-84-255-218.cpe.teksavvy.com [198.84.255.218]) By maleficent.mr.itd.umich.edu ID 5E6FF94F.872E8.13137; Authuser adityam; Mon, 16 Mar 2020 18:10:23 -0400 In-Reply-To: <916B32A2-2C23-4BF3-BD82-0FA03B30770D@rna.nl> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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.io gmane.comp.tex.context:106557 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-521169188-1584396623=:3177 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 16 Mar 2020, Gerben Wierda wrote: > This worked when I was just doing METAPOST. Now, I am using my lua code t= o produce the METAPOST code that produces the pictures. And the picture its= elf is put in a file for METAPOST as follows: > > File test4-mplib-run-001.mp: > > % begin graphic: n=3D0 > > ; beginfig(1) ; defaultfont:=3D"name:dejavuserif*default"; CurrentLayout:= =3D"article"; def OverlayLineColor=3Dblack enddef; def OverlayColor =3Dblac= k enddef; ;picture pic; x:=3D80.000; y:=3D200.000; w:=3D133.000; h:=3D53.00= 0;pic :=3D ApplicationComponentLogo( w, h, typeString) shifted (x, -y); dra= w pic;picture pic; x:=3D273.000; y:=3D253.000; w:=3D133.000; h:=3D53.000;pi= c :=3D Function( w, h, typeString) shifted (x, -y); draw pic;picture pic; x= :=3D380.000; y:=3D133.000; w:=3D133.000; h:=3D53.000;pic :=3D Service( w, h= , typeString) shifted (x, -y); draw pic;path p; p :=3D (200.000,-227.000)--= (333.000,-227.000)--(333.000,-273.000); draw p;path p; p :=3D (393.000,-253= =2E000)--(393.000,-180.000); draw p;;; endfig ; > % end graphic > > This apparently is tried to get run through METAPOST separately and that = clearly doesn=E2=80=99t work, because ApplicationComponentLogo isn=E2=80=99= t defined. This is the result of the following setup: > > \starttext > \startMPdefinitions (or inclusions, no difference) > % ApplicationComponentLogo is defined here with a vardef > \stopMPdefinitions > \ctxlua{foo(=E2=80=9Cfilename=E2=80=9D)} =09% produces a series of > =09=09=09=09% context.startMPpage { instance =3D "doublefun=E2=80=9D } > =09=09=09=09% several of: > =09=09=09=09%=09context( METAPOST statements in a string) > =09=09=09=09% context.stopMPpage() > \stoptext > > How do I get my MPdefinitions available in those METAPOST runs? Since you are using \startMPpage[instace=3Ddoublefun], you need to do the= =20 definitions for doublefun instance: so use \startMPdefinitions{doublefun} =2E.. \stopMPdefinitions Aditya --8323329-521169188-1584396623=:3177 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --8323329-521169188-1584396623=:3177--