summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <davison@stats.ox.ac.uk>2010-10-28 21:55:40 +0100
committerDan Davison <davison@stats.ox.ac.uk>2010-10-28 21:55:40 +0100
commit9c5586855069353cfd95ea707aba024e5d51319d (patch)
tree3dffa4de7663b31d6b5ac4d7b69e98f84a70ea31
parentc560abd8e3ee0d2ff73001b15c44ab6ecbe3240e (diff)
downloadorg-mode-9c5586855069353cfd95ea707aba024e5d51319d.tar.gz
Alter way in which user chooses minted for latex source code export
* lisp/org-exp.el (org-export-format-source-code-or-example): Use minted for latex source code export if `org-export-latex-listings' has the value 'minted * lisp/org-latex.el (org-export-latex-listings): Document special value 'minted * lisp/org-latex.el (org-export-latex-minted): Delete variable
-rw-r--r--lisp/org-exp.el7
-rw-r--r--lisp/org-latex.el37
2 files changed, 22 insertions, 22 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index aec2bee..d0b3a27 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -607,7 +607,6 @@ table.el tables."
(:TeX-macros "TeX" org-export-with-TeX-macros)
(:LaTeX-fragments "LaTeX" org-export-with-LaTeX-fragments)
(:latex-listings nil org-export-latex-listings)
- (:latex-minted nil org-export-latex-minted)
(:skip-before-1st-heading "skip" org-export-skip-text-before-1st-heading)
(:fixed-width ":" org-export-with-fixed-width)
(:timestamps "<" org-export-with-timestamps)
@@ -2235,7 +2234,6 @@ in the list) and remove property and value from the list in LISTVAR."
(defvar org-export-latex-listings) ;; defined in org-latex.el
(defvar org-export-latex-listings-langs) ;; defined in org-latex.el
(defvar org-export-latex-listings-w-names) ;; defined in org-latex.el
-(defvar org-export-latex-minted) ;; defined in org-latex.el
(defvar org-export-latex-minted-langs) ;; defined in org-latex.el
(defvar org-export-latex-minted-with-line-numbers) ;; defined in org-latex.el
@@ -2368,7 +2366,8 @@ INDENT was the original indentation of the block."
(concat "#+BEGIN_LaTeX\n"
(org-add-props
(cond
- (org-export-latex-listings
+ ((and org-export-latex-listings
+ (not (eq org-export-latex-listings 'minted)))
(concat
(if lang
(let*
@@ -2388,7 +2387,7 @@ INDENT was the original indentation of the block."
"_" "\\\\_" caption)))
"\\begin{lstlisting}\n"
rtn "\\end{lstlisting}\n"))
- (org-export-latex-minted
+ ((eq org-export-latex-listings 'minted)
(if lang
(let*
((lang-sym (intern lang))
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 5f1c6a8..dc5e7fc 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -376,7 +376,25 @@ for example using customize, or with something like
(require 'org-latex)
(add-to-list 'org-export-latex-packages-alist '(\"\" \"listings\"))
- (add-to-list 'org-export-latex-packages-alist '(\"\" \"color\"))"
+ (add-to-list 'org-export-latex-packages-alist '(\"\" \"color\"))
+
+Alternatively,
+
+ (setq org-export-latex-listings 'minted)
+
+causes source code to be exported using the minted package as
+opposed to listings. If you want to use minted, you need to add
+the minted package to `org-export-latex-packages-alist', for
+example using customize, or with
+
+ (require 'org-latex)
+ (add-to-list 'org-export-latex-packages-alist '(\"\" \"minted\"))
+
+In addition, it is neccessary to install
+pygments (http://pygments.org), and to configure
+`org-latex-to-pdf-process' so that the -shell-escape option is
+passed to pdflatex.
+"
:group 'org-export-latex
:type 'boolean)
@@ -411,23 +429,6 @@ of noweb."
:group 'org-export-latex
:type 'boolean)
-(defcustom org-export-latex-minted nil
- "Non-nil means export source code using the minted package.
-This package will fontify source code with color.
-If you want to use this, you need to make LaTeX use the
-minted package. Add this to `org-export-latex-packages-alist',
-for example using customize, or with something like
-
- (require 'org-latex)
- (add-to-list 'org-export-latex-packages-alist '(\"\" \"minted\"))
-
-In addition, it is neccessary to install
-pygments (http://pygments.org), and configure
-`org-latex-to-pdf-process' so that the -shell-escape option is
-passed to pdflatex."
- :group 'org-export-latex
- :type 'boolean)
-
(defcustom org-export-latex-minted-langs
'((emacs-lisp "common-lisp")
(cc "c++")