将 minted(源代码 LaTeX 包)与 emacs/auctex 一起使用 [英] Using minted (source code LaTeX package) with emacs/auctex
问题描述
如 这里,我发现 minted 包对于源代码列表非常酷.
As is explained in here, I find minted package is pretty cool for source code listing.
我的问题是如何在 AucTeX/emacs 中使用 minted 包?对于命令行,我可以使用 pdflatex -shell-escape SOURCE
,但是
My question is how to use minted package with AucTeX/emacs?
For command line I can use pdflatex -shell-escape SOURCE
, but
- Q1 : 如何修改 AucTeX 以插入
-shell-escape
?我的意思是,如何更改 C-c+C-c 的动作? - Q2 : 除了 C-c+C-c 之外,我还需要特殊键吗?>-shell-escape 选项?或者,是否可以毫无问题地使用它?
- Q3 :
-shell-escape
是干什么用的?
- Q1 : How can I modify the AucTeX to insert the
-shell-escape
? I mean, how to change the action for C-c+C-c? - Q2 : Do I need special key other than C-c+C-c for
-shell-escape
option? Or, is it just OK to use it without any problem? - Q3 : What is the
-shell-escape
for?
推荐答案
Q1:需要修改AucTeX调用LaTeX的方式.一种方法是将以下内容添加到您的 .emacs 文件中:
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:一旦你做出改变,所有使用 C-c C-c 调用 LaTeX 将使用 -shell-escape
选项.
Q2: Once you have made the changes, all calls to LaTeX with C-c C-c will use the -shell-escape
option.
Q3:见康拉德的回答.请注意,此方法将为在 AucTeX 中编辑的所有文件启用 -shell-escape
,因此如果使用其他人的包或文件可能存在潜在的安全风险.
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.
这篇关于将 minted(源代码 LaTeX 包)与 emacs/auctex 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!