From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109404 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: Re: embed metapost figure into document Date: Mon, 9 Nov 2020 17:40:14 -0500 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8256262433211487205==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18287"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users , champignoom@gmail.com Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 09 23:40:48 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 1kcFqB-0004dW-90 for gctc-ntg-context-518@m.gmane-mx.org; Mon, 09 Nov 2020 23:40:47 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 439891A9C27; Mon, 9 Nov 2020 23:40:30 +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 uPOJxw0vohJW; Mon, 9 Nov 2020 23:40:29 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4BCE91A9D0F; Mon, 9 Nov 2020 23:40:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D4D0A1A9C27 for ; Mon, 9 Nov 2020 23:40: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 Xpft0asVa7Ec for ; Mon, 9 Nov 2020 23:40:27 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.45; helo=mail-wr1-f45.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 047C01A9C19 for ; Mon, 9 Nov 2020 23:40:26 +0100 (CET) Original-Received: by mail-wr1-f45.google.com with SMTP id b8so10578048wrn.0 for ; Mon, 09 Nov 2020 14:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=uZSe94QfdCt1Ai1Iy7Ne586RGqjSyX6TGNrr7BTBPvM=; b=qbb3ZgLUZxC4Mt8wKJZpqOX90+NhfSYRQfj1wE+Ryx82no7YDyZvj3HvKOOFFLRhPJ tZYuK+Qz9sskawkXcpb6s062ixEWnncVvg2a3orBT4dH+tzRSbIz6kEZ/ebCR3I0sTbT GdIE2+pnkrP5nxCoObnHT0YOcdyybgN9geUKhJIx8nWEbZy1e8LYJqcvYPT1VlDN9J44 h0r651zDWGASL3k0Ha2m+9rD36x0enrk0ovMsL5uJVnLMI1PRDVefpe9k0THln6zScrH NbPtTOBQ1rGgHnJk24njpBKNCSZPGZn9lZ1hBn6dWQXM0kNYyiH8qx/ulrxqJXjKXc6v djUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=uZSe94QfdCt1Ai1Iy7Ne586RGqjSyX6TGNrr7BTBPvM=; b=iTpmopgL/oW1vUYf9SCqRWLTCUUJHwRLzKd2xSgLSSNyzZe0fpLISCAS1XHi4kU8v+ eAq830XmDaU00hWikVMPmND3NWG2qPjO03lG+hQK9Y87nGhBwoMe+T6LXs3yfT5UpCh+ gvSH6FZQYiTmJcx3iNZkrJz2oxm1IDxOOuPfq5VZEKo6F0VTpYaiRvm+GsOfScqVMj2r jk/UJ8M3FAaKECnjFQTsqBSH0zbHj8zNjkcMY1vxLoIon65a3oeN8lsAE4kN9G0BERQt 8wWvwq2/VfXBEv+wIn7DGpsyfd2ibY+klKWOU2L3B6RfGw4KOiKy9UiSgUjtncMeGCUV f+0Q== X-Gm-Message-State: AOAM5302FlLO/zDPig8XMcNTVnYYymx+PsNzRUv5BA28D9vGBiN8iBFH gO6x2psPEOVv+j74X07xob+33Lt0+E8nVt1Sxv0q0dsHA6+a0A== X-Google-Smtp-Source: ABdhPJzn8N0kmjHOFmBoMKZbqgg601B9R0eG1te3v7Nkb32JXByW7uXEcM2n6gMoOiK9xNCNCUHpQ6PNdiE+sL8qFIg= X-Received: by 2002:a5d:6550:: with SMTP id z16mr19992921wrv.266.1604961626321; Mon, 09 Nov 2020 14:40:26 -0800 (PST) In-Reply-To: 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:109404 Archived-At: --===============8256262433211487205== Content-Type: multipart/alternative; boundary="0000000000009d746505b3b43fbb" --0000000000009d746505b3b43fbb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Sylvain. LuaMetaTeX and LuaTeX, the engines used by ConTeXt nowadays, use an embedded library, so external compilations/files are not necessary. Just out of curiosity, wouldn't it be easier to use a ConTeXt environment? E.g.: \starttext \startMPcode %\startuseMPgraphic{} if you want to reuse your graphic with \useMPgraphic{} draw fullcircle scaled cm %withcolor black % black is default ; \stopMPcode %\stopuseMPgraphic \stoptext More info here: https://wiki.contextgarden.net/MetaFun_-_MetaPost_in_ConTeX= t To actually answer your question, if you actually want to load a Metapost graphic externally generated, you should have something like: %nice.mp %"begin ... endfig", as well as "end" are important beginfig (1); draw fullcircle scaled cm %withcolor black ; endfig; end so when you compile it via mpost nice.mp (obviously supposing you have Metapost installed) you'll get a file called nice.1 and \starttext \externalfigure[nice.1][width=3D4cm] \stoptext will work. However, as you can see, ConTeXt deals with such minutiae for you and extends Metapost capabilities too, so the second alternative is not the ConTeXt way to go. I hope it helps. Jairo :) El lun., 9 de nov. de 2020 a la(s) 16:59, Sylvain Hubert ( champignoom@gmail.com) escribi=C3=B3: > Dear List, > > I'm trying to embed a metapost image into the document. According the Met= aFun > manual , > "embedding such a graphic is done by: > \externalfigure[graphic.123][width=3D4cm]", but the following example > produces an empty page: > > % test.mkxl > \starttext > \externalfigure[test.123][width=3D4cm] > \stoptext > > % test.123 > draw fullcircle scaled cm withcolor black; > > Does anyone know how to properly embed a metapost image into a context > document? > > Thanks! > > Best, > Sylvain > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --0000000000009d746505b3b43fbb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Sylvain.

