revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

add Latex support #17

Closed revolunet closed 8 years ago

revolunet commented 12 years ago

see https://github.com/morlay/sublimetext-markdown-preview fork

dhulihan commented 12 years ago

+1

dpo commented 11 years ago

I strongly vote for this. Please make it a pull request!

dcow commented 10 years ago

+1

vtsatskin commented 10 years ago

I don't know if this is the direction you want to take, but I saw a pretty useful project that would allow you to mix Markdown and Latex in the same file. The idea is that Latex would be used when you want something a bit more complex and Markdown would be used for everything else. Check it out, it's called markx. It even had github support.

I would use markx during school to easily take notes in class while still being able to generate mathematical formulas.

One of the disadvantages was that you had to supply your github credentials every time you loaded the website, which got annoying. So restoring state was a pain so you couldn't easily have two documents open at the same time. I think having Sublime do the authoring and having this package do the generating would be really awesome.

vtsatskin commented 10 years ago

I've found a pretty easy work around for enabling LaTeX mathematical equations in documents. If you embed MathJax into your document, it will convert any text wrapped between two dollar signs (i.e. $$...$$) into nicely formatted mathematics.

Just add this at the beginning (or end) of your document:

<script type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

If you want inline support with the single dollar sign, (i.e. $...$), you'll want to include this block:

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
  });
</script>

More information can be found in MathJax's Getting Started page.

facelessuser commented 10 years ago

It looks like this MathJax support was already implemented.

I think this should be closed unless further work is planned for this.

arnm commented 10 years ago

I'm having trouble getting this render properly: (a'{1}, a'{2})

It is getting styled instead of converting it to Latex

This works fine: (a'_{1})

Edit: Github is removing some backlashes... it's correct Latex syntax Edit: got it to work just use '\' in front of literal characters

facelessuser commented 10 years ago

Yes in certain parsers, you will have to prevent against normal formatting of such characters as latex support is not built into the Github parser. And since the github parser logic is not controlled by this plugin, there isn't much we can do except be aware and escape appropriately.

facelessuser commented 8 years ago

It sounds like the general workaround is sufficient for people to get mathematical expression with LaTex. It also appears that no more work is planned on this.

Obviously this can only really be controlled in Python Markdown, but if the current workaround is not sufficient we can revisit this with a Python Markdown plugin (that is how I personally approach it), but in general, I haven't heard of any complaints in regards to the current offering. I think this can generally be closed.