Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latextools does not display cite keys if .tex file is in subfolder

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?

like image 306
David Avatar asked Nov 02 '25 11:11

David


1 Answers

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.

like image 123
Tom Avatar answered Nov 04 '25 11:11

Tom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!