Direct tex2svg example rendering as blank when I paste into HTML file
thomasjm opened this issue · 1 comments
I'm trying to run the tex2svg
example and finding that it renders as a blank page when I try to paste it into an HTML file. I'm trying to paste the CSS and SVG output respectively into an HTML page skeleton like this:
<html>
<head>
<style>
--css output...
</style>
</head>
<body>
<mjx-container> ... </mjx-container>
</body>
</html>
A full Gist with this HTML file is here.
Am I misunderstanding how this is supposed to work? I tried the same thing with the tex2chtml
example and it worked so I'm wondering what I'm missing with tex2svg
.
This is caused by the problem discussed in mathjax/MathJax-src#365 and fixed in mathjax/MathJax-src#417, which is that the xlink
namespace is being mishandled, and you are getting xlink:xlink:href
for the references in <use>
elements. These should be xlink:href
instead, so one solution would be to use a regular expression to replace xlink:xlink:href
with xlink:href
. Alternatively, you could prevent the use of font caching (at the expense of space) by setting fontCache: 'none'
in the svg
block of your MathJax configuration. E.g.
MathJax = {
svg: {
fontCache: 'none'
}
}
The problem with be fixed in the next release, but either solution would handle things until then.