unknown symbols brought by 'lvert' in latex formula expression
Posted: Thu Nov 09, 2023 10:01 am
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?
I checked the font-support page of mathJax: https://docs.mathjax.org/en/latest/output/fonts.html
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?
I checked the font-support page of mathJax: https://docs.mathjax.org/en/latest/output/fonts.html
Really?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