[NTG-context] SVG images inside XML setups

2021-03-08 Thread Thangalin
Here's a fairly minimal example showing an issue, using ConTeXt LMTX.
Save the following as "main.tex":

% SOF
\startbuffer[document]

\stopbuffer

\startbuffer[csvg]
http://www.w3.org/2000/svg;>


\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{body|img}{xml:*}
\stopxmlsetups

\startxmlsetups xml:body
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:img
  \placefigure{}{\externalfigure[\xmlatt{#1}{src}][conversion=mp]}
  \placefigure{}{\externalfigure[circle.svg][conversion=mp]}
  \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\starttext
  \xmlprocessbuffer{xhtml}{document}{}

  \placefigure{}{\externalfigure[circle.svg][conversion=mp]}
  \placefigure{}{\externalfigure[diagram.svg][conversion=mp]}
\stoptext
% EOF

Save the contents of "\startbuffer[csvg]" to a file named
"circle.svg", to create a valid, external SVG file.

Copy "circle.svg" to a file named "diagram.svg" to create a second
valid, external SVG file.

Run: context main.tex

Expected

All the SVG images appear.

Actual

Figures 1, 2, and 4 show only the following text:

\includesvgfile[circle.svg]\resetbuffer[svg-circle-inclusion]

In contrast, consider the following document:

% SOF
\startbuffer[csvg]
http://www.w3.org/2000/svg;>


\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
  \placefigure{}{\externalfigure[circle.svg][conversion=mp]}
  \placefigure{}{\externalfigure[diagram.svg][conversion=mp]}
\stoptext
% EOF

All the images appear as expected.

Any idea why using XML setups appears to affect the behaviour of
rendering SVG documents using MetaPost?

Thank you!
___
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
___


Re: [NTG-context] arbitrary context commands in xml file

2021-03-08 Thread denis.maier
Indeed. That's very useful. Thanks!

Von: ntg-context  Im Auftrag von Duncan Hothersall
Gesendet: Montag, 8. März 2021 14:06
An: Hans Hagen 
Cc: mailing list for ConTeXt users 
Betreff: Re: [NTG-context] arbitrary context commands in xml file



On Mon, 8 Mar 2021 at 12:46, Hans Hagen 
mailto:j.ha...@xs4all.nl>> wrote:
> I'd like to second Denis' request for support for XML processing
> instructions to execute ConTeXt code, rather than elements which can
> cause big problems if one is working to a fixed schema. It would be a
> boon to be able to drop in  in an XML source.
one of the things that can already be done ...

\def\xmltexdirective#1#2{\doif{#1}{command}{#2}}

\xmlinstalldirective{tex}{xmltexdirective}

 
 

(the #2 is something without spaces btu one can work around that)

Aha. Useful, thanks!
___
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
___


Re: [NTG-context] arbitrary context commands in xml file

2021-03-08 Thread Duncan Hothersall
On Mon, 8 Mar 2021 at 12:46, Hans Hagen  wrote:

> > I'd like to second Denis' request for support for XML processing
> > instructions to execute ConTeXt code, rather than elements which can
> > cause big problems if one is working to a fixed schema. It would be a
> > boon to be able to drop in  in an XML source.
> one of the things that can already be done ...
>
> \def\xmltexdirective#1#2{\doif{#1}{command}{#2}}
>
> \xmlinstalldirective{tex}{xmltexdirective}
>
>  
>  
>
> (the #2 is something without spaces btu one can work around that)
>

Aha. Useful, thanks!
___
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
___


Re: [NTG-context] arbitrary context commands in xml file

2021-03-08 Thread Hans Hagen

On 3/8/2021 12:48 PM, Duncan Hothersall wrote:



On Mon, 8 Mar 2021 at 10:21, > wrote:


 > -Ursprüngliche Nachricht-
 > Von: Hans Hagen mailto:j.ha...@xs4all.nl>>
 > Gesendet: Freitag, 5. März 2021 23:17
 > An: mailing list for ConTeXt users mailto:ntg-context@ntg.nl>>; Maier, Denis
 > Christian (UB) mailto:denis.ma...@ub.unibe.ch>>;
 > wolfgang.schuster.li...@gmail.com

 > Betreff: Re: [NTG-context] arbitrary context commands in xml file


[...]

 > >
 > > Here, I was thinking if something like this could be easier:
 > >
 > > 
 > you can also do this:
 >
 > 
 >
 > \startxmlsetups xml:testpage
 >    \testpage[\xmlatt{#1}{n}]
 > \stopxmlsetup
 >
 > and register that one (as in previous examples)

Thanks,. That's a good idea, but it will also make the XML invalid.

Denis

I'd like to second Denis' request for support for XML processing 
instructions to execute ConTeXt code, rather than elements which can 
cause big problems if one is working to a fixed schema. It would be a 
boon to be able to drop in  in an XML source.

one of the things that can already be done ...

\def\xmltexdirective#1#2{\doif{#1}{command}{#2}}

\xmlinstalldirective{tex}{xmltexdirective}




(the #2 is something without spaces btu one can work around that)


-
  Hans Hagen | PRAGMA ADE
  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
___


Re: [NTG-context] arbitrary context commands in xml file

2021-03-08 Thread Duncan Hothersall
On Mon, 8 Mar 2021 at 10:21,  wrote:

> > -Ursprüngliche Nachricht-
> > Von: Hans Hagen 
> > Gesendet: Freitag, 5. März 2021 23:17
> > An: mailing list for ConTeXt users ; Maier, Denis
> > Christian (UB) ;
> > wolfgang.schuster.li...@gmail.com
> > Betreff: Re: [NTG-context] arbitrary context commands in xml file
>
>
> [...]
>
> > >
> > > Here, I was thinking if something like this could be easier:
> > >
> > > 
> > you can also do this:
> >
> > 
> >
> > \startxmlsetups xml:testpage
> >\testpage[\xmlatt{#1}{n}]
> > \stopxmlsetup
> >
> > and register that one (as in previous examples)
>
> Thanks,. That's a good idea, but it will also make the XML invalid.
>
> Denis
>

I'd like to second Denis' request for support for XML processing
instructions to execute ConTeXt code, rather than elements which can cause
big problems if one is working to a fixed schema. It would be a boon to be
able to drop in  in an XML source.

Duncan
___
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
___


Re: [NTG-context] --extra=select --once in LMTX

2021-03-08 Thread denis.maier
Same here.

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Pablo
> Rodriguez
> Gesendet: Sonntag, 7. März 2021 11:11
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] --extra=select --once in LMTX
> 
> Dear list,
> 
> I think there is a bug in LMTX with:
> 
>   context --extra=select --selection=15:30 a.pdf --once
> 
> This gives 16 repetitions of page 30 (with any PDF document).
> 
> If --once isn't used or MkIV is deployed, selection is fine.
> 
> Could anyone confirm the issue?
> 
> Many thanks for your help,
> 
> Pablo
> --
> http://www.ousia.tk
> __
> _
> 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
> __
> _
___
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
___


Re: [NTG-context] Log overful boxes

2021-03-08 Thread denis.maier
After installing LMTX I could now this test.
Looks great. Thanks for adding this.

Denis

> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 5. März 2021 23:14
> An: Maier, Denis Christian (UB) ; ntg-
> cont...@ntg.nl
> Betreff: Re: AW: AW: [NTG-context] Log overful boxes
> 
> On 3/5/2021 10:35 PM, denis.ma...@ub.unibe.ch wrote:
> > Thanks Hans. So, it's already available?
> 
> how about just trying it ...
> 
> -
>Hans Hagen | PRAGMA ADE
>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
___


Re: [NTG-context] arbitrary context commands in xml file

2021-03-08 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 5. März 2021 23:17
> An: mailing list for ConTeXt users ; Maier, Denis
> Christian (UB) ;
> wolfgang.schuster.li...@gmail.com
> Betreff: Re: [NTG-context] arbitrary context commands in xml file


[...]

> >
> > Here, I was thinking if something like this could be easier:
> >
> > 
> you can also do this:
> 
> 
> 
> \startxmlsetups xml:testpage
>\testpage[\xmlatt{#1}{n}]
> \stopxmlsetup
> 
> and register that one (as in previous examples)

Thanks,. That's a good idea, but it will also make the XML invalid.

Denis
___
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
___