Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: TeX \liminf procudes invalid SVG output / treatment of known-unkown chars #6

Closed
pkra opened this issue Jun 18, 2014 · 13 comments
Closed

Comments

@pkra
Copy link
Contributor

pkra commented Jun 18, 2014

This is more of a MathJax-core issue but I wasn't sure how to file it so I wanted to discuss this here first.

Issue Summary

Converting \liminf leads to invalid SVG.

(Also, tex2svg does not produce output if unknown characters are reported.)

Steps to Reproduce

  • Converting TeX input \liminf to SVG will contain<text transform="scale(53.81925) matrix(1 0 0 -1 0 0)" stroke="none" font-weight="" font-style="" font-family="STIXGeneral,'Arial Unicode MS',serif"> </text> which is invalid since font-weight and font-style are empty.
  • Removing the empty attributes fixes this.

IIUC, the problem is that converting TeX input \liminf to MathML produces u+2006 which is not covered by the MathJax TeX fonts (at least according to the error message of the SVG output) but also (in the output) not converted into characters that are covered. In turn, this unknown characters is causing the text tag.

@physikerwelt
Copy link
Contributor

same for \S.
I did not use the tex2svg mapper but the mathoid wrapper that displays the error message.

@pkra
Copy link
Contributor Author

pkra commented Jul 31, 2014

Thanks. (This issue actually confuses me; I thought our policy was to not support macros that our font's don't cover). One workaround is to switch to STIX fonts.

@physikerwelt
Copy link
Contributor

Any updates here?

@pkra
Copy link
Contributor Author

pkra commented Aug 27, 2014

Thanks for reminding us. I've reported this upstream on MathJax's issue tracker as it's not MathJax-node specific.

(Unless you mean the problem with tex2svg's output -- that should probably move to a separate issue on MathJax-node.)

@pkra pkra added the Upstream label Aug 27, 2014
@physikerwelt
Copy link
Contributor

The most complete test that we have in Wikipedia
http://en.wikipedia.beta.wmflabs.org/wiki/User:Physikerwelt/Help:Formula contains exactly 3 problems
problem1
problem2
problem3
At least 1. and 2 are related to this issue.
And the red ink is really bad advertisement for this rendering mode.
Therefore it would be great to find a way to get a temporary fix for this issue even though it might not look perfect.

@pkra
Copy link
Contributor Author

pkra commented Aug 28, 2014

I don't think they're related. The original posting was about

a) SVG that works but does not validate due to empty attributes
b) the problem that the sample scripts like tex2svg do not produce output on the CLI (they do produce output and you can get to the SVG, MathML etc)

a) is an upstream issue with MathJax b) is a MathJax-node issue (albeit a minor one since tex2svg is just an example and the actual output is generated just not printed to the command line).

Could you file a separate issue and provide some background? I don't see how MathJax-node could generate that message unless TeX is processed as MathML.

@physikerwelt
Copy link
Contributor

