I am using {natbib} package for the bibliography style and {splitbib} package for separate my bibiography into categories at the end of my documents, for example : all articles in one group, all the books in an other group.
The author of {splitbib} advised to use the [export] argument when usign {natbib} package.
Everything is working, I have my final document as I wanted but the problem is that I get an error message from LaTeX : "Undefined control sequence \begin{thebibliography}"
If I don't use {natbib} package, I don't have any error. If I use {natbib} package without [export] argument it is worth. If I use {natbib} package with [export] argument it works but with an error message.
How can I solve this ?
Thank you
Here is an example :
\documentclass[a4paper,12pt]{book}
\usepackage[comma,longnamesfirst]{natbib}
\bibliographystyle{plainnat}
\usepackage[export]{splitbib}
\begin{category}{Articles}
\SBentries{Article1,Article2}
\end{category}
\begin{category}{Books}
\SBentries{Book1,Book2}
\end{category}
\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@article{Article1,
author={Jhon Doe},
title={Blabla},
journal={Blabla},
year={2019},
volume={145},
number={4},
pages={1-25}
}
@book{Book2,
author={Fabrice Doe},
title={Blabla4},
journal={Blabla4},
year={2016},
volume={142},
pages={4-22}
}
\end{filecontents}
\begin{document}
I want to cite Article1~\cite{Article1} and then Book2~\cite{Book2}.
\bibliography{bibliography}
\end{document}