Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-22-2015, 04:13 AM   #1
bgiroud
Junior Member
bgiroud began at the beginning.
 
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
Attached Files
File Type: zip TestCal.zip (335.9 KB, 176 views)
bgiroud is offline   Reply With Quote
Old 07-22-2015, 05:56 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
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).
kovidgoyal is offline   Reply With Quote
Advert
Old 07-22-2015, 09:20 AM   #3
bgiroud
Junior Member
bgiroud began at the beginning.
 
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
bgiroud is offline   Reply With Quote
Old 07-26-2015, 09:21 AM   #4
bgiroud
Junior Member
bgiroud began at the beginning.
 
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.
bgiroud is offline   Reply With Quote
Old 07-26-2015, 02:51 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,576
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@bgiroud - have you tried this Open Office plugin ==>> Writer2ePub

BR
BetterRed is offline   Reply With Quote
Advert
Old 07-27-2015, 03:33 AM   #6
bgiroud
Junior Member
bgiroud began at the beginning.
 
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.
bgiroud is offline   Reply With Quote
Old 07-27-2015, 03:43 AM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,576
Karma: 26954694
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
BetterRed is offline   Reply With Quote
Reply

Tags
conversion, custom styles, epub, odt


Forum Jump

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


All times are GMT -4. The time now is 05:39 PM.


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