Issue with Reload when rendering math with nvUltra (not nvUltra Beta)
The first pass normally works for both MathJax and KaTeX. However, if I do a reload on the preview I sometimes get source code in preview (see image below). This will usually clear up if I go back to the markdown file and add a space.
File:
Title: Simple Math Test
# [%title]
This is just to see if I can get a simple math express to work with either mathjax or KaTeX.
$$E=mc^2$$
--------------------------------
Image: 
-
Oh, sometimes adding a space does not work and the equation is not render as is the case here:
0 -
Can you include a screenshot of your preview preferences? I can't replicate this.
0 -







All Preferences windows


0 -
What happens when you change to KaTeX and updating preview whenever text is changed?
Also, is there a reason you have the "always perform full reload" enabled for the preview? There are times where one needs this, but if not needed should be turned off. Esp. when using KaTeX.
0 -
KaTeX works. I have not found a case yet were it doesn't. MathJax usually does but I tested its more and in a couple cases I can not reproduce it did not.
I was doing full reload at one time otherwise I would sometimes get odd results. I turn it off and also only update on save and see how that works.
BTW: nvUltra is expiring.
0 -
Without full reload if I do
1. Reload in Preview - get source code.
2. add a character - The page is re-rendered but KaTeX is not applied. so I get this:
0 -
One correction - The Reload fails when a 2 choice popup shows up of Back and Reload.

Then I get the source code displayed and I have to type a character and have a full refresh to get back to the proper math display.
0 -
Are you using the pop up menu in the preview? That might not work really well, and certainly does not trigger a true reload and regeneration of the html.
0 -
<bump>
0 -
I did find a correlation between "style" and proper rendering. This is with preference set to MathJax and Preview CSS to Github (also the default CSS).

if I change Preview CSS to Pretentious then preview is correct.

If I change Preview CSS back to Github I get the first screen back again.
Also, don't mind the last math "code block" - it works in One Markdown and for a more complex Maxwell Equations example it renders \, (a special size space in LaTeX) correctly.
0 -
I think a bit of a reset is in order to help sort through this appropriately.
1. There seems to be a difference between what KaTeX can do, and what MathJax can do. To be clear, that is not my responsibility or something I am knowledgeable about. You're on your own there (Not that you implied otherwise.) For my own documents, KaTeX works fine. For some of the tests you have sent me, it does not.
2. KaTeX can re-render when the preview is "updated" between keystrokes. MathJax cannot. MathJax requires a full reload in order to rerender. If using MathJax, you will need to either manually reload by choosing the "Refresh Preview" menu item, or toggling the preview off/on, or having the "full reload when updating" preference turned on when you type. But to be clear, otherwise, when you type and use MathJax it will NOT update the math rendering.
3. The CDN's I link to by default do not provide a "latest" version URL, so the versions have to be manually specified. I just updated KaTeX from 0.11.0 to 0.13.20 and it seems to work in quick tests. I tried updating MathJax from 2.7.7. to 3.2.0, and it did *NOT* seem to work, so I reverted back to 2.7.7 which does seem to work.
4. You never answered my question about what you meant by "reloading" the preview. Are you using the "right-click" pop-up menu in the preview? If so -- don't. That doesn't do what you think it does. :)
5. As you are aware, but just to note for others -- there is not really anything special about the way nvUltra links to these scripts. You can disable them and use the `HTML Header` metadata function within MultiMarkdown to use any scripts that you like (you may have to follow the reloading instructions for MathJax to get the expected behavior while typing, depending on your scripts.)
I want to make sure that this works properly, but from my tests I cannot identify any behavior that is not working correctly that is within my control (I cannot address bugs or limitations with KaTeX/MathJax).
0 -
I made some other improvements to the preview for the latest release today. See if that makes any difference for you as well.
0
Please sign in to leave a comment.
Comments
12 comments