08-20-2011, 08:35 AM | #1 |
Junior Member
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! |
08-20-2011, 09:03 AM | #2 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, 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. |
Advert | |
|
08-20-2011, 09:54 AM | #3 | |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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 ) |
|
08-20-2011, 10:29 AM | #4 |
Junior Member
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. |
08-20-2011, 11:31 AM | #5 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Moderator Notice
Moved the thread to the correct subforum. |
Advert | |
|
08-29-2011, 01:06 AM | #6 |
Junior Member
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. |
08-29-2011, 01:13 AM | #7 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, 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. |
08-29-2011, 01:15 AM | #8 |
creator of calibre
Posts: 43,844
Karma: 22666666
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> |
08-29-2011, 01:40 AM | #9 |
Junior Member
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. |
08-29-2011, 01:55 AM | #10 |
creator of calibre
Posts: 43,844
Karma: 22666666
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.
|
08-29-2011, 01:55 AM | #11 |
Junior Member
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! |
08-29-2011, 04:06 AM | #12 |
Junior Member
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. |
08-29-2011, 07:49 AM | #13 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
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. |
08-29-2011, 10:05 AM | #14 |
Junior Member
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. |
08-29-2011, 11:14 AM | #15 |
Junior Member
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! |
Tags |
kindle, mobi, paragraph spacing |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Huge Sentence and Paragraph Spaces EPub to Mobi | Dasha | Amazon Kindle | 10 | 06-06-2011 06:43 PM |
Can't get rid of paragraph spaces converting to Mobi | vanpelten | Conversion | 7 | 03-10-2011 05:00 PM |
I'm having a problem with extra paragraph spaces | akosimike | Calibre | 10 | 05-27-2010 06:53 PM |
Paragraph indendation or spaces? | enarchay | Sony Reader | 0 | 05-28-2009 05:18 AM |
Anyway to remove paragraph spaces in pdb files? | twister | Other formats | 3 | 03-12-2009 09:36 PM |