Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-16-2010, 03:07 PM   #31
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
Quote:
Originally Posted by GreenMonkey View Post
I dunno if anything has changed in the last mini update or two, but I'm still getting extra blank lines.

Every paragraph mark is still being turned into a blank line by default.

Any update? Should I enter a bug report when I get home? (Calibre site blocked at work)
It's not really clear what your problem is.

The fix was that newer versions of Calibre INSERT/RETAIN blank paragraph lines when they exist in the source document. The original poster was asking that this information be retained as older versions of code automatically removed it.

If you want to get rid of all spacing between paragraphs use the 'remove spacing between paragraphs' option under look and feel. This will delete all blank lines.

If what you're actually complaining about is spacing between paragraphs - defined as a style - you can either use the 'remove spacing between paragraphs' option, which will delete all blank lines, or you can specify a margin-top and margin-bottom of 0em in the extra_css. Using extra_css is in more cases the better option as soft breaks will be retained.

Lastly, if the problem is that your document has hard line breaks in the middle of sentences, and you want those removed, then use the 'preprocess input file' option under Structure Detection.
ldolse is offline   Reply With Quote
Old 12-17-2010, 04:17 AM   #32
GreenMonkey
DRM hater
GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.
 
GreenMonkey's Avatar
 
Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
I'm the OP

The problem is, a source RTF file has a paragraph mark (i.e. enter key stroke) at the end of each paragraph (as expected).

For some reason, when this is converted to epub by Calibre, it adds a blank line that wasn't in the original source. I don't get why it does that. Is the only option in conversion, paragraph mark = blank line?

I tried also checking the "remove spacing between paragraphs". This indeed removed the blank lines. But it still failed to preserve the blank lines in the original document (generated with an enter key / paragraph mark).

So the choice becomes - lines between every paragraph. Or - no lines between any paragraphs. The behavior hasn't changed.

Last edited by GreenMonkey; 12-17-2010 at 04:19 AM.
GreenMonkey is offline   Reply With Quote
Advert
Old 12-17-2010, 04:20 AM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,019
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
CRLF is NOT an end of line and then a blank line. a CRLF is what Windows/MS-DOS uses are the end of line. So please, let Calibre thread a CRLF as a proper end of line instead of a line end (ala Unix) and then the LF as a blank line.
JSWolf is online now   Reply With Quote
Old 12-17-2010, 04:34 AM   #34
GreenMonkey
DRM hater
GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.
 
GreenMonkey's Avatar
 
Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
I tried this as an experiment - and I don't understand the results.

I converted an RTF file to HTM via Word 2010.

I opened the HTM in Firefox. No extra lines.

Now I added the HTM into Calibre via "Add books". I opened the Zip file Calibre created, and opened the HTML file in Firefox. Extra blank lines.

So somehow when Calibre imported the HTM file, it added the blank lines at every paragraph mark. I did no conversion whatsoever.
GreenMonkey is offline   Reply With Quote
Old 12-17-2010, 05:47 AM   #35
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Have you tried opening the HTML file from the calibre zip file in a text editor to see if there are really blank lines specified at the HTML level? It is possible that there are not really blank lines, but that there is a style that is specifying space (which can look like blank lines) is to be used between paragraphs. If that is the case then it changes what the solution will be.
itimpi is offline   Reply With Quote
Advert
Old 12-17-2010, 10:15 AM   #36
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 agree with itimpi, what you're most likely seeing is Calibre's default styling of paragraph tags during conversion. You'll need to actually open up the html to see if there really are blank lines.

There are several ways to handle this, as I said before:
  1. Use the 'remove paragraph spacing' option. But presently this will remove the softbreaks, which was the original reason you opened this thread. (sorry about not realizing you were the OP). The remove paragraph spacing option changes the styles set by Calibre, but it also deletes softbreaks since that is what the user is asking to do when checking that box.
  2. Change the 'minimum line height' setting under 'Look and Feel' to 100%. Haven't tried this particular option, but doing that should work and would be a permanent fix if you enable it globally.
  3. Enter a line like this under the extra_css option under 'Look and Feel':
    Code:
    p {margin-top: 0em; margin-bottom: 0.3em}
    I used 0.3em on the bottom margin to create a bit of extra space, tweak as you like.



