I currently use emacs to write and compile LaTeX files using the key combo: C-c C-f
. Now this is all well and good, but now I'm working on a much bigger project that is divided into many chapters. My main file includes these chapters using \include{chp1}
for example, and so I have to go back to the main file to use C-c C-f
to compile everything.
So here's my question: When I am editing chp1.tex, is there any way to turn OFF the automatic recognition of LaTeX mode so that if I mistakenly hit C-c C-f
, it doesn't freak out and spam me with pages and pages of LaTeX error messages? I'd like it to just tell me when I type C-c C-f
in chp1.tex, "you stupid idiot, this is not the main file," rather than try to compile chp1 by itself.
Makefile
for your bigger project?(setq-default TeX-master nil)
as it suggests, AUCTeX will ask you for your master file before compiling.TeX-master
as described in the manual you should be able to compile the whole document usingC-c C-f
from a buffer visiting a chapter file.C-c C-c
(TeX-command-master
)? The default binding forC-c C-f
isTeX-font
.