Rasmus <ras...@gmx.us> writes: > Here's an updated patch.
Thank you. Some comments follow. > +(defconst org-latex-math-environments-re > + (concat (regexp-opt > + '("equation" "eqnarray" "math" "displaymath" > + "align" "gather" "multline" "flalign" "alignat" > + "xalignat" "xxalignat" > + "subequations" > + ;; breqn > + "dmath" "dseries" "dgroup" "darray" > + ;; empheq > + "empheq")) "*?") ITYM "\\*?", not "*?". Moreover, I think it is better to check only first line, i.e., (format "\\` *\\begin{%s}" (concat (regexp-opt ...) "\\*?")) > + (save-match-data > + (let ((string (org-element-property :value > datum))) > + (string-match > + (nth 1 (assoc "begin" org-latex-regexps)) > + string) > + (and (org-string-match-p > + org-latex-math-environments-re > + (match-string 2 string)) > + "eq:")))) This is not needed. Choose an appropriate regexp for `org-latex-math-environments-re' and forget about `org-latex-regexps'. Regards,