View Single Post
Old 07-06-2022, 08:47 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by DaveLessnau View Post
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.
E-Book Formats > ePub is where you'd post EPUB-specific questions.

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:
Originally Posted by DaveLessnau View Post
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.
For everything Footnotes, I'd highly recommend reading through the topic:

especially my posts where I:
  • break down simple code (that works everywhere)
    • Post #11 + Post #9
  • describe the EPUB2 + EPUB3 methods
  • describe the advantages of bottom-of-file footnotes vs. separate-file endnotes
    • Post #13

Quote:
Originally Posted by DaveLessnau View Post
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 haven't tested "popup footnotes" in a while, but the standard/simple code will work.

But how the footnotes are displayed? It's all device-/app-dependent:
  • On some devices, the popup may only show the 1st paragraph, you may have to click to jump to read the rest.
  • Others use heuristics to guess when footnote 1 ends and 2 begins.
    • Kindles
  • Others display footnotes in a "footer". (Similar to a printed book.)
    • KOReader
  • [...]

If I remember correctly, to detect popup footnotes, Calibre's Viewer looks for at least one of these:
  • EPUB3 footnote code
  • a back/forth link
    • <sup>
  • and/or a few specific class names.

(I haven't tested/dug into the code in a very long time.)

Quote:
Originally Posted by DaveLessnau View Post
But, when I look at W3C's information on footnotes, I find:

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>
and

Code:
<a href="#footnoteid"><sup>*</sup></a>
Eh? I've never heard or seen <fn> in my life.

(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">
(For more details, see the topics linked above.)

- - -

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:
  • Headers/Footers
  • Page Numbers
  • Widows/Orphans
  • Left/Right pages (Two-page spreads)
  • [...]

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.
Tex2002ans is offline   Reply With Quote