使用minted(源代码LaTeX包)与emacs / auctex [英] Using minted (source code LaTeX package) with emacs/auctex

查看:263
本文介绍了使用minted(源代码LaTeX包)与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:您需要编辑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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