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 09-08-2011, 11:43 AM   #1
markpearl
Enthusiast
markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.
 
Posts: 37
Karma: 576732
Join Date: Jun 2011
Device: Kindle
Paragraph spaces in ePub to Mobi conversion disrupts indent formatting

I've been trying to convert a commercial epub book to mobi in Calibre, but the epub has those annoying small spaces between paragraphs. The conversion is successful, BUT the book is formatted so that the first line of each chapter and mid-chapter breaks have NO indenting -- which is the way the book should read. There are no formatted paragraph breaks when I view with Sigil -- just different CSS style for each of the first "no-indent" paragraphs.

Calibre adds indents to all the "no-indent" paragraphs when I use the "Remove spacing between paragraphs", stripping away the original first-line formatting intent. If I enable Heuristic Processing, checking off "delete blank lines between paragraphs" I still come up with the same results. The only way to convert the book to mobi in Calibre is to leave all these options open -- resulting with those darned small lines between paragraphs so prevalent with epubs.

Is there any workaround for this in Calibre? or just a bug I'll have to live with?


Last edited by markpearl; 09-08-2011 at 12:05 PM.
markpearl is offline   Reply With Quote
Old 09-08-2011, 12:29 PM   #2
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,098
Karma: 5939999
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by markpearl View Post
I've been trying to convert a commercial epub book to mobi in Calibre, but the epub has those annoying small spaces between paragraphs. The conversion is successful, BUT the book is formatted so that the first line of each chapter and mid-chapter breaks have NO indenting -- which is the way the book should read. There are no formatted paragraph breaks when I view with Sigil -- just different CSS style for each of the first "no-indent" paragraphs.

Calibre adds indents to all the "no-indent" paragraphs when I use the "Remove spacing between paragraphs", stripping away the original first-line formatting intent. If I enable Heuristic Processing, checking off "delete blank lines between paragraphs" I still come up with the same results. The only way to convert the book to mobi in Calibre is to leave all these options open -- resulting with those darned small lines between paragraphs so prevalent with epubs.

Is there any workaround for this in Calibre? or just a bug I'll have to live with?

UPDATE: AFAIK Mobi does not use Style sheets.

Space between paragraphs are usually "blank lines"

Indent, is just that Indent. Look at the 'noindent" class in the stylesheet
text-indent: 0 (or, and this can be tricky depending on/if the styles Cascade: no line entry.)

Last edited by theducks; 09-08-2011 at 12:32 PM. Reason: Missed it was a Mobi conversion
theducks is offline   Reply With Quote
Old 09-08-2011, 12:42 PM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,465
Karma: 986493
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
MOBI does not support style sheets. Mobi uses a super set of HTML 3. It allows for limited inline styling which calibre will translate form EPUB to what Mobi supports.

You need to have the EPUB formatted without paragraph spacing and with the first paragraph unindented with css before converting to Mobi. This will produce the output you want.
user_none is offline   Reply With Quote
Old 09-08-2011, 12:47 PM   #4
vanpelten
Member
vanpelten began at the beginning.
 
vanpelten's Avatar
 
Posts: 19
Karma: 10
Join Date: Feb 2011
Device: Kindle
Quote:
Originally Posted by theducks View Post
UPDATE: AFAIK Mobi does not use Style sheets.

Space between paragraphs are usually "blank lines"

Indent, is just that Indent. Look at the 'noindent" class in the stylesheet
text-indent: 0 (or, and this can be tricky depending on/if the styles Cascade: no line entry.)

I have a very similar problem as Mark -- here's my situation:

There are no visible blank lines between the spaced paragraphs that I can see in Sigil:

Code:
  <p class="normal">It was Sarah who gave Emily her first information about sex. They were eating orange popsicles and fooling around a broken hammock in the yard of their house in Larchmont, New York – that was one of the other suburban towns they lived in after Tenafly – and as Emily listened her mind filled with confused and troubling images.</p>

  <p class="bodytext">‘And you mean they put it up in<i>side</i> you?’</p>

  <p class="bodytext">‘Yup. All the way. And it hurts.’</p>

  <p class="bodytext">‘What if it doesn’t fit?’</p>

  <p class="bodytext">‘Oh, it fits. They make it fit.’</p>
