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

后端 未结 3 1963
夕颜
夕颜 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 10:42

    Q1: You need to edit the way LaTeX is called by AucTeX. One way of doing this is to add the following to your .emacs file:

    (eval-after-load "tex" 
      '(setcdr (assoc "LaTeX" TeX-command-list)
              '("%`%l%(mode) -shell-escape%' %t"
              TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX")
        )
      )
    

    Q2: Once you have made the changes, all calls to LaTeX with C-c C-c will use the -shell-escape option.

    Q3: See Konrad's answer. Note that this method will enable -shell-escape for all files edited in AucTeX, so can be a potential security risk if using other peoples packages or files.

提交回复
热议问题