Dear list, I have the following sample: \startbuffer[demo] <doc> <p>This context is not ConTeXt.</p> </doc> \stopbuffer \starttext \startxmlsetups xml:initialize \xmlsetsetup{#1}{p|doc}{xml:*} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups \xmlprocessbuffer{main}{demo}{} \stoptext Is there any way that I get "ConTeXt" (and not "context") typeset as \ConTeXt? Many thanks for your help, Pablo -- http://www.ousia.tk
Am 26.01.2015 um 14:21 schrieb Pablo Rodriguez
: Dear list,
I have the following sample:
\startbuffer[demo] <doc> <p>This context is not ConTeXt.</p> </doc> \stopbuffer
\starttext
\startxmlsetups xml:initialize \xmlsetsetup{#1}{p|doc}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups
\xmlprocessbuffer{main}{demo}{}
\stoptext
Is there any way that I get "ConTeXt" (and not "context") typeset as \ConTeXt?
Many thanks for your help,
Hans uses for the documentation of the Lua code <logo label="context"/> to print the ConTeXt logo, to do so the following setup is used (copied from x-ldx.mkiv): \startxmlsetups ldx:logo \uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii \ifx\ascii\empty\else\getvalue{\ascii}\fi \stopxmlsetups Wolfgang
On 01/26/2015 02:40 PM, Wolfgang Schuster wrote:
[...] Hans uses for the documentation of the Lua code <logo label="context"/> to print the ConTeXt logo, to do so the following setup is used (copied from x-ldx.mkiv):
\startxmlsetups ldx:logo \uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii \ifx\ascii\empty\else\getvalue{\ascii}\fi \stopxmlsetups
Many thanks for your reply, Wolfgang. I thought it was possible only changing the environment (and not the XML code). But this really does what I intend. Many thanks for your help, Pablo -- http://www.ousia.tk
Am 26.01.2015 um 16:19 schrieb Pablo Rodriguez
: On 01/26/2015 02:40 PM, Wolfgang Schuster wrote:
[...] Hans uses for the documentation of the Lua code <logo label="context"/> to print the ConTeXt logo, to do so the following setup is used (copied from x-ldx.mkiv):
\startxmlsetups ldx:logo \uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii \ifx\ascii\empty\else\getvalue{\ascii}\fi \stopxmlsetups
Many thanks for your reply, Wolfgang.
I thought it was possible only changing the environment (and not the XML code).
But this really does what I intend.
To replace text in your input you can try to use the translate module. \usemodule[translate] \translateinput[ConTeXt][\CONTEXT] \starttext This document was produced with ConTeXt. \enableinputtranslation This document was produced with ConTeXt. \stoptext Wolfgang
On 01/26/2015 04:33 PM, Wolfgang Schuster wrote:
[...] To replace text in your input you can try to use the translate module.
\usemodule[translate]
\translateinput[ConTeXt][\CONTEXT]
\starttext
This document was produced with ConTeXt.
\enableinputtranslation This document was produced with ConTeXt.
\stoptext
Many thanks for your reply, Wolfgang, I must confess I like this solution more, but I’m not sure it will be safe to use it XML. Anyway, this is something I wanted to correct some user input for automatically generated documents. Many thanks for your help, Pablo -- http://www.ousia.tk
participants (2)
-
Pablo Rodriguez
-
Wolfgang Schuster