Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-31-2019, 01:30 AM   #61
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by DNSB View Post
IMHO, popup footnotes are about the best way to handle the many to one problem (15 links to the same footnote makes for fun (for certain values of fun...).
Ok, thanks. All of these will be 1-to-1.
lumpynose is offline   Reply With Quote
Old 08-31-2019, 04:40 AM   #62
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@lumpynose if you're interested in creating Apple Books (iBooks) compatible popup footnotes, you might want to read the footnote section of the Apple Books Asset Guide, because Apple is really picky when it comes to footnote id attributes. It expects:

Code:
  <aside id="myNote" epub:type="footnote">
    <p style="direction:rtl">Text in popup</p>
  </aside>
or

Code:
  <div id="myNote" epub:type="footnote">
    <p style="direction:rtl">Text in popup</p>
  </div>
If you add the id attribute to other tags inside of <div> or <aside> tags, popup footnotes won't work.
Doitsu is offline   Reply With Quote
Old 08-31-2019, 01:21 PM   #63
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by Doitsu View Post
@lumpynose if you're interested in creating Apple Books (iBooks) compatible popup footnotes, ...
Ok, thanks. The stuff I'm making is just for uploading here.
lumpynose is offline   Reply With Quote
Old 09-01-2019, 01:18 PM   #64
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
But remember, it has to also work with reading software that doesn't do popup footnotes.
JSWolf is offline   Reply With Quote
Old 07-25-2021, 08:01 AM   #65
mrevent
Zealot
mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
Transferring Footnotes from a Website

Hi All,
I hope this is the right thread to pose the following question:
I'm trying to convert an ebook on a website where a book's footnotes already "pop-up" in a new window. I'd like to have the main text of the book not interrupted with those numerous footnotes (which would be the case were I to attempt to convert the "printed" version of the page to epub) with the latter being available by clicking on their corresponding number (doesn't matter if they "pop-up" or not).

The website in question is a great one: UC Press e-books collection, where 700 of them are accessible by the public.
The book in question is The Fabrication of Labor by R. Biernacki.

The main text is supplied with numerous footnotes. Now, to avoid having the footnotes displayed under each page (as is the case under "Print View") I make the Firefox "Show Only" the right frame under normal view, save the page as such (Web page, complete) and add the html file to Sigil.

The footnotes in Sigil are linked to like this:

<sup class="ref">[<a href="javascript://" onclick="javascript:window.open('https://publishing.cdlib.org/ucpressebooks/view?docId=ft8g5008n9&amp;doc.view=popup&amp;chunk .id=d0e2555','popup','width=300,height=300,resizab le=yes,scrollbars=yes')">1</a>]</sup>


In the resulting epub file, clicking on footnotes leads nowhere.

Is there anything one can do to properly transfer the links to the footnotes as well?

If there is, I hope one can do the same for the other publicly available books on this site as well since their current format doesn't seem optimal (for me) to read or annotate them.

Many thanks...
mrevent is offline   Reply With Quote
Old 07-25-2021, 10:48 AM   #66
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
That is not a valid epub link. You do not need nor should you use javascript or onclick for hyperlinks in xhtml.
Replace the:

<a href="blah" ... >

blah part with the correct link to a local xhtml file inside the epub the corresponds to what gets popped up on the website when you click on that footnote (most likely ... an element with an id of d0e2555 inside the xhtml file that represents the ft8g5008n9 document).
KevinH is offline   Reply With Quote
Old 07-25-2021, 05:30 PM   #67
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by mrevent View Post
I'd like to have the main text of the book not interrupted with those numerous footnotes (which would be the case were I to attempt to convert the "printed" version of the page to epub) [...].
Looks like working from their "print view" would still be your best bet.

All the footnote text is there + the code is all clean.

All you'd have to do is use a few regexes to convert their code into the EPUB footnote HTML already discussed.

Quote:
Originally Posted by mrevent View Post
The website in question is a great one: UC Press e-books collection, where 700 of them are accessible by the public.

