[NTG-context] XML and math
adityam at umich.edu
Fri Jan 11 02:28:43 CET 2019
On Thu, 10 Jan 2019, Aditya Mahajan wrote:
> On Thu, 10 Jan 2019, Hans Hagen wrote:
>> On 1/10/2019 10:26 PM, Aditya Mahajan wrote:
>>> I have an XML file (which is generated via a program that I have no
>>> control over), which contains elements as follows:
>>> <equation text="$$y_1(t) = 1, t \geq 0$$">
>>> <img alt="$$y_1(t) = 1, t \geq 0$$" class="equation"
>>> height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>
>>> I want to typeset the `text` attribute of equation (and ignore the <img>
>>> tag). So, I tried:
>>> \startxmlsetups matlab
>>> % Bunch of missing definitions
>>> \startxmlsetups matlab:equation
>>> This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the
>>> attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for
>>> content and not attributes).
>> Time for an "aha, I knew it" moment ...
> This contains `
` which I want to convert to either newline or blank.
Some debugging showed that the entity was being translated correctly. I
was typesetting the output under texcatcodes, which was causing the
problem. Setting formfeedasciicode and endoflineasciicode to ignorecatcode
made everything work correctly.
More information about the ntg-context