summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-06-18 09:30:00 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2009-06-18 09:30:00 +0200
commite23665ee66ee2082453d28ecdcbf3152a50e1562 (patch)
tree03d377eb71c757b183a5ffd57493254987ebf12e
parent57c12e8bef96b72b62d7d25bf93c1a6407038c32 (diff)
downloadorg-mode-e23665ee66ee2082453d28ecdcbf3152a50e1562.tar.gz
LaTeX export: Make the verbatim environment configurable
-rwxr-xr-xlisp/ChangeLog5
-rw-r--r--lisp/org-exp.el4
-rw-r--r--lisp/org-latex.el12
3 files changed, 20 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be0d17a..288b805 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
2009-06-18 Carsten Dominik <carsten.dominik@gmail.com>
+ * org-latex.el (org-export-latex-verbatim-wrap): New option.
+
+ * org-exp.el (org-export-format-source-code-or-example): Use
+ `org-export-latex-verbatim-wrap'.
+
* org.el (org-clone-subtree-with-time-shift): Also shift inactive
time stamps.
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index c935a23..925ee7d 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -2145,6 +2145,7 @@ in the list) and remove property and value from the list in LISTVAR."
(defvar htmlp) ;; dynamically scoped
(defvar latexp) ;; dynamically scoped
+(defvar org-export-latex-verbatim-wrap) ;; defined in org-latex.el
(defun org-export-format-source-code-or-example
(backend lang code &optional opts indent)
@@ -2249,7 +2250,8 @@ INDENT was the original indentation of the block."
((eq backend 'latex)
(setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt))
(concat "\n#+BEGIN_LaTeX\n"
- (org-add-props (concat "\\begin{verbatim}\n" rtn "\n\\end{verbatim}\n")
+ (org-add-props (concat (car org-export-latex-verbatim-wrap)
+ rtn (cdr org-export-LaTeX-verbatim-wrap))
'(org-protected t))
"#+END_LaTeX\n\n"))
((eq backend 'ascii)
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 483267b..55d0628 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -274,6 +274,18 @@ will pass them (combined with the LaTeX default list parameters) to
:group 'org-export-latex
:type 'plist)
+(defcustom org-export-latex-verbatim-wrap
+ '("\\begin{verbatim}\n" . "\\end{verbatim}\n")
+ "Environment to be wrapped around a fixed-width section in LaTeX export.
+This is a cons with two strings, to be added before and after the
+fixed-with text.
+
+Defaults to \\begin{verbatim} and \\end{verbatim}."
+ :group 'org-export_translation
+ :group 'org-export-latex
+ :type '(cons (string :tag "Open")
+ (string :tag "Close")))
+
(defcustom org-export-latex-remove-from-headlines
'(:todo nil :priority nil :tags nil)
"A plist of keywords to remove from headlines. OBSOLETE.