Hi Michael,

The plugin is Javascript based:

https://github.com/oxygenxml/wsaccess-javascript-sample-plugins/blob/master/latex-images-support/wsAccess.js

and has this condition to identify XML elements that it should render:

return "latex" == nodeContext.getNodeName() || ("foreign" == nodeContext.getNodeName() && "embed-latex" == nodeContext.getAttributeValue("outputclass"));
I think in your case the condition should be:

return "tex-math" == nodeContext.getNodeName() && "MathJax" == nodeContext.getAttributeValue("version");
You probably also need to modify the CSS Oxygen uses to edit JATS content to hide the text content from the element, probably something like:

tex-math[version=MathJax]{
    display:inline !important;
    white-space: -oxy-trim-when-ws-only !important;
}
tex-math[version=MathJax] * {
    display:none !important;
    white-space:normal !important;
}

Regards,

Radu

Radu Coravu
Oxygen XML Editor

On 4/21/21 22:15, Michael Boudreau wrote:

Hello,

The blog post at https://blog.oxygenxml.com/topics/adding-latex-equation-support-dita.html <https://blog.oxygenxml.com/topics/adding-latex-equation-support-dita.html> refers to a plugin that will create an image from LaTeX to display in Author mode.

I downloaded the ‘latex-images-support’ folder and installed it in my plugins folder. The math expression in the sample file—

<?xml-stylesheet type="text/css" href="sample.css"?>
<root>
A document containing LaTeX :
<latex>$x=\frac{1+y}{1+2z^2}$</latex>
</root>

is rendered correctly as an image when I view it in Author mode (using Oxygen 23.0).

I’d like to be able to use the plugin with JATS XML documents, which can contain LaTeX inside a <tex-math> element, like so:

<tex-mathnotation="LaTeX"version="MathJax">$x=\frac{1+y}{1+2z^2}$</tex-math>

or

<tex-mathnotation="LaTeX"version="MathJax"><![CDATA[$x=\frac{1+y}{1+2z^2}$]]></tex-math>

Is there a way to configure or modify the plugin to handle this?

--

Michael R. Boudreau

Electronic Publishing Technology Manager

The University of Chicago Press

1427 E. 60^th Street

Chicago, IL 60637

www.journals.uchicago.edu <http://www.journals.uchicago.edu>


_______________________________________________
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user

_______________________________________________
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Reply via email to