0

If I run bibtex it says that it cannot find the file unsrt.bst

I couldn't open style file unsrt.bst

This is strange because unsrt.bst this is one of the basic files of bibtex. Anyway, the man page of bibtex says that it first looks in the path defined by the variable BSTINPUTS. So if I set

export BSTINPUTS=/usr/local/texlive/2018/texmf-dist/bibtex/bst/base

then bibtex does find the unsrt.bst file. But then bibtex claims that it cannot find my bib file

I couldn't open database file references.bib

which, however, is in the same directory!

So obviously bibtex has some severe problems to find the standard files and to find files in the same directory.

It seems that there is something wrong with my installation. For me it is no satisfying solution to manually set the path, since there are a lot of standard bst folders with texlive, not just .../bst/base.

I installed texlive via the quick install guide.

And I already tried

tlmgr install --reinstall bibtex

but it did not change anything.

Can someone help me out?

5
  • Did you follow, in particular, the instructions for "Post-install: setting PATH" in the quick install guide? You could probably also take a look at tex.stackexchange.com/a/95373/105447.
    – gusbrs
    Commented Jan 25, 2019 at 18:57
  • Yes I did. Otherwise all the commands like "bibtex" would not work.
    – thyme
    Commented Jan 25, 2019 at 19:04
  • What is the result of kpsewhich unsrt.bst on your terminal?
    – gusbrs
    Commented Jan 25, 2019 at 19:05
  • No output. But when I set the variable BSTINPUTS then it says "/usr/local/texlive/2018/texmf-dist/bibtex/bst/base/unsrt.bst"
    – thyme
    Commented Jan 25, 2019 at 19:11
  • So it seems to be a path problem indeed. Though I've never faced the need to specify BSTINPUTS manually myself, so I don't have much clue what might be going wrong. Let's see if someone else has some experience with it. You could though add some more information to your question which might be useful: e.g. your distro, if there are any other parallel installations of a TeX distribution in your system, exactly how you are setting your path, and so on.
    – gusbrs
    Commented Jan 25, 2019 at 19:16

1 Answer 1

1

There are in this case three separate environment variables to consider

◦ TEXINPUTS tells LaTeX where to find sty (style) files.
◦ BSTINPUTS tells BibTeX where to find bst (bibliography style) files.
◦ BIBINPUTS tells BibTeX where to look for bib (bibliography database) files.

By default to reduce issues you can keep all the necessary files in the same directory where you are processing your documents.

Or make symbolic links to them with the UNIX command ln -s.

Alternatively they can be set in a variety of different ways.

For windows users it is simplest to set them in the "System" environment (unless you are on a shared system, in which case you may need to set them per user)

A list for MiKTeX users without advice is here https://docs.miktex.org/manual/envvars.html

One very terse users guide is available here and another description here https://ccrma.stanford.edu/~jos/webpub/Installing_LaTeX_BibTeX_Input.html

In some cases the environmental paths MAY include more than one location (subject to system syntax ; for windows : for others?) such as
command to set EnvVar=FirstDir;SecondDir;Default
Don't forget to add the default last !

However if it does not appear to work (especially due to other overrides) then remove the confusion of multiple locations.

Others have commented however I cant verify "Remember, if you start an editor from a menu, then any setting in bashrc is ignored. You need to add them to .profile, log out and log in again. If you start texworks from the command line it will know the setting from bashrc"

Also note in Windows and some other systems setting (especially using setx / set) environment variables may not always "Stick" simply by re-logging in again. It may require a reboot to take permanent effect.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .