I want to add a references section to my report. However I have not been able to. I used \addbibresource, \bibliography, but no result. I have seen a lot of questions about this but nothing solved my problem, so maybe it is a package issue. I have a references file called refs.bib
What I have right now is this -
\documentclass[12pt,oneside]{book}
\usepackage{biblatex}
\begin{document}
text text text
\nocite{*}
\bibliography{refs}
\end{document}
I have tried -
\documentclass[12pt,oneside]{book}
\usepackage{biblatex}
\addbibresource{refs.bib}
\begin{document}
text text text
\nocite{*}
\printbibliography
\end{document}
This does not generate a reference page. I have tried many different things though, and I always get an error. I am working in TexMaker and am using XeLatex to compile.
I am thinking this might be a very specific problem, only applicable to my system. I will delete this if there is nothing that I have missed.
Here is the part of the log for the XeLaTex run which I thought is relevant:-
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1023 \bibliography
{refs.bib}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
[70
]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1024.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 1024.
(./thesis.aux)
Package atveryend Info: Empty hook `AtVeryEndDocument' on input line 1024.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1024.
Package rerunfilecheck Info: File `thesis.out' has not changed.
(rerunfilecheck) Checksum: 3ADE6CBD12915D7B9305AC529A3E8178.
Package logreq Info: Writing requests to 'thesis.run.xml'.
\openout1 = `thesis.run.xml'.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1024.
)
The only in preamble error is weird because I have no packages inside the document
The log for the second piece of code is:-
LaTeX Warning: Empty bibliography on input line 1022.
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1023.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 1023.
(./thesis.aux
*************************************************
* pdfbase warning: "rerun"
*
* Rerun to get internal references right!
*************************************************
)
Package atveryend Info: Empty hook `AtVeryEndDocument' on input line 1023.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1023.
Package rerunfilecheck Info: File `thesis.out' has not changed.
(rerunfilecheck) Checksum: 3ADE6CBD12915D7B9305AC529A3E8178.
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) thesis
(biblatex) and rerun LaTeX afterwards.
Package logreq Info: Writing requests to 'thesis.run.xml'.
\openout1 = `thesis.run.xml'.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1023.
)
The BibTex log:-
This is BibTeX, Version 0.99d (TeX Live 2019/dev/Debian) The top-level auxiliary file: thesis.aux I found no \citation commands---while reading file thesis.aux I found no \bibdata command---while reading file thesis.aux I found no \bibstyle command---while reading file thesis.aux (There were 3 error messages)
\addbibresource{refs.bib}in the preamble, and\printbibliographyafter\begin{document}, at the place you want it. – Bernard May 15 '19 at 14:56pdflatex -> biber -> pdflatex (twice)? – Bernard May 15 '19 at 15:01\bibliography). Please show that of the second code, with\addbibresourceand\printbibliography. – Phelype Oleinik May 15 '19 at 18:16biblatexpackage you need to use Biber instead (there is a compatibility mode, but let's not get into that). For TeXMaker there is this answer which shows how to configure Biber. – Phelype Oleinik May 15 '19 at 18:50