I would like to make a database bibliography file library.bib, then load it when I write a paper.

Though I already had a look this link, it seems not for my case.

Using the below command, I though I found the candidate paths for .bib:

kpsewhich -show-path=bib

then it returned the below paths:


Note that I use absolute paths which do contain not %AppData% but C:\Users\<User name>\AppData\Roaming.

So I set BibTeX Syncing path in Mendeley as one of the above path: %AppData%/MiKTeX/2.9/bibtex/bib//(even this folder didn't exist, I made it manually), now I have a library.bib file in this folder:


I though that it should work if I import this on my .tex such that


but it returns an error

This is BibTeX, Version 0.99d (MiKTeX 2.9.6210 64-bit)
The top-level auxiliary file: myfilename.aux
The style file: style.bst
I couldn't open database file db.bib
---line 32 of file myfilename.aux
 : \bibdata{library
 :                 }
I'm skipping whatever remains of this command
I found no database files---while reading file myfilename.aux
Warning--I didn't find a database entry for "firstcitation"
(There were 2 error messages)

When I, however, assign the absolute path, then it works fine.


Although there is a way to load my library.bib using absolute path, then there is no need to use TDS. Besides, I would like to use relative path not absolute path.

Can I use a relative path when I have library.bib in different directory from myfilename.tex?

  • Does kpsewhich find the file, i.e. what is the output of kpsewhich library.bib? Sep 1, 2017 at 18:07
  • @RalfStubner if I hit kpsewhich library.bib, no response returns. if typing kpsewhich -show-path=***.bib it always returns same results what I wrote above.
    – actlee
    Sep 1, 2017 at 19:05
  • Have a look at tex.stackexchange.com/questions/20796/…. I found the suggestion to use a subdirectory particularly interesting. I have no MikTeX and cannot compare. The equivalent of your approach works with TeXLive on Linux. Sep 1, 2017 at 19:31
  • @RalfStubner It works fine so far!! But one important thing is that it needs to restart the LaTeX editor when .bib has been changed. :) It does not matter at all so this is exactly what I wanted to do!! Why don't you write as the answer, then I definitely pick it up! Thank you!
    – actlee
    Sep 2, 2017 at 11:04

1 Answer 1


Have a look at the suggestions in How to have access to (or manage) bib files in MiKTeX?. For MikTeX it seems to be necessary to use a subdirectory, e.g. %AppData%/MiKTeX/2.9/bibtex/bib/mybib/library.bib.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.