From bf7ce56a7244672bdcb0ac9013bfd5d776629ac7 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Thu, 28 Apr 2011 16:47:23 +0000 Subject: [PATCH] Make the latex export preprocessor rewrite #+INDEX to \index. * lisp/org-latex.el (org-export-latex-preprocess): Replace index entries. --- lisp/org-latex.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index e7307ef1e..86a96c5b4 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -2322,6 +2322,15 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (and (looking-at "[ \t]*ORG-VERSE-END.*") (org-replace-match-keep-properties "\\end{verse}" t t))) + ;; Convert #+INDEX to LaTeX \\index. + (goto-char (point-min)) + (let ((case-fold-search t)) + (while (re-search-forward + "^[ \t]*#\\+index:[ \t]*\\([^ \t\r\n].*?\\)[ \t]*$" + nil t) + (let ((entry (match-string 1))) + (replace-match (format "\\index{%s}" (match-string 1)) t t)))) + ;; Convert center (goto-char (point-min)) (while (search-forward "ORG-CENTER-START" nil t)