The first paragraph with <p class="normal"> is the noindent -- the others below are the following paragraphs. No breaks that I'm aware of.

Here's the bodytext from the stylesheet.css:

Quote:
.bodytext
{
font-family:"Times New Roman", serif;
font-size:small;
margin-top:0.25em;
margin-bottom:0.25em;
text-align:justify;
text-indent:1.5em;
The "Normal" one is the same, except of course that the text-indent is set to 0em.

I'm not a Sigil or Calibre "Power User" to know how to remedy this situation to either 1) remove the spaces in the ePub before converting to Mobi -- or 2) remove the spaces diring a Calibre mobi conversion while preserving the noindent format.

Last edited by vanpelten; 09-08-2011 at 12:50 PM.
vanpelten is offline   Reply With Quote
Old 09-08-2011, 01:00 PM   #5
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,098
Karma: 5939999
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by vanpelten View Post

The "Normal" one is the same, except of course that the text-indent is set to 0em.

I'm not a Sigil or Calibre "Power User" to know how to remedy this situation to either 1) remove the spaces in the ePub before converting to Mobi -- or 2) remove the spaces diring a Calibre mobi conversion while preserving the noindent format.
I believe that should be just: 0
having a (nonsense, in usage) unit may confuse things
theducks is offline   Reply With Quote
Old 09-08-2011, 01:03 PM   #6
markpearl
Enthusiast
markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.
 
Posts: 37
Karma: 576732
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by user_none View Post
MOBI does not support style sheets. Mobi uses a super set of HTML 3. It allows for limited inline styling which calibre will translate form EPUB to what Mobi supports.

You need to have the EPUB formatted without paragraph spacing and with the first paragraph unindented with css before converting to Mobi. This will produce the output you want.
The EPUB is already formatted with no paragraph spacing. And if I change all the EPUB css formatting to "0" indent, as I already tried, Calibre then indents all paragraphs when converting to Mobi. So I'm back to where I was: no lines between paragraphs, but indents where there should be none. Calibre overrides the css formatting and makes no distinction between the "no-indent" css instruction and the "indent" one.
markpearl is offline   Reply With Quote
Old 09-08-2011, 01:06 PM   #7
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,465
Karma: 986493
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
See this for an example of the CSS. There is also an example EPUB file. This formatting in the EPUB will convert to MOBI and retain the paragraphs.
user_none is offline   Reply With Quote
Old 09-08-2011, 01:19 PM   #8
markpearl
Enthusiast
markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.
 
Posts: 37
Karma: 576732
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by user_none View Post
See this for an example of the CSS. There is also an example EPUB file. This formatting in the EPUB will convert to MOBI and retain the paragraphs.
THANK YOU!! I implemented the css example shown in the blog and VOILA! Spaces removed in the original EPUB and all the correct was formatting retained when Calibre converted to MOBI...with no switches or options.

So much to learn...the mind boggles.
markpearl is offline   Reply With Quote
Old 09-08-2011, 03:45 PM   #9
vanpelten
Member
vanpelten began at the beginning.
 
vanpelten's Avatar
 
Posts: 19
Karma: 10
Join Date: Feb 2011
Device: Kindle
That link to John's website was a Godsend for me too! I managed to correct these same issues by using his suggested reformatting of CSS areas affecting the key areas. Only in a few books I've converted using calibre going from epub to mobi is it a major hassle due to their unwieldy length and complexity of the book -- a perfect example is the Pevear & Volokhonsky translation of "War and Peace" -- way too many variables and impossible length. So I'll have to settle for first-page & paragraph indents in mobi. I'll live

I wonder why Calibre's Blank Space Removal switch in the conversion process also forces an indent by default. Is it not possible to have it just remove blank paragraph spaces while offering indenting as a user option -- thus preserving the original indent formatting?

Anyone know?
vanpelten is offline   Reply With Quote
Old 09-08-2011, 06:58 PM   #10
vanpelten
Member
vanpelten began at the beginning.
 
vanpelten's Avatar
 
Posts: 19
Karma: 10
Join Date: Feb 2011
Device: Kindle
Quote:
Originally Posted by user_none View Post
MOBI does not support style sheets. Mobi uses a super set of HTML 3. It allows for limited inline styling which calibre will translate form EPUB to what Mobi supports.

You need to have the EPUB formatted without paragraph spacing and with the first paragraph unindented with css before converting to Mobi. This will produce the output you want.
Perhaps you missed my last question about EPUB to Mobi in Calibre, so I'll repeat it:

Quote:
I wonder why Calibre's Blank Space Between Paragraph Removal switch in the conversion process also forces an indent by default. Is it not possible to have it just remove blank paragraph spaces while offering indenting as a user option -- thus preserving the original indent formatting?
Is there any answer, or should I ask it in the Calibre forum?
vanpelten is offline   Reply With Quote
Old 09-08-2011, 07:05 PM   #11
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,098
Karma: 5939999
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by vanpelten View Post

Is there any answer, or should I ask it in the Calibre forum?
You ARE in a Calibre forum (and, IMHO in the correct section).

I'm not sure how far Calibre goes to re-write document code to include EPUB CSS elements.
theducks is offline   Reply With Quote
Old 09-08-2011, 07:06 PM   #12
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,465
Karma: 986493
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by vanpelten View Post
Perhaps you missed my last question about EPUB to Mobi in Calibre, so I'll repeat it:
You asked this question 3 hours ago. You need to give people a chance to respond. It can take a day or two as many people here only check once a day or once every few days. Very people people have the time to check and respond multiple times a day. Most of us have day jobs (me) and shouldn't be responding at all.

Quote:
Originally Posted by vanpelten View Post
Is there any answer, or should I ask it in the Calibre forum?
The conversion sub forum within the calibre forum (where we are now) is the place for this. This is the correct location for this question.
user_none is offline   Reply With Quote
Old 09-08-2011, 10:04 PM   #13
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,339
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by vanpelten View Post

I wonder why Calibre's Blank Space Removal switch in the conversion process also forces an indent by default. Is it not possible to have it just remove blank paragraph spaces while offering indenting as a user option -- thus preserving the original indent formatting?
Because books that both have incorrect paragraph margins and correct paragraph indents are rare enough to not merit a separate option for this. You can achieve what you are trying to do with

p, div { margin: 0pt; padding: 0pt }

in extra css in the conversion settings.
kovidgoyal is online now   Reply With Quote
Old 09-09-2011, 02:42 PM   #14
vanpelten
Member
vanpelten began at the beginning.
 
vanpelten's Avatar
 
Posts: 19
Karma: 10
Join Date: Feb 2011
Device: Kindle
@user_none:
Sorry very much for jumping the gun I was concerned that perhaps my question was buried in the rest of my original post.

@kovidgoyal:
What a perfect solution for my problem, many thanks!! I tried it with that EPUB version of "War and Peace" and the conversion to Mobi was perfect. Thank you again!
vanpelten is offline   Reply With Quote
Old 09-11-2011, 07:41 PM   #15
markpearl
Enthusiast
markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.markpearl ought to be getting tired of karma fortunes by now.
 
Posts: 37
Karma: 576732
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
Because books that both have incorrect paragraph margins and correct paragraph indents are rare enough to not merit a separate option for this. You can achieve what you are trying to do with

p, div { margin: 0pt; padding: 0pt }

in extra css in the conversion settings.
WOW! This little trick could have saved me LOTS of time I'm now spending re-converting epub to mobi books with the same paragraph indent issues due to the default/forced Indent Size when trying to eliminate blank spaces between paragraphs. Like over 700 "rare" ebooks! It's quite a tiring experience going over them again, you could save users these hassles by providing a separate option as suggested above. But I couldn't live without Calibre, so we live with its shortcomings
markpearl is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] PDF to Epub conversion (spaces between letters) mastroalex Conversion 8 10-09-2011 11:39 PM
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
TXT conversion to ePub or LRF - paragraph formatting Zapped Calibre 6 10-23-2009 06:06 PM
First Line indent for Mobi conversion tbergman Calibre 7 09-06-2009 10:09 AM


All times are GMT -4. The time now is 11:13 PM.


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