[NTG-context] arbitrary context commands in xml file

Hans Hagen j.hagen at xs4all.nl
Mon Mar 8 13:46:30 CET 2021


On 3/8/2021 12:48 PM, Duncan Hothersall wrote:
> 
> 
> On Mon, 8 Mar 2021 at 10:21, <denis.maier at ub.unibe.ch 
> <mailto:denis.maier at ub.unibe.ch>> wrote:
> 
>      > -----Ursprüngliche Nachricht-----
>      > Von: Hans Hagen <j.hagen at xs4all.nl <mailto:j.hagen at xs4all.nl>>
>      > Gesendet: Freitag, 5. März 2021 23:17
>      > An: mailing list for ConTeXt users <ntg-context at ntg.nl
>     <mailto:ntg-context at ntg.nl>>; Maier, Denis
>      > Christian (UB) <denis.maier at ub.unibe.ch
>     <mailto:denis.maier at ub.unibe.ch>>;
>      > wolfgang.schuster.lists at gmail.com
>     <mailto:wolfgang.schuster.lists at gmail.com>
>      > Betreff: Re: [NTG-context] arbitrary context commands in xml file
> 
> 
>     [...]
> 
>      > >
>      > > Here, I was thinking if something like this could be easier:
>      > >
>      > > <?context-directive raw-tex-injector \testpage[4]?>
>      > you can also do this:
>      >
>      > <testpage n="4"/>
>      >
>      > \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 <?context \whatever{fdfd}?> in an XML source.
one of the things that can already be done ...

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

\xmlinstalldirective{tex}{xmltexdirective}

         <?context-directive tex command \inframed{xxx} ?>
         <?context-directive tex command \page ?>

(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
-----------------------------------------------------------------


More information about the ntg-context mailing list