使用 biblatex 切换参考书目中的语言

使用 biblatex 切换参考书目中的语言

我想要一个包含西里尔文和拉丁文的书目,并且主要文档语言是英语。我怎样才能让 biblatex 自动在语言之间切换?(不使用某些人建议的 XeTeX)如果主要语言是英语,最小示例会返回错误。但是,如果主要语言是俄语,文档就可以正常工作。

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}

\usepackage[backend = biber,babel=other]{biblatex}
\usepackage{csquotes}
\addbibresource{library.bib}

\begin{document}
%\selectlanguage{russian} %if the main document language is Russian the bibliography is compiled without any problem.
This is a test. \parencite{Bara2006,Baranov2001}

\printbibliography

\end{document}

.bib 条目是

@book{Bara2006,
address = {New York},
author = {Bara, Judith},
publisher = {Routledge},
title = {{English Citation entry}},
year = {2006}
}

@book{Baranov2001,
address = {Санкт-Петербугр},
author = {Баранов, Николай А},
title = {{Эволюция взглядов}},
year = {2001}
}

答案1

您必须向每个 bibentry添加hyphenation和键:language

\documentclass{article}
\usepackage{filecontents}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}

\begin{filecontents*}{library.bib}
@book{Bara2006,
  address = {New York},
  author = {Bara, Judith},
  publisher = {Routledge},
  title = {{English Citation entry}},
  year = {2006},
  language={english},
  hyphenation={english}
}
@book{Baranov2001,
  address = {Санкт-Петербугр},
  author = {Баранов, Николай А},
  title = {{Эволюция взглядов}},
  year = {2001},
  language={russian},
  hyphenation={russian}
}
\end{filecontents*}

\usepackage[bibencoding=auto,backend=biber,babel=other]{biblatex}
\usepackage{csquotes}
\addbibresource{library.bib}

\begin{document}
This is a test. \parencite{Bara2006,Baranov2001}
\newpage
\printbibliography
\end{document}

相关内容