¿Es posible insertar un enlace de referencia cruzada a la propia bibliografía (no solo a elementos individuales de la bibliografía) con biblatex
, hyperref
y cleverref
bajo la memoir
clase?
Es decir, como en la siguiente fuente, ¿qué etiqueta se podría crear, dónde y cómo, para que lo \cref{WHAT}
mostrado en el Prefacio apunte a la Bibliografía? (De modo que al hacer clic en ese enlace se accedería a la primera página de la bibliografía).
\documentclass[12pt]{memoir}
\usepackage[backend=bibtex]{biblatex}
\usepackage{hyperref}
\hypersetup{hyperindex,colorlinks, citecolor=red}
\begin{filecontents}{biblatexdoc.bib}
@article{Archimedes200,author = {Archimedes},title = {Pi's the limit },
journal = {Syracuse J. Gastronom.\ Math.}, year = {200BCE},volume = {10},pages={\textsc{CCCXV}--\textsc{CCCXIV}}}
@article{EulerE1776,Author = {Euler, Leonhard},Title = {All about E},
Journal = {Math.\ Psychol.},Year = {1776},Volume = {4},pages={1--2718}}
\end{filecontents}
\addbibresource{biblatexdoc}
\begin{document}
\frontmatter
\tableofcontents
\chapter{Prefarc}
The Bibliography (\cref{WHAT}) includes only works actually cited.
\chapter{Math}
Archimedes~\cite{Archimedes200} and Euler~\cite{EulerE1776} studied the constants, $\pi$ and $e$, respectively.
\printbibliography
\end{document}
Respuesta1
\nameref{WHAT}
parece ser una mejor variante que \cref{WHAT}
, este último requiere una etiqueta para un mostrador (bueno, \nameref
también la necesita, pero es más fácil falsificar la etiqueta con un envoltorio, por ejemplo, \biblabel
que se usará \label
internamente y agregará automáticamente el hipervínculo al bibliografía.
\documentclass[12pt]{memoir}
\usepackage[backend=bibtex]{biblatex}
\usepackage{hyperref}
\hypersetup{hyperindex,colorlinks, citecolor=red}
\usepackage{cleveref}
\begin{filecontents}{biblatexdoc.bib}
@article{Archimedes200,author = {Archimedes},title = {Pi's the limit },
journal = {Syracuse J. Gastronom.\ Math.}, year = {200BCE},volume = {10},pages={\textsc{CCCXV}--\textsc{CCCXIV}}}
@article{EulerE1776,Author = {Euler, Leonhard},Title = {All about E},
Journal = {Math.\ Psychol.},Year = {1776},Volume = {4},pages={1--2718}}
\end{filecontents}
\addbibresource{biblatexdoc}
\makeatletter
\newcommand{\biblabel}[1]{%
\phantomsection
\edef\@currentlabel{\bibname}%
\edef\@currentlabelname{\bibname}% Provide the \nameref - anchor name
\label{#1}%
}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\chapter{Preface}
The \nameref{WHAT} includes only works actually cited.
\chapter{Math}
Archimedes~\cite{Archimedes200} and Euler~\cite{EulerE1776} studied the constants, $\pi$ and $e$, respectively.
\printbibliography\biblabel{WHAT}
\end{document}
Actualizar
Soporte para más de una bibliografía.
\documentclass[12pt]{memoir}
\usepackage[backend=bibtex]{biblatex}
\usepackage{hyperref}
\hypersetup{hyperindex,colorlinks, citecolor=red}
\usepackage{cleveref}
\begin{filecontents}{biblatexdoc.bib}
@article{Archimedes200,author = {Archimedes},title = {Pi's the limit },
journal = {Syracuse J. Gastronom.\ Math.}, year = {200BCE},volume = {10},pages={\textsc{CCCXV}--\textsc{CCCXIV}}}
@article{EulerE1776,Author = {Euler, Leonhard},Title = {All about E},
Journal = {Math.\ Psychol.},Year = {1776},Volume = {4},pages={1--2718}}
\end{filecontents}
\addbibresource{biblatexdoc}
\makeatletter
\define@key{blx@bib2}{title}{\gdef\blx@thetitle{#1}}
\newcommand{\biblabel}[1]{%
\phantomsection
\edef\@currentlabel{\bibname}%
\@ifundefined{blx@thetitle}{%
\edef\@currentlabelname{\bibname}%
}{%
\edef\@currentlabelname{\blx@thetitle}%
}%
\label{#1}%
}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\chapter{Preface}
The \nameref{WHAT} includes only works actually cited, however, there is another \nameref{WHATOTHER}.
\chapter{Math}
Archimedes~\cite{Archimedes200} and Euler~\cite{EulerE1776} studied the constants, $\pi$ and $e$, respectively.
\printbibliography[title={My sophisticated bibliography}]\biblabel{WHAT}
\printbibliography[title=Bib2]\biblabel{WHATOTHER}
\end{document}
Actualización para bibliografías de varias páginas.
\documentclass[12pt]{memoir}
\usepackage[backend=bibtex]{biblatex}
\usepackage{hyperref}
\hypersetup{hyperindex,colorlinks, citecolor=red}
%\usepackage{msc}
\usepackage{cleveref}
\begin{filecontents}{biblatexdoc.bib}
@article{Archimedes200,author = {Archimedes},title = {Pi's the limit },
journal = {Syracuse J. Gastronom.\ Math.}, year = {200BCE},volume = {10},pages={\textsc{CCCXV}--\textsc{CCCXIV}}}
@article{EulerE1776,Author = {Euler, Leonhard},Title = {All about E},
Journal = {Math.\ Psychol.},Year = {1776},Volume = {4},pages={1--2718}}
\end{filecontents}
\addbibresource{biblatexdoc}
\addbibresource{biblatex-examples}
\makeatletter
\define@key{blx@bib2}{title}{\gdef\blx@thetitle{#1}}
\newcommand{\biblabel}[1]{%
\phantomsection
\@ifundefined{blx@thetitle}{%
\edef\@currentlabelname{\bibname}%
\edef\@currentlabel{\bibname}%
}{%
\edef\@currentlabel{\blx@thetitle}%
\edef\@currentlabelname{\blx@thetitle}%
}%
\label{#1}%
}
\newcommand{\biblabelnote}[1]{%
\defbibnote{#1}{\biblabel{#1}}%
}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\chapter{Preface}
The \nameref{WHAT} includes only works actually cited, however, there is another \nameref{WHATOTHER}.
\chapter{Math}
\nocite{*}
Archimedes~\cite{Archimedes200} and Euler~\cite{EulerE1776} studied the constants, $\pi$ and $e$, respectively.
\biblabelnote{WHAT}
\printbibliography[title={My sophisticated bibliography},prenote={WHAT}]
\biblabelnote{WHATOTHER}
\printbibliography[title=Bib2,prenote={WHATOTHER}]
\end{document}
Respuesta2
Otra posibilidad (aunque no muy sofisticada; parcialmente tomadade aquí): Coloque el \label
debajo \printbibliography
. En el prefacio del capítulo escribe:
The \hyperref[WHAT]{Bibliography} includes only works actually cited.