14

I am not talking about a \footnote that appears both at the end of the current page and at the end of the book.

Instead, I'm talking about

  • leaving \footnotes as they are,
  • using another mechanism for creating notes which are printed at the end of the book.

As regards the latter, the following two photos should make clear what I mean: enter image description here

Such a huge note is just not good as a footnote, so it must be an endnote.

This is the characteristics I can notice:

  • The endnote and the text that refers to it can refer to each other, so it's kind of having 2 \labels and each text can \ref the other:

    • where the note is printed, the reference to the referencing text is made via the page number;
    • where the reference of the note is made, only the page number of where the note is printed is given.
  • Where the note is printed, there is a bolded title, which is made of two parts:

    • A kind of title:, which clearly is different from note to note
    • Suggestions for further reading:, which is the same for all notes

    followed by the full text of the note. Therefore I suspect that in theory the referencing text could mention the A kind of title: (maybe without the :) via a \ref, if the writer wanted.

Apparently there are several packages that could maybe target such a layout, but each of the seems to have some short coming.

  • endnotes

    The latest version is from 2020-01-02, so not that recent. Plus several package, such as pagenote mention that it has some shortcomings, so I haven't invested much into understanding how this can be used.

  • pagenote

    One problem is described in this question, where Enrico Gregorio provided a workaround. Apparently, though, that workaround doesn't work anymore, as you can verify by compiling the very MWE from his answer and checking that the chapter from backmatter is numbered as 1.

    After all, the latest version of this package is v1.1a, last revised in 2009/09/03, so it's a fairly old package, and I wouldn't expect much from it (even though an answer to a recent question of mine shows that the package can still be used with moderate success).

  • enotez

    From the package doc I haven't really understood how I can avoid the footnote-like numbering of the notes, to obtain the layout as in the attached photos.

    Plus there's a problem similar to pagenotes, as you can see by compiling the following MWE and seeing that the chapters from frontmatter and backmatter are numbered 0 and 1 respectively:

    \documentclass{book}
    \usepackage{enotez}
    \setenotez{split=chapter, totoc=chapter}
    \begin{document}
    \frontmatter
    \chapter{Introduction}
    text in frontmatter\endnote{note from frontmatter}
    \mainmatter
    \chapter{The first}
    text in mainmatter\endnote{note from mainmatter}
    \backmatter
    \chapter{Epilogue}
    text in backmatter\endnote{note from backmatter}
    \printendnotes
    \end{document}
    

    Nonetheless, the latest version is from 2022-01-04, so the package is fairly recent and is probably what I should use.

  • postnotes

    It looks like this is the most recently updated, latest update dating to 2022-11-13. At the moment I'm stuck on File `postnotes.sty' not found, but in the documentation there are no examples of how the results look like, so I'd like to understand if this is indeed the package I should go to, before spending time on it.

    Another (minor) drawback is that it doesn't honor babel automatically, as currently supported languages are only English, German, French, and Portuguese. (In reality starting the document with \documentclass[german]{book} \usepackage[german]{babel} doesn't make the headings of the notes German, so...)

So with this question I'm wondering if anybody has enough experience with the topic to draw an answer telling pros and cons about these packages, outlining what each provides that not all the others provide.

Enlico
  • 2,592
  • Regarding "At the moment I'm stuck on File postnotes.sty' not found`", I suppose this means you have to install it. It is available from CTAN: https://ctan.org/pkg/postnotes. – gusbrs Dec 24 '22 at 11:57
  • 2
    Postnotes is quite new and so also needs a new tex system. I would try it, it has the huge advantage that you can pester @gusbrs is something doesn't work :-). – Ulrike Fischer Dec 24 '22 at 13:43
  • Oh crap, only now I understand I'm interacting with postnotes' author :D Well, I haven't said to bad things, have I? Anyway, given the 3 tags to this question exist, I'm wondering whether an user with a lot of rep like @UlrikeFischer can create a postnotes tag :/ – Enlico Dec 24 '22 at 13:59
  • @UlrikeFischer That's appreciated, thanks! :-) – gusbrs Dec 24 '22 at 14:01
  • @gusbrs by the way: are you interested and have to time to add tagging support to your package? – Ulrike Fischer Dec 24 '22 at 14:14
  • @UlrikeFischer I don't know what's the policy in that regard. This is probably the first question which would deserve such a tag, do you think it justifies to create the tag at this point? – gusbrs Dec 24 '22 at 15:12
  • @UlrikeFischer Oh, I think I misunderstood you, and you meant something completely different... Did you mean creating a tag here on the site or some package feature? – gusbrs Dec 24 '22 at 15:13
  • @UlrikeFischer Oh, you definitely meant https://github.com/u-fischer/tagpdf. In this case, I not really acquainted with the requirements for that, but I'd be glad to discuss it and learn about it. And, if at all possible, I'd be happy to add support for it. Would you like to open an issue to discuss it? – gusbrs Dec 24 '22 at 15:20
  • 2
    I've seen books like this, and such notes are very bad for reference and for reading. Why not put a number instead of repeating a sentence? Besides the fact that endnotes are a pain to go back and forth to begin with. They just make things easier for the typesetter, not for the reader or the writer. – user574859 Dec 24 '22 at 19:33

