Bug 462555

Summary: Some pandoc symbols are not parsed in preview
Product: [Applications] ghostwriter Reporter: Ryan H. <kde>
Component: generalAssignee: megan.conkle
Status: CONFIRMED ---    
Severity: minor CC: kde
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Ryan H. 2022-12-02 17:22:08 UTC
SUMMARY

I am unable to view some LaTeX symbols when using pandoc as the preview generator. These are valid for pandoc, but the preview is showing the LaTex source with a red font. But when I export the document to HTML or PDF the symbol is correctly shown.

STEPS TO REPRODUCE
1. Open ghostwriter
2. Open Settings -> Preview Options and set "Markdown Flavor" to "Pandoc"
3. In editor write $T = 2 \celsius$

OBSERVED RESULT

Preview pane shows "T = 2\celsius"

EXPECTED RESULT

Preview pane should show "T = 2℃"

SOFTWARE/OS VERSIONS
ghostwriter Version: 2.1.6
Linux/KDE Plasma: Arch Linux 
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Pandoc Version: 2.16.2
Graphics Platform: X11
Comment 1 megan.conkle 2022-12-12 18:25:14 UTC
It looks like this is part of an extension that is not autoloaded in MathJax.  I'll add the appropriate code to load it.

Note to self or anyone who wants to implement the fix, the gensymb extension needs to be loaded like so:

    window.MathJax = {
      loader: {load: ['[tex]/gensymb']},
      tex: {packages: {'[+]': ['gensymb']}}
    };

See this link for details: https://docs.mathjax.org/en/latest/input/tex/extensions/gensymb.html