
Estou começando a usar o BibLatex/biber para processar minhas entradas bibliográficas em Latex. Usando o estilo autorano como ponto de partida, faço ajustes para ficar de acordo com o estilo editorial da revista para a qual submeterei meu artigo. Um dos ajustes é substituir o padrão "e" por um "e" comercial (&) antes do último autor da bibliografia, usando o seguinte código:
% Add a comma and replace "and" with "&" before last coauthor
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addcomma\addspace\&\space}
Infelizmente este código também substitui o “e” nas citações, ao contrário do que a revista deseja para as citações.
Minha dúvida é: como substituir “e” por “&” somente na bibliografia? Parece que o biblatex-dw tem essa opção, mas meu documento não compila com esse estilo.
Responder1
Tenho certeza que BibLaTeX
possui facilidades para soluções melhores e mais eficientes, um hack rápido é o seguinte
\documentclass{article}
\usepackage{filecontents}
\usepackage{etoolbox}
\usepackage[style=authoryear]{biblatex}
\newtoggle{incitation}
\pretocmd{\citesetup}{\toggletrue{incitation}}{}{}
\pretocmd{\bibsetup}{\togglefalse{incitation}}{}{}
\newcommand{\biband}{\iftoggle{incitation}{and}{\&}}
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addcomma\addspace\biband\space}
\begin{filecontents}{\jobname.bib}
@article{test,
author = "Family, Given and FamilyTwo, GivenTwo",
title = "title",
journal = "Journal",
year = "2012"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{test}
\printbibliography
\end{document}
EDITAR
Baseado na sugestão de @Audrey
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=authoryear]{biblatex}
\newcommand{\biband}{\ifcurrentname{labelname}{\bibstring{and}}{\&}}
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addcomma\addspace\biband\space}
\begin{filecontents}{\jobname.bib}
@article{test,
author = "Family, Given and FamilyTwo, GivenTwo",
title = "title",
journal = "Journal",
year = "2012"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{test}
\printbibliography
\end{document}
Responder2
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=authoryear,backend=biber]{biblatex}% delete backend= when running bibtex
\begin{filecontents}{\jobname.bib}
@article{test,
author = "Family, Given and FamilyTwo, GivenTwo and Family3, Given3",
title = "title",
journal = "Journal",
year = "2012"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
foo\cite{test}
\begingroup
\renewcommand*\finalnamedelim{ \& }
\printbibliography
\endgroup
\end{document}