Pandoc/KaTeX loading issue

Scott Hartley's Avatar

Scott Hartley

27 Aug, 2020 05:40 PM

I'm using Marked to view html generated by Pandoc. Recently (I think this started with the last update), I've noticed some weird behavior with the rendering of equations: if Marked updates itself after I save the file, none of the equations are rendered properly; I just see the raw LaTeX. If I get Marked to manually reload the page, however, they show up just fine. If I then change the text and save they go back to being rendered improperly until I manually reload, etc.

  1. Support Staff 1 Posted by Brett on 27 Aug, 2020 06:25 PM

    Brett's Avatar

    Hm. This sounds like an issue with the new update mechanism in version 2.6.0, but none of the beta testers pointed it out. Can you tell me if you have the same issue with MathJax as well?

    Thanks,
    Brett

  2. 2 Posted by Scott Hartley on 27 Aug, 2020 08:16 PM

    Scott Hartley's Avatar

    Does not seem to be an issue with MathJax, just KaTeX.

    Thanks! For what I’m doing I can just use MathJax, so this basically solves the problem for me.

  3. Support Staff 3 Posted by Brett on 27 Aug, 2020 08:20 PM

    Brett's Avatar

    Cool. I'll figure out what's going on with Katex.

    Thanks,
    Brett

  4. Support Staff 4 Posted by Brett on 28 Aug, 2020 02:02 PM

    Brett's Avatar

    So in my testing Katex is rendering just as well as MathJax with every
    refresh. Do you have a sample document that displays the issue for you?

    Thanks,
    Brett

  5. 5 Posted by Scott Hartley on 28 Aug, 2020 08:24 PM

    Scott Hartley's Avatar

    Sure, no problem. I've attached the markdown input and the html output I see when I view source in Marked. This is processed using pandoc --from markdown --to html --katex --template default.html. I've also attached before and after screenshots.

    Thanks!

  6. Support Staff 6 Posted by Brett on 03 Sep, 2020 12:41 PM

    Brett's Avatar

    Sorry for the delay on this one, getting around to investigating now.

  7. Support Staff 7 Posted by Brett on 03 Sep, 2020 12:50 PM

    Brett's Avatar

    In my testing your whole setup seems to work fine if I just leave the --katex flag out of the custom processor command. Can you test and verify?

  8. 8 Posted by Scott Hartley on 03 Sep, 2020 05:56 PM

    Scott Hartley's Avatar

    I checked this out. I think the minimal example I sent was a little too minimal, unfortunately. It does render ok without the --katex flag, but it doesn't seem to be using KaTeX (or MathJax). If I switch the math to something even a little more complicated, like $\frac{x}{y}$, it fails.

    MathJax is still working fine for me, though, so maybe this is some weird bug/behavior on the KaTeX side.

    Best,

    Scott

    ---- On Thu, 03 Sep 2020 08:50:12 -0400 Brett <[email blocked]> wrote ----

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac