![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 404
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
|
[Old Thread] Epub Output: Line Height
Hi!
I've been using Calibre for a few weeks now, and I'm very impressed by it. I'd like to say thanks to the author of this amazing software. I have a problem though. I'm very fond of the way feedbooks.com formats the epub ebooks: the line height within a paragraph is somewhat smaller than the line height between paragraphs. This makes it a lot easier to read, when I choose to remove line spacing between paragraphs. To clarify what I mean, this is a screen capture of a public domain ebook from feedbooks.com: ![]() I'm not able to create this effect with calibre when converting a file to epub. Any changes in the 'Line Height' figure under "Look & Feel" is applied evenly within and between paragraphs. I wonder if you could provide me with instructions how to achieve the effect that feedbooks.com does so effectively with their epub ebooks. Additionally, I'd like to ask if it is possible to import, save, and apply settings of existing well-formatted epub files as a template for my own conversions. Thank you for the wonderful software! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,262
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
In extra css add
p { margin-top: 5px; margin-bottom: 5px; } and no it's not possible to import settings. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 404
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
|
Hi Kovid!
I'm very thankful for your quick reply. I tried the code you provided, but it didn't seem to do the trick. Perhaps the previous diagram wasn't quite clear. Here's another screenshot: ![]() The spaces between paragraphs, marked "*", is somewhat bigger than the spaces between lines within a paragraph, marked "#". I wonder if this could be achieved with extra css codes? Thanks! |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,262
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
it can and the extra css code i gave you achieves precisely that, provided the text in your document is in actual <p> tags and not just separated by <br> tags. Try increasing the amount to 15px
|
![]() |
![]() |
![]() |
#5 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 404
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
|
I tried using the code
p { margin-top: 5px; margin-bottom: 5px; } again, changing 5px to other figures, eg 15px, 20px. It appears there's no effect at all to the paragraph spacing.. I googled and found this code for widening paragraph spacing p { margin-top: 0em; margin-bottom: 2em; } source: http://www.boutell.com/newfaq/creati...phspacing.html Again, applying this code does not cause any noticeable change to the paragraph spacing in my epub output. I've set as my default preferences base font as 13px, font key as 11, 12, 13, 15, 17. Could this have anything to do with it? |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 404
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
|
I've tried converting a .html file with <p> line breaks, a txt document, a .lit file, but they don't seem to respond to the margin-top and -bottom css code.
![]() Thanks anyway, Kovid. I can totally enjoy my converted ebooks without the extra spacings. It's not essential. |
![]() |
![]() |
![]() |
#7 |
Handy Elephant
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
This method of using specific margins for p works very well for me, and makes it possible to fit more text on the screen. I usually combine it with a small indent as well.
Check the rest of the css so you don't have other settings that negate the margin settings for p, later in the code. |
![]() |
![]() |
![]() |
#8 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 404
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
|
Hi
I've tried to work at it for hours, trying to achieve the desired effect. I've used a number of different files/configurations, and I've also completely reinstalled Calibre. ![]() But totally without success. I wonder if anyone could be kind enough to use the attached file and run it through Calibre's conversion engine to create an epub with the effect described, using the margin-top and -bottom css code. Just curious if it was something to do with my pc configuration or it's possibly a bug? Thanks very much. |
![]() |
![]() |
![]() |
#9 | |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 726
Join Date: Dec 2007
Location: US
Device: Sony PRS-350, Astak PocketPro, iPhone, Asus eee Pad Transformer
|
Quote:
I converted your .lit file to .epub using Calibre's engine as you requested. The resulting file had a 1 em bottom margin between paragraphs. It appears to work just fine for me. |
|
![]() |
![]() |
![]() |
#10 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 404
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
|
Thanks, GeneS.
![]() Hmm... I guess it must be something to do with my system. Can't figure out what could have caused it though. (My OS = Vista, default browser = Firefox.) It's one of those pc mysteries that couldn't be solved. ![]() |
![]() |
![]() |
![]() |
#11 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 116
Karma: 960
Join Date: Feb 2011
Device: PocketBook 360
|
I'm seeing the same thing on my end, and I believe it has to do with the fact that RE-converting Epubs (after you have already converted to them initially), causes this. Take a clean download of an epub or whatever format, and try again. It will work
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
but it should be pointed out, as per my REJECTED bug report, that that does not always work
specifically it will NOT work on any book which has previously been converted with the remove blank lines option ticked. I learnt that the hard way. I ticked remove blank lines so as to use the linked set indent feature ( which is not accessible unless you also tick remove blank lines) I then find to my horror, this undocumented side effext - that extra CSS is now broken for that book; and worse, that this is not seens as a defect, either in the program or in its documentation. |
![]() |
![]() |
![]() |
#13 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
i tried thw wipe saved conversion settings trick - no joy.
the root causeof the "bug" and I still consider it a bug - in documentation / code or both is this: the mechanism used for set indents+remove blank lines ( a paired option - set indents is not available by itself) is: add explicit margin top, margin bottom =0 definitions to every relevant css entry. once that has happened the cascading css rules prevent p - whatever in extra css from overriding. I was following a logical - fix one thing at time clean -up program my step 1 was to standardise all my indents - so I ran all epubs through the set indent to 1em option ( wchih necessitated also having remove blank lines active) by step 2 was to be set my preferred line spacings via CSS and that is where it all went pear shaped. I did take a full backup beforehand so I could revert, but I decided instead to slog on & fix the line spacings book by book, and do a remove indent for 1st paragraph onlytidy-up at the same time - then flag which books I had optimised. |
![]() |
![]() |
![]() |
#15 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Personally I made my peace with the compromises that calibre makes. I use the remove spaces between paragraphs and add a 1.1em indent. At the same time I have calibre insert a blank line. This gives a indent and a space between my paragraphs. This combination did destroy soft scenes breaks, but the recent heuristics will usually allow my soft scene breaks to become hard scene breaks so they don't get lost. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems with Line Height Formatting | JohnnyRocks | Conversion | 4 | 02-20-2011 07:10 AM |
EPUB output | kovidgoyal | Calibre | 920 | 02-05-2011 11:59 AM |
changing text line-height in css | wjcroft | EPUBReader | 0 | 12-15-2010 03:13 PM |
Epub line height problem | dorotie | Calibre | 5 | 08-24-2010 03:23 PM |
epub output metadata | troymc | Calibre | 5 | 05-22-2010 12:23 AM |