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 02-10-2011, 01:17 AM   #1
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Lit conversion w/<pre> tags

When I go to convert a lit file to a epub that has the text in <pre> tags I end up with an extra space between the paragraphs.

My pertinent conversion settings under Look & Feel are:

Remove spacing between paragraphs w/indent 1.1em
and
Insert blank lines

Lit file code
Code:
<body>     
<pre>This book is for my wife, Danielle, with all my love for ever

  It had never been exposed to the light of day, not once in the 200 million years since it assumed its present form, and yet it seemed in itself to be a distilled drop of dirtied sunlight.

  It had been conceived in heat as vast as that of the sun's surface, in those unholy depths below the earth's crust, in the molten magma that welled up from the earth's very core.
</pre>
</body>
Epub file code
Code:
<body class="calibre">  <p class="calibre7">This book is for my wife, Danielle, with all my love for ever</p>
    <p class="calibre7">&nbsp;</p>
    <p class="calibre7">It had never been exposed to the light of day, not once in the 200 million years since it assumed its present form, and yet it seemed in itself to be a distilled drop of dirtied sunlight.</p>
    <p class="calibre7">&nbsp;</p>
    <p class="calibre7">it had been conceived in heat as vast as that of the sun’s surface, in those unholy depths below the earth’s crust, in the molten magma that welled up from the earth’s very core.</p>
</body>
The CSS is

.calibre7 { border-bottom: 0;
border-top: 0;
display: block;
margin-bottom: 0.5em;
margin-left: 0;
margin-right: 0;
margin-top: 0.5em;
padding-bottom: 0;
padding-top: 0;
text-indent: 1.1em
}

Showing the indent and the added top and bottom margin for the insert blank line.

At some point in the past I don't believe the NBSP paragraphs were inserted. Is there a way to prevent these from being inserted? I tried heuristics - Delete blank lines between paragraphs without success.

I have no problem editing these blank paragraphs out using Sigil. I'm hoping a calibre solution can be implemented.

Last edited by DoctorOhh; 02-10-2011 at 01:21 AM.
DoctorOhh is offline   Reply With Quote
Old 02-10-2011, 01:19 AM   #2
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: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This will likely be because of the ongoing changes to the text input plugin (lit with <pre> uses that). You should open a ticket and attach a lit sample.
kovidgoyal is offline   Reply With Quote
Old 02-10-2011, 01:22 AM   #3
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by kovidgoyal View Post
This will likely be because of the ongoing changes to the text input plugin (lit with <pre> uses that). You should open a ticket and attach a lit sample.
Will do.
DoctorOhh is offline   Reply With Quote
Old 02-10-2011, 02:42 AM   #4
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I'm not sure if it's a bug - Am I reading it correctly that you have 'remove spacing' AND 'Insert blank lines' enabled? Those sort of conflict with one another... I think blank lines get inserted after heuristics if you want them inserted, but I'm not sure why you would have it enabled.

Also heuristics only deletes blank lines when it detects that every single paragraph is separated by a blank line.

What's the formatting you're trying to achieve?

I usually avoid both the 'insert blank line' and 'remove paragraph spacing' in favor of using extra css:
Code:
p {margin-top:0.3em; margin-bottom:0.3em; text-indent:3%; text-align:justify}
h1+p, h2+p, h3+p, p.whitespace+p, p.softbreak+p {margin-top:0.1em; margin-bottom:0.3em; text-indent:0%; text-align:justify}
The second line only works well if heuristics is enabled and detects chapter headings/scene breaks, but the first one will set up top/bottom margin and indents. Obviously adjust the parameters to whatever you prefer.
ldolse is offline   Reply With Quote
Old 02-10-2011, 05:57 AM   #5
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Thanks for the response.

Quote:
Originally Posted by ldolse View Post
I'm not sure if it's a bug - Am I reading it correctly that you have 'remove spacing' AND 'Insert blank lines' enabled? Those sort of conflict with one another... I think blank lines get inserted after heuristics if you want them inserted, but I'm not sure why you would have it enabled.
I have always had those two settings enabled for the last two years. First it removes spaces and adds the indent then it changes the top and bottom margin to 0.5em to give a space between paragraphs. Since my eyes are older this is how I prefer my books to be formatted.

Quote:
Originally Posted by ldolse View Post
Also heuristics only deletes blank lines when it detects that every single paragraph is separated by a blank line.
The whole LIT document created paragraphs internally by having blank lines between each paragraph. If this was text I believe either Single or Block would have worked. I tried heuristics on with delete blank line checked and ended up with the same results.

Quote:
Originally Posted by ldolse View Post
What's the formatting you're trying to achieve?
IIRC previously if the text in the <pre> tags in a lit file (or text in a txt file) had the paragraphs separated by a blank line those paragraphs would end up in <p> tags and no extra lines with non-breaking spaces were created between those paragraphs. At what point does the <p class="calibre7">&nbsp;</p> get inserted? It isn't from the insert blank line under look & feel because that just changes the top and bottom margin on the main paragraphs.

Quote:
Originally Posted by ldolse View Post
I usually avoid both the 'insert blank line' and 'remove paragraph spacing' in favor of using extra css:
Checking Remove spacing between paragraphs w/indent 1.1em and Insert blank lines is like using the following in extra css. I consistently end up with my main paragraphs setup with these settings.

Code:
p {margin-top:0.5em; margin-bottom:0.5em; text-indent:1.1em}
Quote:
Originally Posted by ldolse View Post
The second line only works well if heuristics is enabled and detects chapter headings/scene breaks, but the first one will set up top/bottom margin and indents. Obviously adjust the parameters to whatever you prefer.
Thanks for this info I may experiment with these settings.

