1

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

rantanplan
  • 11
  • 2
  • How come there's a space between the `-` and `interaction` in the error message? That doesn't seem to match the fourth line of your configuration code. – Thomas May 17 '13 at 01:37
  • Does the error only occur if `myfile.tex` initially contains errors? This seems to be the case on my Emacs 23. If the file does not contain any syntax errors the first time flymake tries to pdflatex it, it works fine later, on even if I then put in some errors intentionally. (By the way: I don't have any problems with Emacs 24, so perhaps an upgrade could solve your problem?) – Thomas May 17 '13 at 01:50
  • sorry, there is no space between `-` and `interaction` in the error message. If `myfile.tex` does not contain any syntax errors no error message occur. But immediately after i insert an environment the same error as above appear. Also i just installed Emacs 24.3.1. But nothing changed. – rantanplan May 17 '13 at 12:13

2 Answers2

0

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 "$@"
0

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

Community
  • 1
  • 1
Matt Klein
  • 7,856
  • 6
  • 45
  • 46