Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 06-09-2014, 10:53 AM   #1
Borek
Junior Member
Borek began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2014
Device: Kindle
problems with indented text when converting to MOBI

Hi All,

Did some searching of the forum, but couldn't find anything relevant.

I have an OpenOffice.org document that I am trying to convert to ebook formats. I am doing it using Calibre. Documents is correctly exported to EPUB (or at least it is converted in a way that satisfies me, taking into account I have about two hours experience only).

Problem is with conversion to MOBI. Part of the document contains indented text that tries to simulate forum discussion, with headers and quotes. Something like

Code:
What he saw on the screen was:
     John wrote:
          in the answer to Borek's post:
               Problem is with conversion to MOBI. Part of the document
               contains indented text that tries to simulate forum discussion,
               with headers and quotes.
          Don't use MOBI.
With each indent being 1 cm.

Unfortunately, in MOBI these indents become so large, "Problem is with conversion..." is shifted right way too far, so any longer text becomes barely readable (split between many lines containing just a word or two), something like:

Code:
What he saw on the screen was:
                John wrote:
                                in the answer to Borek's post:
                                                Problem is with conversion 
                                                to MOBI. Part of the 
                                                document contains 
                                                indented text that tries to 
                                                simulate forum discussion,
                                                with headers and quotes.
                Don't use MOBI.
Anyone had this problem before? Any idea what to do?

Last edited by Borek; 06-09-2014 at 06:17 PM.
Borek is offline   Reply With Quote
Old 06-09-2014, 11:33 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
How do you define the indent in the ePUB file? How does the code look like?
Toxaris is offline   Reply With Quote
Old 06-09-2014, 06:16 PM   #3
Borek
Junior Member
Borek began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2014
Device: Kindle
I am not editing EPUB files. What I did was I added *.odt (native OPenOffice.org file) to the Calibre library and told Calibre to convert it directly to MOBI and EPUB (and AZW3). Indents in the *.odt are defined using paragraph styles.

Generated EBPUB and AZW3 - when checked with Calibre - look OK. MOBI looks bad (both when checked with Calibre and when sent to my Kindle through Amazon).
Borek is offline   Reply With Quote
Old 06-09-2014, 07:23 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,994
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Borek View Post
I am not editing EPUB files. What I did was I added *.odt (native OPenOffice.org file) to the Calibre library and told Calibre to convert it directly to MOBI and EPUB (and AZW3). Indents in the *.odt are defined using paragraph styles.

Generated EBPUB and AZW3 - when checked with Calibre - look OK. MOBI looks bad (both when checked with Calibre and when sent to my Kindle through Amazon).
Try converting the ePub and AZW3 to Mobi and see what happens.
JSWolf is online now   Reply With Quote
Old 06-10-2014, 04:19 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by Borek View Post
I am not editing EPUB files. What I did was I added *.odt (native OPenOffice.org file) to the Calibre library and told Calibre to convert it directly to MOBI and EPUB (and AZW3). Indents in the *.odt are defined using paragraph styles.

Generated EBPUB and AZW3 - when checked with Calibre - look OK. MOBI looks bad (both when checked with Calibre and when sent to my Kindle through Amazon).
You can still look at the code though. Calibre has an editor. It might give us some leads.
Toxaris is offline   Reply With Quote
Old 06-10-2014, 05:06 AM   #6
Borek
Junior Member
Borek began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2014
Device: Kindle
Did some testing and I think I know where the problem is.

Looks like Calibre generated MOBI (or perhaps MOBI in general) doesn't like margins (and presumably other measurements as well) given in cm. I have manually edited stylesheet in EPUB and replaced all margins given as 0.5cm, 1cm, 1.5cm by 0.5em, 1em, 1.5em and so on - and the conversion result was close to what I expected. Sure, em and cm are not the same thing, but that was the simplest way of testing the idea. Unfortunately, living where I live and using local Windows version it would be quite difficult to not use cm.

I have a gut feeling cm were treated as inches previously, which was why these margins looked so large.

Looks like the conversion will be much more time consuming than expected :/
Borek is offline   Reply With Quote
Old 06-10-2014, 06:43 AM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Margins should (almost) always be best set in relative measurements like em instead of fixed like cm, pt or px. As screen sizes differ, fixed sizes can cause a headache soon. Imagine reading a book on a phone which has margins of a cm... Not much room for text anymore.
The same applies to font sizes.
Toxaris is offline   Reply With Quote
Old 06-10-2014, 10:51 AM   #8
Borek
Junior Member
Borek began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2014
Device: Kindle
Technically you are right - unfortunately, most text editors I am aware of are printer oriented and they use cm/inch measurements only. ATM I have to work with ODT documents whether I like it, or not.
Borek is offline   Reply With Quote
Old 06-10-2014, 12:37 PM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
That is why a text editor/word processor is not always the best source for an e-book. It is fine to create the text, but for the e-book manual adjustment is required. A printed document is something different than a electronic document.
Toxaris is offline   Reply With Quote
Old 06-10-2014, 03:18 PM   #10
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by Borek View Post
Technically you are right - unfortunately, most text editors I am aware of are printer oriented and they use cm/inch measurements only. ATM I have to work with ODT documents whether I like it, or not.
Atlantis will build an ePub and Mobi directly from the processor. It automatically converts any cm/in measurements to relative values during the ePub creation. The ePub is clean. It can read an ODT file.

Dale
DaleDe is offline   Reply With Quote
Old 06-11-2014, 03:23 PM   #11
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
DiapDealer published two days ago a script that converts cm to em directly within EPUB CSS stylesheets using Calibre.

More about it here
https://www.mobileread.com/forums/sho...6&postcount=30

It works both with condensed and "beautified" (classic) stylesheets. However, it does not convert values written in shorthand and leave them untouched.

Of course, still experimental.

Exemple with px in the screenshot for shorthand illustration. Number four (lowest one) should be OK however.
Attached Thumbnails
Click image for larger version

Name:	shorthand.png
Views:	200
Size:	24.5 KB
ID:	123997  

Last edited by roger64; 06-11-2014 at 03:30 PM.
roger64 is offline   Reply With Quote
Old 06-11-2014, 03:40 PM   #12
Borek
Junior Member
Borek began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2014
Device: Kindle
Thanks for the info.

So far I managed to convert ODT to EPUB, then I manually edited EPUB - having some experience with CSS/HTML definitely helped. After that EPUB -> MOBI works OK. It happens a single style sheet will work for all documents I have to deal right now.

I will need a more flexible solution, but not soon.
Borek is offline   Reply With Quote
Old 06-12-2014, 04:44 PM   #13
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
If you are looking for the golden fleece of epubs it will be a while. It is all still rough around the edges and the manufacturer gang can't or won't shoot in the same direction. Look up discussions on the nook about it barfing badly if you put too many size changes in one line!, as a terrible example.
mrmikel is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems converting rtf to mobi Pierdzioszek Conversion 3 04-09-2012 03:04 PM
Two problems converting ePub to mobi AlexBell Conversion 3 05-26-2011 04:38 AM
Missing text while converting PDF to mobi jhkaplan Calibre 1 12-12-2010 08:54 PM
.epub hyperlinks, centered and non indented text. Xabache ePub 2 09-13-2010 01:11 PM
Problems with converting pdf to mobi Holger Calibre 1 08-27-2010 11:41 PM


All times are GMT -4. The time now is 06:47 PM.


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