What should I do to run bibtex with relative path?

I put a .tex file and a .bib file in same directory.

I use the following two cases to run bibtex, one is described with relative path and the other is absolute path. I am not sure, but I guess relative path is required for submission. When I submit my paper, I guess, compilation on web is required and if I use the absolute path, it dose not success. I reinstalled tex of ver. 2020, but it did not change anything.

Even if I put .bib file in path C:\texlive\texmf-local\bibtex\bib\local, the code \bibliography{} with ralative path did not work.

1. relative path


2. absolute path


If I use the former (1. relative path), then the following error occurred.

This is BibTeX, Version 0.99d (TeX Live 2020/W32TeX)
The top-level auxiliary file: test.aux
The style file: elsarticle-num-names.bst
I couldn't open database file hoge.bib
---line 26 of file test.aux
 : \bibdata{hoge
 :              }
I'm skipping whatever remains of this command
I found no database files---while reading file test.aux
Warning--I didn't find a database entry for "Villani"
Warning--I didn't find a database entry for "Burago"
Warning--I didn't find a database entry for "Gromov"
Warning--I didn't find a database entry for "Flores"
(There were 2 error messages)

According to Where should I put bibfile.bib to use it directly in \bibliography{bibfile}?, I inserted the line BIBINPUTS = .;$TEXMF/bibtex/bib// in the file texmf.cnf located in C:\texlive\2020\texmf.cnf and then run the code mktexlsr on command prompt to reflect the modification of texmf.cnf.

Contents of my texmf.cnf is the following which is in the pathC:\texlive\2020\texmf.cnf

 % (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
OSFONTDIR = $SystemRoot/fonts//
BIBINPUTS = .;$TEXMF/bibtex/bib//

% Prefer external Perl for third-party TeXLive Perl scripts
% Was set to 1 if at install time a sufficiently recent Perl was detected.

I have struggled for several days, but I cannot get any solution. I am a beginner of TeX.

  • 1
    Are you starting the compilation in the folder? Sep 29, 2020 at 6:51
  • 1
    most likely unrelated but TeX Live 2013 any reason for using such an old release? Sep 29, 2020 at 7:15
  • 1
    Maybe you have redefined the BIBINPUTS environment variable and it does not include .. See also tex.stackexchange.com/questions/120427/…
    – adl
    Sep 29, 2020 at 8:05

1 Answer 1


Here are some suggestions for bibtex (putting it here because too big for comment).

  1. Use biber as your default biblatex compiler
  2. Keep \usepackage{biblatex} in your preamble (you may want to use options for customizations such as sorting)
  3. Add your bibliography information in the preamble with something like \bibliography{filename.bib}
  4. Use \printbibliography
  5. Make sure your TeXlive version is updated (mine is 2020)

Hopefully you will not face the same issue if all the steps are taken. Also, try not to make the filename same as the parent tex filename.

  • 1
    Thank you. I have tried but it caused a new error. But, I will try again in your suggestion next day. Oct 1, 2020 at 3:49

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.