Можно ли вставить перекрестную ссылку на саму Библиографию, а не только на отдельные элементы в Библиографии, с помощью biblatex
, hyperref
и cleverref
под memoir
классом?
То есть, как в следующем источнике, какую метку можно создать, где и как, чтобы \cref{WHAT}
указанная в Предисловии ссылка указывала на Библиографию? (Чтобы нажатие на эту ссылку перенаправляло на первую страницу Библиографии.)
\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}
решение1
\nameref{WHAT}
кажется лучшим вариантом, чем \cref{WHAT}
, последний требует метку для счетчика (ну, \nameref
в общем-то, она нужна, но проще подделать метку с помощью обертки, скажем, \biblabel
которая будет использоваться \label
внутри и автоматически добавит гиперссылку в библиографию.
\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}
Обновлять
Поддержка более чем одной библиографии.
\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}
Обновление для многостраничных библиографий
\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}
решение2
Другая возможность (хотя и не очень сложная; частично принята)отсюда): Разместите \label
ниже \printbibliography
. В главе Предисловие напишите:
The \hyperref[WHAT]{Bibliography} includes only works actually cited.