Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-22-2010, 08:45 AM   #1
lordvetinari2
Zealot
lordvetinari2 is on a distinguished road
 
Posts: 137
Karma: 61
Join Date: Jun 2006
Location: Gijón, Spain
Device: Kindle 3G+WiFi & Galaxy Note
Unhappy [SOLVED] Paragraph spacing from HTML to ePUB

I am having problems forcing Calibre not to overwrite my formatting.

Let's say I format a HTML file inside MS Word. I am aware that MS Word includes lots and lots of garbage in the code, but I know many tricks in Word that I am unable to replicate in serious HTML editors.

Let's say I define a heading as having no indent and the main text body as having indent in most cases, but not always. The main text body has no paragraph spacing in the HTML code, either.

I enter this file into Calibre and convert it into ePUB. With the "Remove spacing between paragraphs" option disabled, Calibre adds paragraph spacing even though the HTML formatting does not mention any such thing. OK. I enable "Remove spacing between paragraphs" and I am forced to enter a value for "Indent size" (0 means no indentation, rather than "do not touch the indent"). The resulting ePUB has no paragraph spacing, but the same indent size for every paragraph.

For the record, I am just mentioning ePUB here because it is easier to see the resulting code, but my intention is to convert to MOBI. The same problems happen with ePUB and MOBI, anyway. The Amazon kindlegen utility respects the HTML code, but I prefer Calibre because it adds the TOC info and the cover for me.

How do I force Calibre to honour the HTML format which specifies spacing and indent for every paragraph?

Attachments (within the ZIP):
adventures.htm > Source HTML file with Word 2010 garbage HTML code
adventures_checked.epub > Output ePUB with the "Remove spacing between paragraphs" disabled and "0 pt" as indent size
adventures_unchecked.epub > Output ePUB with the "Remove spacing between paragraphs" disabled
Attached Files
File Type: zip adventures.zip (267.1 KB, 227 views)

Last edited by lordvetinari2; 11-22-2010 at 09:56 AM. Reason: Solved!
lordvetinari2 is offline   Reply With Quote
Old 11-22-2010, 09:26 AM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Try saving your Word file as Webpage-filtered. This will remove a lot of the excess baggage in the HTML file.

Then reimport to Calibre and convert with 'Remove spacing between paras' unchecked.

For your info, the problem with the original HTML seems to be the MS tags
Code:
<o:p></o:p>
at the end of each paragraph. Calibre seems to be converting them into a <p/> tag. This is not something I've seen before so it may be a Calibre bug, but I'm not sure. Perhaps you should raise a ticket.

Nevertheless, saving as Webpage-filtered will not create the excess MS-specific tags and so should avoid the problem.
jackie_w is offline   Reply With Quote
Old 11-22-2010, 09:55 AM   #3
lordvetinari2
Zealot
lordvetinari2 is on a distinguished road
 
Posts: 137
Karma: 61
Join Date: Jun 2006
Location: Gijón, Spain
Device: Kindle 3G+WiFi & Galaxy Note
Quote:
Originally Posted by jackie_w View Post
Try saving your Word file as Webpage-filtered. This will remove a lot of the excess baggage in the HTML file.
You are completely right! It completely solves the problem, thanks!

I knew about the "Webpage, filtered", and I use it regularly. For some reason, I saved this file as Webpage instead. Such an idiot!
lordvetinari2 is offline   Reply With Quote
Old 11-22-2010, 10:02 AM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Glad to help
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paragraph spacing Banks ePub 2 08-09-2012 05:24 PM
Paragraph spacing jhempel24 Calibre 5 08-24-2010 12:14 AM
Questions about <p> and <div> and paragraph spacing droople Sigil 7 08-14-2010 12:03 PM
Changing paragraph spacing in DRMed epub? salty-horse ePub 4 09-15-2009 06:48 AM
Paragraph spacing when creating eBooks? gwynevans Workshop 21 04-24-2009 11:01 AM


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


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