.png)
Quiero citar dos artículos del mismo autor usando biblatex
el estilo de cita biblatex-aer
(https://github.com/dmsul/biblatex-aer). Sin embargo, cuando uso \textcite{key1,key2}
, obtengo, por ejemplo
Gurley y Shaw (1955), 1966
en lugar de
Gurley y Shaw (1955, 1966)
Al entrar en el código de biblatex-aer
, se reduce a este fragmento de código:
\renewbibmacro*{textcite}{%
\ifboolexpr{
( not test {\iffieldundef{prenote}} and
test {\ifnumequal{\value{citecount}}{1}} )
or
( not test {\iffieldundef{postnote}} and
test {\ifnumequal{\value{citecount}}{\value{citetotal}}} )
}
{\DeclareFieldAlias{textcitehyperref}{noformat}}
{}%
\printtext[textcitehyperref]{%
\restorebibmacro{textcite}%
\usebibmacro{textcite}}}
Si elimino estas líneas, recibo la cita correcta, sin embargo, hyperref
ya no colorea el nombre completo, sino solo el año de publicación.
¿Sabes cómo arreglar ésto?
Respuesta1
El código utilizado enhttps://github.com/dmsul/biblatex-aer/blob/master/biblatex-aer.texpara obtener enlaces completos en las citas se tomó de la respuesta de Audrey anombre del hipervínculo con biblatex autoraño (biblatex 1.4b). Esa respuesta se escribió teniendo style=authoryear,
en cuenta (también funciona para algunos otros estilos), pero biblatex-aer
se basa en el estilo biblatex-chicago
de authordate
, que es más similar a uno mucho más complejo style=authoryear-comp,
(además, en biblatex-chicago
sí mismo también esmuycomplejo).
Esto significa que necesitas una estrategia diferente para los enlaces. La siguiente variación está inspirada en el código de Audrey ennombre del hipervínculo con biblatex autoraño (biblatex 1.4b)y por mi respuesta a¿Cómo cambiar el color de la primera mitad del paréntesis en una cita?.
También actualicé el código para nombres en negrita biblatex-aer.tex
para que el siguiente preámbulo reemplace completamente biblatex-aer.tex
ahttps://github.com/dmsul/biblatex-aer/blob/master/biblatex-aer.tex.
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[authordate, backend=biber, uniquename=false, noibid]{biblatex-chicago}
\usepackage[colorlinks]{hyperref}
\makeatletter
\newrobustcmd{\blx@imc@transparentprinttext}[2][]{%
\ifblank{#2}
{}
{\ifblank{#1}
{\let\blx@theformat\@firstofone}
{\blx@getformat\blx@theformat{ffd}{#1}{}}%
\ifdefvoid\blx@theformat
{}
{\blx@theformat{#2}}}}
\newcommand*{\blx@imc@iffieldequalstr@swap}[2]{\iffieldequalstr{#2}{#1}}
\newcommand*{\blx@imc@iffieldequalsdefstring}[2]{%
\expandafter\blx@imc@iffieldequalstr@swap\expandafter{#2}{#1}}
\blx@regimcs{\transparentprinttext \iffieldequalsdefstring}
\makeatother
\DeclareFieldFormat{citehyperref}{%
\DeclareFieldAlias{bibhyperref}{noformat}%
\bibhyperref{#1}}
\letbibmacro{orig:cite}{cite}
\renewbibmacro*{cite}{%
\transparentprinttext[citehyperref]{%
\usebibmacro{orig:cite}}}
\letbibmacro{orig:textcite}{textcite}
\letbibmacro{orig:textcite:postnote}{textcite:postnote}
\renewbibmacro*{textcite:postnote}{}
\renewbibmacro*{textcite}{%
\transparentprinttext[citehyperref]{%
\usebibmacro{orig:textcite}%
\ifnumequal{\value{citecount}}{\value{citetotal}}
{\usebibmacro{orig:textcite:postnote}}
{}%
}%
}
\newcommand\ifmknamebold{%
\ifboolexpr{test {\ifcurrentname{labelname}}
or
test {\iffieldequalsdefstring{labelnamesource}{\currentname}}}}
\DeclareNameWrapperFormat{default}{\ifmknamebold{\mkbibbold{#1}}{#1}}
\DeclareNameWrapperFormat{labelname}{#1}
\addbibresource{biblatex-examples.bib}
\begin{document}
\textcite{knuth:ct:a,knuth:ct:b}
\cite{sigfridsson,gaonkar:in,westfahl:space,westfahl:frontier,companion}
\printbibliography
\end{document}