2
votes

I'm having some problems with flymake-mode when editing latex files in emacs 23.4.1. First, when I start the mode I see Flymake:! in the mode line. The manual tells me this is because "Flymake was unable to find the master file for the current buffer.", but it doesn't suggest a solution. apropos tells me there is a function TeX-master-file-ask so I call it to set the master file and try flymake-mode again, but now it gives an error about .#file.tex not being found, but the file does exist.

How can I get flymake mode to work when editing latex files?

1
Have you had a look at emacswiki.org/emacs/FlymakeTex?N.N.
Unfortunately, yes. I have (defun flymake-get-tex-args (file-name) (list "pdflatex" (list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name))) in ~/.emacs.jrm

1 Answers

0
votes

Try adding this to your .emacs:

(setq flymake-allowed-file-name-masks
    (delete '("[0-9]+\\.tex\\'"
        flymake-master-tex-init
        flymake-master-cleanup)
        flymake-allowed-file-name-masks)) ; don't use multipart tex files

By default (Flymake .3), Flymake tries to be smart about multipart .tex files it assumes that if your .tex file ends in a number then you must be working on a multi-part file.

I personally find this behavior annoying since I like to work on files named assingment1.tex and similar. However, by default, Flymake then assumes that there is an assignment.tex master file, and I get stuck with the Flymake:! behavior you describe.

Adding the above block to your .emacs will disable this behavior.