I am currently doing my PhD manuscript and struggle with the bibliography.
My main.tex looks like that :
\documentclass[12pt,a4paper,twoside]{book}
\usepackage[utf8]{inputenc}
\input{packages_manuscript.tex}
\title{manuscrit}
\author{Moi}
\date{Février 2023}
\addbibresource{biblio/biblio.bib}
\begin{document}
\selectlanguage{french}
\dominitoc
\tableofcontents
\glsaddall
\input{chaps/Chap1}
\printbibliography
\end{document}
and my biblio.bib looks like that
@article{Rellstab2021a,
title = {Genomics helps to predict maladaptation to climate change.},
author={Rellstab, C.},
journal={Nature Climate Change},
volume={11(2)},
pages={85-86},
year={2021},
}
Chap1.tex
\pagestyle{fancy}
\chapter{Introduction}
\label{chap:intro}
\begin{refsection}
\abstract{blabla \parencite{Rellstab2021a}.}
\end{refsection}
The references are displayed correctly in chapitre 1 "blabla (Rellstab, 2021)". However, I don't have the corresponding bibliography at the end of my document with error "Empty bibliography at line ..". However, when I use \printbibliography in Chap1.tex, the bibliography is displayed correctly at the end of the chapter. The problem is that I want one general bibliography for all my .tex files. It seems like as there are no citations in the "main.tex", it gives an empty document when \printbibliography is in the main. I am using bibtex my packages_manuscript.tex looks like that:
\usepackage[backend=biber, style = authortitle, citestyle=authoryear, maxcitenames=2, maxbibnames=9, natbib=true]{biblatex}
I am using overleaf to compile the document.
packages_manuscript.texeither. And it should be possible to use a single file (plus bib data). The contents ofChap1.texcan just as well be inserted instead of\input{chaps/Chap1}refsectionand the fact that you have no citations outsiderefsection.