0

In practice, I want to have text like this where a note is inserted,

This is in the middle of a chapter, and we are at page XYZ. To know more, go look at the note at page UVW.

and text like this in the list of notes, specifically at page UVW,

(Page XYZ) This is the note

How can I achieve this?


The first attempt attempt was to use the memoir class (I was using book), like this

\documentclass{memoir}
\makepagenote
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Some chapter}
\chapter{Some other chapter}
Some text and a page/end note.\pagenote[Page what]{This is an end note}
\backmatter
\printpagenotes
\end{document}

However,

  • I've not understood from the documentation what what should be for the it to resolve to the page number where \pagenote is used;
  • I have to use memoir instead of book, and I don't see why I should do so for one feature.

Then I discovered that the pagenote package exists, so I tried going back to book and use this package, like this:

\documentclass{book}
\usepackage[page]{pagenote}
\makepagenote
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Some chapter}
\chapter{Some other chapter}
Some text and a page/end note.\pagenote{This is an end note}
\backmatter
\printnotes
\end{document}

It will generate something like this where the note is set:

Some text and a page/end note.¹

and this where the notes are printed

  1. (page 3) This is an end note

Now, I've put the page option precisely to avoid the numbering of the notes and just have a reference, where the not is printed, to the page where the note is set (indeed, if I remove [page], (page 3) will disappear). However, the ¹ and the 1. seem to persist. Why is that?

gusbrs
  • 13,740
Enlico
  • 2,592
  • You can use \hypertarget and \hyperlink pretty much anywhere, so long as only one target per name. Unlike \label and \ref, they go directly into the PDF (\special). – John Kormylo Dec 23 '22 at 19:00

1 Answers1

3

Indeed, the page option from pagenote/memoir only adds the page information before the note being printed. If you'd like to remove the note marks and numbering when printed, you have to additionally instruct it to do so. Also, if you'd like to refer to where the note is printed from where it is being set, a traditional cross-reference, with \label and \pageref, is sufficient.

A couple of alternatives you could use.

With pagenotes:

\documentclass{book}
\usepackage[page]{pagenote}
\makepagenote
\renewcommand{\notenumintext}[1]{}
\renewcommand{\notenuminnotes}[1]{}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Some chapter}
\chapter{Some other chapter}
Some text and a page/end note.\pagenote{\label{en:1}This is an end note} To
know more see page \pageref{en:1}.
\clearpage
Some text and a page/end note.\pagenote{\label{en:2}This is an end note} To
know more see page \pageref{en:2}.
\backmatter
\printnotes
\end{document}

enter image description here enter image description here

Or, with postnotes you could also get backlinks from the notes:

\documentclass{book}
\usepackage{postnotes}
\postnotesetup{
  makemark = {},
  maketextmark = {#2(Page \pnthepage)#3},
}
\usepackage{hyperref}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Some chapter}
\chapter{Some other chapter}
Some text and a page/end note.\postnote{\label{en:1}This is an end note} To
know more see page \pageref{en:1}.
\clearpage
Some text and a page/end note.\postnote{\label{en:2}This is an end note} To
know more see page \pageref{en:2}.
\backmatter
\printpostnotes
\end{document}

enter image description here enter image description here

I presume you could also achieve something similar with enotez, but I haven't tried.

gusbrs
  • 13,740
  • I had mistakenly inverted XYZ and UVW in the second part of the initial statement. – Enlico Dec 24 '22 at 07:03
  • @Enlico That's what I thought. The requirements seemed impossible. :-) I see you fixed it, great. – gusbrs Dec 24 '22 at 11:05
  • By the way, is \tableofcontents* meant to be \tableofcontents? The asterisk for me just get printed at the end of the index :/ – Enlico Dec 24 '22 at 14:40
  • 1
    Yes, indeed, I just got if from you. I'll fix the answer, though. – gusbrs Dec 24 '22 at 15:08
  • Oh, sorry! :D Fixig it there too. Anyway, installed your package. It works well! Should I have any feedback, I'll ask a question here again :) – Enlico Dec 24 '22 at 15:18