06-27-2022, 04:18 PM | #1 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Footnotes: Best Practices?
I'm not sure where to post this question. But, since I was in the Calibre Editor when I messed things up, I figured this forum might be acceptable.
Anyway, I managed to destroy the footnote links in an epub and thought it wouldn't be a problem to re-create them. Unfortunately, I can't seem to figure it out. From what I can see, roughly speaking, the book puts the footnote text down at the bottom of the chapter/file, prefaces it with a paragraph id and a link back to the place in the text where it's called. With most of the extraneous stuff stripped out, that footnote text looks like: Code:
<p id="footnoteid"><a href="#returnfootnoteid"><sup>*</sup></a>the note</p> Code:
<a id="returnfootnoteid" href="footnoteid"><sup>*</sup></a> https://www.w3.org/MarkUp/html3/footnotes.html which uses an <fn> element to do the same thing and doesn't have a return function. The equivalent of the above is: Code:
<fn id="footnoteid"><sup>*</sup>the note</fn> Code:
<a href="#footnoteid"><sup>*</sup></a> https://stackoverflow.com/questions/...otnote-in-html And some references to even more ways that seem to require epub3 which I can't even understand: https://github.com/kobolabs/epub-spe...kobo-platforms and https://www.w3.org/publishing/epub3/...type-attribute But, for Calibre and my Kobo Forma, what would be the best way to do footnotes? Note that the footnote behavior is different in Calibre's Viewer between the <fn> element version and the supposed original way the book did it (the <fn> "window" seems to show the whole screen from the footnote text up, while the "original" way seems to just show the footnote text. |
06-27-2022, 07:03 PM | #2 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
After trying various ways of footnoting, I ran EPUBCheck against the epub. It didn't like any of the <fn> elements: "...element "fn" not allowed anywhere...."
So, I'll be changing those out for the original type of footnote. |
Advert | |
|
06-27-2022, 11:02 PM | #3 | |
Wizard
Posts: 1,203
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
I think we are using html5. As for how to fix the footnotes, I'll leave that for the guru's in the forum |
|
06-28-2022, 08:46 AM | #4 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
I didn't even notice that html3 bit of the URL. Thanks. That explains why I couldn't find anything else on using <fn> elements for it. I found oodles of people complaining about the lack of an easy, one-stop footnote capability in HTML, but it doesn't seem to have been implemented.
|
06-28-2022, 05:33 PM | #5 |
Wizard
Posts: 1,203
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
I tend to add my footnotes in the flow of the text, usually directly after the paragraph that requires the footnote. I know, I'll probably be laughed off the forum for doing it this way, but it works for me, and I don't need to be jumping around my novel trying to read references. Plus, general fiction novels that require footnotes are an exception, rather than normal, and there aren't many of them.
But no reason you couldn't place the footnotes elsewhere using the same code. For the example in the image, this is how I code it... PHP Code:
PHP Code:
|
Advert | |
|
06-28-2022, 10:01 PM | #6 | |
Evangelist
Posts: 408
Karma: 1851162
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
Quote:
But for the odd short footnote in fiction, I really like your approach! I've recently done a few almost like this, but without even coding the <a and <href -- I just stuffed it in after the paragraph. There were, I think, two short footnotes in the whole book. On paper, you would just glance down at the bottom of the page. So sticking it below the paragraph in an epub worked pretty much the same. Next one I run into, I'll try coding it it your way. No laughter at all. |
|
06-29-2022, 12:40 AM | #7 | |
Wizard
Posts: 1,203
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Sometimes trying to click on those tiny links with my sausage fingers causes me to call up the dictionary, highlighting, context menu... everything but the footnote, then when I eventually jump to the footnote, I realise it was nothing worth reading and have lost the flow of reading. Having it right there as shown in the image, I can quickly glance/read the footnote without fuss and then continue reading without lifting a finger And it does in a small way replicate the pbook treatment of having the footnote at the bottom of the current page. My CSS if it helps anybody... Spoiler:
|
|
06-29-2022, 09:54 AM | #8 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
It's interesting how changes in book delivery can change book structures. With a dead-tree book, having the footnotes at the foot of the page is really nice. I used to complain about books with endnotes where they were at the back of the book. With an ebook, having endnotes is less distracting than footnotes (as retiredbiker said). But, especially for fiction (few footnotes), I like your solution. And, if I'm going to be messing with the book's code anyway, I might as well put the footnotes where I want them.
EDIT: Also, I like the structure of your actual footnote links. In mine, the <a... parts are structurally different from each other at source/destination. By keeping the id= part in the <a part at both places (as you do), it makes it easier to change the id= and href= points (by moving the appended "a" in each around). Last edited by enuddleyarbl; 06-29-2022 at 10:05 AM. |
07-06-2022, 03:18 PM | #9 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
So far, the CSS/HTML structure talked about above has been working fine for me. But, I'm playing around with the formatting of a book (Brandon Sanderson's "Warbreaker") and every chapter has a link to a "footnote" chapter about that chapter. So far, that link acts simply as a link. I can't force it to act like a footnote and bring up the pop-up footnote window in either Calibre or on my Kobo Forma. I've reformatted his links to follow the same structure as what we talked about above. But, no joy. I've even tried using an <aside> type of thing (again, no good).
My guess is the "footnotes" are just too big for the pop-up window to handle, so it reverts to just linking. Does anyone know how to force a link to come up in a pop-up windows like regular footnotes? |
07-06-2022, 07:00 PM | #10 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
In terms of what was discussed here (on_page footnotes in a pop-up), it looks like I've got things working with <aside> (epub3 only). I found a post that led me to:
Code:
<p><a href="file#mynote" epub:type="noteref">footnotesymbol</a></p><aside id="mynote" epub:type="footnote">footnotetext</aside> Code:
<p class="annotations"><a href="acknowledgements.html#mynote" epub:type="noteref">Annotations</a></p><aside id="mynote" epub:type="footnote" class="footnote"><p>blahblahblahblahblah</aside> Code:
<p class="annotations"> <a href="acknowledgements.html#mynote" epub:type="noteref">Annotations</a> </p> <aside id="mynote" epub:type="footnote" class="footnote"> <p>blahblahblahblahblah</aside> I can't find a way to hide that <aside> text (I tried "hidden" in various places in the code, but it didn't work). Does anyone know of a way to hide that? If not, I'll work on the <aside> material remaining in its own chapters. EDIT 1: One site I found said the epub:type="footnote" bit should automatically hide the <aside> stuff. But, it doesn't. Another site said the "hidden" attribute can be used to hide it (i.e., <aside hidden ...), but it also doesn't. EDIT 2: it looks like I tried testing the hidden attribute with a class= style applied. The class= overrode hidden. I'll play around with it some more. Last edited by enuddleyarbl; 07-06-2022 at 08:44 PM. |
07-06-2022, 08:47 PM | #11 | ||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
People are more likely going to see it there compared to this subforum. But, many of the people who check that also check here every so often. :P Quote:
especially my posts where I:
Quote:
But how the footnotes are displayed? It's all device-/app-dependent:
If I remember correctly, to detect popup footnotes, Calibre's Viewer looks for at least one of these:
(I haven't tested/dug into the code in a very long time.) Quote:
(Seems like it was a part of the never-accepted + never-to-be-used HTML 3.0, back in 1995.) I would strongly recommend NOT using such "HTML" tags, since it's completely non-standard. Best to just: 1. KISS (Keep It Simple, Stupid) with basic links back/forth. 2. Use EPUB3 footnote code: Code:
<aside epub:type="footnote"> - - - Technical Side Note: Soon after the transition from EPUB2->EPUB3, the IDPF merged into the W3C, and began working together to create CSS3 Paged Media. The problem (back during EPUB2) is HTML is mostly focused on Web content (which can infinitely scroll down), NOT Print (which has pages). Print / Books have things which make no sense in a scrolling, web-based presentation, like:
And books + Desktop Publishing (DTP) programs, for decades, have had lots of advanced functionality like:
Publishers were coming up with all sorts of markup and workflows, which were completely incompatible with each other + the larger web/browser ecosystem. Getting this stuff merged into HTML5 + CSS3/4 will allow it to be more compatible across all sorts of browsers/programs. If you want to read a lot more about that + the bleeding edge HTML+CSS stuff, you can read:
Side Note: This is one of the reasons why IDPF decided to merge into W3C, making EPUB3 follow closer and closer to HTML5 + CSS3. (Instead of tackling all these book-/print-specific things in crazy, non-standard ways... as was happening from the 1980s->late-2010s.) Side Note #2: But be warned, a lot of the bleeding-edge stuff described there isn't even supported yet. This is stuff that will take many years to even trickle down to a portion of the devices out there. In reality, there are still a ton of older devices, so you'll have to keep in mind code that works well across everything. For example, just last month, I wrote about horrible footnote code (Google Docs) + auto-generating numbers via CSS3 counters: Instead, for maximum compatibility, it's probably best to just bake the numbers into the HTML itself... Last edited by Tex2002ans; 07-06-2022 at 09:11 PM. |
||||
07-06-2022, 09:28 PM | #12 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
It's not smart trying to hide footnotes via CSS like: Code:
display: none; Code:
visibility: hidden;
* * * Side Note: A few weeks back, I did run across a DAISY webinar recommending to mark an endnotes file with linear="no", but that has issues as well: See that topic for just one example. Hint: Not much has changed since 2016. There are a tiny bit more apps that support linear="no", like Thorium, but it's still a mess and will cause more problems than it "solves". It would be "better" than messing with display/visibility though... So this is how I would rank them:
Quote:
This may only be possible if you are targeting a very specific app in a very specific app store. (Or if you are creating this ebook only for personal usage.) If you're trying to put this EPUB up for sale across the actual stores, this won't work across devices/apps. Side Note: And again, I will reiterate what I said in 2013... What's the big deal of footnotes sitting at the end-of-chapter/bottom-of-files? How the heck do you read physical books? Do you see the footnotes at the bottom of the page and fling the book out the window? No, you just skim your eyes right over (or turn the page), or jump to the next chapter, and move on. Last edited by Tex2002ans; 07-06-2022 at 11:13 PM. |
|||
07-06-2022, 09:44 PM | #13 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
@Tex2002ans: Thanks. I'll look over those links and recommendations you posted. But, I think I'm going to end up following your advice of "give it up" (at least for my playing around with this book's code). I feel like I'm playing whac-a-mole or with Matryoshka dolls. Every time I think I've solved one problem, another pops up.
|
07-06-2022, 09:47 PM | #14 | |
Grand Sorcerer
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
And of course, for epubs, Kobo does not do footnote popups at all. They are all treated as links. |
|
07-06-2022, 10:07 PM | #15 |
Well trained by Cats
Posts: 30,076
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Calibre's Viewer and many others that run on a PC are based upon web browsers.
THEY forgive way too many deviations from EPUB limitations. All the experts will tell you: Test on the target devices.. Just because it looks fine in Calibre , and it validates, does not mean you did not use something in your code that brand X ignores or gets wrong. RMSDK was famous for ignoring the whole stylesheet if it had an error in one place. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Got a Poke 3. Best Practices? | bmfrosty | Onyx Boox | 4 | 08-24-2021 07:03 AM |
Plugin Best Practices | sbenz | Development | 12 | 11-28-2014 10:34 PM |
Metadata best practices | Ryn | ePub | 14 | 02-17-2012 02:27 PM |
Apple practices...... | carpetmojo | News | 67 | 02-16-2012 05:15 AM |
Best practices for margins | Mookiemon | ePub | 8 | 07-24-2011 07:13 PM |