@JSWolf, Python/Calibre normalizes all the different kinds of Windows/Unix/Mac linefeeds to a single representation of a linefeed in the conversion pipeline, so one type vs. another won't trip Calibre up.
ldolse is offline   Reply With Quote
Old 12-17-2010, 10:45 AM   #37
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
As near as I can tell the issue here is that sometimes you want an extra line but other times you don't. The problem is you are using a Paragraph mark as a line break whether or not you want an extra line. Different formats and programs interpret Paragraph marks differently. Calibre interprets it to mean that you want an extra line, as if to separate two paragraphs. It will do this *wherever* there is a Paragraph mark. You can, of course, tell Calibre to not add in extra line spaces. This will result in Calibre removing the extra line *wherever* there is a Paragraph Mark. It's a simple either/or logic statement. You can't ask it to just automatically know that sometimes it needs to disregard this logic statement without there being an identifying marker at those particular spots. What you need to do is edit the original RTF so that in the places where you do *not* want an extra line you need to replace it with a Manual Line Break. Is it a pain in the butt? Yes it is. Unfortunately it is the only way you are going to get it to convert reliably. Believe me I had to do it with nearly 700 files but I did it because I am extremely particular about how I want my files to appear.
BookJunkieLI is offline   Reply With Quote
Old 12-18-2010, 10:23 AM   #38
Otter
Connoisseur
Otter has learned how to buy an e-book online
 
Posts: 65
Karma: 79
Join Date: Sep 2006
Location: Fairfax, Va
Device: PRS-500, PRS-505, PRS-650, ipod Touch, ipad 2, NC, Kindle Scribe
@GreenMonkey

I had the same problem and this worked for me, not sure if it will for you but am happy to share what I found. Open the rtf in Word and then save it as Other File Type --> Web Page, Filtered. Then import the new file into calibre and covert it using calibre to epub. Leave the option to remove extra blank lines unchecked. Each time I have done this I end up with an epub that retains the original blank lines (change in narrator, change in scene, other intentional blank lines, etc) but it no longer has a blank line after each and every paragraph, line of dialogue etc. No idea how or why this works, but it does for me....hope it is of some help to you!
Otter is offline   Reply With Quote
Old 12-20-2010, 04:42 AM   #39
GreenMonkey
DRM hater
GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.
 
GreenMonkey's Avatar
 
Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
Quote:
Originally Posted by Otter View Post
@GreenMonkey

I had the same problem and this worked for me, not sure if it will for you but am happy to share what I found. Open the rtf in Word and then save it as Other File Type --> Web Page, Filtered. Then import the new file into calibre and covert it using calibre to epub. Leave the option to remove extra blank lines unchecked. Each time I have done this I end up with an epub that retains the original blank lines (change in narrator, change in scene, other intentional blank lines, etc) but it no longer has a blank line after each and every paragraph, line of dialogue etc. No idea how or why this works, but it does for me....hope it is of some help to you!
Awesome. That does the trick. Thanks!

When I tried the unfiltered web page...Calibre ported in...I opened the zip and checked it - extra blank lines.

This way (Filtered web page), it works just right. Thanks for the workaround! I don't understand the difference (but I haven't had time to crack open the HTML and see what looks different).

As far as RTF: I just don't get why every end of paragraph gets a blank line dropped in after the paragraph. It seems like it would be as simple as

If there is a paragraph symbol (and no other text) = blank line

otherwise, no blank line.

Even regardless of this, I would expect Calibre to be dropping blank lines altogether...not adding extra ones.

Last edited by GreenMonkey; 12-20-2010 at 04:50 AM.
GreenMonkey is offline   Reply With Quote
Old 12-20-2010, 11:27 AM   #40
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
Quote:
Originally Posted by GreenMonkey View Post
Awesome. That does the trick. Thanks!

When I tried the unfiltered web page...Calibre ported in...I opened the zip and checked it - extra blank lines.

