Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-20-2011, 09:35 AM   #1
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
Do not remove paragraph spaces in Kindle output module

I love Calibre and it's made great ePub files for me.
However I'm having trouble when converting .ePub or .odt files into Mobi, because I lose all paragraph spacing. I've seen many threads trying to get rid of paragraph spacing; I can't seem to keep it!
I've run debug and I can see that everything is fine in the Processed folder. All my paragraphs have just the right spacing. (My paragraphs have a variety of spacings.)
But somehow, by the time it gets to Kindle or Kindle previewer, all paragraphs have lost their line spacing.
In the Convert options, I have selected the Output Module as Kindle, and I have NOT selected any of the options mentioned throughout these forums for removing paragraph spacing in the conversion process. The Table of Contents and Chapter detection seem to be working fine.

I'll be grateful for help in solving this. Thank you!
andrewdru is offline   Reply With Quote
Old 08-20-2011, 10:03 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
If you haven't checked options to remove spacings then calibre isn't removing the spacing. It may be that mobi or the Kindle do not respect the method used to create the spacing, does this happen with all epubs and odt files? How do you create the space in the odt files?

I just converted a epub, that uses css top and bottom paragraph margins to create the space between paragraphs, to mobi and the paragraph spacing still exists in the mobi book.

Maybe someone here can help further.
DoctorOhh is online now   Reply With Quote
 
Advertisement
Old 08-20-2011, 10:54 AM   #3
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 15,250
Karma: 6020307
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by dwanthny View Post

I just converted a epub, that uses css top and bottom paragraph margins to create the space between paragraphs, to mobi and the paragraph spacing still exists in the mobi book.
I would have thought that that was the proper way to control paragraph spacing (as opposed to Hard spacing like <br /> and <p>&nbsp;</p> )

using an extra CSS to set (brute force) All Margins and padding to 0
p {margin: 0; padding: 0}

(there are finer levels of this available )
theducks is offline   Reply With Quote
Old 08-20-2011, 11:29 AM   #4
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
Thanks for your replies.
I made the files in Word with styles controlling each paragraph and their spacing. I then opened this in Open Office and saved the file as an .odt. I then used Calibre to convert this into an ePub using the iPad output module. It works brilliantly! All my paragraph styles are faithfully re-presented in the Calibre ebook viewer and in iBooks.
However, if I convert either the ePub or the .odt format into Mobi with the Kindle output profile, then my paragraph styles are preserved (more or less) except all paragraph spacing is removed. I'm surprised at this, since everyone else in these forums seems to have problems with paragraph spacing added!
As I said, if I look at the debug files, in the Processed folder, all the paragraph styles seem to have been faithfully rendered in the xhtml. They just aren't there any longer when I view the mobi file in the Calibre ebook reader, in Kindle Previewer (for Mac), Kindle for Mac, or on my iPhone Kindle app.
Sooo... what to do now?
Thanks again for your help.
andrewdru is offline   Reply With Quote
Old 08-20-2011, 12:31 PM   #5
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Moderator Notice
Moved the thread to the correct subforum.
Manichean is offline   Reply With Quote
Old 08-29-2011, 02:06 AM   #6
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
Hi all, there's been no responses to this for a week and my timeline is shortening... so I hope you don't mind me raising the flag again. I'd be really grateful for some help!

To summarise:

The Kindle output module in Calibre is not creating space between paragraphs when I start with a .odt or a .ePub file. Every paragraph in my file has a paragraph style, giving a top and/or a bottom margin of varying amounts. These top or bottom margins are not appearing in the Kindle file as I mentioned above.

The Debug Processed folder shows that the css and xhtml files are all correct. So, how can I get the .mobi file to retain these top and bottom margins?

Thanks for your help.
andrewdru is offline   Reply With Quote
Old 08-29-2011, 02:13 AM   #7
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
I only use ePub so I'm not familiar with Mobi or the Kindle, but as a last gasp effort you might want to try <br /> tags between paragraphs to create the spaces you want.

Also you might want to try the beta Mobi writer module being tested in the latest release of calibre. It requires you to enter a tweak to use it. Read about it here.

Good Luck.
DoctorOhh is online now   Reply With Quote
Old 08-29-2011, 02:15 AM   #8
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: 26,434
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I converted the following html in calibre to MOBI and got different spaces between paragraphs

Code:
<html>
    <body>
        <p>one</p>
        <p style="margin-top: 1em">two</p>
        <p style="margin-top: 2em">three</p>
    </body>
</html>
kovidgoyal is online now   Reply With Quote
Old 08-29-2011, 02:40 AM   #9
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
Hmmm, thanks so much for this Kovid. Maybe here is the problem:
I'm using a mac and when I convert your html code above into a mobi format I get the following result:

Mac OS X 2yTATTReOBTcom.apple.TextEncodingutf-8;134217984

That's the only text in the book! Same as if I convert to ePub.

