From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106297 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?SmFuLUVyaWsgSMOkZ2dsw7Zm?= Newsgroups: gmane.comp.tex.context Subject: Re: Label in externalfigures Date: Fri, 14 Feb 2020 23:22:21 +0100 Message-ID: <3C5892DD-F3D5-4B57-BC0D-5AD709987602@bahnhof.se> References: <31ABCCAF-E6D4-43E5-8959-8CCDA28A6E38@bahnhof.se> <20200212171654.b110370fd28801a09d28318e@gmail.com> <02701558-b8ed-0368-565a-53db3dbcaabc@xs4all.nl> <93C1165E-733F-4D68-A3B7-7E2911DB9B45@bahnhof.se> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Content-Type: multipart/mixed; boundary="===============6219549171994235701==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="87451"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 14 23:22:56 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 1j2jMN-000MdG-DD for gctc-ntg-context-518@m.gmane-mx.org; Fri, 14 Feb 2020 23:22:55 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D02B9181D6A; Fri, 14 Feb 2020 23:22:31 +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 CKy5rIokV6bN; Fri, 14 Feb 2020 23:22:29 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 80B331809A9; Fri, 14 Feb 2020 23:22:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CF5631809A9 for ; Fri, 14 Feb 2020 23:22: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 v78XOa6i2sCS for ; Fri, 14 Feb 2020 23:22:25 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.80.101.71; helo=ste-pvt-msa2.bahnhof.se; envelope-from=janerik.hagglof@bahnhof.se; receiver= Original-Received: from ste-pvt-msa2.bahnhof.se (ste-pvt-msa2.bahnhof.se [213.80.101.71]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id D0DF7180991 for ; Fri, 14 Feb 2020 23:22:25 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id D1E743F65E for ; Fri, 14 Feb 2020 23:22:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bahnhof.se Original-Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aPC3x_loYiKM for ; Fri, 14 Feb 2020 23:22:22 +0100 (CET) Original-Received: from [192.168.1.148] (h-98-128-229-207.NA.cust.bahnhof.se [98.128.229.207]) (Authenticated sender: mb287648) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 8FADE3F5D5 for ; Fri, 14 Feb 2020 23:22:22 +0100 (CET) In-Reply-To: <93C1165E-733F-4D68-A3B7-7E2911DB9B45@bahnhof.se> X-Mailer: Apple Mail (2.3608.60.0.2.5) 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:106297 Archived-At: --===============6219549171994235701== Content-Type: multipart/alternative; boundary="Apple-Mail=_6FFAE73F-95D8-4007-AE5C-935718A85DB5" --Apple-Mail=_6FFAE73F-95D8-4007-AE5C-935718A85DB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Now finally after consulting the luametafun and the MetaFun manual = I=E2=80=99ve found what I was looking for: The code: \startMPcode=20 picture p; p :=3D lmt_svg [ filename =3D "steguppgift.svg", width =3D = 400 ] ; draw p; path linje ; linje :=3D (15,-330) -- (280,-90); % adding a missing line = in the .svg file drawarrow linje withcolor black ; draw thelabel("37=C2=B0",(160,-330)); draw thelabel("$5,0$m",(150,-160)); \stopMPcode This was a fun learning experience so thanks again > 13 feb. 2020 kl. 10:35 skrev Jan-Erik H=C3=A4ggl=C3=B6f = : >=20 > I=E2=80=99ve tested this but it appears outside, not as an layer over = the picture. >=20 > \startMPcode=20 > draw lmt_svg [ > filename =3D "steguppgift.svg", > height =3D 5cm, > width =3D 10cm, > ] ; > label(\sometxt{5,0m},(63.936298,129.563995)); > label(\sometxt{37=C2=B0},(95.652702,27.367201));=09 > \stopMPcode >=20 > Thanks=20 >=20 > /Janne >> 12 feb. 2020 kl. 20:10 skrev Hans Hagen >: >>=20 >> On 2/12/2020 6:01 PM, Jan-Erik H=C3=A4ggl=C3=B6f wrote: >>> The expected output should be like this, see example in the link = below >>> = https://drive.google.com/file/d/13pCuUvNeL7T_Hs7-qrKZclkadcJ7_jVV/view?usp= =3Dsharing = >>> So that I have a picture so I can change the label text inside = according to different needs e.g change from 37=C2=B0 to 41=C2=B0 = without reediting it in Inkscape. >>> A similar properties like latex export picture.pdf_tex which is a = function in Inkscape >>> I investigate the details manual tip you provided, thanks a lot. >> you might want to peek into the luametafun manual as svg is discussed = there, including label stuff >>=20 >> what you can also try (with lmtx) is this (no real interface yet): >>=20 >> \starttext >>=20 >> \hbox\bgroup >> \ctxlua{metapost.startsvghashing()}% >> \includesvgfile[labels-004.svg]% >> \ctxlua{metapost.stopsvghashing()}% >> \egroup >>=20 >> \stoptext >>=20 >> which should turn your labels into tex, so you can typeset them as = tex (so $\\sin(x)$ comes out as math) it's no big deal to add a remap = option there but then i'd rather go for symbolic names >>=20 >> Hans >>=20 >> ----------------------------------------------------------------- >> Hans Hagen | PRAGMA ADE >> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >> tel: 038 477 53 69 | www.pragma-ade.nl = | www.pragma-pod.nl = >> ----------------------------------------------------------------- >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_6FFAE73F-95D8-4007-AE5C-935718A85DB5 Content-Type: multipart/mixed; boundary="Apple-Mail=_D245BC25-BB28-433A-9CC4-3E0024DDCFCE" --Apple-Mail=_D245BC25-BB28-433A-9CC4-3E0024DDCFCE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Now = finally after consulting the luametafun and the MetaFun manual I=E2=80=99v= e found what I was looking for:

