问题描述
如,我发现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
?我的意思是,如何更改 - + - ? - Q2:除了 - + - 对于
-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 -+-? - Q2 : Do I need special key other than -+- for
-shell-escape
option? Or, is it just OK to use it without any problem? - Q3 : What is the
-shell-escape
for?
推荐答案
Q1:您需要编辑LaTeX由AucTeX调用的方式。一种方法是将以下内容添加到.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:进行更改后,所有使用Cc Cc的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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!