Discussion:
[tex-k] bibtex should print the path of the bib files it uses
Manuel López-Ibáñez
2015-04-16 11:49:42 UTC
Permalink
Dear BibTeX maintainers,

I just wasted a few hours for something that could have been caught earlier if
BibTeX printed the full path to the bib files it uses. Small testcase:

$ cat <<EOF >test.tex
\documentclass{article}
\begin{document}
\cite{X}
\bibliographystyle{plain}
\bibliography{000O}
\end{document}
EOF
$ cat <<EOF >/tmp/000O.bib
@misc{X,
title = "Wrong one"
}
EOF
$ export BIBINPUTS=/tmp/:.
$ pdflatex test.tex
$ bibtex test.aux
This is BibTeX, Version 0.99d (TeX Live 2013/Debian)
The top-level auxiliary file: test.aux
The style file: plain.bst
Database file #1: 000O.bib

Now the problem is that if the search patch is set by other means (for example
by the distribution) and if I actually meant to include 0000.bib (note the typo
in the last character). I will have a hard time figuring out that the 000O.bib
included by bibtex is actually /tmp/000O.bib and not ./000O.bib. The latter
would have resulted in an error and then I would have noticed the typo.

The above is distilled from a real user-case in Ubuntu GNU/Linux where the file
/usr/share/texlive/texmf-dist/bibtex/bib/computational-complexity/journals.bib
is included by default and if I had intended to use ./journals.bib but my file
was misnamed ./journal.bib, then bibtex does not gives me any hint that
something is wrong.

What I would expect above is:

This is BibTeX, Version 0.99d (TeX Live 2013/Debian)
The top-level auxiliary file: test.aux
The style file: plain.bst
Database file #1: /tmp/000O.bib

that is, for bibtex to print the path to the file it uses. I would go as far as
to suggest the same for "The style file:".

BibTeX 0.99d (TeX Live 2013/Debian)
kpathsea version 6.1.1

Thanks,

Manuel.
Karl Berry
2015-04-17 23:30:34 UTC
Permalink
Hi Manuel - thanks for the report. I'm not sure that we should change
the default bibtex output after all these years, but maybe. I'll ask
Oren what he thinks. We could at least provide a -verbose option.

Of course running kpsewhich foo.bib should yield the information, or
running KPATHSEA_DEBUG=-1 bibtex ..., but I recognize that there's no
reason to think of doing such things in the situation you describe.

Meanwhile, it seems wrong to me for a package (computational-complexity)
to take over such a generic name as "journals.bib", for precisely the
reasons you write about.

Best,
Karl
Manuel López-Ibáñez
2015-04-20 09:42:54 UTC
Permalink
Post by Karl Berry
Hi Manuel - thanks for the report. I'm not sure that we should change
the default bibtex output after all these years, but maybe. I'll ask
Oren what he thinks. We could at least provide a -verbose option.
Of course running kpsewhich foo.bib should yield the information, or
running KPATHSEA_DEBUG=-1 bibtex ..., but I recognize that there's no
reason to think of doing such things in the situation you describe.
Thanks Karl for considering this. Do any tools rely on the list of files
printed by bibtex? If so, I do not understand how they can do anything with
this info without the path. They will need to call kpsewhich, which is
idempotent anyway, thus they should keep working.

Best,

Manuel.
Karl Berry
2015-04-20 17:23:23 UTC
Permalink
Do any tools rely on the list of files printed by bibtex?

I don't know it for a fact, but I suspect so.

If so, I do not understand how they can do anything with this info
without the path.

They might implement their own lookup algorithms. There are plenty of
non-kpathsea implementations in use. I agree that having the full path
is unlikely to cause problems, though. We'll see what Oren says.

karl

Loading...