1 Answers1

21

I feel like I might be one such person. But this answer needs a disclaimer, I'm the author of postnotes. I'll try to be as impartial as possible, but beware.

endnotes

endnotes is the old and traditional package for the purpose. It's been around for decades, its changelog goes back to the 1980s, and is rock solid. Its code is as sharp as it gets. A thing of beauty really, I wish one day I could code like that.

Even if arguably spartan, endnotes is carefully built, making it actually quite tweakable. @egreg's answers here on the site are a demonstration of this. A sample of some common tasks:

However, with time, endnotes also became somewhat dated. Probably the most noticeable thing would be the lack of hyperref support. endnotes-hy is a companion package which provides such support, but in a limited fashion. Hyperlinks are only provided for labelled notes, and it uses a peculiar syntax for the labels, where \label must go outside of the note (the manual states its reasons for this syntax but, personally, I'm not really convinced. enotez also uses the same syntax, presumably by "inheritance", so that it can work as a drop-in replacement for endnotes).

Another companion package worth mentioning is endheads which provides the neat feature of running heads for the printed notes with information about the pages where the notes came from. But for some reason it hard-codes a dependency to fancyhdr and I'm not sure of the package's status (I couldn't make it work at all, last I tried).

memoir / pagenote

As far as I grasp, memoir has developed its own end notes infrastructure, which eventually got branched out to an independent package for use with other classes, and that's pagenote. They have some bells ans whistles, and are more easily configurable than endnotes, even if the latter is quite powerful in its simplicity. Still, it is arguable that memoir/pagenote are somewhat more user friendly than endnotes.

As far as I can tell, though, memoir and pagenote have diverged. Maintenance of both have been passed over to different maintainers, and it seems they have taken different paths.

One difference appears to be that memoir has hyperref support for links from the note mark to the printed one, while pagenote hasn't.

However, most importantly, memoir.dtx says the following about it:

% \changes{v3.6h}{2011/01/19+}{Reimplemented page notes}
% This used to be a copy of the \Lpack{pagenote} package, with minor
% amendments. But it turned out that the implementation used by
% \Lpack{pagenote} at that time, had a few serious flaws. In this
% implementation we will instead turn to the trick used by the
% \Lpack{endnotes} package to overcome the same problem.
% For the sake of history, let us summarise what the actual problem
% was. Basically the command \cs{pagenote}\marg{text} would write an
% entry to an external file in the following format
% \begin{verbatim}
% \noteentry{nom}{id}{text}{pagenum}
% \end{verbatim}
% and when typesetting the page notes, this file would be read into
% the document and \cs{noteentry} would typeset each page note. The
% main problem here is \verb|{text}| which is written verbatimly to
% the external file, but it is written on a single line!, thus an
% input like this
% \begin{verbatim}
% \pagenote{Test%
% test}
% \end{verbatim}
% would give us the entry
% \begin{verbatim}
% \noteentry{num}{id}{Test%test}{pagenum}
% \end{verbatim}
% oops! This is what we will solve using inspiration from
% \Lpack{endnotes}, kudos to  John Lavagnino.

I'm not sure if the "at that time" means paths had diverged earlier, but considering that this comment is from 2011 and that the last update of pagenote was in 2009, it appears there are grounds to avoid it as a standalone package at this point (at the time of writing, pagenote's version is v1.1a from 2009/09/03). The error mentioned in the comment does still occur with the latest version, and endnotes.sty gives still other reasons not to write the note as a single long line ("which might well overflow limits on output line length"). But I would also assume that the package is still usable even if with some limitations (I've tested it, and it works in a simple well behaved document).

enotez

enotez, as far as I get, strives to be a more modern alternative to the previously existing ones. It is a powerful package with highlights being:

  • Full hyperref support, including backlinks from the printed notes to the note mark.
  • The package is highly configurable with a key=value user interface.
  • It provides for automatic splitting the list of notes, according to the chapter or section they were set in.

A couple of distinctive features of enotez are:

  • The support for nested notes.
  • The possibility of printing the notes before they are actually called. endnotes/memoir/pagenote work by writing each note, when it is called, to an external file, which is read and discarded when you print the notes set. So only "past" notes can be ever printed. enotez does something different, it writes the notes, with full contents, to the .aux file, so that you have all the notes available at begindocument, which can then be printed at any point.

postnotes

I wrote this package earlier this year because I was writing a document requiring end notes, and was having a hard time getting what I wanted from existing packages. My pick, among the previously existing ones, was clearly enotez. But one requirement important for me was not really available, and I had another practical/technical qualm with it. The requirement was running heads for the printed with information from the origin of the notes (page etc.). The technical issue arose because I was working with a large document, the end notes section itself was about 150 pages, so the way enotez works meant a huge amount of material ended up in the .aux file, with a corresponding penalty in compilation time. Hence, postnotes is one of those "scratch my own itch" packages.

Some distinctive features:

  • Support for running heads for the printed notes. By default, it is in the form "Notes to pages N-M", but you can get fancier ones like "Notes to chapters A-B, pages N-M" and so on. (This particular feature has been actually offered to enotez, and at the time of writing is pending code review https://github.com/cgnieder/enotez/issues/37).
  • postnotes strives to store some "context" from where the note is placed and make it available where the note is printed. I had very much biblatex in mind when implementing this, and tried to add support for refsection, refcontext, and refsegment. This proved harder than I anticipated on the biblatex side of things (https://github.com/plk/biblatex/issues/1226). But it is still a potentially powerful feature. In particular, the answer I gave you yesterday (https://tex.stackexchange.com/a/669491/105447) works because of this, the page where the note was placed was stored, and then made available as \pnthepage at the place of printing.
  • On the technical side postnotes does not write the content of the notes to an external file, but stores it in variables. The .aux file is used, but only to store page references. So the usual issues stemming from writing and reading are circumvented.
  • Storing the notes in variables adds some flexibility, which is leveraged. For example, usually, an end note placed in a float may scramble the order of the notes. The numbering can be corrected by setting a manual mark. But the notes get printed out of order. With the set of notes available as variables, we can pre-process them and, for example, sort them. Which postnotes does. (Technically, enotez could also do it, but I don't think it does).

Other noteworthy features:

  • As enotez, postnotes also has full hyperref support, including backlinks.
  • The UI is mostly key=val, but not exclusively so. It is quite flexible, and indeed trades off some user friendliness for flexibility, as compared to enotez.
  • Better support for cross-references to end notes, with better syntax. You can set labels both to the note mark and to the note text (to my knowledge, postnotes is the only package to allow this). The syntax is in the form \postnote[label=en:mark]{\label{en:text}End note.}. Also, support for zref and zref-clever.
  • As enotez, there are facilities to automate the splitting of the notes by chapter/section. It may require a little more manual work than enotez but, in compensation, the UI is somewhat more flexible and capable of handling unnumbered sections.

Now, postnotes deliberately breaks some traditions, which may make it inadequate, or more cumbersome, to your needs.

  • \postnote does not obey the traditional syntax of \endnote in that its optional argument can receive a key=val set of options. So, to set a manual mark, you have to do \postnotes[mark=5]{End note.}. This means a couple of things, postnotes is not a drop in replacement for endnotes and other packages which followed its traditional syntax. Also, the common procedure of toggling footnotes with endnotes with \let\footnote\endnote cannot be done without adjustments.
  • postnotes does not offer \...mark and \...text variants to manually separate a note from its mark. There are other techniques to handle the common cases these would serve for (see the manual). But, again, it's not a drop in replacement.

Other packages

  • reledmac: Really huge one to cater for scholarly/critical editions which, among the many features it offers, has extensive support for end notes, including multiple series of them, and so on.
  • biblatex-chicago maintains cmsendnotes.sty, which is a version of endnotes modified to support hyperref (by means of a comp.text.tex answer by Ulrich Dirr) and its own noteref option, but which, as far as I can tell, can be used independently as well.
  • enotesj describes itself as providing "Japanese-style endnotes.", but I can't read the manual to tell you what this means.
  • Some rather specialized packages meant to do other things can also be used to generate end notes: parnotes and sepfootnotes.

Well... It appears I have been more partial than I had promised. I guess it's only natural that I can say a little more about what I did. I hope I haven't been unfair. ;-)

Still, all four alternatives for this purpose are very good ones (with the possible exception of the standalone pagenote, as discussed above). Check your requirements with what they offer, and if they suffice, you'll be well served. If you don't need hyperref, you may prefer the robustness and stability of endnotes. If you're using memoir, you'll find a well integrated and resourceful end notes infrastructure. If you need backlinks and more flexibility, enotez or postnotes will give you that. If you need running headers for the notes, then either postnotes or endnotes with endheads are the alternatives.

In your assessment of the packages, you seem to take "modern", "latest", or "last upgraded", to mean "best". That is frequently not the case with software in general and probably more so with LaTeX packages. Besides, when getting to know any particular package, you should take your time and at least go through its docs, before reaching your judgment and discarding them so quickly. I'm pretty confident that many, even if not all, of the problems you mentioned in your question for each of them are solvable.

About that particular end notes style you are striving to achieve, I also share the opinion vented in the comments that it's particularly hard on the reader. I've provided ways to achieve that style with pagenote and postnotes elsewhere (https://tex.stackexchange.com/a/669491/105447), but I'd personally not use it. It might be viable to achieve the same result with endnotes and enotez (for endnotes you might try https://tex.stackexchange.com/a/438715/105447).

PS: Regarding your comment:

but in the documentation there are no examples of how the results look like

that seems unfair, since the manual has no less than 7 usage examples.

As to:

Another (minor) drawback is that it doesn't honor babel automatically, as currently supported languages are only English, German, French, and Portuguese. (In reality starting the document with \documentclass[german]{book} \usepackage[german]{babel} doesn't make the headings of the notes German, so...)

it should follow babel's settings, as long as the language is supported (otherwise if falls back to English). If it really doesn't, you should report it. But I suspect that what may be happening is that german is a very recent contribution the package received, and you may be running an outdated version of it. And if you are lacking any other language you need, you are very welcome to contribute it, it is actually quite simple.

gusbrs
  • 13,740
  • To that seems unfair, I aplogize for not being clear, but I'm referring to the result that those 7 examples produce. Anyway, nothing I can't verify myself by copying your codes and pasting them in overleaf.com. Anyway, I suspect going for your package is probably a good idea. – Enlico Dec 24 '22 at 14:25
  • @Enlico Well, get the examples, and compile them with your favorite up to date TeX distribution... – gusbrs Dec 24 '22 at 15:09
  • 1
    @Enlico You could use https://texlive.net/run for this sort of thing (copy the example there, click update). At the moment, I'm not sure about Overleaf though, they have a strict update policy and postnotes is quite recent, I don't know if it has made the cut of their latest. – gusbrs Dec 24 '22 at 15:43
  • Apparently it works just fine :/ But thanks for the other solution, which I didn't know of. – Enlico Dec 24 '22 at 16:02
  • 2
    Only point that "modern" do not mean "best" in software already deserves the upvote. ;) – Fran Dec 29 '22 at 11:12
  • Sorry to ask this newbie question but is there an easy way to just move the footnote to endnote at the end of PDF. It seems all move to .aux file and if that is a must how to "print" or output that. – Dennis Ng Jul 13 '23 at 11:18
  • @DennisNg Indeed, this is not the best place to ask a different question. What you're asking was very likely already answered here on the site. So a little search should get you there. But, if you can't find it, I recommend you ask a new question. – gusbrs Jul 13 '23 at 18:05