Cleaned up the LaTeX section.

This commit is contained in:
larstvei 2013-12-23 03:26:22 +01:00
parent 39e2eec692
commit 36a399bcb8
4 changed files with 10 additions and 23 deletions

View File

@ -292,16 +292,9 @@ tangled, and the tangled file is compiled."
(add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode)) (add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode))
(setcar (cdr (cddaar tex-compile-commands)) " -shell-escape ")
;; Add minted to the defaults packages to include when exporting.
(add-to-list 'org-latex-packages-alist '("" "minted")) (add-to-list 'org-latex-packages-alist '("" "minted"))
;; Tell the latex export to use the minted package for source
;; code coloration.
(setq org-latex-listings 'minted) (setq org-latex-listings 'minted)
;; Let the exporter use the -shell-escape option to let latex
;; execute external programs.
;; This obviously and can be dangerous to activate!
(setq org-latex-pdf-process (setq org-latex-pdf-process
(mapcar (mapcar
(lambda (str) (lambda (str)

BIN
init.elc

Binary file not shown.

View File

@ -617,31 +617,25 @@
** LaTeX ** LaTeX
I want =.tex=-files to be associated with =latex-mode= instead of =.tex=-files should be associated with =latex-mode= instead of
=tex-mode=. =tex-mode=.
#+BEGIN_SRC emacs-lisp :tangle yes #+BEGIN_SRC emacs-lisp :tangle yes
(add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode)) (add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode))
#+END_SRC #+END_SRC
When compiling LaTeX using =C-c C-c= a latex compile command is run. When I like using the [[https://code.google.com/p/minted/][Minted]] package for source blocks in LaTeX. To make org
using the =Minted=-package for LaTeX, one must compile with the flag use this we add the following snippet.
=shell-escape=. Here is a not-quite-so-elegant fix.
#+BEGIN_SRC emacs-lisp :tangle yes #+BEGIN_SRC emacs-lisp :tangle yes
(setcar (cdr (cddaar tex-compile-commands)) " -shell-escape ") (add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
#+END_SRC #+END_SRC
Because [[https://code.google.com/p/minted/][Minted]] uses [[http://pygments.org][Pygments]] (an external process), we must add the
=-shell-escape= option to the =org-latex-pdf-process= commands.
#+BEGIN_SRC emacs-lisp :tangle yes #+BEGIN_SRC emacs-lisp :tangle yes
;; Add minted to the defaults packages to include when exporting.
(add-to-list 'org-latex-packages-alist '("" "minted"))
;; Tell the latex export to use the minted package for source
;; code coloration.
(setq org-latex-listings 'minted)
;; Let the exporter use the -shell-escape option to let latex
;; execute external programs.
;; This obviously and can be dangerous to activate!
(setq org-latex-pdf-process (setq org-latex-pdf-process
(mapcar (mapcar
(lambda (str) (lambda (str)

BIN
init.pdf

Binary file not shown.