emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add support for $…$ latex fragments followed by a dash


From: Max Nikulin
Subject: Re: [PATCH] Add support for $…$ latex fragments followed by a dash
Date: Tue, 1 Feb 2022 21:26:50 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

manual states:

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. For the other delimiters, there is no such restriction, so
      ^^^^^^
when in doubt, use ‘\(...\)’ as inline math delimiters.

It is even more interesting. Support of dash likely was unintentionally lost in the following commit:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6779f8f424883ffd202e24cbd8bb4e241db294b0
that generalizes handling of punctuation, unfortunately dash and apostrophe are not always belong to punctuation symbols in *text* modes. That commit even updates manual to a less precise phrase, however .texi file only, so the change was lost. Nicolas later restored apostrophe in the commit c0369a798470763f8f3c69cf2079c3a194635feb

False positive with the proposed patch:

 > Balance decreased from $10 to negative value ($-2 approximately)

certainly it is more rare than $n$-th valid case.

Tim, as mentioned before I’m strongly in favour of a ~half decade transition

Half of decade already passed since dash after currency symbol was broken so maybe it is better to fix current state by updating the manual (including bugfix branch) and by adding some tests.

P.S. It is deja vu, I almost certainly saw quite recent discussions whether punctuation may be handled in some regexps in more generic way. Consequences may be similar in respect to characters that are almost punctuation...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]