I'm trying to get a bibliography to work while using subfiles for my dissertation. My goal is to have one main bibliography for all chapters. The current structure of my files is:
Main Folder
Thesis.txt
Thesis.bib
Introduction Folder
- Introduction.txt
I have tried several different methods with natbib and biblatex, including most highly rated answer from this question (Handle .bib in subfiles), with no luck. My bibliography is available in the main Thesis.txt file and if I try to \cite something there it's fine. However when I try and cite something in the subfile (Introduction.txt), \cite will auto fill but I always get the error for undefined citations. This is also the case if I try and compile the main Thesis.txt file with the subfile Introduction.txt.
My current simplified code is as such:
Thesis.txt
\documentclass{ucetd}
\usepackage[super,comma]{natbib}
\bibliographystyle{unsrtnat}
\usepackage{subfiles}
\providecommand{\main}{.}
\def\biblio{\bibliographystyle{unsrtnat}\bibliography{\main/Thesis}}
\begin{document}
\def\biblio{}
\renewcommand\bibname{References}
\newpage
\addcontentsline{toc}{chapter}{References}
\begin{singlespace}
\bibliography{Thesis}
\end{singlespace}
\end{document}
Introduction.txt
\providecommand{\main}{..} % *Modification: redefine path location, must go before \documentclass
\documentclass[\main/Thesis.tex]{subfiles}
\begin{document}
some text. \cite{}
\newpage
\biblio
\end{document}
I have also tried including the bibliography in the subfile and this still does not resolve the error. Moreover I tried the biblatex exaple(Handle .bib in subfiles) and that did not work either.
I'm at my wits end please help.