I'm using AUCTeX in Emacs, and would like to store all output files (.aux, .log, .pdf etc) in a sub-directory "output" rather than directly in the current working directory.

To achieve this, I have updated the AUCTeX settings so that the "LaTeX" command now includes --output-directory=output and the BibTeX and View commands open output/%s etc.

This works, in the sense that all intermediate files are generated in ./output correctly.

However, previously pressing C-c C-c several times would run LaTeX, then LaTeX then View, noticing after the second LaTeX run that nothing more is needed and the PDF file is ready to view (presumably it checks after each LaTeX run to see if various intermediate files change?). This switch from automatically choosing the "LaTeX" option to choosing "View" no longer works using --output-directory as described. I must now press C-c C-c and type "View" manually.

Does anyone know how I can tell AUCTeX that the output files are in "./output" and to compare to them when checking whether it is "time to View" rather than "time to LaTeX"?

  • Maybe via TeX-check-path variable... – Paul Gaborit Jul 10 '12 at 14:17
  • @PolGab I tried adding "./output" and/or "./output/" to TeX-check-path but that didn't make any difference. – MGwynne Jul 10 '12 at 16:08
  • 2
    A workaround would be to use C-c C-v, which calls the view command regardless of what AUCTeX thinks about the 'readiness' of the .pdf or .dvi (etc.) file. – jon Jul 11 '12 at 4:11
  • How did you add the options to Latex, Bibtex etc? I'd like to do that too. – Tyler Jul 24 '12 at 12:54
  • @jon can you please write an answer? – doed Dec 4 '13 at 0:22

There is a relatively easy workaround if a better solution can't be found:

C-c C-v

calls TeX-view, which will open the associated .pdf or .dvi file (assuming there is one). On my computer, TeX-view in fact calls xdg-open, but you can hardwire a particular viewer in you .emacs file if you like.

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.