LuaMeta= TeX and LuaTeX, the engines used by ConTeXt nowadays, use an embedded libra= ry, so external compilations/files are not necessary. Just out of curiosity= , wouldn't it be easier to use a ConTeXt environment? E.g.:

\starttext
\startMPcode %\startuseMPgraphic{<name>} if you= want to reuse your graphic with \useMPgraphic{<name>}
=C2=A0= =C2=A0=C2=A0 draw fullcircle scaled cm
=C2=A0=C2=A0=C2=A0 %withco= lor black % black is default
=C2=A0=C2=A0=C2=A0 ;
\stopMPcode= %\stopuseMPgraphic
\stoptext

More info= here: https://wiki.contextgarden.net/MetaFun_-_MetaPost_in_ConTeXt
T= o actually answer your question, if you actually want to load a Metapost gr= aphic externally generated, you should have something like:

%nice.mp
%"begin ... e= ndfig", as well as "end" are important
beginfi= g (1);
draw fullcircle scaled cm
%withcolor black
;
endfig;end

so when you compile it via

mpost = nice.mp

(obviously supposi= ng you have Metapost installed) you'll get a file called nice.1 and
=

\starttext

\externalfigur= e[nice.1][width=3D4cm]

\stoptext

<= /div>

will work. However, as you can see, ConTeXt deals = with such minutiae for you and extends Metapost capabilities too, so the se= cond alternative is not the ConTeXt way to go.

I hope it= helps.

Jairo :)

El= lun., 9 de nov. de 2020 a la(s) 16:59, Sylvain Hubert (champignoom@gmail.com) escribi=C3=B3:
Dear = List,

I'm trying to embed a metapost image int= o the document. According the MetaFun manual, "embeddin= g such a graphic is done by: \externalfigure[graphic.123][width=3D4cm]"= ;, but the following example produces an empty page:

=C2=A0=C2=A0=C2=A0 % test.mkxl
=C2=A0=C2=A0=C2=A0 \starttext=C2=A0 =C2=A0 \externalfigure[test.123][width=3D4cm]
=C2=A0 =C2=A0 \st= optext

=C2=A0=C2=A0=C2=A0 % test.123
=C2= =A0=C2=A0=C2=A0 draw fullcircle scaled cm withcolor black;

Does anyone know how to properly embed a metapost image into a con= text document?

Thanks!

Be= st,
Sylvain
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--0000000000009d746505b3b43fbb-- --===============8256262433211487205== 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== --===============8256262433211487205==--