My citations work fine when the sources.bib
file is within the same directory as my .tex
file, as shown here:
\documentclass{article}
\usepackage{fancyhdr}
\begin{document}
\thispagestyle{fancy}
\everymath{\displaystyle}
\nocite{textbook}
\bibliographystyle{plain}
\bibliography{sources}
\end{document}
Here is the sources.bib
file:
@book{textbook,
author = {First, Last},
title = {title},
}
My bibliography shows up just fine. However, if I simply move sources.bib
outside into the parent directory, and adjust the code:
\documentclass{article}
\usepackage{fancyhdr}
\begin{document}
\thispagestyle{fancy}
\everymath{\displaystyle}
\nocite{textbook}
\bibliographystyle{plain}
\bibliography{../sources}
\end{document}
I receive the errors:
Citation `textbook' undefined
Empty `thebibliography' environment
There were undefined references.
What's wrong here?
.bib
file either in the current directory or in a place that TeX/BibTeX will search by default (or 'force' the issue, which I don't recommend). If you have TeX Live installed, you may (not sure about Windows) be able simply to typekpsewhich --var-value TEXMFHOME
to find the base of your local tree. For me that gives:~/texmf
, so I can construct the BibTeX branch of that tree:mkdir ~/texmf/bibtex/bib
and put my bibliography file there (or create a link to it from that directory). For MikTeX, I believe the arrangement is more complicated.