12-16-2010, 03:07 PM | #31 | |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Quote:
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. |
|
12-17-2010, 04:17 AM | #32 |
DRM hater
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. |
Advert | |
|
12-17-2010, 04:20 AM | #33 |
Resident Curmudgeon
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.
|
12-17-2010, 04:34 AM | #34 |
DRM hater
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. |
12-17-2010, 05:47 AM | #35 |
Wizard
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.
|
Advert | |
|
12-17-2010, 10:15 AM | #36 |
Wizard
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:
@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. |
12-17-2010, 10:45 AM | #37 |
Evangelist
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.
|
12-18-2010, 10:23 AM | #38 |
Connoisseur
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! |
12-20-2010, 04:42 AM | #39 | |
DRM hater
Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
|
Quote:
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. |
|
12-20-2010, 11:27 AM | #40 | |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Quote:
|
|
12-20-2010, 12:55 PM | #41 |
Connoisseur
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.
|
12-21-2010, 01:17 AM | #42 | |
DRM hater
Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
|
Quote:
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. |
|
12-21-2010, 02:26 AM | #43 |
Wizard
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?
|
12-21-2010, 02:54 AM | #44 |
Wizard
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} Last edited by ldolse; 12-21-2010 at 02:56 AM. |
12-21-2010, 03:04 AM | #45 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
It is treating each line as a paragraph, just follow ldolse's advice. I don't think this is a bug.
|
|
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 |