I am able to forward search from an emacs buffer containing my top level tex file to sumatrapdf by using the f8 key which is bound to Sumatra-jump-to-line. If i visit a buffer with a file included in the first buffer Sumatra incorrectly tries to find a PDF associated with that buffer. Are there any ways to make forward search work from the include file buffer?

1 Answer 1


I just tested this on my Emacs/Sumatra combination. If you add the following to the end of the included file:

%%% Local Variables: 
%%% TeX-master: "path-to/masterfile"
%%% End: 

When you do a forward search from the subfile, such as a chapter included in the master file, it should take you to the proper location in the master PDF. This should also let you compile the master document from the individual .tex files. This is all assuming that you are using AUCTeX as your LaTeX mode in Emacs.

Edit: After you add this to your component .tex file you may need to close the file and reopen it in Emacs for AUCTeX to load the local variables.

  • That works perfectly and I really should have known that Auctex would have a way to point to the master file. Note to self: read Auctex documentation more carefully.
    – mcheema
    Apr 15, 2012 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.