End-of-book notes

In a book, endnotes can be placed at the end of their chapters or they can be placed in a separate section at the end of the book. In the latter case we speak of 'end-of-book' notes. If all the chapters are in a single file – and each chapter is in a separate story – then end-of-book notes can be handled by InDesign's endnotes. However, for various reasons many (if not most) typesetters prefer to keep chapters in separate documents and collate them in a book file.

Out of the box, InDesign can't handle end-of-book notes when the chapters are in separate files. But a workflow can be set up to handle them with ease. I'll use a sample book, linked below, to illustrate how it works.

(There is an another approach to handle end-of-book notes, which I now think is not as good; see here.)

The basics

The basic idea is to convert InDesign's endnotes to anchored text frames, and use InDesign's table of contents to generate the endnotes section. We'll see that this approach gives us some interesting functionality for free, though at the same time it creates a couple of problems. These can be worked around, though, as we'll see later. We'll begin with a straightforward example.

A quick tour

Extract the script eobn-convert-notes-to-frames.jsx from the end-of-book-scripts.zip archive and place it in InDesign's Scripts folder. Then extract the files from the book.zip archive into a new folder.

Open the ch-01.indd file. You'll see that it contains a few standard InDesign endnotes. Run eobn-convert-notes-to-frames.jsx. The script converts the document's endnotes to anchored text frames. In the process the script creates various styles and some other items; we'll describe all these things in more detail below.

Save ch-01.indd, then open ch-02.indd and run the note converter again and save the document. (In the real world you may have a lot of documents to convert, in which case it makes sense to use a batch processor; see, for example, here.)

Now open the book file, book.indb, and add the two documents you converted. Then add the endnote document, ch-90-notes.indd, into which you'll generate the notes:

Endnotes book panel

Select the text frame on the first page, then update the TOC (Layout > Update Table of Contents). I set up a TOC style and generated the TOC earlier to make this quick tour easier. Again, details will be discussed later.

You should now see the end notes in the document:

Endnotes generated

And there you are, that's basically all there's to it.

Naturally, the page numbers in the endnotes (shown in red) should be hidden, I left them exposed here for illustration. They can be hidden by changing the character style Note page number: point size 0.1, horizontal scale 1%, fill colour Paper.

The page numbers are used by the running headers, which were set up to use some running-header type text variables. You can see that when you reduce the endnote text frame's height so that the text flows to the second page, the running headers are updated automatically.

Updating notes

To delete a note, simply delete the note's frame and the reference (which is an InDesign cross-reference). You'll need to update the cross-references to fix the numbering in the text:

End-of-book notes update cross-reference

Here, note 2 was deleted.

To add a note, place the cursor at the insertion point where the new note's reference should go. Then run the script eobn-add-endnote.jsx, which adds a new note frame. Enter the note's text in the frame. The notes's reference is updated automatically.

Fixing note numbers

If for whatever reason you want to get rid of the note cross-references, simply delete them in the usual way: select all the text and select delete Cross-reference in the fly-out menu of the Cross-References panel.

Drawbacks

The approach outlined here works well, but you should be aware that not everything in the original endnotes makes it to the generated endnote section. All formatting is preserved, and all anchored elements are preserved as well. But several of InDesign's special markers are removed: index markers, cross-references, footnotes (not relevant in this context), hyperlinks – I haven't checked them all, there may be more. Here, I'll deal only with index markers.

Index

The only real problem I see with the approach outlined here is that index markers are dropped when the endnote section is generated as a TOC. But with two scripts we can work around that. To see how this works, extract these three scripts from the end-of-book-scripts.zip archive and place them in InDesign's Scripts folder:

eobn-index-markers-to-dummies.jsx
eobn-dummies-to-index-markers.jsx
eobn-index-merge-notes.jsx

Run eobn-index-markers-to-dummies.jsx against any document that contains footnotes with index markers (here, ch-01 and ch-02). Save the documents. Then update the note section by updating the TOC in ch-90-notes. Finally, run eobn-dummies-to-index-markers.jsx in the notes (later on we'll explain what happens).

Now add the index document (ch-99-index.indd) to the book and open it. Generate the index in the usual way – please don't change anything in the Generate Index dialog. (The index is in fact updated, I generated it and removed it.) The generated index looks as follows:

End-of-book notes index

The blue backslashes are InDesign's End Nested Style characters. If there's only one in an entry, it was inserted when the index was created (it was set as the Following Topic character in the Generate Index dialog). That is the case in the first entry, Aqui\1, 2.

When an entry contains two End Nested Style characters, as in the second entry, Aqui\2\7, the second one was again inserted when the index was generated, while the first one was inserted when eobn-dummies-to-index-markers.jsx was run. The number following the first of two End Nested Style characters is the note number: Aqui\2\7 stands for 'Aqui in note 2 on page 7'. It follows that in this case the topic's name is in fact Aqui\2 and that therefore references to the main text and those to notes are on separate lines.

This means that we now have to merge them. While we're doing that we'll keep the information about note numbers. Run the eobn-index-merge-notes.jsx script against the index; the result in our example is as follows:

End-of-book notes index merged

Now the references to notes are marked as such.

All that's left for you to do is to replace the remaining End Nested Style characters with the character or string you need as the topic separator.

If you add an index marker to a note, you'll have to run the eobn-index-markers-to-dummies.jsx again, update the TOC in the notes document, and run eobn-dummies-to-index-markers.jsx. Note that it's necessary to run these two scripts only if any markers were added to any notes. When you add markers to the main text, running the two scripts again isn't necessary.

Dependencies and prerequisites

There's really only one prerequisite: the endnotes and the endnote references should be styled with dedicated paragraph and character styles. The script uses these two styles for various new objects, and takes them from the Endnote Options dialog:

End-of-book notes endnote options dialog

Some details

The script creates an object style for the note frames, a numbered style list for the endnote paragraphs, and a cross-reference format. These are all named after the paragraph style set in the Endnote Options window.

Index markers in notes are transferred to the note section using small, zero-width, graphic lines. The properties of each index marker is set as the line's name (you can inspect these in the Layers panel after running eobn-index-markers-to-dummies.jsx). When the note section is updated (by updating the TOC), the index markers themselves have disappeared, but the graphic lines are present. The script eobn-dummies-to-index-markers.jsx recreates the index markers (and deletes the lines).


Version history

10 July 2023: Posted.


Useful script? Saved you lots of time?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

Click to download the InDesign files

Click to download the scripts


Back to script index

Installing and running scripts

Questions, comments? Get in touch