\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로 변환하는 방법은 무엇입니까?.

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

관련 정보