Just for future reference A list of all errors I see for Latin-Modern:

Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2AB5 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \prec ,\nprec ,\preceq ,\npreceq ,\precneqq \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2AB6 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \succ ,\nsucc ,\succeq ,\nsucceq ,\succneqq \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2AB7 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1","SVG - Unknown character: U+2AB9 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \precsim ,\precnsim ,\precapprox ,\precnapprox \,
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2AB8 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1","SVG - Unknown character: U+2ABA in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \succsim ,\succnsim ,\succapprox ,\succnapprox \,
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+29EB in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1","SVG - Unknown character: U+2605 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \Box ,\blacksquare ,\diamond ,\Diamond \lozenge ,\blacklozenge ,\bigstar \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+29F8 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \lnot \neg ,\not \operatorname {R},\bot ,\top \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+25C3 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1","SVG - Unknown character: U+25B9 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \smile \frown \wr \triangleleft \triangleright \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2141 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \diamondsuit ,\heartsuit ,\clubsuit ,\spadesuit ,\Game ,\flat ,\natural ,\sharp \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2571 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1","SVG - Unknown character: U+2572 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2A5E in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1","SVG - Unknown character: U+22D4 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): \intercal \barwedge \veebar \doublebarwedge \between \pitchfork \!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+1D768 in LatinModernMathJax_Main,LatinModernMathJax_Normal,LatinModernMathJax_Monospace,LatinModernMathJax_Latin,LatinModernMathJax_Alphabets,LatinModernMathJax_Marks,LatinModernMathJax_Arrows,LatinModernMathJax_Operators,LatinModernMathJax_Symbols,LatinModernMathJax_Shapes,LatinModernMathJax_Misc,LatinModernMathJax_Variants,LatinModernMathJax_NonUnicode,LatinModernMathJax_Size1"]"): {\boldsymbol {\varepsilon \digamma \varkappa \varpi }}\!
ailed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+393 in LatinModernMathJax_SansSerif","SVG - Unknown character: U+394 in LatinModernMathJax_SansSerif","SVG - Unknown character: U+398 in LatinModernMathJax_SansSerif"]"): {\mathsf {\mathrm{A} \mathrm{B} \Gamma \Delta \mathrm{E} \mathrm{Z} \mathrm{H} \Theta }}\!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+39B in LatinModernMathJax_SansSerif","SVG - Unknown character: U+39E in LatinModernMathJax_SansSerif","SVG - Unknown character: U+3A0 in LatinModernMathJax_SansSerif"]"): {\mathsf {\mathrm{I} \mathrm{K} \Lambda \mathrm{M} \mathrm{N} \Xi \Pi \mathrm{P} }}\!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+3A3 in LatinModernMathJax_SansSerif","SVG - Unknown character: U+3A5 in LatinModernMathJax_SansSerif","SVG - Unknown character: U+3A6 in LatinModernMathJax_SansSerif","SVG - Unknown character: U+3A8 in LatinModernMathJax_SansSerif","SVG - Unknown character: U+3A9 in LatinModernMathJax_SansSerif"]"): {\mathsf {\Sigma \mathrm{T} \Upsilon \Phi \mathrm{X} \Psi \Omega }}\!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+2111 in LatinModernMathJax_Fraktur"]"): {\mathfrak {ABCDEFGHI}}\!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+211C in LatinModernMathJax_Fraktur"]"): {\mathfrak {JKLMNOPQR}}\!
Failed to parse (Conversion error. Server ("http://mathoid-puppet.eqiad.wmflabs:10042") reported: "Error:["SVG - Unknown character: U+30 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+31 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+32 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+33 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+34 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+35 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+36 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+37 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+38 in LatinModernMathJax_Fraktur","SVG - Unknown character: U+39 in LatinModernMathJax_Fraktur"]"): {\mathfrak {0123456789}}\!

All those should be fixed before, we can use Latin-Modern for wikipedia.

@pkra
Copy link
Contributor Author

pkra commented Aug 29, 2014

These errors (soon to be warnings) tell you which Unicode characters are not covered by the Latin Modern font, so they are expected behavior (unless you mean to report that the SVG output is missing characters that ARE in the original Latin Modernfonts in which case this would be an upstream bug with MathJax.).

@dpvc
Copy link
Member

dpvc commented Aug 31, 2014

Several of these are actually problems in the LatinModern fonts. For example, the Fraktur problems at the bottom are due to the LatinModernMathJax_Fraktur font not including several Fraktur characters from the Letterlike Symbols. Some were included, but some not (I'm not sure why Fred didn't include them; probably an oversight). They are in one of the other fonts, but it was not included in the search path for the Fraktur font (I did point out that the search list wasn't complete for these fonts, but nothing was done about it). These issues can be fixed in the font data files (without needing to update the fonts).

Others are (as you indicate) limitations of the LatinModern fonts, which don't include some symbols that are in the MathJax fonts. There is no easy solution other than going to the STIX fonts for better coverage.

@pkra
Copy link
Contributor Author

pkra commented Sep 2, 2014

I've created mathjax/MathJax#904 to track the part of this that we can fix.

Again this issues is not about these error messages or missing font support -- it is about (very slightly) invalid SVG due to empty attributes where SVG expects non-empty ones (and that part is also an upstream issue).

@dpvc
Copy link
Member

dpvc commented Sep 3, 2014

I've included a fix for the empty attributes in the SVG output for missing characters in mathjax/MathJax#898. (It also fixes the space problem.)

@dpvc
Copy link
Member

dpvc commented Sep 3, 2014

I thought our policy was to not support macros that our font's don't cover

It is, but the \S macro was included before that policy was in place. I'm pretty sure it is the only one that isn't properly covered. It was included because it was part of the plain TeX macro tables in appendix F of the TeXBook, as I recall.

@dpvc dpvc added the Fixed label Sep 3, 2014
@dpvc
Copy link
Member

dpvc commented Sep 3, 2014

I'm closing this as fixed, since the MathJax issue 904 now covers the remaining content of this issue.

@dpvc dpvc closed this as completed Sep 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants