I want to include a lot of bibliography entries in various languages. The great majority are in english and only a handful is in another language. I have no language
, langid
or hyphenation
fields, to use different language per entry. I can manualy add the langid
filed to the non-english entries. Is there a way to set langid={english}
by default for every entry that it is not set?
1 Answer
The description of the autolang
option on p. 48 of the biblatex
documentation says
[The
autolang
] option controls whichbabel
language environment is used if thebabel
/polyglossia
package is loaded and a bibliography entry includes alangid
field (see § 2.2.3). Note that Biblatex automatically adjusts to the main document language ifbabel
/polyglossia
is loaded. In multilingual documents, it will also continually adjust to the current language as far as citations and the default language of the bibliography is concerned. This option is for switching languages on a per-entry basis within the bibliography.
So if no langid
field is provided biblatex
falls back to the current language. Consider the following MWE where british
is the document language and uthor
does not come with a langid
field, while torin
has ngerman
.
\documentclass[ngerman,british]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear-icomp,autolang=other]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{uthor,
author = {Anne Uthor},
year = {2001},
title = {An English Title},
booktitle = {Collection},
editor = {Eddie Tor},
}
@incollection{torin,
author = {Anne U. Torin},
year = {2002},
title = {Ein deutscher Titel},
booktitle = {Sammelband},
editor = {Heinz E. Rausgeber},
langid = {ngerman},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
torin
is set in German, while uthor
remains in (British) English.
If you insist on setting the langid
field for entries that do not yet have it, use
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldset=langid, fieldvalue={english}]
}
}
}
since this mapping does not overwrite fields, only those entries without a langid
get english
now.
-
Thank you! As I commented to the main question, the document's language is not english... I tried your last solution, which works in many cases, but not all of them! I still try to figure out the common point of the non-working entries/files.– TheoCommented Nov 22, 2015 at 19:08
-
langid
fall back to the document language. Wouldn't that be enough for your purposes?langid
field in greek!