简体   繁体   中英

Flymake pdflatex ubuntu 12.04 emacs 23.3.1 Configuration Error

i tried to get flymake for pdflatex running on my system. The following code is included in my .emacs file:

(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)

Error:

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

I was searching for a solution but was not able find one. Hopefully someone may help me.

Thanks in advance

I guess it was due to a line break. Calling a wrapper script instead of pdflatex as follows solved the problem for me at least:

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

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

From the flymake manual :

The following errors cause a warning message and switch flymake mode OFF for the buffer.

CFGERR : Syntax check process returned nonzero exit code, but no errors/warnings were reported. This indicates a possible configuration error (for example, no suitable error message patterns for the syntax check tool)

So my guess is that pdflatex is getting called, parsing your .tex file, and then giving a non-zero exit code without "reporting" any errors or warnings.

To test this, run this in your shell:

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

Now, type:

echo $?

to see the exit code. If it's non-zero and there was no indication of an error or warning, then that will explain the behavior you're seeing.

I just asked a question focused on this exact situation here: Using emacs for .tex files with Flymake - error with unbalanced braces

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM