Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2014, 03:31 AM   #1
Kamikuza
Enthusiast
Kamikuza began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
Inline footnotes - solved?

Stumbled across this on a book I updated to epub... and finally got it sorted today.

using sigil to edit the epub, and KindlePreview to convert to .mobi

The trick seems to be:
1. have a file called "footnotes.xhtml" (but I don't know if you can get away with just .htm or .html and I can't be bothered testing... and I'm not even sure if the name "footnotes" is vital )
2. have a link in your text (duh)

and finally, the key to getting it displayed nicely...
3. start each footnote with a link, with something in the link!*

So-ooo... here's how I like to do it...

Code:
chapter01.xhtml...
<p>It was a dark and stormy night<a href="../Text/footnotes.xhtml#fn01" id="ft01**">[1]</a> but that was just the beginning<a href="../Text_footnotes.xhtml#fn02" id="ft02">[2]</a>.</p>

and then

footnotes.xhtml...
<p><a href="../Text/chapter01.xhtml#ft01">^</a> It's always a dark and stormy night.</p>
<p><a href="../Text/chapter01.xhtml#ft02">^</a> Actually, it's the end.</p>
You'll get everything in the pop-up from each <a... to the next <a. e.g.
Code:
^ It's always a dark and stormy night.
I use the carat (^) for style but you should have something to click, in the event the device doesn't support pop-ups and as I said you gotta have something in the link.

* If you DON'T put a character in the link in the footnotes page e.g. <a href="BLAH"></a> you will NOT get a pop-up but WILL got straight to the footnotes page link... could be useful if you want to skip the pop-up...
** Seems like you can put the "id" in either the anchor tag <p> or the <a>...

I like to use ordered lists for the footnotes, so you get nice numbering and layout and yet, the pop-up is clean. Shame about needing a character in the link though... especially if you like to add "Click here to return to text" or something, cos that'll look sucky.

Well, FWIW - I hope it helps someone!
Kamikuza is offline   Reply With Quote
Old 01-10-2014, 04:21 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 63,376
Karma: 41542799
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
This belongs in the Kindle BOOK FORMAT forum, not the Kindle DEVICE forum. Moved.
HarryT is offline   Reply With Quote
 
Enthusiast
Old 01-10-2014, 06:03 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,007
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Why would one never have some sort of character(s) between the <a> tags of a footnote link? With or without inline popups? Can you even click/tap/follow a link with no text?

Last edited by DiapDealer; 01-10-2014 at 06:05 AM.
DiapDealer is offline   Reply With Quote
Old 01-10-2014, 06:28 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 63,376
Karma: 41542799
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by DiapDealer View Post
Why would one never have some sort of character(s) between the <a> tags of a footnote link?
Perhaps if you're just using it as a marker for a point to jump to?

Eg, mark your footnote with:

<a name=footnote_1></a<

then, elsewhere,

<a href=footnote_1>Footnote 1</a>
HarryT is offline   Reply With Quote
Old 01-10-2014, 07:20 AM   #5
Kamikuza
Enthusiast
Kamikuza began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
Some books use them as page numbers e.g. <a id="p123"></a> which is handy for a functioning index... and it shuts down the pop-up, if you want to style it that way.

Seems the pop-up breaks the text at every looped <a> only... Just having a link won't do it.

I'm trying to figure out if you can use an empty link & loop to slip subheadings into the footnotes, but KP keeps crashing

Oh and, & or &amp; breaks the pop-up text... get an error message in the pop-up box.
Kamikuza is offline   Reply With Quote
Old 01-10-2014, 07:58 AM   #6
Kamikuza
Enthusiast
Kamikuza began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
Me for the win! Only took all evening :/

Yes, you can use empty <a></a> links to get headings in the footnotes.xhtml so they won't show up in the pop-up text.
Kamikuza is offline   Reply With Quote
Old 01-10-2014, 08:23 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,007
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yes. I understand empty tags for an anchor or perhaps an index entry. I just don't understand it with regard to a link designed to take you to--or pop up--a foot|end-note reference. Of course that needs some sort of character(s) between the <a> tags. They always have. You can't go anywhere or pop anything up without link text. There'd be nothing to "click" on in the text.

It seems to me that it would be hard to NOT make inline pop-up references work (on the Kindles that support them) as long as you use the (relatively) standard way footnote links are always constructed.
DiapDealer is offline   Reply With Quote
Old 01-10-2014, 08:44 AM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 63,376
Karma: 41542799
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by DiapDealer View Post
Yes. I understand empty tags for an anchor or perhaps an index entry. I just don't understand it with regard to a link designed to take you to--or pop up--a foot|end-note reference. Of course that needs some sort of character(s) between the <a> tags. They always have. You can't go anywhere or pop anything up without link text. There'd be nothing to "click" on in the text.
I think the OP is saying that the ANCHOR has to contain text in order to make pop-ups work, not the link.
HarryT is offline   Reply With Quote
Old 01-10-2014, 09:05 AM   #9
Kamikuza
Enthusiast
Kamikuza began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
It's "gaming the system" for how the inline/pop-up footnotes work on the PW2, so you can slip in headings in the footnotes.xhtml without messing up the contents of the pop-up box. You don't have to do it of course, but the way the Kindle seems to get the info for the pop is from <a> to <a> with links that complete a loop.

The regular loop - with visible links of say, [1] to ^ and back - of course works the way we want: pop-up in PW2 and (probably) just a regular link in Keyboard or iBooks or something.

Empty links can be used to hide text in the pop-up, without having nasty underlines - completing a loop, so the pop-up hides the text, but the links are invisible to the person reading.

If you want to do the following in a footnotes.xhtml:
Code:
Chapter 1 A dark and Stormy Night
1. ^ It's always a dark and stormy night.
2. ^ Actually, it's the end.

Chapter 2 Resurrection Joe
1. ^ He was quite smelly.
... then, in the text, when you tap the [2] link in chapter 1, the pop-up will show:

Code:
^ Actually, it's the end.

Chapter 2 Ressurection Joe
1.
Which is annoying. Adding the empty links will fool the system and NOT show the heading text.

Of course, you could add an emptily link in the footnotes so you could do without the ^ but I think you'd break the functionality in a non-PW2 device...

Does that make sense?

Last edited by Kamikuza; 01-10-2014 at 09:12 AM.
Kamikuza is offline   Reply With Quote
Old 01-10-2014, 09:42 AM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,007
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm just not following.
I guess I'll just have to get a new PW to play along.
DiapDealer is offline   Reply With Quote
Old 01-10-2014, 10:52 AM   #11
Kamikuza
Enthusiast
Kamikuza began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
I'll have one last crack at it

When you tap a link that points to footnotes.xhtml, you get a pop-up window on the screen.

The text that's grabbed by the Kindle for the pop-up is from the footnotes file... from link to link. Using the "regular" footnotes link and back-linking (that I probably learned off here!) works just fine.

But if you add headings to the footnotes folder, the pop-up blindly grabs them too, if they appear between links. If you want to exclude the headings, then you have to add the empty <a> links to fool the software into hiding the "overlap" of the heading in the pop-up window.

from the footnotes.xhtml...
<p><a href="../Text/ch01.xhtml#ft01" id="fn01">^</a> My first footnote</p>
<p>
<a href="../Text/ch01.xhtml#ft02" id="fn02">^</a> The second footnote</p>
<p>*Chapter 2's Footnotes</p>
<p>
<a href="../Text/ch02.xhtml#ft03" id="fn03">^</a> Chp2's footie</p>

So for the first footnote, it'll grab all the text in the orange. Fine.
For the second, all the red text... including the heading you don't want. Adding the ghost link at * forces the pop-up window to break there, and the chapter 2's first footnote then starts over at <a id="fn03">...

Better explanation?
Kamikuza is offline   Reply With Quote
Old 01-10-2014, 11:25 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,007
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Ah. OK. I think I have it now. Thanks.

I've never used any type of headings (or ordered lists) in my endnotes files, so I probably never would have run up against this.

Mine would only ever look like this:
Code:
<p class=fn_para><a href="../Text/ch01.xhtml#ft01" id="fn01">[1]</a> My first footnote</p>
<p class=fn_para><a href="../Text/ch01.xhtml#ft02" id="fn02">[2]</a> The second footnote</p>
<p class=fn_para><a href="../Text/ch02.xhtml#ft03" id="fn03">[3]</a> Chp2's footie</p>
Good to know there's workarounds just in case, though.

Have you checked to see if all of this (including ordered lists for the footnotes page) degrades gracefully at all on devices that don't support the KF8 format? I suspect it wouldn't look pretty at all on my Kindle 2.
DiapDealer is offline   Reply With Quote
Old 01-10-2014, 11:35 AM   #13
susan_cassidy
Wizard
susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.
 
Posts: 1,877
Karma: 1698650
Join Date: Jan 2009
Device: Kindle, iPad (not used much for reading)
Why would you have a heading in the footnotes file, anyway? Doesn't the heading belong in the main text?
susan_cassidy is offline   Reply With Quote
Old 01-10-2014, 02:51 PM   #14
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 63,376
Karma: 41542799
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
When you have a book with a lot of endnotes, it's very common to have headings in the endnotes indicating which chapter of the book those notes refer to.

Eg,

Chapter 1

Note 1
Note 2
Note 3

Chapter 2

Note 1

Etc.

It makes it a lot easier to find your way around if you're browsing through the notes. Very common in the "Penguin Classics" series, for example, which typically has many notes in each chapter.
HarryT is offline   Reply With Quote
Old 01-11-2014, 05:31 AM   #15
Kamikuza
Enthusiast
Kamikuza began at the beginning.
 
Posts: 31
Karma: 10
Join Date: May 2011
Location: Japan
Device: Kindle3
They're just regular footnote links; the pop-up is a bonus on the PW2.

I like to reformat my epubs so they look more like the print books also only convert to .mobi with KindlePreview cos I like it better than Calibre for some reason I forget but was vital at the time...
Kamikuza is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Footnotes odedta Calibre 0 12-24-2013 12:42 PM
Inline Styles and Overrides ukzembla Kindle Formats 2 01-18-2012 07:06 AM
Word Macro: Footnotes to inline text ? Hadrien Workshop 17 10-08-2011 01:28 PM
inline text to footnote Ciprian Workshop 0 06-27-2011 04:13 AM
350/650 footnotes -- solved SeaBookGuy Sony Reader 5 10-30-2010 12:47 PM


All times are GMT -4. The time now is 01:29 AM.


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