![]() |
#16 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
For anyone wanting to edit their RTFs in MSWord and having problems getting the EPUB line spacing retained, this is another approach which requires only MSWord and Calibre. MSWord to create/edit the RTF, Calibre to do a simple RTF to EPUB conversion. I don't claim it as 'the One True Way'.
I have attached 2 images. the first is how the sample RTF looks in Word, the second is how the EPUB looks in the Calibre Viewer. As you can see the line spacing appearance has been correctly retained. If the first image is what you're aiming for -- read on.
I've also attached the source sample RTF for anyone who wants to try it out. Hope it helps someone ![]() |
![]() |
![]() |
![]() |
#17 | |
DRM hater
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
|
Quote:
Hmm. Thanks. That seems like a lot of work unless you could devise it into a macro that substituted it in somehow. Seems like the best way to create new epubs though from RTF. I'll try the conversion to ODT prior as a workaround. Didn't realize Calibre did ODT. Have to go install openoffice somewhere. |
|
![]() |
![]() |
![]() |
#18 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
However, on the whole I've found that saving the RTF as HTML webpage-filtered and importing the HTML to Calibre instead, is likely to retain more of the formating. It will certainly retain blank lines, which (at least on my ancient version of Word) gets saved as: Code:
<p> </p> or <p class=MsoNormal> </p> Last edited by jackie_w; 11-18-2010 at 11:03 AM. |
|
![]() |
![]() |
![]() |
#19 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Another option is to fix it after the fact in Sigil - I was digging into this more, and the blank line is actually preserved as an extra line feed in the converted document created by Calibre - so anywhere there was a soft break (using blank lines) the resultant file has 2 or more empty lines/line feeds.
So a regex like this: (?<=\n)\n{2} Replaced with this: <p> </p> Would re-insert the soft-breaks for epub. I'm not really familiar enough with the rtf code to figure out where to fix it there, but this would also be easy enough to include in the optional preprocess code. Edit - I was wrong about the extra line feeds being preserved - they aren't preserved unless a variable gets tweaked in the source code. Last edited by ldolse; 11-19-2010 at 02:46 AM. |
![]() |
![]() |
![]() |
#20 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 880
Join Date: Jun 2010
Device: Pandigital Novel
|
Quote:
1. USE A COPY. 2. USE A COPY. 3. Search and replace all "^P^P" with an unused character. The pipe symbol is almost always safe. "|" 4. Search and replace all single "^P" with a space. 5. Search and replace all "|" with ^P or what ever you want to see. This works well in any case where a single delimiter is used for one thing and two of them for something else as in converting multi line lists to a comma delimited flat file. One and two above are the most important because if you do #4 before #3 you have a "bit" of work ahead. Signed: Been there, done that. |
|
![]() |
![]() |
![]() |
#21 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 640
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
|
Those have to be lowercase p's. ^p.
I do the same but instead of replacing ^p with a space I replace it with nothing. |
![]() |
![]() |
![]() |
#22 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 880
Join Date: Jun 2010
Device: Pandigital Novel
|
|
![]() |
![]() |
![]() |
#23 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 640
Karma: 4911
Join Date: Jul 2007
Location: Grapevine, TX
Device: iPad4
|
You're right, I don't know what I was thinking.
I have a macro that replaces ^p^p with ^p. Then it goes through and checks for incorrect line breaks. The macro searches for "^pa" and replaces with " a". Match case on. It does this for each letter in the alphabet. |
![]() |
![]() |
![]() |
#24 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@Mike,
I think we are at cross-purposes here. You appear to be detailing how to correctly reconstruct paragraphs from a file where every line has an end-of-paragraph. My original contribution was about trying to retain the extra whitespace between "scenes", in RTF to EPUB conversions, whilst removing extra whitespace between standard paragraphs, because RTF to EPUB currently removes blank lines. By the way, this doesn't need to be a problem in MSWord, as long as you switch on the 'Wildcards' option in Find/Replace. Using your example Step 3, this should replace 2 or more end-of-paras with the pipe char: Code:
Find: ^13{2,} (with the Wildcards box checked) Replace: | |
![]() |
![]() |
![]() |
#25 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
FYI, this issue will be fixed in the next release of Calibre, extra line feeds in rtf files will be preserved as empty html paragraphs with a non-breaking space.
If your rtf file has garbage blank lines that you want to get rid of this can still be achieved by enabling the "remove spacing between paragraphs" option under Look & Feel. Last edited by ldolse; 11-21-2010 at 01:01 PM. |
![]() |
![]() |
![]() |
#26 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
|
![]() |
![]() |
![]() |
#27 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
|
did you try changing the default line spacing in word or relpacing ^p^p with ^p (should do twice)
Helen |
![]() |
![]() |
![]() |
#28 | |
DRM hater
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
|
Quote:
|
|
![]() |
![]() |
![]() |
#29 | |
DRM hater
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 945
Karma: 2066176
Join Date: Jun 2010
Location: Michigan
Device: Nook ST glow, Kindle Voyage
|
Quote:
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) |
|
![]() |
![]() |
![]() |
#30 |
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,
|
Uhm, if you don't want a blank line at the Paragraph mark have you tried turning it into a manual line break? Or a text wrapping break? 90% of my files were RTF before I uploaded them to Calibre for conversion. I quickly learned that I needed to check what kind of line break they had if I didn't want just a solid book length paragraph.
I just did a test file in which I used a Paragraph mark, a Manual Line break, a Text Wrapping break, and two Paragraph Marks. The Paragraph mark gave me an empty line between the two paragraphs. Both the Manual Line break and Text Wrapping Break gave me a new paragraph without an empty line between them and the Double Paragraph marks gave me two blank lines. The conversion settings were at the default settings, nothing special clicked, and I'm currently using Word 97 and Calibre 7.33. I hope this was of some help. Beth |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |