Flymake pdflatex ubuntu 12.04 emacs 23.3.1配置错误

时间:2013-05-16 20:26:30

标签: ubuntu emacs pdflatex flymake

我试图在我的系统上运行pdflatex的flymake。以下代码包含在我的.emacs文件中:

(require 'flymake)
(defun flymake-get-tex-args (file-name)
(list "pdflatex"
(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
(add-hook 'LaTeX-mode-hook 'flymake-mode)

错误:

Flymake: Configuration error has occurred while running(pdflatex -file-line-error -draftmode -interaction=nonstopmode /home/.../myfile_flymake.tex).Flymake will be switched OFF

我正在寻找解决方案,但却找不到解决方案。希望有人可以帮助我。

提前致谢

2 个答案:

答案 0 :(得分:0)

我猜这是因为换行了。如下调用包装脚本而不是pdflatex解决了我的问题:

---------- [pdflatex_nobreak] ----------

#!/bin/bash
export max_print_line=1000
export error_line=254
export half_error_line=238
pdflatex "$@"

答案 1 :(得分:0)

来自flymake manual

  

以下错误会导致警告消息并切换flymake模式   关闭缓冲区。

     

CFGERR:语法检查进程返回非零退出代码,但没有   报告了错误/警告。这表示可能的配置   错误(例如,语法没有合适的错误消息模式   检查工具)

所以我的猜测是pdflatex被调用,解析你的.tex文件,然后给出非零退出代码而不“报告”任何错误或警告。

要测试此功能,请在shell中运行:

pdflatex -file-line-error -draftmode -interaction=nonstopmode /home/.../myfile.tex

现在,输入:

echo $?

查看退出代码。如果它不为零并且没有任何错误或警告的迹象,那么这将解释您所看到的行为。

我刚刚在这里问了一个专注于这个确切情况的问题:Using emacs for .tex files with Flymake - error with unbalanced braces