2

The endnotes in my document are not linked.

  1. How can I link endnotes and back to the original page?
  2. How can I set the title of theendnotes to zero without a vertical space?

MWE:

\documentclass[]{scrartcl}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{2}
\usepackage[english]{babel}
\usepackage{endnotes}
\let\endnote=\endnote{}
\def\enotesize{\footnotesize}
\counterwithin*{endnote}{section}
\renewcommand{\notesname}{}
\usepackage{blindtext}
\usepackage[]{hyperref}

\begin{document}

\tableofcontents

\section{This is the first Article 1}

\textbf{Hello all!} In this collection of different articles I need to put the footnotes to the end of each article. But these footnotes are not linked, and I would like to have also the backreference to the page of origine. Is this possible? Supplemental question: How to avoid the ``Title'' of endnotes and the resulting space, setting it to none with

\verb!\renewcommand{\notesname}{}! \endnote{comp. \url{https://tex.stackexchange.com/questions/238403/change-the-heading-for-endnotes}}

While editing this posting, I discovered the package \verb!endnotes-hy! Perhaps the solution? \endnote{comp. /usr/local/texlive/2022/texmf-dist/tex/latex/endnotes-hy/endnotes-hy.sty}

\blindtext\endnote{third footnote}

\subsection{First Subsection 1.1}

\blindtext\endnote{fourth footnote} \blindtext\endnote{fifth footnote}

\subsection{Second Subsection 1.2}

\blindtext\endnote{sixth footnote} \blindtext\endnote{seventh footnote}

\subsubsection{Here a Subsubsection 1.2.1}

\blindtext\endnote{eighth footnote} \blindtext\endnote{ninth footnote}

\subsection{Annotations}

\begingroup \parindent 0pt \parskip 0pt \theendnotes \endgroup

\section{This is the second Article 2} \blindtext\endnote{first footnote} \blindtext\endnote{second footnote}

\subsection{Annotations}

\begingroup \parindent 0pt \parskip 0pt \theendnotes \endgroup

\end{document}

  • 1
    MWE stands for Minimal Working Example - could you please remove the unnecessary code such as komafonts, comments etc and minimize it down to just the issue please? – JamesT Feb 12 '23 at 17:45
  • With endnotes you can get hyperlinks for labeled notes with endnotes-hy. But if you want backlinks too, then you need either enotez or postnotes. This summary is perhaps useful: https://tex.stackexchange.com/a/669532/105447. – gusbrs Feb 12 '23 at 19:23
  • @gusbers thx for this suggestion: I will try the coming week your postnotes and perhaps enotez. – Marek Stepanek Feb 12 '23 at 21:01
  • And sorry for the too long MWE. I will edit it tomorrow, to strip it down. – Marek Stepanek Feb 12 '23 at 21:01
  • I shortened my MWE. Hope it is compiling again. – Marek Stepanek Feb 13 '23 at 06:08

1 Answers1

2

With the endnotes package, you can use the endnotes-hy to get hyperlinks for labeled notes from the mark to the text, but no backlinks.

With endnotes + endnotes-hy a document should look like:

\documentclass{article}

\usepackage{endnotes} \usepackage{endnotes-hy} \usepackage{hyperref}

% You can remove the heading with: \renewcommand{\enoteheading}{}

\begin{document}

\endnote{Foo.}\label{en:1}

% Non-labeled notes are not linked. \endnote{Bar.}

\clearpage{}

% And there are no backlinks. \theendnotes

\end{document}

However, since you require backlinks too, the only packages that offer this are enotez and postnotes. With enotez you could setup things as:

\documentclass{scrartcl}

\usepackage[english]{babel}

\usepackage{enotez} % Enabling backlinks. \setenotez{backref} % You could remove the notes heading with: % \DeclareInstance{enotez-list}{plain}{paragraph}{heading=} % But I think you'd do better by letting the package do its job for you: \DeclareInstance{enotez-list}{plain}{paragraph}{ heading=\subsection{Annotations}}

\counterwithin*{endnote}{section}

\usepackage{blindtext} \usepackage{hyperref}

\begin{document}

\tableofcontents

\section{This is the first Article 1}

\blindtext\endnote{first footnote}

\blindtext\endnote{second footnote}

\blindtext\endnote{third footnote}

\subsection{First Subsection 1.1}

\blindtext\endnote{fourth footnote} \blindtext\endnote{fifth footnote}

\subsection{Second Subsection 1.2}

\blindtext\endnote{sixth footnote} \blindtext\endnote{seventh footnote}

\subsubsection{Here a Subsubsection 1.2.1}

\blindtext\endnote{eighth footnote} \blindtext\endnote{ninth footnote}

\printendnotes

\section{This is the second Article 2} \blindtext\endnote{first footnote} \blindtext\endnote{second footnote}

\printendnotes

\end{document}

And with postnotes:

\documentclass{scrartcl}

\usepackage[english]{babel}

\usepackage{postnotes} % You could remove the notes heading with: % \postnotesetup{heading=} % But I think you'd do better by letting the package do its job for you: \postnotesetup{heading=\subsection{Annotations}}

\counterwithin*{postnote}{section}

\usepackage{blindtext} \usepackage{hyperref}

\begin{document}

\tableofcontents

\section{This is the first Article 1}

\blindtext\postnote{first footnote}

\blindtext\postnote{second footnote}

\blindtext\postnote{third footnote}

\subsection{First Subsection 1.1}

\blindtext\postnote{fourth footnote} \blindtext\postnote{fifth footnote}

\subsection{Second Subsection 1.2}

\blindtext\postnote{sixth footnote} \blindtext\postnote{seventh footnote}

\subsubsection{Here a Subsubsection 1.2.1}

\blindtext\postnote{eighth footnote} \blindtext\postnote{ninth footnote}

\printpostnotes

\section{This is the second Article 2} \blindtext\postnote{first footnote} \blindtext\postnote{second footnote}

\printpostnotes

\end{document}

gusbrs
  • 13,740