![]() |
#1 |
Enthusiast
![]() Posts: 25
Karma: 26
Join Date: Oct 2010
Location: IL, USA
Device: kindle 3
|
![]()
FB2 output doesn't support footnotes properly, it just puts e.g. [1] in the text and lists the footnotes themselves at the end of the file. So they need to be corrected manually (the [1] is replaced by proper link etc.) after the conversion. Is it planned to fix the problem?
Thanks. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
The second use case may be of interest to you.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Quote:
It would be possible to use a heuristic to detect [number] is a footnote but I have no plans to do this. |
|
![]() |
![]() |
![]() |
#4 | |
Enthusiast
![]() Posts: 25
Karma: 26
Join Date: Oct 2010
Location: IL, USA
Device: kindle 3
|
Quote:
Code:
#!/usr/bin/python import os import re import sys def file_replace(fname, out_fname, regex, repl): tmp_fname = fname + ".tmp" out = open(tmp_fname, "w") for line in open(fname): out.write(re.sub(regex, repl, line)) out.close() if os.path.exists(out_fname): os.remove(out_fname) os.rename(tmp_fname, out_fname) if len(sys.argv) != 3: u = "Usage: file_replace <file_name.fb2> <file_name_fixed.fb2>\n" sys.stderr.write(u) sys.exit(1) file_replace(sys.argv[1], sys.argv[2], r'<p>\[1\]', r'</section></body><body name="notes"><section><p>[1]') file_replace(sys.argv[2], sys.argv[2], r'<p>\[(\d+)\](.+)</p>', r'</section><section id="n_\1"><title><p>\1</p></title><p>\2</p>') file_replace(sys.argv[2], sys.argv[2], r'\[(\d+)\]', r'<a xlink:href="#n_\1" type="note">[\1]</a>') |
|
![]() |
![]() |
![]() |
#5 |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
FB2 Output changes | user_none | Calibre | 4 | 01-10-2011 09:32 AM |
FB2 output | KarateMonkey | Calibre | 0 | 03-14-2010 07:47 PM |
FB2 output | Solicitous | Calibre | 1 | 02-10-2010 11:20 PM |
FB2 Output error | stahanovez | Calibre | 2 | 08-02-2009 03:33 PM |
Do footnotes/endnotes work in FB2? | rfog | HanLin eBook | 3 | 12-05-2008 10:22 PM |