|
|
Thread Tools | Search this Thread |
07-22-2015, 04:13 AM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jul 2015
Location: France
Device: Kindle Paperwhite
|
Attributes lost from hierarchical custom style when converting from ODT to EPUB
Hi,
When converting an ODT document which uses hierarchical custom styles, the attributes like font-size or text-align are not taken over in the first phase of ebook-convert. Versions used: Ubuntu 14.04 LTS, LibreOffice 4.2.8.2 and Calibre 2.32.1 The doc file has among others, 3 custom styles: roman.description, roman.dialogue and roman.discussion, in that hierarchical order. Font-size 13pt, justified for roman.description; plus list style InciseDialog for roman.dialogue; plus italic for roman.discussion. When converting with ebook-convert, the result in the directory input, files index.xhtml and odfpy.css, are already wrong: - the style roman.discussion is rendered in index.xhtml as "<p class="P-roman_discussion c_odt4">" instead of just "<p class="P-roman_discussion">". In odfpy.css: - P-roman_description is OK - P-roman_dialogue has no "text-align: justify;" attribute - P-roman_discussion is not there, and the complementary c_odtN has a font-size of 12pt and no justification. The file TestCal.zip has the necessary file to show the behaviour, just unzip it in an empty directory and run it as ./show_bug_cal.sh I hope a solution can be found, because I really like the whole lot of Calibre programs. From my current tests, it seems it's not enough to have the styles non hierarchical, but I have to confirm that point. Thx in advance for your advices, Bernard |
07-22-2015, 05:56 AM | #2 |
creator of calibre
Posts: 44,399
Karma: 23798586
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Save your file as docx instead of odt in LibreOffice, calibre's docx engine is much better than odfpy (the library used for odt files).
|
Advert | |
|
07-22-2015, 09:20 AM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jul 2015
Location: France
Device: Kindle Paperwhite
|
Thx Kovid,
Works better (the CSS for the custom styles are OK with .docx), but there is 1 drawback with this hint: - The conversion from ODT to DOCX by soffice is not handling correctly dialog style (one more unbreakable space in front of the § and only for roman.dialogue). But I will try to go along your line, and correct the conversion once in the EPUB format. And if I have enough heart and time, I might have a look at the source, but don't expect it very soon |
07-26-2015, 09:21 AM | #4 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jul 2015
Location: France
Device: Kindle Paperwhite
|
Further points:
1) the way to DOCX is a no go: the page layout is not respected when converting from ODT to DOCx from LibreOffice (at least in that version). 2) So I had to debug, trace the problem and guess a solution which is reported in the bug tracker under bug #1478346. If that seems OK, I hope it will be applied pretty soon (I can even make it myself). In between, I will continue to use my corrected development version. |
07-26-2015, 02:51 PM | #5 |
null operator (he/him)
Posts: 20,952
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
Advert | |
|
07-27-2015, 03:33 AM | #6 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jul 2015
Location: France
Device: Kindle Paperwhite
|
Yes, but when I evaluated it (1 1/2 year ago), the code generated was wrong when lists (representing dialogs with a leading mdash) were used at the end of a chapter: the tag <ul> was not properly closed.
|
07-27-2015, 03:43 AM | #7 |
null operator (he/him)
Posts: 20,952
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@bgiroud - I guessed you would have it known about it, but thought it was worth asking anyway
It appears that it was last updated about a year since. And I found what maybe a 'better' link than the one at MR - Blog | Writer2ePub Good luck - BR |
Tags |
conversion, custom styles, epub, odt |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Image Lost During ODT > ePub Conversion | Foothills | Conversion | 12 | 08-24-2012 08:26 AM |
Editing epub's style.css when converting to epub | Pros | Calibre | 0 | 02-02-2012 01:13 PM |
little issue converting from odt to epub (top and bottom margin) | superanima | Calibre | 1 | 02-15-2010 04:15 PM |
Strange behavior converting from ODT to EPUB, lots of page-break | superanima | Calibre | 0 | 01-25-2010 02:57 AM |
Converting ODT to EPUB/LRF | banjomike | Calibre | 2 | 10-03-2009 04:32 PM |