Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2013, 04:02 PM   #1
MHC
Member
MHC began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2012
Location: Northeast US
Device: iPad 2, old Kindle
Internal links not working after Packaging (copying) indb file

I have an InDesign CS6 Book (indb) file with 300+ manually created internal hyperlinks to/from endnotes. The endnotes worked fine until I used the Package for Print function to make a copy of everything.

The original indb file was drawing on indd files scattered in different locations and I needed them all in one place to avoid confusion and for backup purposes. So I Packaged them - all files have retained the same name, but I have made extensive edits to them.

Now my internal endnote links don't work. I was thinking the path name could be wrong because of the new location of my file, but I unzipped the ePub and the html reveals that the path is completely missing. On my new file, the endnote link will have, say, <a id="x18" /> in the correct spot, but no href code at all. The working file includes the href after it, ie: <a id="x18" /></span><a href="Endnotes.xhtml#x18">

Is there a way to make my new file work properly without re-doing the hyperlinks? The filenames for the old and new files are identical, BTW.
MHC is offline   Reply With Quote
Old 03-06-2013, 04:25 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by MHC View Post
Now my internal endnote links don't work. I was thinking the path name could be wrong because of the new location of my file, but I unzipped the ePub and the html reveals that the path is completely missing. On my new file, the endnote link will have, say, <a id="x18" /> in the correct spot, but no href code at all. The working file includes the href after it, ie: <a id="x18" /></span><a href="Endnotes.xhtml#x18">

Is there a way to make my new file work properly without re-doing the hyperlinks? The filenames for the old and new files are identical, BTW.
Actually, there is a rather easy way to fix this. Load all the XML files into Notepad++ and do the following search/replace using Regular Expression...

Search for: <a id="(.*)" />
Reaplace with: <a id="\1" /></span><a herf="Endnotes.xhtml#\1">

Then click Replace ALL in All Opened Documents.

Problem solved.
JSWolf is offline   Reply With Quote
Advert
Old 03-07-2013, 12:33 AM   #3
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Careful, there -- that pattern will also replace the anchor links in the Endnotes, so they will link back to themselves, I think.

Don't you need one pattern to fix the link that goes from the paragraph TO the endnote, and another pattern to fix the link that goes from the endnote BACK to the source paragraph?

Last edited by GrannyGrump; 03-07-2013 at 01:01 AM.
GrannyGrump is offline   Reply With Quote
Old 03-07-2013, 09:33 AM   #4
MHC
Member
MHC began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2012
Location: Northeast US
Device: iPad 2, old Kindle
I appreciate the script and may try it if needed, but can anyone shed light on why this is happening? I'd like to be able to re-export my ePub from InDesign and have the endnotes link properly.
MHC is offline   Reply With Quote
Old 03-07-2013, 11:15 AM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by grannyGrumpy View Post
Careful, there -- that pattern will also replace the anchor links in the Endnotes, so they will link back to themselves, I think.

Don't you need one pattern to fix the link that goes from the paragraph TO the endnote, and another pattern to fix the link that goes from the endnote BACK to the source paragraph?
If the regex I posted will modified the endnotes so they are not correct, just don't load the endnotes file into Notepad++ and let it do its work on the rest of the XML files.

But given that the endnotes will be referring back to different files, I think the endnotes may have to be edited by hand.
JSWolf is offline   Reply With Quote
Advert
Old 03-08-2013, 01:48 AM   #6
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Being a lazy typist, I made an AutoHotkey script to handle that kind of manual editing. It pops up a little input box, where I type in the unique ID number, and the script types the anchor tags, including the ID, then brings up the search window with the Find pattern already there, I just have to hit Enter to go to the next instance, then hit my single hotkey, and type in the next ID number, and rinse, lather, repeat til done.

AutoHotkey is excellent for entering repetitive text, and saves lots of time.
GrannyGrump is offline   Reply With Quote
Old 03-09-2013, 01:50 PM   #7
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Also, unless you're talking about an EMP weapon, I think you meant href.
dgatwood is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal Links best Practices Jamestoo ePub 2 02-26-2012 11:26 AM
Links to URLs work, internal links don't? NewDay ePub 36 10-27-2010 04:09 AM
internal links and chapter division .mau. Sigil 23 07-28-2010 04:01 PM
Internal Links??? Guns4Hire PocketBook 11 04-18-2010 02:25 AM
I/O Errors copying from internal memory Gafry Bookeen 17 12-06-2007 02:49 PM


All times are GMT -4. The time now is 08:27 PM.


MobileRead.com is a privately owned, operated and funded community.