I have a lot of different folders with different projects and different .tex documents. For all of them I am using the same bib-file (mainbib.bib). Since it gets a bit tedious to always keep the bib-file in the same folder as the .tex, I thought I could try the do the following:
I copied my mainbib.bib file into the the root's directory of MikTeX's bibtex folder, that would be something like
C:\Program Files (x86)\MiKTeX 2.9\bibtex\bib\bibtex
since - at least I thought so - MikTeX would look into this folder while searching for the file (before it eventually would find it in the same folder as my .tex). But it doesn't find the mainbib.bib file. Is there anything I did wrong or does this approach not work at all?
I am using Windows 10 and MikTeX 2.9 (TeXworks) and for typesetting latexmk.
\documentclass[a4paper]{article}
\usepackage{geometry}
\geometry{a4paper,left=30mm,right=25mm, top=2cm, bottom=2cm}
\parindent0mm
\usepackage{tabularx}
\usepackage{imakeidx}
\usepackage{cite}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bbm}
\usepackage{amsthm}
\usepackage{color}
\usepackage[onehalfspacing]{setspace}
\usepackage{graphicx}
\usepackage{framed, color}
\makeatother
\makeindex
\begin{document}
\section{Test}
\cite{test}
\bibliography{mainbib}
\bibliographystyle{plainnat}
\end{document}
bibfiles
subdirectory of your working directory, or in yourlocal
texmf root. You should never put whatever in the main root: it might be deleted on updates.