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
This commit is contained in:
parent
c560abd8e3
commit
9c55868550
|
@ -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))
|
||||
|
|
|
@ -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++")
|
||||
|
|
Loading…
Reference in New Issue