Hello,

Florian Beck <f...@miszellen.de> writes:

> Nick Dokos <ndo...@gmail.com> writes:
>
>> "punctuation" in the syntax tables. Look for org-latex-regexps in
>> org.el
>
> The line in question is
>
> #+BEGIN_SRC emacs-lisp
> ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^    
> \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^        
> \r\n,.$]\\)\\$\\)\\)\\([-       .,?;:'\")\000]\\|$\\)" 2 nil)
> #+END_SRC
>
> It's probably not too hard to see that the culprit is the bunch of
> punctuation characters towards the end. Indeed if you change .,?;:'\"
> to .,?;:'\"” -- that solves the OPs problem. However, it might be even
> better to use a more general syntax, [:punct:], which matches all
> punctuation (as we want). So:
>
> #+BEGIN_SRC emacs-lisp
> ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^    
> \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^        
> \r\n,.$]\\)\\$\\)\\)\\([-       [:punct:]\000]\\|$\\)" 2 nil)
> #+END_SRC

Actually this variable is hardly used throughout Org code base. See
org-element-latex-fragment-parser instead (which has the same "problem"
anyway).

Also, according to Elisp manual; [:punct:] is not ideal either:

  `[:punct:]'
       This matches any punctuation character.  (At present, for multibyte
       characters, it matches anything that has non-word syntax.)

There is also "\s.".

Anyway, it might be better to know exactly what kind of false positives
we want to avoid.


Regards,

-- 
Nicolas Goaziou

Reply via email to