2

I hope this is not already answered somewhere else in the forum, I have been looking for a while and I have not found anything...

The thing is I am sorting my bibliography using the superfullcite command, and it works great. However, when I use the hyperref package, the hyperlinks for every cite are broken...

Here I post a MWE...any help would be great. Thank you!

\documentclass{article}
\usepackage[style=numeric-comp]{biblatex}
\bibliography{biblatex-examples}
\makeatletter

\ExecuteBibliographyOptions{citetracker,sorting=none}

\DeclareCiteCommand{\superfullcite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{superfullcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{superfullcite}{%
  \ifciteseen
    {}
    {\xappto\cbx@citehook{%
       \noexpand\footnotetext[\thefield{labelnumber}]{%
         \fullcite{\thefield{entrykey}}.}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty

\makeatother

\usepackage{hyperref,bookmark}
\begin{document}

Some filler text,\superfullcite{augustine} then some more
text.\superfullcite{companion} Perhaps some more text and the
same citation again.\superfullcite{companion} Yet another
one.\superfullcite{kastenholz} Now all
again.\superfullcite{augustine,companion,kastenholz}


\newpage

And now...\superfullcite{augustine}

\end{document}

1
  • It may be useful to point out that the code as shown uses the normal code for numerical citations to typeset the supercites. biblatex usually just links the citation to the bibliography entry. You don't have a bibliography (\printbibliography) in your document, so the links don't attach to anything. Ulrike's answer redirects those links to the bibliograph items in the footnotes.
    – moewe
    Commented May 4, 2020 at 15:33

2 Answers 2

4

You are missing destinations for the links.

\documentclass{article}
\usepackage[style=numeric-comp]{biblatex}
\bibliography{biblatex-examples}
\usepackage{l3pdf}
\ExplSyntaxOn
\pdf_uncompress:
\ExplSyntaxOff
\makeatletter

\ExecuteBibliographyOptions{citetracker,sorting=none}

\DeclareCiteCommand{\superfullcite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{superfullcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newrobustcmd\superfullcitedest[1]{%
  \raisebox{\baselineskip}[0pt][0pt]{\makebox[0pt][l]{%
         \hypertarget{cite.\the\c@refsection @#1}{}\hspace{-\parindent}}}}

\newbibmacro*{superfullcite}{%
  \ifciteseen
    {}
    {\xappto\cbx@citehook{%
       \noexpand\footnotetext[\thefield{labelnumber}]{%
         \superfullcitedest{\thefield{entrykey}}%
         \fullcite{\thefield{entrykey}}.}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty

\makeatother

\usepackage{hyperref,bookmark}
\begin{document}

Some filler text,\superfullcite{augustine} then some more
text.\superfullcite{companion} Perhaps some more text and the
same citation again.\superfullcite{companion} Yet another
one.\superfullcite{kastenholz} Now all
again.\superfullcite{augustine,companion,kastenholz}


\newpage

And now...\superfullcite{augustine}


\end{document}
2
  • This solved the problem. Thank you very much!!
    – Manuel
    Commented May 4, 2020 at 12:16
  • Just wanted to get it working with the base \fullcite. Got it working with \newrobustcmd*\fullcitehyper[1]{\hypertarget{cite.\the\c@refsection @#1}\protect\fullcite{#1}} Commented Jul 1, 2020 at 14:14
1

Normally, biblatex links citations to the respective entry in the bibliography. In the MWE you don't have a bibliography, so biblatex doesn't create any links. (You can see how things normally work by adding a \printbibliography to the MWE).

As an alternative to Ulrike's answer, here is a solution that uses biblatex commands to set the anchor that is normally set by the bibliography entry in the fullcite.

The main idea of this approach is a copy of \fullcite that says \blx@anchor before the executing the bibliography driver.

\documentclass{article}
\usepackage[style=numeric-comp]{biblatex}


\makeatletter
\ExecuteBibliographyOptions{citetracker,sorting=none}

\DeclareCiteCommand{\superfullcite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{superfullcite}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}


\newbibmacro*{superfullcite}{%
  \ifciteseen
    {}
    {\xappto\cbx@citehook{%
       \noexpand\footnotetext[\thefield{labelnumber}]{%
         \superfullcite@fullcite{\thefield{entrykey}}.}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty

\DeclareCiteCommand{\superfullcite@fullcite}
  {\usebibmacro{prenote}}
  {\usedriver
     {\blx@anchor
      \DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother



\usepackage{hyperref,bookmark}

\addbibresource{biblatex-examples.bib}
\begin{document}
Some filler text,\superfullcite{augustine} then some more
text.\superfullcite{companion} Perhaps some more text and the
same citation again.\superfullcite{companion} Yet another
one.\superfullcite{kastenholz} Now all
again.\superfullcite{augustine,companion,kastenholz}


\newpage

And now...\superfullcite{augustine}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .