[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: Math mode doesn't work if followed by a dash [9.4 (nil @ /home/
From: |
Richard Lawrence |
Subject: |
Re: Bug: Math mode doesn't work if followed by a dash [9.4 (nil @ /home/gutin/.emacs.d/.local/straight/build/org-mode/)] |
Date: |
Tue, 29 Sep 2020 20:53:33 +0200 |
"Berry, Charles" <ccberry@health.ucsd.edu> writes:
> The case Gutin describes conforms to the documentation, viz. `$x\beta$-`
> should produce math mode LaTeX as I read the next paragraph.
>
> From (info "(org) LaTeX fragments"):
>
> • Text within the usual LaTeX math delimiters. To avoid conflicts
> with currency specifications, single ‘$’ characters are only
> recognized as math delimiters if the enclosed text contains at most
> two line breaks, is directly attached to the ‘$’ characters with no
> whitespace in between, and if the closing ‘$’ is followed by
> whitespace, punctuation or a dash.
Hmm, good point.
It looks to me like the relevant function is
org-element-latex-fragment-parser, and the code for that hasn't changed
much in several years (last change was 2017). (Also, I was wrong,
parsing latex fragments is not done with just a regexp.) I can confirm
that this function parses "$foo" in "$foo$ bar" as a latex fragment, but
not in "$foo$-bar"
Not sure if the problem here is the code or the documentation. Perhaps
the documentation should be updated to reflect the current behavior?
--
Best,
Richard