I'm doing a document in which I want to add a bibliography. As I'm under CentOS 7, and there is almost no package installed by default with texlive, I installed bibtex
from the CTAN web site.
In my tex file, I load it like this:
\usepackage[backend=bibtex]{biblatex}
\addbibresource{myBib.bib}
And I got this error:
I couldn't open style file biblatex.bst
---line 6 of file myDoc.aux
: \bibstyle{biblatex
: }
I'm skipping whatever remains of this command
I found no style file---while reading file myDoc.aux
As I did not find the bibtex.bst
file on CTAN, I downloaded the plain.bst
file on the CTAN site. And, as it did not work on the first try, I put it in multiple places.
~/texmf/tex/plain.bst
~/texmf/tex/bibtex/plain.bst
~/texmf/tex/bibtex/bstplain.bst
~/texmf/tex/latex/biblatex/bst/plain.bst
/usr/share/texlive/texmf/tex/bibtex/bst/plain.bst
I then run texhash ~/texmf/
and sudo texhash /usr/share/texlive/texmf/
. Here are the corresponding ls-R
files:
~/texmf/ls-R
./tex:
bibtex
generic
latex
plain.bst
./tex/bibtex:
bst
plain.bst
./tex/bibtex/bst:
plain.bst
.
.
.
./tex/latex/biblatex:
biber
bibtex
bst
CHANGES.md
doc
latex
README
./tex/latex/biblatex/bibtex:
bib
bst
./tex/latex/biblatex/bibtex/bst:
biblatex.bst
./tex/latex/biblatex/bst:
plain.bst
.
.
.
./tex/latex/biblatex/latex/bst:
plain.bst
.
.
.
/usr/share/texlive/texmf/ls-R
./tex:
bibtex
generic
latex
./tex/bibtex:
bst
./tex/bibtex/bst:
plain.bst
In my tex file, I then told to bibtex
which style I want to use:
\usepackage[backend=bibtex,style=plain]{biblatex}
\addbibresource{myBib.bib}
And know I've got this error:
! Package biblatex Error: Style 'plain' not found.
I don't understand why it's not working, and I can't find anything else on the Internet. Does someone have an idea?
Best Answer
Before we start, it is a good idea to try and understand the difference between
biblatex
and BibTeX. bibtex vs. biber and biblatex vs. natbib has some explanations that should make the difference between the two clearer, so just quickly: BibTeX is a program that extracts bibliography data from a.bib
file and processes the data with the help of.bst
files ('BibTeX styles') into LaTeX-readable data. More generally, sometimes people (I certainly) say 'BibTeX' when they mean the whole bibliography setup that comes with using BibTeX with.bst
files.biblatex
is a LaTeX package for citations and bibliographies that works differently from the 'BibTeX approach'.biblatex
can be used with BibTeX and the newer Biber as 'backends' that extract the relevant entry data from the.bib
file.When you want to use
in your document, you are using
biblatex
.When you are loading
biblatex
with the optionbackend=bibtex,
, then you are usingbiblatex
with the BibTeX backend.That means you need both
biblatex
and BibTeX to be properly installed on your system.The first message
you get suggests BibTeX is up an running (the message comes from BibTeX), but
biblatex
does not appear to be fully installed. In particular the filebiblatex.bst
(available from https://ctan.org/tex-archive/macros/latex/contrib/biblatex/bibtex/bst on CTAN) does not appear to be installed correctly.According to your directory listings you have
but the file should live in
The correct path here is crucial since the file will not be found correctly by
kpsewhich
if it resides elsewhere. (The path specifications are known as TDS: http://tug.ctan.org/tds/tds.html. Technically, only the./bibtex/bst/
bit of the path is crucial, the rest after that is arbitrary, but it is a good idea to keep your directories organised with subdirectories.)This is one of the perils of installing packages manually from CTAN: For complex packages you might get the directory structure wrong. That's why some packages come with a
.tds.zip
, where the TDS structure is already correctly represented in the.zip
and you only need to unpack everything into yourTEXMFHOME
.Another issue with manual installations from CTAN is package compatibility. The version you get from CTAN is the newest version of the package. The new
biblatex
version may rely on other packages being similarly up-to-date. So if you install one package manually, you may end up having to update or install several other packages manually as well to make sure that versions match.Since you installed your TeX Live from the software repositories of your Linux distro, it may be possible to properly install
biblatex
via your Linux distro as well. Unfortunately, I'm not really familiar with CentOS and don't know which version of TeX Live CentOS 7 ships. But firing upyum
's search function to look forbiblatex
can't hurt.If the TeX Live shipped by your Linux distribution in its repositories is hopelessly outdated or packages you need are not available, you may want to consider installing a 'vanilla' TeX Live from TUG.org. (Instructions for Ubuntu are at How to install "vanilla" TeXLive on Debian or Ubuntu?. Generic instructions at https://tug.org/texlive/acquire-netinstall.html.)
Assuming your
biblatex
installation is complete and compatible with all packages on your installation,is still not quite right. You are telling
biblatex
to use a style calledplain
, butbiblatex
doesn't know a style of that name.biblatex
has its own system of defining bibliography and citation styles that doesn't use BibTeX's.bst
files. Ifplain
was meant to refer to the BIbTeX styleplain.bst
it simply cannot be used withbiblatex
. (As we have seen,biblatex
needsbiblatex.bst
when it is used with BibTeX. That file is always used no matter whatbiblatex
style you request.)You need to pick one of
biblatex
's own styles. The available standard styles are listed in thebiblatex
documentation and further custom styles are available on CTAN: https://www.ctan.org/topic/biblatex. For exampleIf you don't want to use
biblatex
at all and just want to use standard BibTeX instead, your document would look like the followingNote that nowadays it is recommended to use Biber as backend for
biblatex
instead of BibTeX. Only Biber allows you to make use of all ofbiblatex
's advanced features. But Biber needs to be available on your system and must be installed in a version that is compatible with yourbiblatex
version.