use-package auctex

This commit is contained in:
larstvei 2023-06-11 21:48:42 +02:00
parent 9521ff0240
commit 89426bfbe5

View File

@ -206,8 +206,7 @@
(let* ((package--builtins nil) (let* ((package--builtins nil)
(packages (packages
'(auctex ; Integrated environment for *TeX* '(chatgpt-shell ; Interaction mode for ChatGPT
chatgpt-shell ; Interaction mode for ChatGPT
cider ; Clojure Interactive Development Environment cider ; Clojure Interactive Development Environment
clj-refactor ; Commands for refactoring Clojure code clj-refactor ; Commands for refactoring Clojure code
company ; Modular text completion framework company ; Modular text completion framework
@ -1287,40 +1286,18 @@
#+end_src #+end_src
** LaTeX and org-mode LaTeX export ** LaTeX
=.tex=-files should be associated with =latex-mode= instead of =tex-mode=.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode)) ;; Integrated environment for *TeX*
(use-package auctex
:ensure t
:defer t)
#+end_src #+end_src
Use [[http://mg.readthedocs.io/latexmk.html][latexmk]] for compilation by default. * Org-mode LaTeX export
#+begin_src emacs-lisp
(add-hook 'LaTeX-mode-hook
(lambda ()
(add-hook 'hack-local-variables-hook
(lambda ()
(setq-local compile-command
(concat "latexmk -pdf -pvc "
(if (eq TeX-master t)
(file-name-base (buffer-name))
TeX-master))))
t t)))
#+end_src
Use ~biblatex~ for bibliography.
#+begin_src emacs-lisp
(setq-default bibtex-dialect 'biblatex)
#+end_src
I like using the [[https://code.google.com/p/minted/][Minted]] package for source blocks in LaTeX. To make org use I like using the [[https://code.google.com/p/minted/][Minted]] package for source blocks in LaTeX. To make org use
this we add the following snippet. this we add the following snippet.
@ -1335,9 +1312,9 @@
Because [[https://code.google.com/p/minted/][Minted]] uses [[http://pygments.org][Pygments]] (an external process), we must add the 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. The =-shell-escape= option to the =org-latex-pdf-process= commands. The
=tex-compile-commands= variable controls the default compile command for =tex-compile-commands= variable controls the default compile command for Tex-
Tex- and LaTeX-mode, we can add the flag with a rather dirty statement (if and LaTeX-mode, we can add the flag with a rather dirty statement (if anyone
anyone finds a nicer way to do this, please let me know). finds a nicer way to do this, please let me know).
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -1356,8 +1333,8 @@
#+end_src #+end_src
For my thesis, I need to use our university's LaTeX class, this snippet For my thesis, I need to use our university's LaTeX class, this snippet makes
makes that class available. that class available.
#+begin_src emacs-lisp #+begin_src emacs-lisp