5

I'm using endnotes package to create endnotes, and since my existing body of text already contains lots of footnotes, I use \let\footnote=\endnote to convert footnotes into endnotes.

 \documentclass{article} \usepackage{endnotes} \usepackage{hyperref} \let\footnote=\endnote \begin{document} Sample text.\footnote{Sample footnote}. \theendnotes \end{document} 

But while the original footnotes were nicely cross-referenced, the conversion doesn't preserve that. Is there a way to make a conversion while preserving the cross-referencing?

6
  • What do you mean? The question is unclear to me. Commented Feb 15, 2015 at 18:34
  • Normally, the footnote number in the body of the text just takes you to the text in the footnote. That's not preserved with the conversion to the endnotes I provide above (the endnote no. doesn't take you to the endnote text). Commented Feb 15, 2015 at 18:36
  • 1
    The default latex footnotes are not hyperlinked, you might ne used to hyperref? Commented Feb 15, 2015 at 18:38
  • Thanks. I am using hyperref to get the footnotes be cross-referenced in the first place. But not sure how to modify when converting to endnotes. Commented Feb 15, 2015 at 18:39
  • 1
    You should use enotez, it was developed to provide – amongst other things – support for hyperref. Commented Feb 15, 2015 at 18:57

1 Answer 1

13

In order to make hyperref work with endnotes, you could use enotez. All you have to do is load enotez instead of endnotes and use \printendnotes instead of \theendnotes:

\documentclass{article} \usepackage[backref]{enotez} % <-- instead of \usepackage{endnotes} \usepackage{hyperref} \let\footnote=\endnote \begin{document} Sample text.\footnote{Sample footnote}. \printendnotes % <-- instead of \theendnotes \end{document} 

Edit: If you want back references from the notes to the mark in the text, then use the option backref

Update: Newer versions of enotez are set differently (see remark in the comments)

\documentclass{article} \usepackage{enotez} \setenotez{backref=true} % <-- options are set like this nowadays \usepackage{hyperref} \let\footnote=\endnote \begin{document} Sample text.\footnote{Sample footnote}. \printendnotes \end{document} 
13
  • That works, but I do get an error message ("LaTeX error:"kernel/command-already-defined" "control sequence !\endnote already defined.") This happens regardless of whether I just replace all instances of \footnote with \endnote or if I do it via \let\footnote=\endnote. Commented Feb 15, 2015 at 19:19
  • Clearly, it must be due to some other package I'm loading but not sure which one is to blame. Commented Feb 15, 2015 at 19:25
  • Looks like it's due to mdwlist but I have no idea why. Commented Feb 15, 2015 at 19:30
  • mdwlist is rather old . . . is there any particular reason why you are using it and not enumitem? Commented Feb 15, 2015 at 19:36
  • 1
    For anyone trying to do that in 2023 : \usepackage{enotez} \setenotez{backref=true} Commented Jan 20, 2024 at 11:58

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.