Prechádzať zdrojové kódy

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.
Lawrence Mitchell 14 rokov pred
rodič
commit
0e8f873c88
1 zmenil súbory, kde vykonal 1 pridanie a 7 odobranie
  1. 1 7
      lisp/org-latex.el

+ 1 - 7
lisp/org-latex.el

@@ -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{}")
 	  )))