The code:

\startMPcode 
picture p; p :=3D lmt_svg [ filename =3D = "steguppgift.svg", width =3D 400 ] ;
draw p;
path linje ; linje :=3D (15,-330) -- (280,-90); % = adding a missing line in the .svg file
drawarrow linje withcolor black ;
draw = thelabel("37=C2=B0",(160,-330));
draw thelabel("$5,0$m",(150,-160));
\stopMPcode



= --Apple-Mail=_D245BC25-BB28-433A-9CC4-3E0024DDCFCE Content-Disposition: inline; filename=steguppgift.svg Content-Type: image/svg+xml; x-unix-mode=0644; name="steguppgift.svg" Content-Transfer-Encoding: quoted-printable image/svg+xml= --Apple-Mail=_D245BC25-BB28-433A-9CC4-3E0024DDCFCE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

This was a fun learning experience so thanks = again

13 feb. 2020 kl. 10:35 skrev Jan-Erik H=C3=A4ggl=C3=B6f = <janerik.hagglof@bahnhof.se>:

I=E2=80=99ve tested = this but it appears outside, not as an layer over the picture.

\startMPcode 
draw lmt_svg = [
filename = =3D "steguppgift.svg",
= height =3D 5cm,
= width =3D 10cm,
= ] ;
label(\sometxt{5,0m},(63.936298,129.563995));
label(\sometxt{37=C2=B0},(95.652702,27.367201)); =
\stopMPcode

Thanks 

/Janne
12 feb. 2020 kl. 20:10 skrev Hans Hagen <j.hagen@xs4all.nl>:

On = 2/12/2020 6:01 PM, Jan-Erik H=C3=A4ggl=C3=B6f wrote:
The expected output = should be like this, see example in the link below
https://drive.google.com/file/d/13pCuUvNeL7T_Hs7-qrKZclkadcJ7_j= VV/view?usp=3Dsharing
So that I have a picture so I = can change the label text inside according to different needs e.g change = from 37=C2=B0 to 41=C2=B0 without reediting it in Inkscape.
A similar properties like latex export picture.pdf_tex which = is a function in Inkscape
I investigate the details manual = tip you provided, thanks a lot.
you might = want to peek into the luametafun manual as svg is discussed there, = including label stuff

what you can also try = (with lmtx) is this (no real interface yet):

\starttext

\hbox\bgroup
 \ctxlua{metapost.startsvghashing()}%
=  \includesvgfile[labels-004.svg]%
=  \ctxlua{metapost.stopsvghashing()}%
\egroup

\stoptext

which = should turn your labels into tex, so you can typeset them as tex (so = $\\sin(x)$ comes out as math) it's no big deal to add a remap option = there but then i'd rather go for symbolic names

Hans

---------------------------------------------------------------= --
=             &n= bsp;           &nbs= p;            =     Hans Hagen | PRAGMA ADE
=             &n= bsp;Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
=       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
---------------------------------------------------------------= --

___________________________________________________= ________________________________
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
_______________________________________________________________= ____________________

= --Apple-Mail=_D245BC25-BB28-433A-9CC4-3E0024DDCFCE-- --Apple-Mail=_6FFAE73F-95D8-4007-AE5C-935718A85DB5-- --===============6219549171994235701== 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== --===============6219549171994235701==--