Bottom line: At what point does the <p class="calibre7">&nbsp;</p> get inserted and why?
DoctorOhh is offline   Reply With Quote
Old 02-10-2011, 06:30 AM   #6
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I'm pretty sure the <p class="calibre7">&nbsp;</p> is coming from the insert blank line option being enabled. I never use that option, but a review of the code corroborates that.

There have been a lot of bug fixes/improvements lately - Lit input had a bug in it where it was treating all content in <pre> tags as 'block', and that didn't work for the majority of Lit files using <pre> tags. So if Lit input detects a <pre> tag it now does text processing using 'Single', and a user can enable heuristics if they need unwrapping.

Text input also had improvements where it's preserving soft scene breaks - i.e. empty lines. It's possible that a document that is both 'single' and 'block' - i.e. single line paragraphs with a blank line in between each one - might cause text input to create a lot of blank paragraph markers. If so, the 'delete blank paragraphs' option in heuristics would detect and get rid of those.

The insert blank line option happens much further down the pipeline, looks like after remove paragraph spacing but before css rationalization - though I always thought remove paragraph spacing was part of css rationalization, maybe that happens during rationalization but before the user defined css is applied. Anyway in my experience if you use user defined css it will basically do the same thing as the checkbox, which your css settings and result corroborate.

It sounds to me like you found a workflow that was working around old bugs, and now that some of that has been fixed you're seeing your old workflow impacted. That's just a guess though - It would take a bit of investigation to confirm - old and new versions of Calibre, etc.

I think disabling insert blank line and increasing the margins in your extra css would probably be the best option for you, unless there really is a bug to be fixed, but I'm not sure I see one.

Last edited by ldolse; 02-10-2011 at 06:46 AM.
ldolse is offline   Reply With Quote
Old 02-10-2011, 07:01 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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by ldolse View Post
I'm pretty sure the <p class="calibre7">&nbsp;</p> is coming from the insert blank line option being enabled. I never use that option, but a review of the code corroborates that.
Unchecking that feature still had the <p class="calibre7">&nbsp;</p> inserted but the css changed the top and bottom margins to 0.

Quote:
Originally Posted by ldolse View Post
There have been a lot of bug fixes/improvements lately - Lit input had a bug in it where it was treating all content in <pre> tags as <block>, and that didn't work for the majority of Lit files using <pre> tags. So if Lit input detects a <pre> tag it now does text processing using 'Single', and a user can enable heuristics if they need unwrapping.
This would be great because this never added the extra <p class="calibre7">&nbsp;</p> before. It does now.

Quote:
Originally Posted by ldolse View Post
Text input also had improvements where it's preserving soft scene breaks - i.e. empty lines. It's possible that a document that is both 'single' and 'block' - i.e. single line paragraphs with a blank line in between each one - might cause text input to create a lot of blank paragraph markers. If so, the 'delete blank paragraphs' option in heuristics would detect and get rid of those.
I tried it with and without heuristics - Delete blank paragraphs, same result.

Quote:
Originally Posted by ldolse View Post
The insert blank line option happens much further down the pipeline, looks like after remove paragraph spacing but before css rationalization.
This is correct because the insert blank line option changes the top and bottom margins to 0.5em

Quote:
Originally Posted by ldolse View Post
It sounds to me like you found a workflow that was working around old bugs, and now that some of that has been fixed you're seeing your old workflow impacted.
I guess that's possible.

Quote:
Originally Posted by ldolse View Post
I think disabling insert blank line and increasing the margins in your extra css would probably be the best option for you, unless there really is a bug to be fixed, but I'm not sure I see one.
When I do that I now have an extra <div> tag but the rest is the same except now the top and bottom <p> margins are 0. The extra css wasn't added and the result is a gap between paragraphs about twice what it would be if the <p class="calibre7">&nbsp;</p> wasn't there.

Code:
<body class="calibre">  
  <div class="calibre5">
    <p class="calibre7">This book is for my wife, Danielle, with all my love for ever</p>
    <p class="calibre7">&nbsp;</p>
    <p class="calibre7">It had never been exposed to the light of day, not once in the 200 million years since it assumed its present form, and yet it seemed in itself to be a distilled drop of dirtied sunlight.</p>
    <p class="calibre7">&nbsp;</p>
    <p class="calibre7">it had been conceived in heat as vast as that of the sun’s surface, in those unholy depths below the earth’s crust, in the molten magma that welled up from the earth’s very core.</p>
  </div>
</body>
As I stated to begin with I have no problem removing the <p class="calibre7">&nbsp;</p> lines using Sigil.
DoctorOhh is offline   Reply With Quote
Old 02-10-2011, 07:33 AM   #8
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Created Ticket #8904 - this isn't critical to me it is just no matter what I do I get the non-breaking space paragraphs inserted between each normal paragraph.

<p class="calibre?">&nbsp;</p>

This only takes me a minute in Sigil to correct.
DoctorOhh is offline   Reply With Quote
Old 02-10-2011, 08:35 AM   #9
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Ok, it does turn out to be a regression - will post more details in the bug.
ldolse 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
<pre> tags and no text reflow in EPUB sergio blum Calibre 24 10-14-2010 08:07 PM
.lit conversion bubulac Calibre 0 01-07-2010 11:33 PM
Remove pre-conversion file? JDThird Calibre 4 07-25-2009 03:59 PM
lit conversion with the Kindle. keving1701 Amazon Kindle 5 02-17-2008 06:25 PM
.lit conversion question uvholic Sony Reader 7 02-04-2008 10:26 PM


All times are GMT -4. The time now is 01:08 AM.


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