The the problem of partial name matches with LaTeX entities.

This commit is contained in:
Carsten Dominik 2008-10-18 10:44:41 +02:00
parent 25b227e5ca
commit 79e0ca32d2
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2008-10-18 Carsten Dominik <dominik@science.uva.nl>
* org-export-latex.el (org-latex-entities-regexp): New constant.
2008-10-17 Carsten Dominik <dominik@science.uva.nl>
* org-export-latex.el (org-export-latex-treat-sub-super-char):

View File

@ -1206,7 +1206,7 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
;; Protect LaTeX entities
(goto-char (point-min))
(while (re-search-forward (regexp-opt org-latex-entities) nil t)
(while (re-search-forward org-latex-entities-regexp nil t)
(add-text-properties (match-beginning 0) (match-end 0)
'(org-protected t)))
@ -1451,6 +1451,15 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
"\\vspace")
"A list of LaTeX commands to be protected when performing conversion.")
(defconst org-latex-entities-regexp
(let (names rest)
(dolist (x org-latex-entities)
(if (string-match "[a-z][A-Z]$" x)
(push x names)
(push x rest)))
(concat "\\(" (regexp-opt (nreverse names)) "\\>\\)"
"\\|\\(" (regexp-opt (nreverse rest)) "\\)")))
(provide 'org-export-latex)
;; arch-tag: 23c2b87d-da04-4c2d-ad2d-1eb6487bc3ad