Marcin Borkowski <mb...@wmi.amu.edu.pl> writes: > Hi list, > > I have this: „$n\eps\le b$”, and it seems not to be recognized as a > LaTeX fragment. The manual says: > > ================ > 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. > ================ > > When I C-u C-x = on the closing quote, I get > > ================ > ... > syntax: . which means: punctuation > ... > ================ > > so I don't know why it is not recognized as punctuation. Consequently, > it is exported verbatim (with `\$') into LaTeX, and also (obviously) C-c > C-x C-l does not fontify it. When I change ” into " (the ASCII #x22 > quote), everything is ok. >
The $...$ construct is recognized by a regexp which, while complicated, is not complicated enough to recognize everything that's marked "punctuation" in the syntax tables. Look for org-latex-regexps in org.el (and note that the regexp for "$" is about twice as long as the next longest regexp - the one for "begin"). The others (for \(...\), \[...\] and $$..$$) are fairly trivial. > My questions: > > 1. Isn't it a bug? > Yes, probably - but looking at the regexp, I cringe: I don't want to even try deciphering it, let alone change it - life's too short... > 2. If not, what can I do to in my config so that it is recognized > properly? > > PS. I just recalled that using \(...\) should help, and indeed it does. > Still, I'm curious about the answer to my questions (now that I > remembered a workaround, especially #1). > That is indeed the best solution. -- Nick