Karthik Chikmagalur <karthikchikmaga...@gmail.com> writes:

> If I delete the last line, so it looks like
>
> \begin{align}
> x = 1
>
> And now place the cursor anywhere on the first line (with the \begin...)
> and call (org-element-context), it parses it as a `latex-fragment'.
>
> This make sense too, since any text of the form 
>
> \NAME BRACKETS
>
> is a `latex-fragment' as per Org syntax.  Is there a way to temporarily
> suppress this latter behavior while parsing?

No, there is no such way. Because there is nothing to suppress. Org
parser has no notion of "partial latex fragment" and simply cannot parse
such constructs.

> ... This is required for
> handling an edge case with live-updating LaTeX previews where the end
> delimiter of a latex-environment (\end{foo}) is modified.

Basically, we need a specialized parser that will guess that a given
paragraph of text is actually an incomplete or broken latex fragment.
You may try writing one. For example, by additionally checking paragraph
elements to be latex-like.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to