Cimbali / markdown-viewer

Markdown (.md) file viewer WebExtension for your browser.
Other
165 stars 28 forks source link

LaTeX support via MathJax #75

Closed ale66 closed 3 years ago

ale66 commented 3 years ago

Hello, I am using Markdown viewer as a Firefox add-on to let my students see my notes directly from the MD source, thank you very much! However, the rendering of embedded LaTeX formulas, which is normally supported by MD viewers, here seems absent (or is it me?). Have you considered allowing the linking of, e.g., MathJax rendering

Many thanks.

Cimbali commented 3 years ago

We use markdown-it as a markdown renderer. though LaTeX math is not a natural part of markdown, support for this is often included indeed.

It seems there is a plugin for that: markdown-it-mathjax, though I have not tested it. Do you maybe want to write a PR to include this plugin, on the same model as the other plugins ?

KeithLRobertson commented 3 years ago

@ale66 Markdown Viewer from Simeon Velichkov supports it. I'm very happy to recommend it if it meets your need.

ale66 commented 3 years ago

thanks for the prompt answer! I understand that outside the 'academic bubble' LaTeX formulae are important only for a minority of Markdown viewever users.

However, I'm confused on whether the markdown-it extension and/or Velichkov's work only locally -I apologise for sloppy language as I'm not very knowledgeable our your browser plug-ins work.

Let me just add the for viewing local files there's a nice MD preview extension for VS Code which interprets LaTeX by default: they also use markdown-it with the plugin https://github.com/goessner/markdown-it-texmath (from the same author). Would it please be possible to consider calling that markdown-it plug-in also in your own markdown-it invocation?

Many thanks

Cimbali commented 3 years ago

Happy to report that markdown-viewer now (optionally, see preferences) supports LaTeX with katex and markdown-it-texmath. Look out for v1.7.0 when it’ll be out on AMO