I took your text, put it in a text file, compressed it using Mac's Finder thus to get a .zip file. Then converted it from ZIP to MOBI with default input profile and output Kindle. Using Debug, the html in the input folder looks as expected, but the above text Encoding statement appears in the Processed folder.

This is the same whether or not I choose 'Transliterate unicode characters into Ascii' in the Look and Feel tab of the conversion process.

As far as I know, I do not have any unusual character encoding settings on this mac.

Perhaps this can shed a light on the issue?

Thanks for your help.
andrewdru is offline   Reply With Quote
Old 08-29-2011, 02:55 AM   #10
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: 26,434
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to paste that into a text file, save the file with a .html extension, then add the saved file to calibre.
kovidgoyal is online now   Reply With Quote
Old 08-29-2011, 02:55 AM   #11
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
Oooops, sorry for being a newbie to this... I forgot to add the proper <head> tags with character encoding at the top of my doc. When I do the .mobi output is as you mentioned above Kovid.
I'll explore the css further to see what might be happening; I'm posting this now to avoid you having to think through my earlier mistake.
Thanks!
andrewdru is offline   Reply With Quote
Old 08-29-2011, 05:06 AM   #12
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
aahhaaa... I think I have found the solution.

MOBI format will only preserve paragraph spacing if the css margin-top is used. It will ignore margin-bottom. Further, the units of margin-top must be in Ems or similar, not cms.

My paragraphs were formatted mostly with space after, rather than space before. Bit tragic really!

Further, in my setup I started with an .odt file, with paragraph spacing measured in pts. Calibre has converted this spacing into cms. Is there a way to persuade it to make the conversion into Ems so the MOBI format will read it?

I hope this discovery might help others mystified by the vagaries of Kindle and paragraph spacing!

Thanks for you help.
andrewdru is offline   Reply With Quote
Old 08-29-2011, 08:49 AM   #13
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,456
Karma: 43770933
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
You really can't convert "pt" spacing into "em" units. Pts are an absolute unit of spacing (72pt = 1 inch); em spacing is dependent on the font size. You use pt (or inch or cm) spacing when you want an absolute value, and em units when you want something that scales along with the text.

You'd normally, for example, have margins specified in pts, and indents in ems.
HarryT is online now   Reply With Quote
Old 08-29-2011, 11:05 AM   #14
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
This raises a point about Calibre conversion process into MOBI which would be very helpful to understand.

I am now starting with an .odt document that specifies the font size in points (eg 10 pt) and the spacing before paragraphs in points too (eg 10pt, 15pt).

When Calibre converts this to ePub and I look at the ePub's css, the font size has been converted to ems (eg 0.8889em), and the paragraph spacing into cms (eg 0.527cm). The html files based on this css all display fine.

Yet it seems that the Kindle conversion process won't accept the css margin-top command unless it is in ems. Cms don't do it. There is just no space before the paragraph. If I change the css margin-top to ems then the space appears. I haven't tried other units yet.

So, is there a way to control the units that Calibre converts text and margins to in the ePub's css? So that, in this case, the css margin-top command can be in ems or whatever else works for Kindle?

I'd be grateful to understand this in some detail! Thanks for your assistance.
andrewdru is offline   Reply With Quote
Old 08-29-2011, 12:14 PM   #15
andrewdru
Junior Member
andrewdru began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2011
Location: Canberra
Device: calibre
Haaa, all problems solved.

I made one assumption when writing the above... actually my .odt file paragraph spacing was formatted in cms, not pts. As soon as I set Open Office Writer global measurement to pts, Calibre then formatted the ePub's css in pts.

And it appears that Kindle accepts pts in the margin-top css command. So I now have as much control over the paragraph spacing in Kindle as I can get, and it looks great on Kindle previewer and Kindle for Mac.

Btw - a tip I discovered...

Amazon say it's not possible to get your own documents into Kindle for Mac, I think. However, if you open them in KindlePreviewer, there is an option to 'Open in Kindle for Mac'. As far as I've seen so far, if you do this, your book becomes part of your library and is synched to Amazon and available then as part of your downloads, complete with bookmarks and other data.
Useful, eh!

Thanks to all who helped my troubleshoot this process.

Calibre certainly is a marvellous programme!
andrewdru is offline   Reply With Quote
Reply

Tags
kindle, mobi, paragraph spacing

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Huge Sentence and Paragraph Spaces EPub to Mobi Dasha Amazon Kindle 10 06-06-2011 07:43 PM
Can't get rid of paragraph spaces converting to Mobi vanpelten Conversion 7 03-10-2011 06:00 PM
I'm having a problem with extra paragraph spaces akosimike Calibre 10 05-27-2010 07:53 PM
Paragraph indendation or spaces? enarchay Sony Reader 0 05-28-2009 06:18 AM
Anyway to remove paragraph spaces in pdb files? twister Other formats 3 03-12-2009 10:36 PM


All times are GMT -4. The time now is 06:36 AM.


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