I am creating online documentation using Katex to render maths formulas (similar to MathJax, only faster and smaller weight/less dependencies). The Frameless HTML5 export of the doc looks like this when using Katex:
However, I need to be able to create CHM and PDF as well, and when I generate those outputs that same page looks like this:
The CHM output also gives me a script error when loading the page. I'm assuming this is because of basic incompatibility between the formats, as I assume PDF would need to pre-render the JS elements before being created (which it can't/doesn't, obviously), and CHM just doesn't like JS stuff in general from my experience.
I know I can use images instead of generating the maths, but that makes it a lot more painful to maintain and update. So, any suggestions on how I can work around this or even resolve the situation? Or any better tools that would be cross platform compatible to create these maths formulas?
I think your logic is correct. I'm guessing the Katex output is HTML5 and CSS3 compliant and therefore RoboHelp can generate the frameless output.
CHMs require CSS2 so RoboHelp has to do a backwards conversion, hence that not working.
I can't offer any alternatives so hopefully someone else can.
Have you tried Katex forums or support to see if others have faced this issue and found a solution?
CHM is actually a bit worse than Peter suggest. It uses IE7, which was not fully HTML 4.01 or CSS2 standards compliant.
Svg isn't supported either, so if you can get it to prerender, you'll need to specify an older image format for the CHM output (png or gif probably).
Katex only supports IE11, it looks like: https://katex.org/docs/browser.html
I noticed on the Extensions and Libraries page of the Katex doco it mentions Asciimath. Perhaps using the Asciimath library could work better, as, if I'm reading it right, you should at least get a plaintext rendering of the formula in the chm, rather than the katex code? (I'm assuming the scripting code for asciimath won't work in chm either) I haven't used anything like it before though, so my interpretation could be wrong. http://asciimath.org
Thank you Peter for your reply! I haven't checked the katex forums yet, as I thought that someone here might have had a similar issue before (I can't be the only one using aths forumlas in documentation!!!). I'll have look through them though...
Amebr, your suggestion to use Asciimath sems like a great idea! Quick investigation leads me to believe that it would indeed be more compatible... Thank you very much for the reply and I'll get testing ASAP and see how it goes. 🙂
The issue of maths formulas has come up from time to time and prior to HTML5 the only responses I recall seeing were to convert to images.
I can only guess that not having seen this in more recent times that solutions such as yours were sufficient and CHMs and PDFs were not required by those users.
See www.grainge.org for free Authoring and RoboHelp Information