1

This could be a duplicate of No Bib File Found Sublime Text 3 LatexTools but I'm wondering if a solution was found for this?

I'm writing my thesis in Sublime Text 3 on Win10. The LatexTools package is installed, the distro is TexLive and the builder invokes latexmk. I structured my work so that I have the main Thesis.tex root file which uses subfiles and lets Ch1.tex etc. piggyback preamble + bibliography from the main file. The root document is located at the base level in the working directory, while the bibliography (Bib), figures (Fig) and chapters (Tex) are in their own subfolders.

Trouble is the subfiles cannot seem to fetch .bib files linked in the root document despite using the \subfix command. Upon writing \parencite and opening the first {} bracket I get a Sublime Text error "No bib files found".

MWE

%Thesis.tex
\addbibresource{Bib/Mendeley/Alkaline Rx & Carbonatites.bib}
\addbibresource{Bib/Mendeley/eBooks & Theses.bib}
\addbibresource{Bib/Mendeley/Fluid Processes.bib}
\addbibresource{Bib/Mendeley/Geosoftware stuff.bib}
\addbibresource{Bib/Mendeley/Miscallaneous.bib}

\usepackage{subfiles}

\begin{document}
\subfile{Tex/Ch1}
...
\end{document}

%Ch.1.tex
\documentclass[../Thesis.tex]{subfiles}
\graphicspath{{\subfix{../Fig/Final/}}}

\addbibresource{{\subfix{../Bib/Mendeley/Alkaline Rx & Carbonatites.bib}}}
\addbibresource{{\subfix{../Bib/Mendeley/eBooks & Theses.bib}}}
\addbibresource{{\subfix{../Bib/Mendeley/Fluid Processes.bib}}}
\addbibresource{{\subfix{../Bib/Mendeley/Geosoftware stuff.bib}}}
\addbibresource{{\subfix{../Bib/Mendeley/Miscallaneous.bib}}}

\begin{document}
...
\end{document}

I was hoping to use subfiles to let me compile the chapters on their own and the \subfix command seems to work fine fetching the graphics, but not the .bib files? I thought this was a biber issue so changed my distro from MiKTeX to TexLive, but still getting the error described above.

I should add the root document Thesis.tex compiles just fine and has all of the bibliography working as intended. Issue persists only with the subfiles. Compiling the subfile also works, but I get warnings of undefined citations.

Any ideas? Thanks

1
  • OK I messed around a little bit and using Sublime Text's Basic builder helps a bit. It worked on my code without me introducing any additional changes and fixes the compilation process. Traditional builder seems to not work, probably as it doesn't run biber on the subfile by default. The builder compiles the subfile, but does not fix the Sublime Text prompt, and I am yet to find a solution.
    – Wolfe79
    Apr 23, 2021 at 11:56

1 Answer 1

2

First, your setup is too complicated. Second, you have to make sure that your TeX-IDE runs biber in the main directory on Thesis and in the Tex directory on Ch1.

Here is an example that works.

% Thesis.tex
\documentclass{article}
\usepackage{graphicx}
\usepackage{biblatex}
\usepackage{subfiles}
\addbibresource{\subfix{Bib/Mendeley/a.bib}}% <<< Use subfix here
\addbibresource{\subfix{Bib/Mendeley/b.bib}}% <<< Use subfix here
\graphicspath{{Fig/Final}}% <<< Set the graphicspath in the main file for the main as well as the subfiles
\begin{document}
\cite{aaa,bbb}
\includegraphics{img.jpg} % loads Fig/Final/img.jpg
\subfile{Tex/Ch1}
\end{document}

% Tex/Ch1
\documentclass[../Thesis]{subfiles}
\begin{document}% <<< NO NEED TO SET graphics path AND bib resources
\section{In the subfile}
\cite{aaa,bbb}
\includegraphics{img} % loads ../Fig/Final/img.jpg
\end{document}

To compile Thesis.tex, go to the main directory and run

pdflatex Thesis
biber Thesis
pdflatex Thesis
pdflatex Thesis

To compile Ch1.tex, change to the directory Tex and run

pdflatex Ch1
biber Ch1
pdflatex Ch1
pdflatex Ch1

If you use an IDE, make sure that it does it for you. If you don't know how to configure the tool, ask a specific question on that, with the details of your TeX environment.

5
  • Can you clarify what is complicated about the setup?
    – Wolfe79
    Apr 26, 2021 at 13:50
  • I am conscious of the compilation order. I was hoping for some help to troubleshoot the ST3 "no bib file prompt" upon inserting a command in the subfile. The document compiles correctly when Basic builder is used.
    – Wolfe79
    Apr 26, 2021 at 13:56
  • @Wolfe79 "Can you clarify what is ..." I'm referring to the way how you define the bib resources. In your example, the \subfix in the subfile doesn't do anything, as the preamble of the subfile is only executed when running LaTeX directly on the subfile. But in this case, \subfix is void. On the other hand, the addbibresources in the main file are always executed, but they point nowhere when typesetting the subfile, because \subfix is missing. The same holds for graphicspath.
    – gernot
    Apr 26, 2021 at 17:02
  • As I understand \subfix ought to be included in the subfiles rather than the root document as it's designed to point the subfile in the child directory to the bib and jpg files in their own directories? I re-built each document (pdflatex, biber, pdflatex, pdflatex) having replaced the relative file paths in the addbibresource and graphicspath commands with absolute ones. Still the "no bib files found" prompt persists unless I place the %! TEX root = Thesis.tex at the top of each file. But that forces the builder to compile the main file instead of the subfile...
    – Wolfe79
    Apr 26, 2021 at 17:57
  • @Wolfe79 No, \subfix has to be used with any relative path, no matter whether main or subfile, except in \graphicspath and \bibliography, where the subfiles package adds \subfix automatically. Moreover, the idea is to have path and file specifications only in one place, typically the main preamble, and to specify each path relative to the file where it appears in.
    – gernot
    Apr 27, 2021 at 7:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .