Prefer matching line beginnings in org-export-latex-special-chars

* lisp/org-latex.el (org-export-latex-special-chars): Fix regexp for
`single' special characters and ellipsis.

Repeated special characters are exported differently depending on
their position in the buffer.  A "&&" string at the start of a line is
exported as "&\&" whereas in the middle of a line you get "\&\&".  The
former is incorrect.  Fix this by matching the beginning of a line
before a character.  While we're at it, amalgamate the regexps for the

different special characters.
This commit is contained in:
Lawrence Mitchell 2011-03-28 20:17:32 +00:00 committed by Carsten Dominik
parent f4ba6dc6ee
commit 0e8f873c88
1 changed files with 1 additions and 7 deletions

View File

@ -1686,13 +1686,7 @@ See the `org-export-latex.el' code for a complete conversion table."
"\\(\\(\\\\?\\$\\)\\)"
"\\([a-zA-Z0-9()]+\\|[ \t\n]\\|\\b\\|\\\\\\)\\(_\\|\\^\\)\\({[^{}]+}\\|[a-zA-Z0-9]+\\|[ \t\n]\\|[:punct:]\\|)\\|{[a-zA-Z0-9]+}\\|([a-zA-Z0-9]+)\\)"
"\\(.\\|^\\)\\(\\\\\\)\\([ \t\n]\\|\\([&#%{}\"]\\|[a-zA-Z][a-zA-Z0-9]*\\)\\)"
"\\(.\\|^\\)\\(&\\)"
"\\(.\\|^\\)\\(#\\)"
"\\(.\\|^\\)\\(%\\)"
"\\(.\\|^\\)\\({\\)"
"\\(.\\|^\\)\\(}\\)"
"\\(.\\|^\\)\\(~\\)"
"\\(.\\|^\\)\\(\\.\\.\\.\\)"
"\\(^\\|.\\)\\([&#%{}~]\\|\\.\\.\\.\\)"
;; (?\< . "\\textless{}")
;; (?\> . "\\textgreater{}")
)))