Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-14-2025, 10:37 AM   #1
mcdummy
Connoisseur
mcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the rough
 
mcdummy's Avatar
 
Posts: 73
Karma: 7130
Join Date: Apr 2015
Device: PRS-T3
Creating Word footnotes when converting from epub/html to docx

Hi there,

There's a workaround for creating "real" docx footnotes from epubs using LibreOffice.

Libreoffice can convert html links into footnotes, when the links are properly defined/formated in the html file.

For instance, using importing an html file with the following code into LibreOffice will create "real" footnotes:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Footnote Test</title>
<meta name="generator" content="LibreOffice 7.5.9.2 (Windows)"/>
<style type="text/css">
@page { size: 21cm 29.7cm; margin: 2cm }
p { line-height: 115%; margin-bottom: 0.25cm; background: transparent }
p.sdfootnote { font-size: 10pt; line-height: 100%; margin-left: 0.6cm; text-indent: -0.6cm; margin-bottom: 0cm; background: transparent }
a.sdfootnoteanc { font-size: 57% }
</style>
</head>

<body lang="en-US" link="#000080" vlink="#800000" dir="ltr">

<p align="center" style="line-height: 100%; margin-top: 0.42cm; margin-bottom: 0.21cm; page-break-after: avoid"><font face="Liberation Sans, sans-serif"><font size="6" style="font-size: 28pt"><b>Footnote Test</b></font></font></p>

<p style="line-height: 100%; margin-bottom: 0cm"><br/></p>

<p style="line-height: 100%; margin-bottom: 0cm">This is a text followed by a footnote.<a class="sdfootnoteanc" name="sdfootnote1anc" href="#sdfootnote1sym"><sup>1</sup></a></p>

<div id="sdfootnote1">
<p class="sdfootnote"><a class="sdfootnotesym" name="sdfootnote1sym" href="#sdfootnote1anc">1</a>This is a footnote text.</p>
</div>
</body>
</html>

Thus, turning an epub into an html file, formatting the footnotes as shown above (e.g., using regex), importing the html file into LibreOffice, and saving the document as docx, will create a docx with "real" footnotes.

I did this with an html file containing over 100 footnotes and it worked perfectly.
mcdummy is offline   Reply With Quote
Old 02-15-2025, 07:39 AM   #2
mcdummy
Connoisseur
mcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the rough
 
mcdummy's Avatar
 
Posts: 73
Karma: 7130
Join Date: Apr 2015
Device: PRS-T3
Just played a bit, and this also seems to work

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body>

<p>Here’s a first footnote<a class="sdfootnoteanc" name="sdfootnote1anc" href="#sdfootnote1sym">1</a>. Here’s another footnote.<a class="sdfootnoteanc" name="sdfootnote2anc" href="#sdfootnote2sym">2</a></p>

<div id="sdfootnote1">
<p class="sdfootnote"><a class="sdfootnotesym" name="sdfootnote1sym" href="#sdfootnote1anc">1</a>Footnote 1.</p>
</div>

<div id="sdfootnote2">
<p class="sdfootnote"><a class="sdfootnotesym" name="sdfootnote2sym" href="#sdfootnote2anc">2</a>Footnote 2.</p>
</div>

</body>
</html>

LibreOffice seems to require to use these classes and id-formatting.

Last edited by mcdummy; 02-26-2025 at 08:09 AM.
mcdummy is offline   Reply With Quote
Advert
Reply

Tags
docx, epub, footnote, html, libreoffice

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting PDF to EPUB and automatically creating popup footnotes bleopaskom ePub 16 02-03-2022 04:27 PM
Converting PDF to EPUB and automatically creating popup footnotes bleopaskom PDF 1 01-04-2022 11:45 AM
Converting Word Doc to ePUb- FOOTNOTES Mooninite1 ePub 8 02-28-2015 08:26 AM
Footnotes from Word to html to epub Notjohn Sigil 2 06-07-2013 09:33 AM
Converting Word-> HTML -> Epub arturox Conversion 37 07-18-2012 10:29 AM


All times are GMT -4. The time now is 05:04 AM.


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