在以下简单文档中,参考书目不起作用:
\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}
\inputencoding
我想这样做是因为我的主要文档是 latin-1,而 .bib 文件是 utf-8。这个问题推荐了使用的想法:如何动态地将 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
bibtex
无法处理 utf8 字符。使用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}