5

I use XeLaTex with Biblatex to write my thesis, which is in English. When I cite two authors I get "X and Y", which is fine. However, I have one part of the thesis which is a German abstract, and in that part only I would like to get "X und Y". How do I do that?

6
  • Did you set the language to german?
    – Johannes_B
    Nov 27, 2015 at 10:33
  • Yes, the entire abstract is in a \begin{german} environment.
    – Ariel
    Nov 27, 2015 at 10:34
  • 3
    Can you show us a mminimal example? Setting up a document trying to reproduce what you see just takes too long.
    – Johannes_B
    Nov 27, 2015 at 10:35
  • 1
    Normally biblatex adapts the language to its surroundings. In \documentclass[ngerman,british]{article} \usepackage{babel} \usepackage{csquotes} \usepackage[style=authoryear]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} \cite{sigfridsson} \begin{otherlanguage}{ngerman} \cite{sigfridsson} \end{otherlanguage} \cite{sigfridsson} \end{document}. I get "and" in the first and third citation and "und" in the second.
    – moewe
    Nov 27, 2015 at 14:52
  • See also biblatex issue #359
    – moewe
    Nov 28, 2015 at 9:31

1 Answer 1

2

The issue (#359) has already been addressed by the biblatex developers (in commit 0513325). An updated version has not yet made it to CTAN, but can be found in the development folder at sourceforge.

The following lines now reproduce the official fix

\makeatletter
\protected\def\blx@citeinit{%
  \iftoggle{blx@bibliography}
    {}
    {\toggletrue{blx@citation}}%
  \blx@blxinit
  \blx@langstrings
  \citesetup
  \blx@setsfcodes
  \blx@postpunct@agroup
  \blx@resetdata
  \blx@leavevmode
  \csuse{blx@hook@cite}%
  \csuse{blx@hook@cite@next}%
  \let\blx@citeinit\blx@resetdata}
\makeatother

and can be put into your preamble to get the desired behaviour for the time being.

I leave my original answer below for reference


biblatex's polyglossia interface is still in the preliminary stages and some of the elaborate trickery done with babel cannot be mapped one-to-one to polyglossia, one thing is that polyglossia needs a nudge to load biblatex's localisation. biblatex already has a command to ensure this, but it is not applied when switching languages via polyglossia's commands.

You can use

\makeatletter
\apptocmd\select@@language{\blx@langstrings}
\makeatother

MWE

\documentclass{article}        
\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\setotherlanguage{german}
\usepackage{csquotes}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}

\makeatletter
\apptocmd\select@@language{\blx@langstrings}
\makeatother

\begin{document}
\cite{sigfridsson}

\begin{german}
\cite{sigfridsson}
\end{german}

\cite{sigfridsson}
\end{document}

example output

5
  • Thanks! I try to use this hack but I get the following error: ! File ended while scanning use of \@firstoftwo.
    – Ariel
    Nov 30, 2015 at 10:19
  • @Ariel It does work in my example on my machine. Did you try the exact example? If so did it work? Can you show a short example how it doesn't work for you, please?
    – moewe
    Nov 30, 2015 at 10:35
  • @Ariel You can also reproduce the official fix as shown above, maybe you want to try that as well.
    – moewe
    Nov 30, 2015 at 10:48
  • @moewe Very helpful. Is that multilanguage support in the meantime integrated? Or do I still need to use the above hack?
    – EtoAls
    Jul 27, 2020 at 14:08
  • @EtoAls Yes, the fix mentioned at the beginning of the answer was released in biblatex v3.2 (2015-12-28). But polyglossia support was significantly improved in biblatex v3.14 (2019-12-01). If you want to use polyglossia and biblatex, make sure your system is fully up to date. In any case, the workarounds from this answer have not been necessary for a long time.
    – moewe
    Jul 27, 2020 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .