TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use the endnotes package, hyperref and biblatex together to have links to my endnotes. Here is a MWE that shows how the links don't show up:

\begin{filecontents}{testbib.bib}
@Book{jones00,
  author =   {Douglas Jones},
  title =    {A book},
  publisher =    {The metasyntactic variable publishing company},
  year =     2000}
\end{filecontents}

\documentclass{article}
\usepackage{endnotes}
\usepackage[autocite=footnote,notetype=endonly,style=verbose-trad1]{biblatex}
\bibliography{testbib}
\let\footnote\endnote
\usepackage{hyperref}
\begin{document}
Something\autocite[p.12]{jones00} something else\footnote{another endnote?}

\theendnotes
\end{document}

I'm open to other end-note producing options that work better with hyperref, but I'd rather stick with article document class.

share|improve this question
3  
For what it's worth: endnotes produced by the enotez package work nicely together with hyperref – clemens Mar 5 '13 at 9:44
up vote 13 down vote accepted

I once uncovered the following code on comp.text.tex, credited to Ulrich Dirr:

%%% hyperendnotes.sty
\makeatletter
\newif\ifenotelinks
\newcounter{Hendnote}
% Redefining portions of endnotes-package:
\let\savedhref\href
\let\savedurl\url
\def\endnotemark{%
\@ifnextchar[\@xendnotemark{%
\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotemark
}%
}%
\def\@xendnotemark[#1]{%
\begingroup\c@endnote#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\endgroup
\@endnotemark
}%
\def\endnotetext{%
\@ifnextchar[\@xendnotenext{%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotetext
}%
}%
\def\@xendnotenext[#1]{%
\begingroup
\c@endnote=#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\endgroup
\@endnotetext
}%
\def\endnote{%
\@ifnextchar[\@xendnote{%
\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotemark\@endnotetext
}%
}%
\def\@xendnote[#1]{%
\begingroup
\c@endnote=#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\show\@theenvalue
\endgroup
\@endnotemark\@endnotetext
}%
\def\@endnotemark{%
\leavevmode
\ifhmode
\edef\@x@sf{\the\spacefactor}\nobreak
\fi
\ifenotelinks
\expandafter\@firstofone
\else
\expandafter\@gobble
\fi
{%
\Hy@raisedlink{%
\hyper@@anchor{Hendnotepage.\@theenvalue}{\empty}%
}%
}%
\hyper@linkstart{link}{Hendnote.\@theenvalue}%
\makeenmark
\hyper@linkend
\ifhmode
\spacefactor\@x@sf
\fi
\relax
}%
\long\def\@endnotetext#1{%
\if@enotesopen
\else
\@openenotes
\fi
\immediate\write\@enotes{%
\@doanenote{\@theenmark}{\@theenvalue}%
}%
\begingroup
\def\next{#1}%
\newlinechar='40
\immediate\write\@enotes{\meaning\next}%
\endgroup
\immediate\write\@enotes{%
\@endanenote
}%
}%
\def\theendnotes{%
\immediate\closeout\@enotes
\global\@enotesopenfalse
\begingroup
\makeatletter
\edef\@tempa{`\string>}%
\ifnum\catcode\@tempa=12
\let\@ResetGT\relax
\else
\edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
\@makeother\>%
\fi
\def\@doanenote##1##2##3>{%
\def\@theenmark{##1}%
\def\@theenvalue{##2}%
\par
\smallskip %<-small vertical gap between endnotes
\begingroup
\def\href{\expandafter\savedhref}%
\def\url{\expandafter\savedurl}%
\@ResetGT
\edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
\enoteformat
}%
\def\@endanenote{%
\par\endgroup
}%
% Redefine, how numbers are formatted in the endnotes-section:
\renewcommand*\@makeenmark{%
\hbox{\normalfont\@theenmark~}%
}%
% header of endnotes-section
\enoteheading
% font-size of endnotes
\enotesize
\input{\jobname.ent}%
\endgroup
}%
\def\enoteformat{%
\rightskip\z@
\leftskip1.8em
\parindent\z@
\leavevmode\llap{%
\setcounter{Hendnote}{\@theenvalue}%
\addtocounter{Hendnote}{-1}%
\refstepcounter{Hendnote}%
\ifenotelinks
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi
{\@firstofone}%
{\hyperlink{Hendnotepage.\@theenvalue}}%
{\makeenmark}%
}%
}%
% stop redefining portions of endnotes-package:
\makeatother
% Toggle switch in order to turn on/off back-links in the
% endnote-section:
\enotelinkstrue
%\enotelinksfalse

Load it with the endnotes package (after hyperref) and enjoy.

share|improve this answer
1  
Beware that hyperendnote.sty appears in at least two completely different versions on comp.text.tex, and one of them doesn't work as well as this one. – Ryan Reich Jan 7 '11 at 19:26
    
Jeez, this seems like an awful lot of extra code for what I thought was a simple problem... – Seamus Jan 8 '11 at 17:47
    
@Seamus: Those hyperlinks have to come from somewhere (you were expecting them to come from endnotes; this is basically a reimplementation that does this). Also, in case it wasn't clear, you should copy all that code into a file (say, hyperendnotes.sty) and \input or \usepackage it. So no extra code goes into the actual document. – Ryan Reich Jan 9 '11 at 9:18

It seems that this is not a biblatex issue. The hyperref README states on page 18 that the endnotes package is "[u]nsupported".

share|improve this answer

Use the enotez package (\usepackage{enotez}).

For details see: http://tex.stackexchange.com/a/228296/42648

share|improve this answer
    
This is rather a comment then an answer. – Christian Hupfer Jul 15 '15 at 11:35

enotez works well, but we had a problem when it was used together with a large collection of style files. Instead, defined a simple mod of endnotes that worked in that environment. Also used two options where you can click either on the note number or on the text marked with that number. The latter seems useful for small font displayed on a tablet when it is difficult to hit the very small note number. Here is a complete example.

% A simple macro that uses endnotes with hyperref
% (by Giovanni Rinaldi and Klaus Truemper)
%
% Important: the command \setcounter{notelabelcount}{0} needs
%            to go just before \theendnotes
%
\documentclass[12pt]{article}
\usepackage{hyperref}
%\hypersetup{pdfborder=0 0 0} % Uncomment if you want to get rid 
                              % of the box highlighting the link
\usepackage{endnotes}

% hyperref of notes
\newcounter{notelabelcount}
\setcounter{notelabelcount}{0}
\def\HyperRaiseLinkDefault{12pt} % Replace 12pt with \baselineskip or
                                 % any other suitable length
% this macro makes the note number become the link to the endnote
\newcommand{\mysimplenote}[1]{%
   \addtocounter{notelabelcount}{1}%
   \hyperref[notelabel\thenotelabelcount]{%
   \endnote{%
      \addtocounter{notelabelcount}{1}%
      \phantomsection\label{notelabel\thenotelabelcount}%
      {#1}%
   }}%
}

% this macro makes some text (1st parameter) become the link to 
% the endnote (second parameter)
\newcommand{\mynote}[2]{%
   \addtocounter{notelabelcount}{1}%
   \hyperref[notelabel\thenotelabelcount]{#1}%
   \endnote{%
      \addtocounter{notelabelcount}{1}%
      \phantomsection\label{notelabel\thenotelabelcount}%
      {#2}%
   }%
}

\begin{document}
RODERIGO:
Tush! Never tell me. I take it much unkindly
That thou, Iago, who hast had my purse
As if the strings were thine, shouldst know of
this\mysimplenote{W.~Shakespeare, Othello, Act 1, Scene 1.}.

MONTANO: 
Methinks the wind hath spoke aloud at land,
A fuller blast ne'er shook our battlements.
If it hath ruffianed so upon the sea
What ribs of oak, when mountains melt on them,
Can hold the mortise? What shall we hear of
this?\mysimplenote{W.~Shakespeare, Othello, Act 2, Scene 1.}

OTHELLO:
Get you to bed on th' instant, I will be returned
Forthwith. Dismiss your attendant there, 
\mynote{look't be done}{W.~Shakespeare, Othello, Act 4, Scene 3.}.

\newpage

\setcounter{notelabelcount}{0} % this is necessary
\theendnotes

\end{document}
share|improve this answer
    
SInce I am the maintainer of enotez I am curious: when you say »enotez works well, but we had a problem when it was used together with a large collection of style files« was the problem related to/caused by enotez? Are you able to reproduce the problem in a minimal example so I can investigate and maybe provide a fix for enotez? – clemens Sep 28 '15 at 13:11
    
The problem occurred with use of the tufte_style class, which uses numerous style files and which we have changed significantly. Constructing a small example is not possible due to the complexity of the tufte_style class files. Sorry that we cannot be of more help. – K in Texas Sep 28 '15 at 16:19
    
Thanks. Since enotez is compatible with tufte-latex obviously some of the modifications caused problems. That's OK: a package author cannot predict individual changes… – clemens Sep 28 '15 at 17:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.