03-02-2009, 01:09 PM | #1 |
Time Enough at Last
Posts: 387
Karma: 1151316
Join Date: Feb 2008
Location: New England
Device: iPad 3, iPhone 5, Kindle 3, Fire, Sony PRS-350
|
Insert Blank Lines Between Paragraphs
Hi Kovid,
I know that one of the options in Calibre for converting files to lrf is "insert blank lines between paragraphs", which I love. However, I don't see the same/similar thing for converting files to epub. I see "remove spacing between paragraphs", which is usually antithetical to what I want to do. My brain wants to wrap itself around an isolated paragraph, for some perverted need for clarity. So...is there any way to get Calibre to insert blank lines between paragraphs in a conversion to epub, and if not, could this be a feature request for a future version of Calibre? Thanks! |
03-02-2009, 01:17 PM | #2 |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
You can use some override CSS to achieve that. From the command-line --override-css='p { margin-top: 1.2em; }' should be about right, or using the GUI just put the same CSS (inside the single quotes) in the appropriate field.
|
Advert | |
|
03-02-2009, 01:20 PM | #3 | |
Resident Curmudgeon
Posts: 76,532
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
03-02-2009, 01:30 PM | #4 |
Time Enough at Last
Posts: 387
Karma: 1151316
Join Date: Feb 2008
Location: New England
Device: iPad 3, iPhone 5, Kindle 3, Fire, Sony PRS-350
|
Thanks, guys!
But since I'm a lazy bum, is there a way that Kovid could code this into Calibre as an option, without ripping the "pythons" out of his head? |
03-02-2009, 01:42 PM | #5 |
Wizard
Posts: 1,016
Karma: 4407864
Join Date: Feb 2009
Location: North Carolina
Device: Kobo Aura1, Nexus7.2, Galaxy Tab A 8.4, Ipad Air & Mini 6
|
|
Advert | |
|
03-02-2009, 03:53 PM | #6 | |
Time Enough at Last
Posts: 387
Karma: 1151316
Join Date: Feb 2008
Location: New England
Device: iPad 3, iPhone 5, Kindle 3, Fire, Sony PRS-350
|
Quote:
In the GUI epub css overide box under "Look and Feel" in Calibre, I put this: p { margin-top: 1.2em } It appears to convert ok, but when I look at the output on my PRS-505 nothing is changed; the paragraphs are still not separated. Any ideas what I might be doing incorrectly? Thanks! |
|
03-02-2009, 04:15 PM | #7 | |
Resident Curmudgeon
Posts: 76,532
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
03-02-2009, 04:50 PM | #8 |
Time Enough at Last
Posts: 387
Karma: 1151316
Join Date: Feb 2008
Location: New England
Device: iPad 3, iPhone 5, Kindle 3, Fire, Sony PRS-350
|
No joy
Maybe it has something to do with the fact that it's a lit file that is being converted over by Calibre. What I've done in the meantime is convert the lit over to plain text, add the paragraph spacing in Interparse4, suck the output back into Calibre and then convert that to epub. There must be some simple screw-up that I'm doing with the style sheets... Kovid can you pipe in on this? |
03-03-2009, 12:38 AM | #9 |
creator of calibre
Posts: 44,573
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
the problem with css is that you can't really have "override rules". So there may be something in the CSS from the LIT file that is pverriding the margin setting.
Also you have to make sure that in the HTML in the LIT file <p> is actually what is used for paragraphs and not something like <br> or <DIV> |
03-03-2009, 01:26 AM | #10 |
Connoisseur
Posts: 50
Karma: 12
Join Date: Mar 2009
Device: none
|
great info!
|
03-03-2009, 10:51 AM | #11 | |
Time Enough at Last
Posts: 387
Karma: 1151316
Join Date: Feb 2008
Location: New England
Device: iPad 3, iPhone 5, Kindle 3, Fire, Sony PRS-350
|
Quote:
Now for some investigation and some experimentation...I'm so glad I've got today off! It will keep my mind off the nasty cold I have and the minor surgery I'm going to have done later on this morning. |
|
03-03-2009, 11:13 AM | #12 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
hm... since you are talking about a height measurement and not a width measurement, try your same css but use the unit "ex". "em" is the width of the letter "m" in whatever font / size you are using ; "ex" is the height of the letter x in whatever font / size you are using.
so : p { margin-top: 1.2ex } also, to check if it's working, try with some outrageous value like 5ex ; then you are sure to see a difference, and you can refine it later to find the value you like. |
03-03-2009, 11:21 AM | #13 |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
@zelda_pinwheel: That's definately true in traditional usage, but if you check the CSS spec it defines ems as a just a fraction of the current font-size. I proposed 1.2em as an approximation of the total line-height including leading, although there are certainly better ways with full control over the CSS.
|
03-03-2009, 11:23 AM | #14 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
hm, how odd ! why did they change that unit ? that doesn't make sense to me. as far as i know, ever since traditional printing em has been a measure of width and ex a measure of height (that's why we talk about the "x-height" of a font). now you are making me curious, i'm going to do a bit of experimentation myself.
|
03-22-2009, 03:43 PM | #15 |
Time Enough at Last
Posts: 387
Karma: 1151316
Join Date: Feb 2008
Location: New England
Device: iPad 3, iPhone 5, Kindle 3, Fire, Sony PRS-350
|
Eureka!
Great news for all of you, like me, who needs to chew each paragraph separately --- the peas cannot touch the corn cannot touch the mashed potatoes:
Kovid has written me off-site and given me a simple style sheet override for Calibre's ePub output that separates each paragraph with a line/space: {{{ p { padding-bottom; 3em; margin-bottom: 3em} }}} That's all there is to it --- I've tried it and it works! Thanks, Kovid --- I must pinch myself now to make sure that I'm not dead and already in Elysium... |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Lines became paragraphs after .lit to .mobi conversion | Piper_ | Calibre | 11 | 09-19-2010 06:11 PM |
Blank lines between paragraphs? | ascherjim | OpenInkpot | 30 | 12-03-2009 01:19 AM |
Removing blank lines between paragraphs? | corroonb | Workshop | 3 | 08-13-2009 05:23 PM |
Blank Lines | vivaldirules | Upload Help | 55 | 03-02-2009 04:17 PM |
How to eliminate blank lines between paragraphs with Calibre | Mr. Goodbar | Calibre | 8 | 06-02-2008 08:39 AM |