unknown symbols brought by 'lvert' in latex formula expression
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 115
- Joined: Mon Jul 10, 2023 11:49 am
unknown symbols brought by 'lvert' in latex formula expression
Hi,
When converting latex formulas of which the expressions contain "lvert", the webhelp transformation reports the following:
For example, in the formula for Elastic Net Regression Algorithm:
It seems jlatexmath 1.0.7 cannot parse certain symbols converted from characters such as 'lvert' or 'rvert'. As it said the symbol expressed by 'lvert' is unknown (to its library).
I believe the latex plugin works well because there are many other latex formulas in the documents, none of them caused errors except for the ones containing 'lvert'.
Then I had a google search finding that eight years ago, someone encountered similar problem with 'lvert' and 'rvert': https://tex.stackexchange.com/questions ... -math-font
As the discussion went in that thread from stackexchange.com, it seems the problem was caused by the font-family, or in other words, the symbols converted from either 'lvert' or 'rvert' cannot be found in the library of specific font-family, then the jlatexmath parser detects it as unknown.
Since I was using the Inter font-family which was specified and imported in the css I used for webhelp, I had another test with default Webhelp Responsive transformation bundled with oxygen, the result was the same.
So, if it's caused by the compatibility issue of font-family, does it mean that I have only two workarounds for such issues?
1. Simple but straightforward, replace formula expression with image (screenshot of those formulas)
2. Use certain font-family to support latex formula, such as "Computer Modern", or "Latin Modern Math" and "TeX Gyre Math"?
Did I understand it correctly?
When converting latex formulas of which the expressions contain "lvert", the webhelp transformation reports the following:
Code: Select all
...
Caused by: org.scilab.forge.jlatexmath.ParseException: Problem with command genfrac at position 1:152
[pipeline] Unknown symbol or command or predefined TeXFormula: 'lvert'
...
Code: Select all
<foreign outputclass="embed-latex"> \dfrac{1}{2*n\_samples}* \Bigl\lVert{y - Xw} \Bigr\rVert_2^2 +
alpha * l1Ratio\Bigl\lVert{w}\Bigr\rVert_1 +
\dfrac{alpha*(1-l1Ratio)}{2}\Bigl\lVert{w}\Bigr\rVert_2^2 </foreign>
I believe the latex plugin works well because there are many other latex formulas in the documents, none of them caused errors except for the ones containing 'lvert'.
Then I had a google search finding that eight years ago, someone encountered similar problem with 'lvert' and 'rvert': https://tex.stackexchange.com/questions ... -math-font
As the discussion went in that thread from stackexchange.com, it seems the problem was caused by the font-family, or in other words, the symbols converted from either 'lvert' or 'rvert' cannot be found in the library of specific font-family, then the jlatexmath parser detects it as unknown.
Since I was using the Inter font-family which was specified and imported in the css I used for webhelp, I had another test with default Webhelp Responsive transformation bundled with oxygen, the result was the same.
So, if it's caused by the compatibility issue of font-family, does it mean that I have only two workarounds for such issues?
1. Simple but straightforward, replace formula expression with image (screenshot of those formulas)
2. Use certain font-family to support latex formula, such as "Computer Modern", or "Latin Modern Math" and "TeX Gyre Math"?
Did I understand it correctly?
image.png
I checked the font-support page of mathJax: https://docs.mathjax.org/en/latest/output/fonts.htmlReally?MathJax version 3 currently supports only one font, the MathJax TeX font. Version 2 provides the following fonts:
MathJax TeX (default)
STIX General
Asana Math
Neo Euler
Gyre Pagella
Gyre Termes
Latin Modern
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: unknown symbols brought by 'lvert' in latex formula expression
Hi,
Our Latex to SVG conversion in the open source DITA OT plugin calls code from the jlatexmath library:
https://github.com/oxygenxml/dita-latex ... ToSVG.java
It seems we are already using the latest version of the jlatexmath library.
I do not know much Latex and I am not familiar with how the jlatexmath library works but I suspect this problem is not related to the used font family. Our Java code does not set any specific font to be used by the jlatexmath library so what you are doing outside, in the WebHelp CSS does not influence in any way the latex image conversion.
How about if you add an issue on the JLatexmath plugin project? Maybe they can give us more feedback about if this works or how it could be made to work...
https://github.com/opencollab/jlatexmath
Regards,
Radu
Our Latex to SVG conversion in the open source DITA OT plugin calls code from the jlatexmath library:
https://github.com/oxygenxml/dita-latex ... ToSVG.java
It seems we are already using the latest version of the jlatexmath library.
I do not know much Latex and I am not familiar with how the jlatexmath library works but I suspect this problem is not related to the used font family. Our Java code does not set any specific font to be used by the jlatexmath library so what you are doing outside, in the WebHelp CSS does not influence in any way the latex image conversion.
How about if you add an issue on the JLatexmath plugin project? Maybe they can give us more feedback about if this works or how it could be made to work...
https://github.com/opencollab/jlatexmath
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 115
- Joined: Mon Jul 10, 2023 11:49 am
Re: unknown symbols brought by 'lvert' in latex formula expression
Hi Radu,
Sure. I've created an issue at https://github.com/opencollab/jlatexmath/issues/101. Thank you!
Regards,
Galano
Sure. I've created an issue at https://github.com/opencollab/jlatexmath/issues/101. Thank you!
Regards,
Galano
-
- Posts: 115
- Joined: Mon Jul 10, 2023 11:49 am
Re: unknown symbols brought by 'lvert' in latex formula expression
Hi @Radu,
I got a reply from jlatexmath's issues list:
Regards,
Galano
I got a reply from jlatexmath's issues list:
So, if I take a test to replace the current jlatexmath used in dita-latex component in DITA-OT/plugins, do I need to replace only the lib file itself, or maybe I should replace the other files with the ones in jLatexMath-v2 as well?JLaTeXMath v2 - try with this branch https://github.com/opencollab/jlatexmat ... perimental
Regards,
Galano
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: unknown symbols brought by 'lvert' in latex formula expression
Hi,
Right, so you should replace the jlatexmath-1.0.7.jar jar library, update the reference to it here:
https://github.com/oxygenxml/dita-latex ... plugin.xml
then run again the DITA OT integrator and hope they did not change the APIs we are using in our custom Java code.
Regards,
Radu
Right, so you should replace the jlatexmath-1.0.7.jar jar library, update the reference to it here:
https://github.com/oxygenxml/dita-latex ... plugin.xml
then run again the DITA OT integrator and hope they did not change the APIs we are using in our custom Java code.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service