To make use of biblatex
's localisation capabilities we can define a new bibliography string or
.
\NewBibliographyString{or}
\DefineBibliographyStrings{english}{%
or = {or},
}
\DefineBibliographyStrings{german}{%
or = {oder},
}
We can then define a new command that will change the "and" in \textcite
to an "or".
\newcommand{\useor}{%
\renewcommand*{\textcitedelim}{%
\iffinalcitedelim
{\ifnumgreater{\value{textcitetotal}}{2}
{\iftextcitepunct{\finalandsemicolon}{\finalandcomma}}{}%
\addspace\bibstring{or}}% here was \bibstring{and} before
{\iftextcitepunct{\addsemicolon}{\addcomma}}%
\space}%
}
The \textcite
commands can then very easily be patched to use "or" instead of "and" by adding \useor
to the wrapper command.
For numeric
and friends that would be
\makeatletter
\DeclareCiteCommand{\textciteor}[\useor\cbx@textcite@init\cbx@textcite]
{\gdef\cbx@savedkeys{}%
\citetrackerfalse%
\pagetrackerfalse%
\DeferNextCitekeyHook%
\usebibmacro{textcite:init}}
{\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
{\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
\global\clearfield{multipostnote}}
{}%
\xappto\cbx@savedkeys{\thefield{entrykey},}%
\iffieldequals{namehash}{\cbx@lasthash}
{}
{\stepcounter{textcitetotal}%
\savefield{namehash}{\cbx@lasthash}}}
{}
{\protected@xappto\cbx@savedcites{%
[\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}}
\makeatother
For authortitle
/authoryear
you would use
\DeclareCiteCommand{\textciteor}[\useor]
{\boolfalse{cbx:parens}}
{\usebibmacro{citeindex}%
\iffirstcitekey
{\setcounter{textcitetotal}{1}}
{\stepcounter{textcitetotal}%
\textcitedelim}%
\usebibmacro{textcite}}
{\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}}
{\usebibmacro{textcite:postnote}}
Look up the \DeclareCiteCommand{\textcite}
in your .cbx
file, copy the definition, change the name to \textciteor
and add \useor
to the wrapper command (that is the portion in square brackets just after \DeclareCiteCommand{\textciteor}
, create this optional argument if its not there already).
MWE
\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\NewBibliographyString{or}
\DefineBibliographyStrings{english}{%
or = {or},
}
\DefineBibliographyStrings{german}{%
or = {oder},
}
\newcommand{\useor}{%
\renewcommand*{\textcitedelim}{%
\iffinalcitedelim
{\ifnumgreater{\value{textcitetotal}}{2}
{\iftextcitepunct{\finalandsemicolon}{\finalandcomma}}{}%
\addspace\bibstring{or}}
{\iftextcitepunct{\addsemicolon}{\addcomma}}%
\space}%
}
\makeatletter
\DeclareCiteCommand{\textciteor}[\useor\cbx@textcite@init\cbx@textcite]
{\gdef\cbx@savedkeys{}%
\citetrackerfalse%
\pagetrackerfalse%
\DeferNextCitekeyHook%
\usebibmacro{textcite:init}}
{\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
{\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
\global\clearfield{multipostnote}}
{}%
\xappto\cbx@savedkeys{\thefield{entrykey},}%
\iffieldequals{namehash}{\cbx@lasthash}
{}
{\stepcounter{textcitetotal}%
\savefield{namehash}{\cbx@lasthash}}}
{}
{\protected@xappto\cbx@savedcites{%
[\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}}
\makeatother
\begin{document}
\ldots as presented by \textcite{shore,yoon,cicero,baez/article}.
\ldots as presented by \textciteor{shore,yoon,cicero,baez/article}.
Just to test \textcite{shore,yoon,cicero,baez/article}.
\end{document}
Of course you can also hook \useor
into \AtNextCite
:
Just to test \textcite{shore,yoon,cicero,baez/article}.
Just to test \AtNextCite{\useor}\textcite{shore,yoon,cicero,baez/article}.
Just to test \textcite{shore,yoon,cicero,baez/article}.
And then define
\newrobustcmd*{\textciteor}{\AtNextCite{\useor}\textcite}
thanks to @Audrey for that solution.
Regarding your BTW: biblatex
only uses the Oxford/serial comma for list with more than two items.
The standard definitions are:
\newcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}
\newcommand*{\finallistdelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}
\newcommand*{\textcitedelim}{%
\iffinalcitedelim
{\ifnumgreater{\value{textcitetotal}}{2}
{\iftextcitepunct{\finalandsemicolon}{\finalandcomma}}{}%
\addspace\bibstring{and}}
{\iftextcitepunct{\addsemicolon}{\addcomma}}%
\space}
One can of course force the \finalandcomma
to appear always by
\renewcommand*{\finalnamedelim}{%
\finalandcomma\addspace\bibstring{and}\space}
and the like.