emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Make the latex export preprocessor rewrite #+INDEX to \index


From: rpgoldman
Subject: [O] [PATCH] Make the latex export preprocessor rewrite #+INDEX to \index.
Date: Thu, 28 Apr 2011 06:47:23 -0500

From: Robert P. Goldman <address@hidden>

---
 lisp/org-latex.el |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index e7307ef..731d6e6 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1775,6 +1775,8 @@ The conversion is made depending of STRING-BEFORE and 
STRING-AFTER."
        (end-of-line 1)
        (insert "\n")))))
 
+
+
 (defun org-export-latex-fixed-width (opt)
   "When OPT is non-nil convert fixed-width sections to LaTeX."
   (goto-char (point-min))
@@ -2322,6 +2324,17 @@ 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))
+  (while
+      (and
+       (let ((case-fold-search t))
+        (re-search-forward "^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$" nil t))
+       (> (match-end 1) (match-beginning 1)))
+    (let ((entry (match-string 1)))
+;;      (message "Found a #+INDEX match...")
+      (replace-match (format "\\index{%s}" entry) t t)))
+
   ;; Convert center
   (goto-char (point-min))
   (while (search-forward "ORG-CENTER-START" nil t)
-- 
1.7.3.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]