[NTG-context] Set up external figure for particular image type

Hans Hagen j.hagen at freedom.nl
Mon Aug 1 09:07:50 CEST 2022


On 8/1/2022 2:29 AM, Thangalin via ntg-context wrote:
> Got it working. Complete solution:
> 
> |\setupexternalfigures[ location={local,global,default}, 
> width=\textwidth ] \defineexternalfigure[svg][width=1cm] 
> \defineexternalfigure[jpg][width=2cm] 
> \defineexternalfigure[png][width=4cm] % Won't be applied because there's 
> no process action. % Default (\textwidth) is used, as defined above. 
> \defineexternalfigure[pdf][width=6cm] \starttexdefinition 
> includegraphics #1 \splitfilename{#1} \processaction[\splitofftype][ 
> jpg=>{\externalfigure[#1][jpg]}, png=>{\externalfigure[#1][png]}, 
> svg=>{\externalfigure[#1][svg][conversion=mp]}, 
> default=>{\externalfigure[#1]}, unknown=>{\externalfigure[#1]} ] 
> \stoptexdefinition \starttext \includegraphics{kitten.jpg} 
> \includegraphics{mill.png} \includegraphics{cow.pdf} 
> \includegraphics{tiger.svg} \stoptext |
I've added:

\setfigureconversion[svg][mp]

So that this works:

\starttext
   \externalfigure[kitten.jpg][width=2cm]
   \externalfigure[mill.png]  [width=4cm]
   \externalfigure[cow.pdf]   [width=6cm]
   \externalfigure[tiger.svg] [width=1cm]
\stoptext

But after we release you need to wikify it.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list