\citefield enlace a la bibliografía (hiperref y backref)

\citefield enlace a la bibliografía (hiperref y backref)

Me gustaría saber si hay alguna manera de obtener enlaces y enlaces de referencia en un comando \citefield. Por ejemplo, quiero citar sólo el título de una referencia:

\citefield{ref}{title} 

o cualquier otro campo, y obtenga el hipervínculo a la referencia y el enlace de referencia posterior correspondiente.

EDITAR:

MWE

\documentclass{article}
\usepackage[backref=true]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo}, 
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \cite{A01,B02}.

\newpage

In this cite \citefield{A01}{title} I do not get any link

\clearpage

Some more text \cite{A01}.

\printbibliography

\end{document}

Respuesta1

Como es otro enfoque de nivel inferior, lo escribiré como otra respuesta.

También puede parchear el \citefieldcomando usando el xpatchpaquete. Por lo tanto, sólo tienes que encontrar la macro subyacente que será invocada por ella:\blx@cite@citefield

No podrás usarlo \citefield{author}como quisieras, porque internamente no se maneja como a fieldsino como name, por lo que también tuviste que parchear \citename, si deseas usarlo \citename{key}{author}. El tercer comando en esta fila es \citelistel que quizás también tengas que parchear. Ver biblatex-manual, 3.7.7 Low-level Commands.

Mi ejemplo contiene parches para los tres, pero \citenamesolo \citelisten comentarios y no probados. (No tiene mucho sentido para mí usarlos de esta manera).

Si realmente quieres tener UN comando como \citeany{key}{field/name/list}, supongo, tenías que implementar una nueva macro con un interruptor interno que conduce a las macros , \citefielddependiendo de lo dado . Pero esto es bastante más difícil, ya que tienes que lidiar con los 5 parámetros opcionales de los comandos de cita. No se como hacer esto.\citekey\citelistfield/name/list

\documentclass{article}
\usepackage[backref=true,backend=biber]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}
\usepackage{silence}\WarningFilter{latex}{Overwriting file}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
url = {http://www.something.com}
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo}, 
}
\end{filecontents}

\addbibresource{\jobname.bib}

\usepackage{xpatch}
\xpatchcmd{\blx@cite@citefield}{\printfield[#4]{#5}}{\printtext[bibhyperref]{\printfield[#4]{#5}}}{}{}%patch \citefield
% \xpatchcmd{\blx@cite@citename}{\printnames[#4]{#5}}{\printtext[bibhyperref]{\printnames[#4]{#5}}}{}{}%patch \citename
% \xpatchcmd{\blx@cite@citelist}{\printlist[#4]{#5}}{\printtext[bibhyperref]{\printlist[#4]{#5}}}{}{}%patch \citelist


\begin{document}

Citefield A01 title: \citefield{A01}{title}.

\clearpage
Citefield B02 title: \citefield{B02}{title}.

Citefield A01 url: \citefield{A01}{url}.

\printbibliography

\end{document}

Respuesta2

No conozco una solución para \citefield. Pero puede declarar uno nuevo citecommandque imprimirá el campo deseado específico. En el siguiente ejemplo, declaro un nuevo comando de cita \citetitle*(no sé cómo sobrescribirlo \citetitle). Entonces solo tienes que envolver \printtext[bibhyperref]alrededor de la salida.\printfield...

MWE:

\documentclass{article}
\usepackage[backref=true]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo}, 
}
\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareCiteCommand*{\citetitle}%your new citecommand \citetitle*
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
    \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}%like \citetile, 
    %only added \printtext[bibhyperref]{...} in this line
  {\multicitedelim}
  {\usebibmacro{postnote}}


\begin{document}

Some text \cite{A01,B02}.

\newpage

In this cite \citetitle*{A01} I do get a link now.

\clearpage

Some more text \cite{A01}.

\printbibliography

\end{document}

información relacionada