In the following simple document, the bibliography does not work :
\documentclass{article}
\usepackage[numbers]{natbib}
\usepackage{inputenc}
\inputencoding{utf8}
\begin{filecontents}{\jobname.bib}
\input{references_utf8}
\end{filecontents}
\inputencoding{latin1}
\begin{document}
\noindent
\cite[voir][chap. 12]{2009solar}
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}
I want to do this because my main documents are in latin-1 and the .bib file is in utf-8. The idea of using \inputencoding
was recommended in this question : How to convert UTF-8 to latin-1 on the fly?.
The file references_utf8.bib looks like this :
@book{2009solar,
address = {New Delhi},
author = {Solanki, Chetan Singh},
booktitle = {Solar Photovoltaics: Fundamentals, Technologies and Applications},
chapter = {12},
edition = {1},
isbn = {9788120337602},
pages = {478},
publisher = {Prentice-Hall of India},
title = {{Solar Photovoltaics: Fundamentals, Technologies and Applications}},
url = {http://books.google.ca/books?id=hdvYA9KsI2YC},
year = {2009}
}
But it has to be encoded in utf-8.
How can I make this setup work?
\jobname.bib
. bibtex will use your originalreferences.bib
to create a\jobname.bbl
. And your document will then input thisbbl
when you use the\bibliography
command. Open the bib and the bbl in your editor to see the differences!