3

Is it possible to have two different expressions for andothers, when using either in-text or parentheses citation with biblatex classes?

For instance, I would like to use "and others" in text (with \textcite) and "et al." in parentheses (with \parencite). Like so:

As presented by Yoon and others (2006), ...

This has been previously presented (Yoon et al., 2006) ...

It says in the manual (p. 103):

\textcitedelim

Similar to \multicitedelim, but used by \textcite and related commands (§ 3.7.2). The default is a comma plus an interword space. The standard styles modify this provisional definition to ensure that the delimiter before the final citation is the localized term ‘and’, separated by interword spaces.

But I wasn't sure which styles were those or how they modify it.

I consulted questions and answers like Change last multicite delim only for textcite (only contrasting it to bibliography entries) and Switch conjunction in textcite, but couldn't make their solutions work for my needs.

2
  • 2
    Please provide a complete minimal example. This can't be answered as it stands as far as I know as the information provided is too deficient.
    – cfr
    Commented May 13, 2016 at 22:37
  • 1
    Note that \textcitedelim is the separator between multiple citations (for example in \textcite{foo,bar}) and has nothing to do with the andothers bibstring.
    – moewe
    Commented May 14, 2016 at 7:23

2 Answers 2

5

Starting with version 3.4 of biblatex there is the concept of delimcontexts that are used to find out in what context (\parencite, \textcite, bibliography, text is printed), we can use that to determine of we are in a \textcite

\makeatletter
\newcommand\ifintextcite{\ifdefstring{\blx@delimcontext}{textcite}}
\makeatother

There is no need for patching the commands and a new toggle here.

We can then modify the andothers bibstring depending on that test

\DefineBibliographyStrings{german}{
  andothers = {\ifintextcite{and others}{et\addabbrvspace al\adddot}}
}

MWE

\documentclass{article}
\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}

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

\addbibresource{biblatex-examples.bib}

\makeatletter
\newcommand\ifintextcite{\ifdefstring{\blx@delimcontext}{textcite}}
\makeatother

\DefineBibliographyStrings{german}{
  andothers = {\ifintextcite{and others}{et\addabbrvspace al\adddot}}
}


\begin{document}
   \textcite{aksin} \parencite{aksin}

   \printbibliography   
\end{document}
1
  • That's smart, utilizing the new internal biblatex checks. Thank you!
    – Fato39
    Commented May 15, 2016 at 10:57
5

In the standard authoryear biblatex style, both \parencite and \textcite internally is use the name:others bibmacro. What we can do is to create a toggle that is switched on and off try \textcite, and we use the toggle for a conditional to be used inside the macro that prints the "and others" or "et al" strings.

\newtoggle{myintextcite}

The simplest way is to use the xpatch package and to prepend the command to switch the toggle on, and append the command to switch it off.

\xpretobibmacro{textcite}{\toggletrue{myintextcite}}{}{}
\xapptobibmacro{textcite}{\togglefalse{myintextcite}}{}{}

Given that we have already loaded xpatch, we can use it to patch the name:andothers bibmacro

\xpatchbibmacro{name:andothers}
  {\andothersdelim\bibstring{andothers}}
  {\andothersdelim\iftoggle{myintextcite}{and others}{\bibstring{andothers}}}
  {}
  {}

Notice that (1) the andothers string prints "et. al." and (2) there is no etal string.

enter image description here

1
  • Thank you for your answer, @Giudo! I couldn't get this to work with apa-style and a language mapping, so I updated my biblatex and used the solution suggested by moewe.
    – Fato39
    Commented May 15, 2016 at 11:01

You must log in to answer this question.

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