Make the latex export preprocessor rewrite #+INDEX to \index.

* lisp/org-latex.el (org-export-latex-preprocess): Replace index entries.
This commit is contained in:
Robert P. Goldman 2011-04-28 16:47:23 +00:00 committed by Carsten Dominik
parent 62c12cc50f
commit bf7ce56a72
1 changed files with 9 additions and 0 deletions

View File

@ -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)