Skip to main content
Inspiring
August 20, 2024
Answered

Endnotes to end of book and roundtrip enabled

  • August 20, 2024
  • 3 replies
  • 773 views

I found a script by Peter Kahrel that moves epub endnotes to the end of the book rather than the end of sections. It worked great but the link between the reference number and endnote was lost or corrupted. Is there a way to make them roundtrip enabled again? When I export as a reflowable epub, I get a message saying the notes are not anchored. Perhaps this is the solution?

This topic has been closed for replies.
Correct answer Peter Kahrel

This is what I meant by "round trip enabled"

 

Aha, ok. What you mean is 'return link'. The term roundtripping is used e.g. when you export a document to IDML, fix something there, and import the IDML. Then you say you roundtripped via IDML.

 

That was the simple bit. Now the other problem.

 

 I got the "text anchor not found" when exporting.

 

This is a terrible bug in InDesign. I wouldn't have expected it here. When you once generate a TOC with a script, then when you create the TOC with 'Make text anchor in source paragraph' enabled, they aren't so that you get the error you saw when you export to PDF. But in these documents the TOC was never created with a script (as far as I remember, anyway) so it's not really clear to me what's going on.

 

But even if you wouldn't have seen the error, these endnotes are a problem when exported to Epub (or PDF). The problem is that the real endnotes arestill in the chapters, on a non-printing layer. So there is no relation between the 'endnotes' in the back and the note references in the text.

 

Adding hyperlinks to navigate back and forth between notes and their references is problematic. In the text, the references are already hyperlinked by InDesign, they point to the notes in the chapter, but because they're on a non-printing layer those links appear dead in the Epub. So you can't add a link. And for some reason you can't create hyperlinks in the notes in the back of the book, maybe because you can't do that in general in TOC entries (which those notes really are). Export to PDF is much better, not only because you can do notes as pop-ups.

 

So on balance, if you want to export to Epub and if you want two-way links between notes and the references, the script on github should be your starting point. With that one it should be possible to add the links.

3 replies

Robert at ID-Tasker
Legend
August 20, 2024

@Cinewaze

 

Do you still have an old / good file - or only converted one and all "links" are broken?

 

CinewazeAuthor
Inspiring
August 21, 2024

Hi Robert. I've made that mistake one too many times. I copied the files to test the script. So yes I have the original file intact.

Robert at ID-Tasker
Legend
August 21, 2024
quote

Hi Robert. I've made that mistake one too many times. I copied the files to test the script. So yes I have the original file intact.


By @Cinewaze

 

That's great. 

 

So can you use script(s) mentioned by @Peter Kahrel or do you still need a solution?

 

Peter Kahrel
Community Expert
Community Expert
August 20, 2024

You probably mean this one:

https://github.com/AdobeInDesignScripts/adobe-community-scripts/tree/master/endnotes-to-end-of-book-notes

(I ask because there are some other scripts that do end-of-book notes.)

 

After you run the script there is no logical relation between the note references in the text and the notes at the end of the book. The references are static numbers. The script wasn't designed to deal specifically with epubs.

 

It's possible to create hyperlinks between note references and notes, but that requires a separate script.

 

Is there a way to make them roundtrip enabled again?

 

I'm not sure what you mean here. There's no roundtripping involved. The script is a one-off, it can't be undone.

 

P.

CinewazeAuthor
Inspiring
August 20, 2024

Hi Peter,

 

Yes, I did use the script from github. It was a quick and easy fix to get the endnotes to the end of the book. 

 

I also tried the script here using the sample files: Convert footnotes to end-of-book notes | Peter Kahrel (creativepro.com)

This is where I got the "text anchor not found" when exporting.  There were 9 instances for the 9 endnotes.  All of the reference numbers were displayed in the 'cross reference' window. In the book epub, clicking on the chapter heading in the endnotes page navigates back to the corresponding chapter. This is what I meant by "round trip enabled" (maybe I'm misusing the term).  I thought maybe I could anchor the missing text numbers, clicking on each endnote would navigate the reader back to the corresponding place in the book. I should note that I wasn't able to successfully use this script in my book. Only the sample docs included.

 

Aaron 

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
August 20, 2024

This is what I meant by "round trip enabled"

 

Aha, ok. What you mean is 'return link'. The term roundtripping is used e.g. when you export a document to IDML, fix something there, and import the IDML. Then you say you roundtripped via IDML.

 

That was the simple bit. Now the other problem.

 

 I got the "text anchor not found" when exporting.

 

This is a terrible bug in InDesign. I wouldn't have expected it here. When you once generate a TOC with a script, then when you create the TOC with 'Make text anchor in source paragraph' enabled, they aren't so that you get the error you saw when you export to PDF. But in these documents the TOC was never created with a script (as far as I remember, anyway) so it's not really clear to me what's going on.

 

But even if you wouldn't have seen the error, these endnotes are a problem when exported to Epub (or PDF). The problem is that the real endnotes arestill in the chapters, on a non-printing layer. So there is no relation between the 'endnotes' in the back and the note references in the text.

 

Adding hyperlinks to navigate back and forth between notes and their references is problematic. In the text, the references are already hyperlinked by InDesign, they point to the notes in the chapter, but because they're on a non-printing layer those links appear dead in the Epub. So you can't add a link. And for some reason you can't create hyperlinks in the notes in the back of the book, maybe because you can't do that in general in TOC entries (which those notes really are). Export to PDF is much better, not only because you can do notes as pop-ups.

 

So on balance, if you want to export to Epub and if you want two-way links between notes and the references, the script on github should be your starting point. With that one it should be possible to add the links.

m1b
Community Expert
Community Expert
August 20, 2024

(I'll tag @Peter Kahrel on the off chance that he has time to give some feedback.)