Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to have a bibliography with both Cyrillic and Latin and the main document language being English. How can I make biblatex to automatically switch between languages? (without using XeTeX as suggested by some) The minimal example returns an error if the main language is English. However, with the main language being Russian the document works.

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

The .bib entries are

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

@book{Baranov2001,
address = {Санкт-Петербугр},
author = {Баранов, Николай А},
title = {{Эволюция взглядов}},
year = {2001}
}
share|improve this question
    
You could add a language key in each of your bibentries (ex: language=russian or language=english). –  Paul Gaborit Feb 2 '13 at 14:56
    
I was thinking about that but unfortunately results in the same error. –  shkelda Feb 2 '13 at 15:06

1 Answer 1

up vote 9 down vote accepted

You must add hyphenation and language keys to each of your bibentries:

\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}
share|improve this answer
1  
This is already great and works on my other file. However, the problem is that I am using a reference manager (Mendeley) that doesn't provide for a hypenation field for .bib-export. I would need to add it manually to all my entries and would loose all the changes when I build a new .bib file. –  shkelda Feb 2 '13 at 15:47
4  
@shkelda Biber can copy the contents of language to hyphenation for you. Just add \DeclareSourcemap{\maps[datatype=bibtex]{\map{\step[fieldsource=language]\step[‌​fieldset=hyphenation,origfieldval]}}} to your preamble. –  Audrey Feb 2 '13 at 16:04
1  
@shkelda BTW: It is actually just the hyphenation field you need to get localized bibliography entries. This field only accepts babel language identifiers. The language field specifies the language of the work for printing. It can be a literal string or a babel identifier. –  Audrey Feb 2 '13 at 16:21
    
Question remaining: Why is there no issue when the main document language is set to Russian, as opposed to the problems coming with setting it to English as the first language? –  shkelda Feb 3 '13 at 9:56
1  
@shkelda Because with Russian as the main language babel loads the proper font encodings for you. With English, you need to load them yourself with, say, \usepackage[T1,T2A]{fontenc}. Either way babel=other requires hyphenation to work properly. –  Audrey Feb 3 '13 at 22:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.