Dynamic endnotes (CS4 and later)

Two scripts here. The first script, end_to_end.jsx, converts static endnotes to dynamic endnotes (MS Word's dynamic endnotes are placed in Indesign as static endnotes). The second one, foot_to_end.jsx, converts footnotes in an InDesign document to endnotes.

The scripts implement a method outlined by Peter Gold (in InDesign's user-to-user forum) and described in detail by Bob Bringhurst (see his blog; see also IndesignSecrets.com). The method is simple: create a paragraph style for the endnotes and enable numbering in it; create a character style that sets the format for the note references; and add a cross-reference format that defines just a paragraph's number. Then at the location of the note reference, create a cross-reference to the endnote.

The method outlined by Peter Gold is simple and elegant, but labour-intensive if you want to convert all footnotes in a document to dynamic endnotes, or when you've placed in InDesign an MS Word document that contains a lot of endnotes which you want to convert to dynamic endnotes. The scripts make this task easy.

Note that this cross-reference trick can be used to overcome other shortcomings of InDesign, namely, its inability to add notes to tables and its lack of support for margin notes (or "sidenotes"). Table notes can be implemented in the same way as outlined by Bob Bringhurst and scripted using the scripts on this page. Margin notes, though the approach is in effect the same, require a different scripting approach. These scripts are illustrated here.

Imported (static) endnotes to dynamic endnotes

MS Word has dynamic footnotes and dynamic endnotes; InDesign has just dynamic footnotes. When you place a Word document with endnotes in InDesign, Word's dynamic endnotes are therefore converted to static endnotes. This means that if you add or remove notes, you have to change note numbers and references manually.

The first script described here converts the static endnotes to dynamic ones, so that footnote references can be updated automatically after adding and deleting footnotes.

Use

Before you run the script, make sure that the endnote paragraph style has been applied to all endnotes. Then run the script.

The script shows a dialog with two dropdowns, one with the character styles defined in the active document, the other with the document's paragraph styles. If the script finds the MS Word style names Endnote text (a paragraph style) and Endnote Reference (a character style) in the document, these names (or a localised version) are preselected in the dialog:

Dynamic endnotes

If the script can't find any standard name, select the style names used in the document for the endnote text and the references. To run the script, press Enter/Return or click OK.

Some details

The script converts static endnotes to dynamic endnotes by applying the method outlined by Peter Gold, mentioned earlier. It works as follows:

  1. It removes phantom note references. In placed Word documents you often find the character style for note references applied to white space. These must be removed, otherwise the script gets confused.
  2. It checks that there are as many endnote references as there are endnotes. If the check fails, the script will tell you how many references and how many notes it sees.
  3. It adds a paragraph style Endnote Text_numbered, based on the Endnote Text style, and adds paragraph numbering. It applies this style to each paragraph that has the paragraph style Endnote Text applied to it and that starts with a number.
  4. The script adds a cross-reference format endnote.
  5. It creates cross-references by linking the endnote references and the endnotes.
  6. Finally, it removes the original, imported, note numbers.

Adding and deleting notes

To add an endnote, enter the endnote's text in its correct position in the endnote section, then add a cross-reference at the place where the note reference should be. Here's a detailed description.

Suppose you have this situation: a text with two endnotes which have been converted by the script:

add dynamic endnote

To add a note after the first one, go to the end of the first note and press Enter/Return. This creates a new paragraph -- the number is added automatically and the numbering of any following notes is adjusted automatically.

Now you need to create a reference to the new note. Place the cursor where the reference should be added and display the Cross-References panel (it's really the Hyperlinks panel, but no matter): Window > Type & Tables > Cross-References. You'll see the references to the two original notes in the panel, with the references whose notes numbers that were changed automatically marked with a yellow triangle to alert you that the number in the numbered paragraph (i.e. the note) has been changed but that the reference still needs to be updated. We'll do that later. (In the screenshot, the "2" marked with the triangle is the old 2, so to speak, the note reference after Tigger, which now points to note number 3.)

add dynamic endnote

With the cursor placed where the new reference needs to be placed (after Piglet), click the New Cross-Reference symbol (circled red). This shows the New Cross-Reference dialog.

Note: Make sure that the Link To dropdown has Paragraph selected (it's the default but check it anyway) and that the Document dropdown shows the active document (you could add cross-references to other documents if they're open).

In the dialog you see two windows in the Destination panel: the one on the left shows all paragraph styles in the document, the window on the right shows the contents of all paragraphs with the style selected in the windowon the left. So select the paragraph style used for the notes, then, in the window on the right, select the paragraph (i.e. the note) which you want to add a reference to. Then at Cross-Reference Format choose the reference format used in the document (endnote) and set the Appearance Type to Invisible Triangle.

add dynamic note -- cross-reference dialog

Click OK to add the new reference and you'll be returned to the text, which will now look as follows:

add dynamic endnote

As you can see, the references haven't been updated yet, you need to do that now. Select the line with the yellow warning triangle and click the Update symbol (circled red in the screenshot).

Deleting a note

To delete a note, simply delete both the note reference and the text, then update the references in the panel. Note: do not delete the reference using the trash can symbol, as this would leave the reference as plain text.


Click to show script -- to download, right click, then Save Link/Target As


(Re)setting note numbers

To reset the note numbers, select the note where you want to restart the numbering. Then open the paragraph panel (Type > Paragraph) and show the flyout:

reset endnote numbering paragraph panel

To reset numbering to 1, click Restart Numbering. To start numbering at any other number, choose Bullets and Numbering to display In the Bullets and Numbering dialog. In that dialog, pick Start At in the Mode dropdown and set the start number in the box next to the dropdown. Click OK to return to the document.

The notes are renumbered now, but the references need to be updated. You do this as described above for updating the references after adding a note: display the Cross-references panel (Window > Type & Tables > Cross-References), select an out-of-date cross-reference (marked by a yellow triangle), and update the references by pressing the cross-reference update symbol symbol in the panel.

To make life a bit easier, the endnotes_renumber.jsx script prompts you to enter a new start number for the notes, enters that, and updates the references. Place the cursor somewhere in the endnote where you want to start renumbering and run the script. Enter the new start number and press Return/Enter.

Renumber endnotes script


Click to show script -- to download, right click, then Save Link/Target As


Convert footnotes to endnotes

The script converts InDesign footnotes to endnotes. It adds some rudimentary styles to the document: a paragraph style for the endnotes, a character style for the note references, and a cross-reference format -- you need to fine-tune them later. The styles are called endnote___ by default; if you want to change that you need to change that in the script at line 7.

Use

Open the document that contains the footnotes you want to convert, then run the script. It has no interface.


Click to show script -- to download, right click, then Save Link/Target As


Back to script index

Installing and running scripts

Questions, comments? Get in touch