org-inside-LaTeX-fragment-p
org-inside-LaTeX-fragment-p is a compiled Lisp function in `org.el
'.
(org-inside-LaTeX-fragment-p)
Test if point is inside a LaTeX fragment.
I.e. after a \begin, \(, M-x , $, or $$, without the corresponding closing
sequence appearing also before point.
Even though the matchers for math are configurable, this function assumes
that \begin, \(, \[, and $$ are always used. Only the single dollar
delimiters are skipped when they have been removed by customization.
The return value is nil, or a cons cell with the delimiter and the
position of this delimiter.
This function does a reasonably good job, but can locally be fooled by
for example currency specifications. For example it will assume being in
inline math after "$22.34". The LaTeX fragment formatter will only format
fragments that are properly closed, but during editing, we have to live
with the uncertainty caused by missing closing delimiters. This function
looks only before point, not after.