polymode / poly-org

Polymode for org-mode
57 stars 13 forks source link

How to set it up for latex fragments in a org file #27

Open student-sx opened 4 years ago

student-sx commented 4 years ago

Can I use poly-org to automatically switch to latex mode if the point is between latex delimiters? What to add to my init file to make it work?

vspinu commented 4 years ago

I have created inline-latex branch. Unfortunately I see font lock errors and indentation is not working as expected, so it's not veryuseful I would need to spend more time with it and cannot promise that it will happen soon unfortunately.

student-sx commented 4 years ago

Thanks. Something like \begin{equation} ... \end{equation} seems to be recognized. However \[ ... \] or \(... \) doesn't work for me, as well as $a^2$ or $$ a^2 + b^2 = c^2 $$. Compare the regexp used in poly-markdown.el.

vspinu commented 4 years ago

yes, it does not because even the \begin .. \end has issues, so I didn't proceed with others.

QMeqGR commented 2 years ago

Hello, I just discovered polymode and poly-org and would like to use it for inline LaTeX as well. If the trouble is with the symmetric delimiters $..$ and $$..$$, I could live without them. I tried to modify the regex for \begin..\end to work with [..] but I don't know regular expressions well enough to make it work. Is it as straightforward as modifying the regex to search for [..] and (..) ?