This way (Filtered web page), it works just right. Thanks for the workaround! I don't understand the difference (but I haven't had time to crack open the HTML and see what looks different).

As far as RTF: I just don't get why every end of paragraph gets a blank line dropped in after the paragraph. It seems like it would be as simple as

If there is a paragraph symbol (and no other text) = blank line

otherwise, no blank line.

Even regardless of this, I would expect Calibre to be dropping blank lines altogether...not adding extra ones.
You should open bug with one of your rtf files. The rtf files I tested with didn't behave as you describe. bugs.calibre-ebook.com
ldolse is offline   Reply With Quote
Old 12-20-2010, 12:55 PM   #41
Otter
Connoisseur
Otter has learned how to buy an e-book online
 
Posts: 65
Karma: 79
Join Date: Sep 2006
Location: Fairfax, Va
Device: PRS-500, PRS-505, PRS-650, ipod Touch, ipad 2, NC, Kindle Scribe
Glad it worked for you too! I don't know why, but at least it does.
Otter is offline   Reply With Quote
Old 12-21-2010, 01:17 AM   #42
GreenMonkey
DRM hater
GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.GreenMonkey ought to be getting tired of karma fortunes by now.
 
GreenMonkey's Avatar
 
Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
Quote:
Originally Posted by ldolse View Post
You should open bug with one of your rtf files. The rtf files I tested with didn't behave as you describe. bugs.calibre-ebook.com
I just made a test rtf file with Word 2010. It just looks like this.

This is an rtf.
This is an rtf.
This is an rtf.
This is a test.

This is a test.
This is a test.

Test.
Test.


It comes out like this via conversion to epub:

This is an rtf.

This is an rtf.

This is an rtf.
...


etc.

I'll open a bug report on it when I have my laptop on at home. Calibre site is firewall blocked here at work.
GreenMonkey is offline   Reply With Quote
Old 12-21-2010, 02:26 AM   #43
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I tried ha myself, and assuming you pressed Enter at the end of an "this is an rtf" line it was displayed with spaces between the lines even at the word level. That was because my (default) paragraph style adds a half-line space both before and after a paragraph. What does your paragraph style specify for this?
itimpi is offline   Reply With Quote
Old 12-21-2010, 02:54 AM   #44
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
Without having your rtf to test with I still have no idea what you're actually seeing. Unless you look in the html there isn't really any way to tell whether the spaces you're referring to are actually in the html or in the css styling. Itimpi and myself have asked you to check the html several times now to no avail.

I've attached an rtf file that converts fine on my system. It's the test file I used when investigating your original report about soft breaks being deleted.

This rtf converts to epub with spacing between paragraphs - but not blank lines - that's Calbre's default style. If you want to get rid of them add the following line to extra css under look and feel - note I've already explained this to you:
Code:
p {margin-top: 0em; margin-bottom: 0.3em}
Attached Files
File Type: rtf Test RTF Spacing - Me.rtf (3.0 KB, 213 views)

Last edited by ldolse; 12-21-2010 at 02:56 AM.
ldolse is offline   Reply With Quote
Old 12-21-2010, 03:04 AM   #45
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 GreenMonkey View Post
I just made a test rtf file with Word 2010. It just looks like this.

This is an rtf.
This is an rtf.
This is an rtf.
This is a test.

It comes out like this via conversion to epub:

This is an rtf.

This is an rtf.

This is an rtf.
...
It is treating each line as a paragraph, just follow ldolse's advice. I don't think this is a bug.
DoctorOhh is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra paragraph line when converting from LRF jhempel24 Calibre 3 08-18-2010 07:00 AM
Stripping extra line returns jwhayn Sony Reader 3 02-27-2010 06:46 PM
Odd line/paragraph breaks in epub and FB2? PKFFW Calibre 4 10-01-2009 07:49 AM
No line breaks ecpepper Amazon Kindle 3 08-09-2009 06:42 PM
Removing extra line breaks plemming Calibre 0 07-31-2008 07:50 PM


All times are GMT -4. The time now is 06:38 PM.


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