mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Cleaned up the LaTeX section.
This commit is contained in:
parent
39e2eec692
commit
36a399bcb8
9
init.el
9
init.el
@ -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)
|
||||||
|
20
init.org
20
init.org
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user