![]() |
#1 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2020
Location: Moscow, Idaho
Device: Kindle Previewer, Kindle for PC, Kindle
|
Footnote numbers have gone AWOL
I work in InDesign, export to epub, tweak a thing or two in Sigil, and check in Kindle Previewer. I don't think I've changed anything in my settings or workflow, but suddenly the last couple of books I've worked on have started dropping my footnote (endnote) numbers (not the references in the text, but the numbers in the notes themselves). They show up fine in InDesign, but numberless in Previewer. This happens whether or not I make any changes in Sigil, so it's not Sigil causing the problem, but I'm wondering if it's something I could fix in Sigil...or of course if anybody has advice for InDesign or Calibre or whatever, I'd take that, too!
![]() ~Valerie |
![]() |
![]() |
![]() |
#2 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,757
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
There's not a lot we can do unless you post some sample code so we can see what you are dealing with.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2020
Location: Moscow, Idaho
Device: Kindle Previewer, Kindle for PC, Kindle
|
Can you tell me where in the code this would be? I just trust the automated processes for most things, so I don't know my way around very well.
|
![]() |
![]() |
![]() |
#4 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
You can then look at the exact HTML inside of the book. So let's say your first few footnotes say something like this in your Print book: Code:
1 This is the first footnote. 2 This is the second footnote. In the HTML, you may see something like this: Spoiler:
and in the CSS, you can post the whole thing. Side Note: Another thing is you can create a sample EPUB with you problem in it: 1. Delete a lot of the text, leaving just a paragraph + a few footnotes. 2. Attach it to your next post. We could then easily take apart the EPUB and see what the heck is going on. Quote:
Need to see your exact HTML + CSS of your footnotes in order to make a determination though. Side Note: If I'm going to take a quick guess, each footnote is probably buried in <ol> with lots of ugly CSS attached to it. Last edited by Tex2002ans; 05-31-2022 at 07:24 PM. |
||
![]() |
![]() |
![]() |
#5 | ||
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2020
Location: Moscow, Idaho
Device: Kindle Previewer, Kindle for PC, Kindle
|
Thanks for the patient instruction!
Here's the bit with the first footnote reference: Quote:
Quote:
|
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 316
Karma: 3200000
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
Do the numbers reset to 1 at every chapter? Not asking because that'd have caused the problem, but because the solution might be more complicated if they don't.
What's supposed to have happened is: the number should have appeared in that <a> at the front for the backlink, but it's empty. You can wrangle a fix by shoving that <a> to the end via regex and filling it with e.g. an arrow or something. That way, people have something to click on to get back, since the numbers are missing. Then you can do something semi-similar to transform the notes section into an <ol> to get the numbers regenerated. Those new numbers won't be linkable though, which is why you need that arrow at the end too. But that won't work well if the numbers don't reset at every chapter, because e.g. <ol start="11"> doesn't work reliably for ebook. I can probably whip up an example for what I'm describing above, or maybe others will have better ideas. In InDesign, you might doublecheck that Numbers: Map to Ordered Lists is set under the Text section of the epub export options. Or if it is, see what happens if it's not. It's worth a check since it's relatively quick and I guess it could cause something like this. Last edited by phillipgessert; 06-02-2022 at 06:32 PM. |
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2020
Location: Moscow, Idaho
Device: Kindle Previewer, Kindle for PC, Kindle
|
Yes, they are supposed to reset to 1 every chapter. The puzzling thing for me is that I've exported dozens of epubs with pretty much the exact same settings (I always pull up a previous file to build the next book so things behave the same way) and never run into this before. Really the only thing I usually change from book to book is the fonts.
|
![]() |
![]() |
![]() |
#8 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 316
Karma: 3200000
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
It’d be tough to diagnose it in terms of what went wrong in InDesign, odds are it choked on something or other in the Paragraph Styles involved, because InDesign’s approach to semantics and styles don’t map very well to HTML/CSS.
Sometime tomorrow I may be able to post up some find/replace examples for what I described above, but hopefully between now and then someone else will have already posted up something less cumbersome that I hadn’t thought of. Last edited by phillipgessert; 06-02-2022 at 06:52 PM. |
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2020
Location: Moscow, Idaho
Device: Kindle Previewer, Kindle for PC, Kindle
|
I appreciate anybody taking any sort of stab at it that they can! :-)
|
![]() |
![]() |
![]() |
#10 | |||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
You see where it says:
In Sigil, you can Right-Click on the word "Footnotes" > Go To Link Or Style. Can you also do this for:
* * * Side Note: If "Go To Link Or Style" just leads you to something generic like: Code:
body, div, dl, dt, dd, h1, h2, h3, h4, h5, h6, p, pre, code, blockquote { margin:0; padding:0; border-width:0; } Only post if it leads you to something specific like: Spoiler:
Quote:
This is why I was suspecting it'll be complicated numbering via CSS (counters (?)). Usually, in these cases, I see some really ugly nested <ol> instead—similar to Calibre's footnote/endnote code. (But I don't see that here.) Quote:
I'll be able to take an exact look and figure out what the heck is going on. * * * Side Note: Ultimately, what you want for footnotes is actual numbers baked into the text itself. So having a: Code:
<p class="footnote"><a href="#ft2" id="fn2">[2]</a> Herbert Spencer, <i>Principles of Sociology</i>, 2d ed. (New York: D. Appleton Co., 1916), vol. 2, pp. 378–79.</p>
Instead of having something like yours: Code:
<a href="#ft2" id="fn2"></a>
Quote:
which may help. Quote:
But I am familiar with the kind of messes it spits out. :P Looks like this is EPUB3 as well, so maybe that threw a wrench in things. (It probably decided to spit out more complicated CSS3... because "Well, it'll show up fine in iBooks!!!") Last edited by Tex2002ans; 06-03-2022 at 02:07 PM. |
|||||
![]() |
![]() |
![]() |
#11 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 316
Karma: 3200000
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
I'm very sure Tex'll have a much better solution than this one, but I figured I'd come back anyway since I said I would. If you try any of this, please save a copy first in case something breaks.
Leaving the body text part alone, since that part seemed ok, I'd try this in that footnotes section. I'd first fix the broken backlink with this regex search: Find Code:
(<a class="_idFootnoteAnchor.*?>)(</a>)(.*?)(</p>) Code:
\3\1↩\2\4 Find Code:
<div class="_idFootnotes"> Code:
<ol class="_idFootnotes"> Code:
</aside>\n</div></body> Code:
</aside>\n</ol></body> After that, I'd do this: Find Code:
<aside (id="footnote-\d{1,}") Code:
<li \1 Code:
↩</a></p>\n</aside> Code:
↩</a></p>\n</li> |
![]() |
![]() |
![]() |
#12 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
![]() I'll hold off until I see the actual EPUB. ... buttttttt, if I had to do something quickly: Rough Solution #1: ... If it was me, I'd probably pull the numbers out of the: Code:
#footnote-025-backlink"></a>
If it does, great, it's easier. If it doesn't, things get a little trickier. - - - - - - Side Note: Most likely, the ID numbers InDesign generates are off-by-one or more:
- - - - - - Rough Solution #2: You could use Doitsu's "Incremental IDs" plugin. 1. Renumber all the IDs to match whatever ## the book displays. 2. Get those numbers into the text itself. Quote:
Does anyone know how well this works across devices? (Especially older ones?) In EPUBs, I always avoided <ol> for lists because of:
A lot of that stuff may work on the web, where you have many more updated browsers... but in the land of ebooks, that kind of complicated code would be... extremely unreliable. This why people like me + Hitch always recommend inserting the numbers into the text itself. It's the only reliable way to get it working 100% across all devices/formats. For more info, see lots of the discussion in: where I picked apart Google Docs's <ol> footnote abominations. Side Note #2: If you want even more fun with complicated footnotes/endnotes, see the discussion where I broke down a Winston Churchill ebook:
The beast had ~5000 endnotes and ~300 footnotes. Endnotes were displayed as "1" and footnotes were displayed as "fn1". It's definitely one of those complicated examples where Print book numbering ≠ Ebook. Side Note #2.1: I also wonder how <ol> would handle that when it starts reaching 5000!!! lol. Quote:
That's where I would look first. One of those checkboxes we mentioned may fix this numbering oddity. Side Note: Personally, for my footnotes, I just throw away all the InDesign crap and redo everything to human-readable, clean stuff. :P Last edited by Tex2002ans; 06-03-2022 at 10:37 PM. |
|||
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2020
Location: Moscow, Idaho
Device: Kindle Previewer, Kindle for PC, Kindle
|
Thank you all so much! Turned out to be a corrupted file, so I was able to just rebuild it in a new file and that solved the problem!
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pop-up footnotes in sideloaded kepubs gone AWOL in fw 4.0.7523 | jackie_w | Kobo Developer's Corner | 6 | 09-25-2016 12:48 PM |
[AWOL] Context menu: Alter title text case | Sabardeyn | Calibre | 8 | 06-26-2014 12:04 AM |
False Refuge: AWOL Crime Noir | Steve Anderson | Self-Promotions by Authors and Publishers | 11 | 05-26-2011 05:29 PM |
Is there a hack for displaying page numbers rather than location numbers? | nesler | Kindle Developer's Corner | 16 | 02-15-2011 12:00 AM |
Book Designer: Make LRF Option is AWOL | JEMelby | Sony Reader | 6 | 07-28-2007 12:20 PM |