Bug 462555 - Some pandoc symbols are not parsed in preview
Summary: Some pandoc symbols are not parsed in preview
Status: CONFIRMED
Alias: None
Product: ghostwriter
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: megan.conkle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 17:22 UTC by Ryan H.
Modified: 2022-12-12 18:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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