\input で .bib ファイルを含めると機能しない

\input で .bib ファイルを含めると機能しない

次の単純な文書では、参考文献は機能しません。

\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}

メインのドキュメントは latin-1 で、.bib ファイルは utf-8 なので、これを実行したいと思います。\inputencodingこの質問では、次の使用方法が推奨されていました:UTF-8 を latin-1 に即座に変換するにはどうすればよいでしょうか?

ファイルreferences_utf8.bibは次のようになります:

@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}
}

ただし、utf-8 でエンコードする必要があります。

この設定を機能させるにはどうすればよいですか?

答え1

bibtexutf8文字を処理できません。bibtex8 いくつかのウムラウトなどの utf8 文字は可能です。ただし、入力エンコーディングを変更することができます。

\documentclass{article}
\usepackage[numbers]{natbib}
\usepackage[latin1]{inputenc}

\begin{document}
\noindent
\cite[voir][chap. 12]{2009solar}

\begingroup
\iputencoding{utf8}
\bibliographystyle{plainnat}
\bibliography{\jobname}
\endgroup
\end{document}

関連情報