The book in question is The Fabrication of Labor by R. Biernacki.
In their "print view", each of the "pages" has this basic form:
  • <hr> between pages
  • <div> page number
  • <p class="normal"> or <p class="noindent"> for basic paragraphs
  • <p>[##] for footnote paragraphs
  • <sup class="ref">[##]</sup> for footnote numbers.

Here's the relevant code for page 8:

Spoiler:
Code:
  <hr class="pb"/>

  <div align="center">
    ― <span class="run-head">8</span> ―
  </div>

  <p class="noindent">trade, however, the British exporters had to compete to a greater degree in noncolonial markets, where entry for British goods was no easier than for German ones.<sup class="ref">[20]</sup> [...]</p>

  <p class="normal">The German and British wool textile industries resembled each other another way: in both countries, the majority of factories in this branch operated under the principal ownership of family partners.<sup class="ref">[21]</sup> [...]</p>

  <p>[20] For comments on German competition in the American market for woolens and worsteds, see <i>Textile Manufacturer</i> , June 15, 1884, p. 244. [...]</p>

  <p>[21] <i>Textile Mercury</i> , March 28, 1914, p. 253.</p>


So, what I'd do is 2 regexes:

Search: <sup class="ref">\[(\d+)\]</sup>
Replace: <a class="ref" href="#fn\1" id="ft\1">[\1]</a>

Search: <p>\[(\d+)\]
Replace: <p class="footnote"><a href="#ft\1" id="fn\1">[\1]</a>

That gets you all your EPUB clickable footnotes.

Now you'd just be left with the typical HTML cleanup:
  • Removing page code (or converting to RPNs ["Real Page Numbers"]).
  • Shifting all footnotes to the end-of-file.
  • Merging split paragraphs.
  • [...]

Last edited by Tex2002ans; 07-25-2021 at 05:33 PM.
Tex2002ans is offline   Reply With Quote
Old 07-26-2021, 03:08 PM   #68
mrevent
Zealot
mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
Thank you so much for these elaborate , thoughtful instructions. I will try to implement them, let you know, hopefully, of the satisfactory results and express my gratitude again!
mrevent is offline   Reply With Quote
Old 07-29-2021, 10:34 AM   #69
mrevent
Zealot
mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
I really didn't want to pose another question without trying your suggestions first. The conversion of the numbers to footnote links worked great.
Yet, after many hours of trying, I should give up and say that I still cannot figure out how I can move the footnote paragraphs to the end of the xhtml file or to a new xhtml. (i.e., footnotes to endnotes)
This should be something ridiculously simple I hope, yet, as it turns out, for someone other than me...
mrevent is offline   Reply With Quote
Old 07-29-2021, 02:22 PM   #70
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by mrevent View Post
The conversion of the numbers to footnote links worked great.


Quote:
Originally Posted by mrevent View Post
Yet, after many hours of trying, I should give up and say that I still cannot figure out how I can move the footnote paragraphs to the end of the xhtml file or to a new xhtml. (i.e., footnotes to endnotes)
Send me your latest files.

A while back, I created a little Python program to move all footnotes to the bottom of the HTML file.

It's very helpful when dealing with footnotes mixed right in the middle of the text (mostly due to OCR).

* * *

And on Footnotes vs. Endnotes:

I think it's best to have Footnotes at the bottom of each HTML file. This ensures:
  • each chapter is "standalone"
    • Easily posted on a website as a single article, etc.
  • faster load times
    • Not so much of an issue nowadays, but older devices had noticeably slower load times when jumping back/forth between HTML files.

Very rarely do I do an Endnotes file. The only times I use it is when:
  • There are so many notes that the ~300KB filesize limit is reached.

Like in this recent thread, 2021: "superscript code", we went off on a tangent about a 1100-page Winston Churchill book with ~5.3k endnotes + ~300 footnotes... ~800KB of only notes.

That's one of the rare ones where separate Endnotes file/s might make sense. But in all the hundreds of ebooks I've done, I've maybe only done this 5 times.

Last edited by Tex2002ans; 07-29-2021 at 02:25 PM.
Tex2002ans is offline   Reply With Quote
Old 07-30-2021, 09:18 AM   #71
mrevent
Zealot
mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
I'm sending you the files (the bundle of html files + the epub file), Thank you so much!
The only thing I could do with the epub though was applying for Regex search/ replace instructions and removing the color and font from the Css file (which had made the text whiteish).

A python script to do that sounds great! It would definitely be most useful for me as well, when trying to convert other html texts from that as site at least.
(I don't why we cannot copy all instances of a search result simultaneously though -- that doesn't apply to Sigil only, of course. It would render the transfer of notes quite quick).

Sure, footnotes at the end of the xhtml would definitely work for me... Even many hard copy books tend to put notes at the end of each chapter nowadays...

You have been immensely helpful already, Texas2002ans, thank you again!
mrevent is offline   Reply With Quote
Old 07-30-2021, 06:22 PM   #72
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by mrevent View Post
I'm sending you the files (the bundle of html files + the epub file), Thank you so much!
Okay. All done.

Quote:
Originally Posted by mrevent View Post
The only thing I could do with the epub though was applying for Regex search/ replace instructions and removing the color and font from the Css file (which had made the text whiteish).
Yeah, you typically want to get rid of nearly all hardcoded colors.

They tend to make problems when users switch to Night Mode, etc.

See 2020: "Colored Text, EPUB, Android Dark Mode".

Quote:
Originally Posted by mrevent View Post
A python script to do that sounds great! It would definitely be most useful for me as well, when trying to convert other html texts from that as site at least.
Yeah, I created it because of OCR. Many footnotes are left smack dab in the middle of the text.

I wrote about it back in 2020: "I have a DOCX with footnotes that I wanna turn to pop-up notes in ePub on Kobo Forma":

Spoiler:
Quote:
Originally Posted by Tex2002ans View Post
Quote:
Originally Posted by Hitch View Post
What you have now, you have to go through and recreate the footnotes, in Word, using the automated functionality, one-by-one. OR, you could open it up in HTML and code them--one by one. But those are pretty much your two choices.
There's an HTML method I mentioned in passing over the years:

A superscript number being the first thing in a paragraph "is most likely a footnote".

This allows you to markup something like:

Code:
<p><sup>123</sup> Example footnote.</p>
as:

Code:
<p class="footnote"><sup>123</sup> Example footnote.</p>
so if this is your original:

Code:
<p>This is a sent-</p>

<p class="footnote"><sup>123</sup> Example footnote.</p>

<p class="footnote"><sup>124</sup> Another example footnote.</p>

<p>ence that gets split across pages.</p>
you can rip out all the "footnote" classes and place at the end of the HTML:

Code:
<p>This is a sent-</p>

<p>ence that gets split across pages.</p>

[...]

<p class="footnote"><sup>123</sup> Example footnote.</p>
<p class="footnote"><sup>124</sup> Another example footnote.</p>
</body>
</html>
The downfall is it can't handle more complicated multi-paragraph footnotes*, or footnotes that go across pages, etc., but it can get you most of the way there.

I've tested this method across tons of books, and it works, but it requires some initial massaging of the HTML.

* Note: If the multi-paragraph footnotes are also smaller text, and nothing else in the book is, this can also be used to mark paragraphs as "footnote" class. From what droopy said in Post #7, it seems like this may be the case for this specific book.
Tex2002ans is offline   Reply With Quote
Old 07-31-2021, 11:21 AM   #73
mrevent
Zealot
mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.mrevent knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
All this help is simply incredible. Thank you so much for all your replies and instructions as well as amending the file for me, here and, in a more detailed fashion, in your PM. Simply amazing! I'm most grateful!
mrevent is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying end/foot notes in ePub FlorenceArt Apple Devices 0 12-10-2015 07:31 AM
Asterisk (link to foot notes) almost invisible HansTWN Kobo Reader 1 08-15-2013 04:36 AM
How to skip foot notes: normal flow theducks ePub 7 11-27-2012 11:00 AM
Multiple foot notes with same id Ti-Ron ePub 2 10-04-2012 07:27 PM
Handling end notes Artha Sigil 5 11-22-2011 04:05 PM


All times are GMT -4. The time now is 04:32 PM.


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