From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115513 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thangalin via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Set up external figure for particular image type Date: Mon, 18 Jul 2022 10:10:22 -0700 Message-ID: References: <545a6de4-c8a6-b97f-7196-a4000bbdc65f@fiee.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2689395883561928229==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thangalin To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 18 19:11:16 2022 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 1oDUH6-00068H-1N for gctc-ntg-context-518@m.gmane-mx.org; Mon, 18 Jul 2022 19:11:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A6E7A2A3BF2; Mon, 18 Jul 2022 19:10:39 +0200 (CEST) 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 s-dvV8TL3Jvh; Mon, 18 Jul 2022 19:10:37 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 764B12A3BEB; Mon, 18 Jul 2022 19:10:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1F42C2A3BE8 for ; Mon, 18 Jul 2022 19:10:36 +0200 (CEST) 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 QcKtOrdmWXoN for ; Mon, 18 Jul 2022 19:10:35 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.175; helo=mail-lj1-f175.google.com; envelope-from=thangalin@gmail.com; receiver= Original-Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 DC2D02A3BDB for ; Mon, 18 Jul 2022 19:10:34 +0200 (CEST) Original-Received: by mail-lj1-f175.google.com with SMTP id u14so14419225ljh.2 for ; Mon, 18 Jul 2022 10:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=R5a7Vdwj6Mb4CcpNUQNtp+bOr8K3M5rHlXJhbeRFiPw=; b=nVKB4PhjMtPm/DTkPN6OyQGcbTgHMr0NfucOmaXAYkMG+WmBeKLx/2RRjyRQ+fHSVB hn+JEorHIFE/dvGIaojZ061Jo9GGHd3QtUPfcS6jaI9LzO8G4t73quJj7gtma6wg4mlV lHf1LBLsI9eTrzQb298AjZg+0EyEOJv3bPAQ9P+de3T0EpYOu9zo05BAC1XOKaYvGMua nY2DiE6oEee8intcjPqQit/tM/zN5TV4Jcho6itz0TLPHmobwhLgQDcus5OwigfuI4gV I8CgRxgXe1r/jxoOazhErTdRhIImEMs2aSmS4E69N/aHNXmNJnEPwC8TRroW1yUTzjzH MAng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=R5a7Vdwj6Mb4CcpNUQNtp+bOr8K3M5rHlXJhbeRFiPw=; b=ulbCEZCZR/hhCEOLeXgmUjeJlm5F/HTYZnb41A96VausOW4JXV+hx+hn2eeCpFlggw WbKVT1LDqo+2+DTG7gFTDU387KR6+u782zuOcVzWBLc99jjjPCdN9Zhbtz309x/bFrIq B1On6JXmgVZIYpCdy95JXXpOExhs8nI1iBe5z6hZZeAXWNHplVU75MrDEfXMn7LVXrAa KirfqrM7AWwIBiombZTeavk9YbwgGeUv1pvJ9nG2OHyqmEVTUtKp8v5RyQRIZHFCpEmr vLv0APLgzx6rNI6DtKE0U6ZxeDoWuZREN9JuTUCiJV00vocHvjcVnsQKwbTk272HbgUn neTQ== X-Gm-Message-State: AJIora9on/m0u3wU0D2e9Y5NRcPFyFwGD0eS4tedw75DBwh9PZfUfA+x XmUmPQHOAJfN9ZJRNm0dUwrg8fOt5WvAlf7wqqN2PuI3kdE= X-Google-Smtp-Source: AGRyM1tNVG5C2DZVPq8IIAYJAs8HY+Y1Yuoo6CdmAY3uwHgNHQwTj7JaYeWKThBDMgUFFcIZJmnKdcSLJlvZxDzrIb4= X-Received: by 2002:a2e:2284:0:b0:25d:490f:60d3 with SMTP id i126-20020a2e2284000000b0025d490f60d3mr13473581lji.486.1658164234021; Mon, 18 Jul 2022 10:10:34 -0700 (PDT) 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:115513 Archived-At: --===============2689395883561928229== Content-Type: multipart/alternative; boundary="00000000000025ed6505e4177265" --00000000000025ed6505e4177265 Content-Type: text/plain; charset="UTF-8" Thank you, Wolfgang. That looks promising. SVG files are converted using MetaPost. I thought the following would work: svg=>{\externalfigure[#1][svg][conversion=mp]} Is there anything else that needs to happen to ensure SVG files are piped through MetaPost? Thanks again! > \setupexternalfigures [location={local,global,default}] > > \defineexternalfigure [jpg] [width=4cm] > \defineexternalfigure [png] [width=8cm] > > \starttexdefinition includegraphics #1 > > \splitfilename{#1} > > \processaction > [\splitofftype] > [ jpg=>{\externalfigure[#1][jpg]}, > png=>{\externalfigure[#1][png]}, > default=>{\externalfigure[#1]}, > unknown=>{\externalfigure[#1]}] > > \stoptexdefinition > > \starttext > > \includegraphics{hacker.jpg} > > \includegraphics{mill.png} > > \includegraphics{cow.pdf} > > \stoptext > > --00000000000025ed6505e4177265 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you, Wolfgang.

That looks promising.

SVG files are converted usi= ng MetaPost. I thought the following would work:

svg=3D>{\externalfigure[#1][svg][conversion=3Dmp]}
=

Is there anything else that needs to happen to ensure SVG files are p= iped through MetaPost?

Th= anks again!



\setupexternalfigures [location=3D{local,global,default}]

\defineexternalfigure [jpg] [width=3D4cm]
\defineexternalfigure [png] [width=3D8cm]

\starttexdefinition includegraphics #1

=C2=A0=C2=A0=C2=A0 \splitfilename{#1}

=C2=A0=C2=A0=C2=A0 \processaction
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [\splitofftype]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [=C2=A0=C2=A0=C2=A0 jpg=3D>{\= externalfigure[#1][jpg]},
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 png=3D>{\ex= ternalfigure[#1][png]},
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 default=3D>{\externalfi= gure[#1]},
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unknown=3D>{\externalfi= gure[#1]}]

\stoptexdefinition

\starttext

\includegraphics{hacker.jpg}

\includegraphics{mill.png}

\includegraphics{cow.pdf}

\stoptext

=C2=A0
--00000000000025ed6505e4177265-- --===============2689395883561928229== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2689395883561928229==--