I want to cite references within a subfile and have the subfile correctly compile, but I seem not to be able to access my .bib from the subfiles, since it always gives me an error message when I try to do so.
An MWE is as follows:
\documentclass[12pt,a4paper,twoside,final]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{subfiles}
\usepackage[
backend=biber,
style=authoryear-icomp,
sorting=nyt
]{biblatex}
\addbibresource{/bib/ref.bib}
%End of Preamble
\begin{document}
\subfile{chap/chapter1/ch1.tex}
\printbibliography
\end{document}
And in my ch1.tex file I have the following set:
\documentclass[../../thesis.tex]{subfiles}
\begin{document}
\chapter*{1}
Testing a citation \cite{Aigner2014}.
\end{document}
Where the cited entry is to be found in the ref.bib inside the bib-subdirectory of my main-directory. However, when I try to compile the document, biber gives the following error:
INFO - This is Biber 1.9 INFO - Logfile is 'ch1.blg' INFO - Reading 'ch1.bcf' INFO - Found 1 citekeys in bib section 0 INFO - Processing section 0 INFO - Looking for bibtex format file '/bib/ref.bib' for section 0 ERROR - Cannot find '/bib/ref.bib'! INFO - ERRORS: 1 Process exited with error(s)
Is there any possible way to make the ch1.tex file able to find my ref.bib file?
I have tried the workaround provided in the answer here, but it doesn't seem to help me anyway. I can't make much sense of the code there however.
Any help is much appreciated!
/from/bib/ref.bib./bib/ref.biblooks like an absolute file path, where thebibdirectory sits in the root of your computer. – Guido May 12 '16 at 23:53/bib/ref.bibandbib/ref.bib(the former is, on many systems, an absolute path, the latter is relative). In general, however, if you want a 'clean' working directory, why not simply put the.bibfile where TeX will naturally search for it (as Kurt suggests)? (For me, that would be~/texmf/bibtex/bib/.) – jon May 13 '16 at 03:03