%20%5Ctextcites%20%D0%BA%D0%B0%D0%BA%20%D0%BF%D1%80%D0%B8%D1%82%D1%8F%D0%B6%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5.png)
Расширяя предыдущие ответы наИмя автора \textcite как притяжательное, интересно, как адаптировать предлагаемый код так, чтобы ЕСЛИ поле автора предпоследней цитируемой записи содержит несколько имен, то последующее «и» (для разделения различных записей) заменялось «красиво» на, например, «а также».
\begin{filecontents*}{database.bib}
@book{texbook,
author = {Donald E. Knuth and Someone Else},
title = {The {{\TeX}book}},
publisher = {Addison-Wesley},
date = {1984}
}
@inproceedings{foo,
author = {Foo Bar and {Yet Another} Person},
title = {Some article},
abstract = {Here is the abstract.},
crossref = {acl2015},
year = {2015}
}
\end{filecontents*}
и в текстовом файле я хотел бы использовать
\posscites{foo}{texbook}
и это должно быть напечатано как
Knuth and Else's (1984) as well as Bar and Person's (2015)
Не совсем минимальный MWE следует
\documentclass{article}
\usepackage[british,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[authordate,backend=biber,bibencoding=utf8,safeinputenc,strict,pagetracker= true,loccittracker=constrict,citetracker=true,maxbibnames=99,maxcitenames=3,isbn=false,uniquelist=false]{biblatex-chicago}
\usepackage{filecontents,iflang}
%http://tex.stackexchange.com/questions/22273/author-name-of-textcite-as-possessive
\DeclareNameFormat{labelname:poss}{% Based on labelname from biblatex.def
\nameparts{#1}% Not needed if using Biblatex 3.4
\ifcase\value{uniquename}%
\usebibmacro{name:family}{\namepartfamily}{\namepartgiven} {\namepartprefix}{\namepartsuffix}%
\or
\ifuseprefix
{\usebibmacro{name:first-last}{\namepartfamily}{\namepartgiveni} {\namepartprefix}{\namepartsuffixi}}
{\usebibmacro{name:first-last}{\namepartfamily}{\namepartgiveni} {\namepartprefixi}{\namepartsuffixi}}%
\or
\usebibmacro{name:first-last}{\namepartfamily}{\namepartgiven} {\namepartprefix}{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}%
\IfLanguageName{ngerman}{%true:German language
\ifnumequal{\value{listcount}}{\value{liststop}}{s}{}%
}{%false:nonGerman language
\ifnumequal{\value{listcount}}{\value{liststop}}{'s}{}%
}
}%
\IfLanguageName{ngerman}{%true:German language
\DeclareFieldFormat{shorthand:poss}{%
\ifnameundef{labelname}{#1s}{#1}%
}%
}{%false:nonGerman language
\DeclareFieldFormat{shorthand:poss}{%
\ifnameundef{labelname}{#1's}{#1}%
}%
}%
\IfLanguageName{ngerman}{%true:German language
\DeclareFieldFormat{citetitle:poss}{\mkbibemph{#1}s}
\DeclareFieldFormat{label:poss}{#1s}%
}{%false:nonGerman language
\DeclareFieldFormat{citetitle:poss}{\mkbibemph{#1}s}
\DeclareFieldFormat{label:poss}{#1's}%
}%
\newrobustcmd*{\posscitealias}{%
\AtNextCite{%
\DeclareNameAlias{labelname}{labelname:poss}%
\DeclareFieldAlias{shorthand}{shorthand:poss}%
\DeclareFieldAlias{citetitle}{citetitle:poss}%
\DeclareFieldAlias{label}{label:poss}}}
\newrobustcmd*{\posscite}{%
\posscitealias%
\textcite}
\newrobustcmd*{\Posscite}{\bibsentence\posscite}
\newrobustcmd*{\posscites}{%
\posscitealias%
\textcites}
\begin{filecontents}{\jobname.bib}
@Article{bertram:sa,
author = {Bertram, Aaron and Wentworth, Richard},
title = {Gromov invariants for holomorphic maps on Riemann surfaces},
journaltitle = {J.~Amer. Math. Soc.},
volume = {9},
number = {2},
date = {1996},
pages = {529--571}}
@Article{bertram:i,
author = {Bertram, Aaron and Wentworth, Richard and Brianny Winner},
title = {Gromov invariants for holomorphic maps on Riemann surfaces imagined elsewhere},
journaltitle = {J.~Amer. Math. Soc.},
volume = {9},
number = {2},
date = {2088},
pages = {529--571},
note= {unpublished}}
\end{filecontents}
\addbibresource{\jobname.bib}
\bibliography{biblatex-examples}
\renewcommand{\baselinestretch}{1.25}
\begin{document}
\begin{otherlanguage}{british}
\subsection*{cases british}
1 posscite single item with several authors: \posscites[30]{aksin} \\
2 posscite multiple items: \posscites[e.g.][4]{bertram:sa}{aristotle:poetics} \\
3 posscite multiple items including final item with many authors: \posscites[e.g.][4]{bertram:sa}{aristotle:poetics}[55]{bertram:i} \\
\end{otherlanguage}
I would like the final case, #, to result in:
Bertram and Wentworth’s (e.g. 1996, 4), Aristotle’s (1968) \textbf{as well as} Bertram, Wentworth and Winner’s (2088, 55).
That is, for the case of british english.
\begin{otherlanguage}{ngerman}
\subsection*{cases negerman}
1 posscite single item with several authors: this would be another question \\
2 posscite multiple items: \posscites[z.B.][4]{bertram:sa} {aristotle:poetics} \\
3 posscite multiple items including final item with many authors: \posscites[z.B.][4]{bertram:sa}{aristotle:poetics}[55]{bertram:i} \\
\end{otherlanguage}
I would like the final case, 3, to result in: Bertram und Wentworths (z.B. 1996, 4), Aristotles (1968) \textbf{sowie} Bertram, Wentworth und Winners (2088, 55)
\end{document}
решение1
Все, что вам нужно сделать, это добавить aswellas
строку библиографии (с определениями), а затем изменить определение на , \textcitedelim
чтобы использовать aswellas
вместо and
разделителя перед окончательной цитатой, если в окончательной цитате содержится более одного имени.
Добавьте это к преамбуле вашего MWE выше:
\NewBibliographyString{aswellas}
\DefineBibliographyStrings{english}{%
aswellas = {as well as}
}
\DefineBibliographyStrings{ngerman}{%
aswellas = {sowei}
}
\renewcommand*{\textcitedelim}{%
\iffinalcitedelim
{\ifnumgreater{\value{textcitetotal}}{2}
{\iftextcitepunct{\finalandsemicolon}{\finalandcomma}}{}%
\addspace
\ifnumgreater{\value{labelname}}{1}
{\bibstring{aswellas}}
{\bibstring{and}}}
{\iftextcitepunct{\addsemicolon}{\addcomma}}%
\space}