View Full Version : Links and anchors question


holdit
02-13-2013, 01:05 PM
I'm working on an epub trying to link footnotes at the end of a chapter to the place in the chapter where the footnote is mentioned.

Here is what a working link looks like:

actual footnote <a href="#chapt1fn2" id="chapt1fn2x">[2]</a>

footnote in paragraph <a href="#chapt1fn2x">[2]</a>

this works fine , clicking one takes you to the anchored part and clicking the anchored part takes you to the footnote.

I did 4 of these but when I tried to do the fifth the footnote will only link to the anchor AND NOT back to the footnote.




actual footnote <a href="#chapt1fn26" id="chapt1fn26x">[26]</a>

footnote in paragraph <a href="#chapt1fn26x">[26]</a>

I cannot figure out why the first 4 work and everyone after that does not.

Anyone?

jersysman
02-13-2013, 07:18 PM
If this was in the Epub section, you might get better responses. Have a mod move it there.

GrannyGrump
02-13-2013, 11:57 PM
I try to include the complete filename in the link (href), even when the endnote is in the same file as the source paragraph. It seems to prevent the kind of troubles you are having, though I don't know why it should be necessary.

Jellby
02-14-2013, 04:17 AM
Where are you trying that? All programs have bugs, you may have hit one. Have you tried following this link first after opening the program or turning on your reader?

Did you validate the ePub or source file? A problem elsewhere might be causing this.

Toxaris
02-14-2013, 04:56 AM
I would use the following:

actual footnote <a href="../Text/<HMTL filename>#chapt1fn2" id="chapt1fn2x">[2]</a>

footnote in paragraph <a href="../Text/<HMTL filename>#chapt1fn2x" id="chapt1fn2">[2]</a>

This is what I use and it works fine.

Turtle91
02-14-2013, 07:51 AM
I did 4 of these but when I tried to do the fifth the footnote will only link to the anchor AND NOT back to the footnote.


actual footnote <a href="#chapt1fn26" id="chapt1fn26x">[26]</a>

footnote in paragraph <a href="#chapt1fn26x">[26]</a>

I cannot figure out why the first 4 work and everyone after that does not.

Anyone?

You need to have an id in the paragraph as well for it to link back.

actual footnote
<a href="#chapt1fn26" id="chapt1fn26x">[26]</a>

footnote in paragraph
<a href="#chapt1fn26x" id="chapt1fn26">[26]</a>

Toxaris
02-14-2013, 04:40 PM
That's what I said...

Turtle91
02-14-2013, 09:32 PM
That's what I said...

Yes you did! I just thought it was worth clarifying that the OP's issue was an ID issue, not a full reference issue.

If I may ask, why do you use a full reference for an internal link?

Toxaris
02-15-2013, 03:16 AM
Well, since I sometimes have the notes at the end of an chapter and sometimes as a seperate file (depends on the number and type of notes). By using full links I don't have to think about it. It is more to be complete, although not always necessary.

DiapDealer
02-15-2013, 08:17 AM
Using the full, relative reference also makes it less likely that converters, editors, file-splitters/renamers, etc... might barf on it or otherwise not properly handle a "#chapt1fn26x"-type url. Burn me once....

Turtle91
02-15-2013, 03:28 PM
That makes sense. Thanks!