2

I am writting my PhD thesis and I have in the manuscript two version of the introduction: one is in French and the other in English.

I am using the bibliography style apalike.

When using the commands \cite of \citep in the French part, I would like to have the information in the text in French. For example I have "Author and Author", when I would like to have "Author et Author".

2

apalike is a monolingual style and only speaks English. The "and" you see in the citation is hard-coded and can't be changed easily on the fly (you can edit the .bst file to exchange the "and" for something else, even a macro). The styles from the babelbib bundle can change the language of the bibliography entries automatically, but the bundle does not come with an equivalent for apalike. Some styles such as those of the harvard bundle already use a macro for the and (\harvardand), which could be redefined when you change languages. But I can't think of a BibTeX style/package that would automatically adapt the citation to the surrounding language.


Since you tagged the question with biblatex, here is a solution using that package. Note that BibTeX styles such as apalike are completely incompatible with biblatex, so there is some work involved in switching to biblatex and you can not continue to use apalike, you'll have to find a different style. See bibtex vs. biber and biblatex vs. natbib, What to do to switch to biblatex? and Biblatex with Biber: Configuring my editor to avoid undefined citations.

I'm not aware of a biblatex style that would give the exact same output as apalike, but you can start from the standard authoryear style and modify it as you see fit. There are many questions about that on this site, you can find a good start in Guidelines for customizing biblatex styles.

With biblatex citations automatically adapt to the surrounding language and so

\documentclass[french,british]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\addbibresource{biblatex-examples.bib}


\begin{document}

\begin{otherlanguage}{french}
\chapter{French}
Bonjour \cite{sigfridsson}
\end{otherlanguage}


\chapter{English}
Hello \cite{sigfridsson}
\printbibliography
\end{document}

produces

Bonjour Sigfridsson et Ryde 1998

Hello Sigfridsson and Ryde 1998

If you don't like the small caps in the French citations you can disable them with

\DefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}

See also Keep lowercase in biblatex.

  • This is may not be quite what's needed, since this changes the formatting of the citation to small caps. I would guess that identical formatting might be required. – Alan Munn Mar 31 at 15:24
  • @AlanMunn Added a way to get rid of the small caps. Switching to biblatex will of course change other aspects of the style as well, so there is still a risk of this not being exactly what was desired. – moewe Mar 31 at 15:31
2

Here's a solution that uses natbib and a modified version of apalike.bst. First, make a copy of apalike.bst and put it in the same folder as your thesis file. In this example, I'll name the file apalike-bilingual.

In it you will find two functions:

FUNCTION {format.lab.names}

and

FUNCTION {format.names}

In each of these functions you will find code that contains " and ". This is the code you will change. In the format.lab.names change:

{ " and " * s #2 "{vv~}{ll}" format.name$ * }

to

{ " \harvardand\ " * s #2 "{vv~}{ll}" format.name$ * }

In principle, this is the only thing you need to do, since you just want citation callouts to change. But for completeness, you also want to change the label-names function. Change:

{ " and " * t * }

to

{ " \harvardand\ " * t * }

What this does now makes a version of apalike that uses the \harvardand macro for its and. Note that the following \ in the changed code is important, since spaces get gobbled after a macro.

Using the solution that Ulrike Fischer provided here: language dependent citations and natbib we can now make the \harvardand command sensitive to the current babellanguage by adding the French version of \harvardand to \frenchcaptions. Thanks to Ulrike for this solution and to moewe for pointing out that we can use babel directly instead of using a conditional as in the linked question.

\begin{filecontents}{\jobname.bib}
@article{twoauthors,
title={A cool paper},
author={Duck, A. and Marmot, A.},
journal={Journal of Irrelevant Science},
year={2019},
volume={1}}
\end{filecontents}

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike-bilingual}
\usepackage[french,english]{babel}
\usepackage{etoolbox}
\DeclareRobustCommand{\harvardand}{and}
\appto\captionsfrench{\DeclareRobustCommand{\harvardand}{et}}

\begin{document}


English citation: \cite{twoauthors}

\begin{otherlanguage}{french}
French citation: \cite{twoauthors}
\end{otherlanguage}

\bibliography{\jobname}

\end{document}

output of code

  • 1
    You could also use \DeclareRobustCommand{\harvardand}{and} \appto\captionsfrench{% \DeclareRobustCommand{\harvardand}{et}% } and get rid of iflang. – moewe Apr 1 at 5:27
  • @moewe Thanks, I've updated the answer; it's a cleaner solution. – Alan Munn Apr 1 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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