To contribute to this thread after many months:

Actually, python-markdown does support math via mathjax, if you install 
mdx_math and use it as one of the extensions.  mdx_math is just a python 
file - you can install it using pip - so it will work on any python 
installation.  To use it in viewrendered and vr2, create a @setting  node 
with the headline

@string view-rendered-md-extensions = mdx_math

You also have to do one more thing, though, which is to cause the html 
output to emit the right mathjax script elements, so that mathjax gets 
loaded.  I conditionally add the following the the html generated by 
markdown:

MD_MATHJAX_SCRIPT = r'''<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  config: ["MMLorHTML.js"],
  jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
  extensions: ["MathMenu.js", "MathZoom.js"],
  "HTML-CSS": { fonts: ["TeX"] }
});
</script>
<script type="text/javascript" 
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js";></script>
'''

        _script_header = MD_MATHJAX_SCRIPT if 'type="math/tex' in html else 
''
    html = _script_header + '<style 
type="text/css">body{background-color:%s;}</style>\n' 
%(self.md_background_color) + html

But the real problem, as I see it, with the markdown package is not the 
math but that it does not add a stylesheet to the html output.  And I don't 
feel like figuring one out.  It's just too tedious.

On Friday, October 20, 2017 at 11:24:03 AM UTC-4, Terry Brown wrote:
>
> On Fri, 20 Oct 2017 07:05:44 -0700 (PDT) 
> "Edward K. Ream" <edre...@gmail.com <javascript:>> wrote: 
>
> > Leo can already render LaTex math markup using reStructuredText 
>
> ...
> Not sure but markdown.py may not handle math.  But an obvious 
> alternative is to use pandoc for markdown -> html, which definitely 
> supports math. 
>
> Cheers -Terry 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to