View Single Post
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