Reputation: 23
I have a latex document and wanted to add references using bibtex. I created a file and saved it with the extension .bib. In the latex file I use \usepackage{biblatex} and then \bibliographystyle{style} \bibliography{PHcite} When I compile I get this error:
./Physics IA.tex:153: Package biblatex Error: '\bibliographystyle' invalid. See the biblatex package documentation for explanation. Type H for immediate help. ...
l.153 \bibliographystyle{style}
?
./Physics IA.tex:154: LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...
l.154 \bibliography {PHcite}
Upvotes: 1
Views: 16663
Reputation: 15055
You just have to look at one of the biblatex
examples in order to see what the problem is:
Don't use
\documentclass[<options>]{<class>}
% ...
\begin{document}
% ...
\bibliographystyle{<style>}
\bibliography{<bib>}
% ...
\end{document}
Instead use
\documentclass[<options>]{<class>}
% ...
\usepackage[
style = <style>,
<other options>
]{biblatex}
% ...
\addbibresource[<options>]{<bib>.bib}
% ...
\begin{document}
% ...
\printbibliography[<options>]
% ...
\end{document}
Reference:
Upvotes: 2