Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Math support for markdown preview #718

Open
ExpectationMax opened this issue Apr 12, 2019 · 0 comments

Comments

@ExpectationMax
Copy link

commented Apr 12, 2019

First of all thanks for this great piece of software! I really enjoy working with VimR and it is one of the most functional Neovim GUIs I have used until now.

Regarding my feature request: I would really enjoy having math support in the markdown preview of VimR. I already implemented a hacky version of if by extending the markdown template with the following code in the head section:

  <script type="text/javascript">
    window.MathJax = {
      extensions: ["tex2jax.js"],
      jax: ["input/TeX", "output/HTML-CSS"],
      tex2jax: {
        inlineMath: [ ["\\(","\\)"], ['$', '$'] ],
        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        processEscapes: true
      },
      "HTML-CSS": {
          availableFonts: ["STIX"],
          preferredFont: 'STIX',
          webFont: 'STIX-Web',
          imageFont: null
      }
    };
  </script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" async></script>

There are still some issues with the markdown rendering destroying equations, yet I was not able to figure out how markdown is converted into html. Where should I check in order to find this out/which engine is used for the conversion?

As an alternative to this hacky approach of in-place editing the template, a configurable template would probably be ideal. Unfortunately, I am not proficient in Swift otherwise I would have already provided a pull-request implementing the desired functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.