Using minted (source code LaTeX package) with emacs/auctex

后端 未结 3 1949
夕颜
夕颜 2021-02-08 10:02

As is explained in here, I find minted package is pretty cool for source code listing.

My question is how to use minted package with AucTeX/emacs? For command line I ca

3条回答
  •  梦谈多话
    2021-02-08 11:01

    In recent versions of auctex, it looks like it'll be more reliable to set TeX-command-extra-options, which is designed for just this purpose, and doesn't make you override the various forms of TeX-command. As I understand it (might be wrong), this can't be set globally, but must be set for each file. You can do this with a hook. For example, in .emacs you might add this:

    (add-hook 'TeX-mode-hook
      (lambda ()
        (setq TeX-command-extra-options "-shell-escape")
      )
    )
    

    And since you don't fully overwrite the latex command call, other features will still work -- like turning on synctex support with (setq TeX-source-correlate-mode t) [which can happen outside the hook].

提交回复
热议问题