[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (Feature Request) customise LaTeX-preview regex
From: |
Nicolas Goaziou |
Subject: |
Re: (Feature Request) customise LaTeX-preview regex |
Date: |
Tue, 19 May 2020 09:26:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hello,
Timothy <address@hidden> writes:
> This time, I'm wanting to be able to use the lovely org latex preview
> functionality for more than just the default blocks.
> For instance, I'm interested in applying it to mhchem \ce{ … }
> fragments, as well as siunitx \SI{ … }{ … }.
I think you can preview \ce{...} just fine, with appropriate LaTeX
headers.
> I thought modifying org-latex-regexps may do the trick, yet despite
> trying a few different things, I was confused when unable to get it to
> work. It looks like I'm being confounded by the fact that
> org-format-latex doesn't even reference org-latex-regexps, and instead
> uses it's own hard-coded regexps.
> Hopefully it may be possible to tweak this so that once can preview
> more than just the defaults hardcoded into org-format-latex.
This should not be possible. Org cannot recognize all LaTeX syntax. If
you cannot preview it, Org does not understand it. IOW, it would be
a poor experience if you preview something that doesn't exist, e.g.,
upon exporting the document.
OTOH, nothing prevents an external library to allow previewing any LaTeX
code (probably re-using AucTeX facilities).
Regards,
--
Nicolas Goaziou