Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 11-26-2023, 07:07 AM   #1
ssolomon.tech
Junior Member
ssolomon.tech began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2018
Device: Apple iPad
Question Remove Footnotes using Calibre

I saw this topic raised in other software sections but I only use Calibre so wanted to raise this here. I import all my PDFs and ePUB books into Calibre for use with MapleRead and also VoiceDream Reader. Currently, there is no way to have VoiceDream Reader recognize and skip footnotes/endnotes. I was wondering if there was any way to “batch remove” them in Calibre before I them imported the file into VoiceDream Reader. I have never used anything like RegEx (saw that referenced in a different topic) but am willing to learn.
ssolomon.tech is offline   Reply With Quote
Old 11-26-2023, 08:27 PM   #2
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 389
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
This is a question with a very tricky technical solution, so if you have never used regex it will be a great learning experience! It will also involve some pretty tedious editing (at first, anyway) unless you like the adrenaline rush of hitting "replace all" and watching your book dissolve. (No, of course you're working on a copy.) With that warning, here is a start:

If you look at the html coding for footnotes and endnotes inside an ebook, you will find a lot of this sort of thing:

<a id="page_11">...</a>
and
<a href="page_11">something like <sup>1</sup></a>

Where "a" means attribute, "id" is of course an identifier, and "href" gives a link's destination...in the case of an ebook the href means go to the id. There is a lot more to it, and it can get very complicated, but these are the basic codes to look for.

Unfortunately, tables of content, bibliographies, web links and other things you might want to keep use the same codes.

So some simple search and replace to blow all these things away is possible, but very dangerous, depending on the book. I have blown them all away in novels because I don't use a textual table of contents, only to find I've spoiled something unexpected.

Using regex in the editor is indeed the way to go, but be super careful of any "replace all" actions.

For the sake of your sanity, start on a simple book, not something with 500 pages of reference notes!

Just for a starter, set the editor search box to "regex" and look for <a id=.*?> and <a href=.*?>. Go through the book with find, find, find...see how it is structured. Then you can figure out what will need replacing. It may be simple and obvious. But if you have some new epub3 horror from a publisher showing off useless coding, good luck figuring it out.

A good tutorial on regex in Calibre is here: https://manual.calibre-ebook.com/regexp.html

Last edited by retiredbiker; 11-26-2023 at 08:40 PM.
retiredbiker is offline   Reply With Quote
Old 11-26-2023, 08:51 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,176
Karma: 145735366
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
The OP might want to give Regex101 a try. A handy place to learn about regex and the differences between the flavours.
DNSB is offline   Reply With Quote
Old 11-26-2023, 10:35 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,900
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
@retired
<a> is Anchor for a Link
theducks is offline   Reply With Quote
Old 11-26-2023, 11:53 PM   #5
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 389
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
Quote:
Originally Posted by theducks View Post
@retired
<a> is Anchor for a Link
Oops. Good catch. Thanks.
retiredbiker is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get inpage footnotes from footnotes that span multiple paragraphs? strangelove42 KOReader 1 06-26-2023 03:37 PM
Writing inline footnotes for html to mobi conversion using calibre 123iamking Conversion 9 09-21-2020 07:34 AM
calibre viewer: link to footnotes 7dau253mrwry4spf Calibre 1 06-04-2020 09:53 PM
is there any way to toggle footnotes on and off in Calibre Ebook Viewer eyipko Library Management 3 03-06-2020 01:12 PM
Calibre ebook viewer - epub - links shown as footnotes epubauthor Calibre 11 06-12-2018 08:18 AM


All times are GMT -4. The time now is 03:55 PM.


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