4

The wonderful LatexTools plugin for Sublime Text 2 autocompletes references when using \cite. Everything works perfectly when the .bib filed is in the same folder as the .tex file, and the .tex file includes the \bibliography command.

Unfortunately, for my larger projects, I keep my chapter .tex files in a subfolder. The \bibliography command only appears once in the master .tex file, and the .bib file lives with the master .tex file.

Is there a way to "point" LatexTools to my bibliography for all of the sub .tex files which do not include the \bibliography command, so that I can get autocomplete working?

Machavity
  • 30,841
  • 27
  • 92
  • 100
David
  • 167
  • 1
  • 6

1 Answers1

4

LatexTools searches for a root file that is specified in the subfile you are editing. When it finds such a file, it will look for bibliography related commands there and load the corresponding data. You provide the root file by placing the line

%!TEX root = ../my_main_file.tex

in the (first line of the) subfile.

Tom
  • 2,674
  • 1
  • 25
  • 33
  • This is exactly what I was looking for - thank you so much! For command line newbies, .. takes you up one folder level. – David Jul 09 '15 at 08:09