1

I am using Biblatex and Babel. I am trying to print a translated conjunction for \parencite, \cite and \textcite depending on the language I provide with langid. For reasons too long to explain, I can't define a specific style= for the biblatex package.

This is the document which I'm testing on:

\documentclass{article}
\usepackage[letterpaper,margin=2cm]{geometry}
\usepackage{lipsum}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}

\usepackage[english, main=italian, german]{babel}
\selectlanguage{italian}

\usepackage[autostyle]{csquotes} 
\setquotestyle{english} 

\usepackage[backend=biber,
natbib=true,
citestyle=authoryear-icomp,
bibstyle=authoryear-icomp,
ibidpage=true,
dashed=true,
pagetracker=false,
maxbibnames=4,
maxcitenames=2,
autolang=other
]{biblatex}
\addbibresource{sample.bib}

\DeclareQuoteStyle{english}%
    {\textquotedblleft}
    [\textquotedblleft]
    {\textquotedblright}
        [0.05em]
    {\textquoteleft}
    [\textquoteleft]
    {\textquoteright}
\DeclareQuoteStyle{german}%
    {\textquotedblleft}
    [\textquotedblleft]
    {\textquotedblright}
        [0.05em]
    {\textquoteleft}
    [\textquoteleft]
    {\textquoteright}
\DeclareQuoteStyle{italian}%
    {\textquotedblleft}
    [\textquotedblleft]
    {\textquotedblright}
        [0.05em]
    {\textquoteleft}
    [\textquoteleft]
    {\textquoteright}

\begin{document}
\section{Tutorial LaTeX}

\lipsum[1-4]

\parencite{greenwade93} \cite{greenwade93} \textcite{greenwade93}

\parencite{gurlami1943} \cite{gurlami1943} \textcite{gurlami1943}

\parencite{landa1943} \cite{landa1943} \textcite{landa1943}


\printbibliography[heading=bibintoc, title={Bibliografia}]
\nocite{*}

\end{document}

Considering these three bib-entries, whose language I have clearly differentiated ...

@article{greenwade93,
    author  = "George Greenwade and Bob Jordan",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342-351",
    langid = "english",
}

@article{gurlami1943,
    author  = "Enzo Gurlami and Dominic DeCocco",
    title   = "How to sneak into parties",
    year    = "1943",
    journal = "Scalps",
    volume  = "14",
    number  = "3",
    pages   = "342-351",
    langid = "italian",
}

@article{landa1943,
    author  = "Hans Landa and King Schultz",
    title   = "How to be an actor",
    year    = "1943",
    journal = "The Hateful Eight",
    volume  = "14",
    number  = "3",
    pages   = "100-3901",
    langid = "german",
}

... the result is the same -- the conjunction used is always the italian one "e": Why

If I try fixing the problem by myself, the result is disgusting and every conjunction is added*, regardless of the language defined (*even in the bibliography, which is something I don't need). What am I doing wrong?

\DeclareDelimFormat{finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \iffieldannotation{langid}{english}{\addspace\printtext{and}\space}{}%
  \iffieldannotation{langid}{italian}{\addspace\printtext{e}\space}{}%
  \iffieldannotation{langid}{german}{\addspace\printtext{und}\space}{}%
}

2 Answers 2

3

Well I'm not sure if I like that, after all the text is in italian, but this here should work

\DeclareNameWrapperFormat{labelname}{%
  \iffieldundef{langid}{#1}{\foreignlanguage[captions]{\thefield{langid}}{#1}}}

enter image description here

3

With the default settings autolang only applies to the bibliography whereas the \cite commands are typeset in the surrounding language. You can use the language option (whose default is autobib) to typeset both bibliography entries and citations in the language of the cited work (set language=auto,). Note that this affects more than just the "and": It changes the entire localisation, so in the example it also affects "ibid.".

\documentclass{article}
\usepackage[letterpaper,margin=2cm]{geometry}
\usepackage{lipsum}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}

\usepackage[english, main=italian, german]{babel}
\selectlanguage{italian}

\usepackage[autostyle]{csquotes} 
\setquotestyle{english} 

\usepackage[
  backend=biber,
  natbib=true,
  style=authoryear-icomp,
  ibidpage=true,
  dashed=true,
  pagetracker=false,
  maxbibnames=4,
  maxcitenames=2,
  language=auto,
  autolang=other,
]{biblatex}


\DeclareQuoteStyle{english}%
    {\textquotedblleft}
    [\textquotedblleft]
    {\textquotedblright}
        [0.05em]
    {\textquoteleft}
    [\textquoteleft]
    {\textquoteright}
\DeclareQuoteStyle{german}%
    {\textquotedblleft}
    [\textquotedblleft]
    {\textquotedblright}
        [0.05em]
    {\textquoteleft}
    [\textquoteleft]
    {\textquoteright}
\DeclareQuoteStyle{italian}%
    {\textquotedblleft}
    [\textquotedblleft]
    {\textquotedblright}
        [0.05em]
    {\textquoteleft}
    [\textquoteleft]
    {\textquoteright}

\begin{filecontents}{\jobname.bib}
@article{greenwade93,
    author  = "George Greenwade and Bob Jordan",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342-351",
    langid = "english",
}
@article{gurlami1943,
    author  = "Enzo Gurlami and Dominic DeCocco",
    title   = "How to sneak into parties",
    year    = "1943",
    journal = "Scalps",
    volume  = "14",
    number  = "3",
    pages   = "342-351",
    langid = "italian",
}
@article{landa1943,
    author  = "Hans Landa and King Schultz",
    title   = "How to be an actor",
    year    = "1943",
    journal = "The Hateful Eight",
    volume  = "14",
    number  = "3",
    pages   = "100-3901",
    langid = "german",
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\section{Tutorial LaTeX}

\lipsum[1-4]

\parencite{greenwade93} \cite{greenwade93} \textcite{greenwade93}

\parencite{gurlami1943} \cite{gurlami1943} \textcite{gurlami1943}

\parencite{landa1943} \cite{landa1943} \textcite{landa1943}


\printbibliography[heading=bibintoc, title={Bibliografia}]
\nocite{*}

\end{document}

(Greenwade and Jordan, 1993) ibid. Greenwade and Jordan (ibid.)
(Gurlami e DeCocco, 1943) ibid. Gurlami e DeCocco (ibid.)
(Landa und Schultz, 1943) ebd. Landa und Schultz (ebd.)

You must log in to answer this question.

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