Some math equations do not render correctly

beeven's Avatar

beeven

09 Jul, 2021 01:30 PM

// Please enter a detailed description of the issue // Description of the issue:

Some math equations containing tow or more _{} do not render correctly.

$$f_{y}(x)$$ ok $$f_{y}(x) g_{y}(x)$$ does not render, which is acceptable syntax in MathJax.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

  1. Type $$f_y(x) g_y(x)$$
  2. Change to $$f_{y}(x) g_{y}(x)$$
  3. Try some complex formular from MathJax.org, such as
    $$\sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i -\mu)^2}$$ not working.
  4. Remove some part $$\sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N}$$
  1. Support Staff 1 Posted by Brett on 10 Jul, 2021 12:24 PM

    Brett's Avatar

    It looks like you left out all of the configuration info I would need to diagnose the issue.

    - Brett

  2. 2 Posted by beeven on 15 Jul, 2021 08:53 AM

    beeven's Avatar

    My configuration is as followed. Sorry for the inconvenience.
    It seems some underscores in between $$ are parsed as and carets as .

    // Configuration (do not edit) Marked 2 1022 (Mac App Store)

    macOS Version: 12.0

    additionalMathJaxConfig:
    allowPageBreakInCode: YES
    bookTxtIsLeanpub: NO
    summaryMdIsGitBook: NO
    codeIsPoetry: NO
    codeCanWrap: YES
    collapsibleHeadlines: NO
    convertGithubCheckboxes: YES
    convertGithubEmoji: YES
    convertYAMLToMMD: NO
    defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
    defaultPreviewStyle: 0
    defaultProcessor: Discount (GFM)
    enableMiniMap: NO
    excludeBlockQuotesFromCounts: NO
    excludeFootnotesFromCounts: NO
    excludeVerbatimFromCounts: NO
    excludeCaptionsFromCounts: NO
    folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
    githubNewlines: YES
    h1IsPageBreak: NO
    h2IsPageBreak: NO
    hrIsPageBreak: NO
    includeMathJax: YES
    includeKatex: NO
    limitTextWidth: NO
    mathNumberEquations: NO
    mathNumberEquationsSide: 0
    mathNumberEquationsAMSOnly: NO
    minimalJavaScript: NO
    outlineModeExtensions:
    permissionGranted: NO
    printHeaderBottomLeft:
    printHeaderBottomRight:
    printHeaderFirstPage: NO
    printFooterFirstPage: NO
    printHeaderTopLeft:
    printHeaderTopRight:
    processHTMLFiles: YES
    removeMetadataForPreview: NO
    removeYAMLHeaders: NO
    scrollToEdit: YES
    shouldDetectCritic: YES
    shouldHighlightMarkupErrors: NO
    shouldLoadCritic: NO
    syntaxHighlight: YES
    syntaxHighlightOnlyLang: NO
    useCustomMarkdownProcessor: NO
    customMarkdownProcessor:
    useCustomPreprocessor: NO
    customPreprocessor:
    useFirstH1AsPrintTitle: YES

  3. Support Staff 3 Posted by Brett on 15 Jul, 2021 12:10 PM

    Brett's Avatar

    Do you have the same issue using the MultiMarkdown processor
    (Preferences->Processor)?

    -Brett

  4. 4 Posted by beeven on 17 Jul, 2021 09:22 AM

    beeven's Avatar

    Switching to MultiMarkdown processor solves the problem. Thank you!
    There is just a tiny issue with large square root symbol. No glitch if KaTeX is used instead of MathJax.

  5. Support Staff 5 Posted by Brett on 17 Jul, 2021 11:54 AM

    Brett's Avatar

    Glad to hear that's a good fix for you. I'm afraid the GFM processor
    doesn't avoid rendering underscores as italics inside of equations as
    well as it should.

    I'm very inexperienced with MathJax (and KaTeX), honestly, so I can't
    offer a lot of troubleshooting with the smaller quirks. If there's
    something you think Marked's version of Mathjax is doing wrong that it
    shouldn't be, though, let me know. If it works elsewhere but not in
    Marked, I can look into why that would be.

    -Brett

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • test.md 995 Bytes

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