Re: [oXygen-user] Displaying LaTeX in XML documents

2021-04-22 Thread Michael Boudreau
Thanks, Radu!

--
Michael R. Boudreau
Electronic Publishing Technology Manager
The University of Chicago Press
1427 E. 60th Street
Chicago, IL 60637
www.journals.uchicago.edu<http://www.journals.uchicago.edu>


From: oXygen-user  on behalf of "Oxygen XML 
Editor Support (Radu Coravu)" 
Reply-To: "oxygen-user@oxygenxml.com" 
Date: Thursday, April 22, 2021 at 12:39 AM
To: "oxygen-user@oxygenxml.com" 
Subject: Re: [oXygen-user] Displaying LaTeX in XML documents


Hi Michael,

The plugin is Javascript based:

https://github.com/oxygenxml/wsaccess-javascript-sample-plugins/blob/master/latex-images-support/wsAccess.js<https://urldefense.com/v3/__https:/github.com/oxygenxml/wsaccess-javascript-sample-plugins/blob/master/latex-images-support/wsAccess.js__;!!BpyFHLRN4TMTrA!tD_JomHTrO0SM9nkqJ8Jjr9aSSeDGc4aiO850hbJdt-kqE84UdmgyTxQY14w-QYxF1Lg$>

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://urldefense.com/v3/__https:/blog.oxygenxml.com/topics/adding-latex-equation-support-dita.html__;!!BpyFHLRN4TMTrA!tD_JomHTrO0SM9nkqJ8Jjr9aSSeDGc4aiO850hbJdt-kqE84UdmgyTxQY14w-TLmHLWz$>
 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—




A document containing LaTeX :
$x=\frac{1+y}{1+2z^2}$


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  element, like so:

$x=\frac{1+y}{1+2z^2}$
or





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. 60th Street
Chicago, IL 60637
www.journals.uchicago.edu<http://www.journals.uchicago.edu>




___

oXygen-user mailing list

oXygen-user@oxygenxml.com<mailto:oXygen-user@oxygenxml.com>

https://www.oxygenxml.com/mailman/listinfo/oxygen-user<https://urldefense.com/v3/__https:/www.oxygenxml.com/mailman/listinfo/oxygen-user__;!!BpyFHLRN4TMTrA!tD_JomHTrO0SM9nkqJ8Jjr9aSSeDGc4aiO850hbJdt-kqE84UdmgyTxQY14w-X9xz7NN$>
___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user


Re: [oXygen-user] Displaying LaTeX in XML documents

2021-04-21 Thread Oxygen XML Editor Support (Radu Coravu)

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




A document containing LaTeX :
$x=\frac{1+y}{1+2z^2}$


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  element, like so:


$x=\frac{1+y}{1+2z^2}$

or



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 


___
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


[oXygen-user] Displaying LaTeX in XML documents

2021-04-21 Thread Michael Boudreau
Hello,

The blog post at 
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—




A document containing LaTeX :
$x=\frac{1+y}{1+2z^2}$


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  element, like so:

$x=\frac{1+y}{1+2z^2}$
or





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. 60th Street
Chicago, IL 60637
www.journals.uchicago.edu

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