Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2012, 11:52 AM   #1
steve2112
Junior Member
steve2112 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Mar 2012
Device: None
Space before paragraph not coming through in epub

I'm using InDesign CS6 (just upgraded from CS3) to create epubs.
I'm using the paragraph style to define space before and space after a paragraph (which many people explain is the better way of getting spacing rather than using carriage returns).
However, for headings, the space before is not translating through into the epub document - but the space after is (i.e. if I change the spacing after the paragraph, I can see the difference as soon as I create the epub, but the spacing before is zero, no matter what value I have in InDesign)

Any help appreciated.

Thanks
steve2112 is offline   Reply With Quote
Old 05-22-2012, 03:03 PM   #2
wahahey
Junior Member
wahahey began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2012
Device: none
I have been tearing my hair out all day with the same problem.

steve2112 - you can try "style mapping" and map styles to tags. It's under the fly-out menu in Paragraph Styles. Useful video here: http://tv.adobe.com/watch/learn-inde...d-epub-export/

This has helped me a bit, in that it has standardised the spaces. But for some reasons I can only apply spacing to paragraphs (p tags in xhtml) and not to headings (h1, h2 etc in xhtml) used in epubs.

I've even tried editing the .css in the unzipped epub files but that doesn't work either.

Stopping while I still have some hair.
wahahey is offline   Reply With Quote
 
Advertisement
Old 05-22-2012, 03:47 PM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,408
Karma: 43171350
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by steve2112 View Post
However, for headings, the space before is not translating through into the epub document - but the space after is (i.e. if I change the spacing after the paragraph, I can see the difference as soon as I create the epub, but the spacing before is zero, no matter what value I have in InDesign)
CSS spacing before a heading (or any element) that's been assigned the "page-break-before" CSS directive will be ignored by ADE (or at least it won't render). This happens a lot when the epub consists of one single html document with page breaks assigned via CSS.

In other words if you want spacing above the first item following a page break.. you need to physically start a new html file at that point. Otherwise, you won't be able to assign any spacing before that element.

I'm attaching a sample epub that demonstrates the issue.
Attached Files
File Type: epub margin-top-ade.epub (2.7 KB, 185 views)

Last edited by DiapDealer; 05-22-2012 at 04:08 PM.
DiapDealer is offline   Reply With Quote
Old 05-23-2012, 07:04 AM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,253
Karma: 4801165
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by DiapDealer View Post
CSS spacing before a heading (or any element) that's been assigned the "page-break-before" CSS directive will be ignored by ADE (or at least it won't render). This happens a lot when the epub consists of one single html document with page breaks assigned via CSS.
That's true, and it is an accepted (but optional) behaviour in the spec.

Quote:
In other words if you want spacing above the first item following a page break.. you need to physically start a new html file at that point. Otherwise, you won't be able to assign any spacing before that element.
There are other possible methods. Only margin is thrown away after a forced pagebrak. You can get space through padding, or by having the pagebreak in a previous element, like this:

Code:
<div class="pagebreak"/>

<h2>Chapter 5</h2>
where div.pagebreak has "page-break-before: always" and h2 has some top margin.

Whether this is possible to generate directly from ID, that's a different matter.
Jellby is offline   Reply With Quote
Old 05-23-2012, 07:11 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,408
Karma: 43171350
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I didn't know that about the padding attribute. Thanks!
DiapDealer is offline   Reply With Quote
Old 05-24-2012, 05:13 AM   #6
wahahey
Junior Member
wahahey began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2012
Device: none
Quote:
Originally Posted by DiapDealer View Post
CSS spacing before a heading (or any element) that's been assigned the "page-break-before" CSS directive will be ignored by ADE (or at least it won't render).
True - but this is the same behaviour we see in InDesign - so I expect that to be the case and is not a problem for me (Sorry - I'm starting to feel like I've hijacked someone else's thread, but I do think this is relevant as it is about Heading spacing).

The problem I am seeing is not related to elements which have been assigned the "page-break-before" directive, at least not intentionally. With CS6 epub exports is that any heading, no matter what paragraph style is associated with it, no matter how it is mapped, no matter what, always has any 'space before' removed rather than converted into css padding or margin. Am I missing something else?
wahahey is offline   Reply With Quote
Old 05-24-2012, 11:46 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,408
Karma: 43171350
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by wahahey View Post
With CS6 epub exports is that any heading, no matter what paragraph style is associated with it, no matter how it is mapped, no matter what, always has any 'space before' removed rather than converted into css padding or margin. Am I missing something else?
I don't know enough about how InDesign (or its ePub plugin) works to be very helpful, I'm afraid. I can tell you what might be wrong (or missing) with the final ePub output, but not what you'd have to do in ID (if indeed you can do anything) to produce the proper result in the ePub. I do know I hear a lot of people talking about having to manually tweak the ePub after exporting from ID.
DiapDealer is offline   Reply With Quote
Old 05-24-2012, 04:00 PM   #8
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by Jellby View Post
That's true, and it is an accepted (but optional) behaviour in the spec.



There are other possible methods. Only margin is thrown away after a forced pagebrak. You can get space through padding, or by having the pagebreak in a previous element, like this:

Code:
<div class="pagebreak"/>

<h2>Chapter 5</h2>
where div.pagebreak has "page-break-before: always" and h2 has some top margin.

Whether this is possible to generate directly from ID, that's a different matter.
This doesn't appear to work on the Kobo. With the class="pagebreak" the header is at the top of the page despite the margin-top setting on the header (and with with the text all the way at the top its a bit squashed).

Using separate files works ok.
meme is offline   Reply With Quote
Old 05-25-2012, 03:18 AM   #9
steve2112
Junior Member
steve2112 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Mar 2012
Device: None
Thanks everyone for all this info - there's more info than I was expecting as I was looking at headings through the text, not necessarily just after a page break - but this info helps even more.
I focused on the exploded epub files and found that there was no top margin info being passed from ID when creating the ePub. So I manually went in and added "margin-top:20px;" (for example) into the relevant paragraph styles in the CSS file. This worked, though it's obviously fixing a problem after the event rather than sorting it out at the source.

Steve
steve2112 is offline   Reply With Quote
Old 06-01-2012, 06:20 AM   #10
wahahey
Junior Member
wahahey began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2012
Device: none
InDesign produces tags with complete reliability. I think it is best to use those and create a new stylesheet (or stylesheets) for ebooks. Certainly for e-ink Kindle books this is the least painful way to go, seeing as Kindle decides which fonts are used anyway!

Since my earlier post I've decided to use Indesign's export tagging to assign h1, h2, h3, etc and p tags to every paragraph used. I also assign a class e.g. myh1, myh2, plus various different paragraph styles based around what sort of spacing and other styling each paragraph style requires.

I have also created several stylesheets, and used CS6's Additional Stylesheet feature to include these. This enables me to keep several sets of styles, and decide whether or not to override what InDesign exports (if it isn't working - as seems to usually be the case).

You can even have different stylesheets for different e-readers, all contained in the same epub. It isn't quite the nice tidy solution I expect from InDesign but it does work if you know what you are doing with css, and also means you can keep editing in Indesign and re-exporting epubs without having to then re-edit the Indesign-produced stylesheet to put the margins back in every time you do a new export.
wahahey is offline   Reply With Quote
Old 06-02-2012, 11:56 AM   #11
Marie_D
Junior Member
Marie_D began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2011
Device: none
Apparently, this is a bug in CS6:

http://forums.adobe.com/message/4458453
Marie_D is offline   Reply With Quote
Old 06-03-2012, 09:47 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,408
Karma: 43171350
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Marie_D View Post
Apparently, this is a bug in CS6:

http://forums.adobe.com/message/4458453
Actually, all the discussion so far seems to imply it's a fug... or possibly a beature.

It's hilarious to me that the CS6 epub plugin developers seem to be at odds over whether the exclusion of the "margin-top" property was an intentional feature or a bug.

Last edited by DiapDealer; 06-03-2012 at 10:21 AM.
DiapDealer is offline   Reply With Quote
Old 06-03-2012, 04:46 PM   #13
GMcG
Writer
GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.
 
GMcG's Avatar
 
Posts: 94
Karma: 556222
Join Date: Mar 2011
Location: Munich, Germany
Device: none
@steve2112
I use an empty paragraph (or two) before the headline to adjust the text, like
<p>&nbsp;</p>
</h3>Headline</h3>
This can be done in the source.
The heigth of the empty paragraph depends on the font-size in paragraph with text, normally 1em. You can modify it by creating a new <p class>. But that's after conversion.

George
GMcG is offline   Reply With Quote
Old 06-05-2012, 01:43 PM   #14
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: 37,777
Karma: 18492088
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by GMcG View Post
@steve2112
I use an empty paragraph (or two) before the headline to adjust the text, like
<p>&nbsp;</p>
</h3>Headline</h3>
This can be done in the source.
The heigth of the empty paragraph depends on the font-size in paragraph with text, normally 1em. You can modify it by creating a new <p class>. But that's after conversion.

George
That is very poor code. Get rid of <p>&nbsp;</p> and in the CSS have a top margin of 1em in h3

h3 {
margin-top: 1em;
margin- bottom: 1em
}
JSWolf is offline   Reply With Quote
Old 06-06-2012, 04:57 AM   #15
GMcG
Writer
GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.
 
GMcG's Avatar
 
Posts: 94
Karma: 556222
Join Date: Mar 2011
Location: Munich, Germany
Device: none
Yes, it is poor, but I understood that css didn't give the result the OP wanted.
He said: "... for headings, the space before is not translating through into the epub document."
And wahahey says: "With CS6 epub exports is that any heading, no matter what paragraph style is associated with it, no matter how it is mapped, no matter what, always has any 'space before' removed rather than converted into css padding or margin."

George
GMcG is offline   Reply With Quote
Reply

Tags
cs6, epub, indesign, spacing

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB to RTF w/out paragraph breaks arslonga Conversion 2 02-06-2012 05:40 AM
PRS-T1 Sony T1 EPUB paragraph problem Cptow Sony Reader 13 01-20-2012 11:01 PM
Paragraph/line space - "n" added NormalJoe Conversion 6 01-25-2011 12:28 PM
Paragraph Style Not Exporting / ePub soulartist Workshop 5 12-11-2010 01:02 AM
Paragraph breaks in ePub? rocalisa Calibre 3 10-29-2010 04:53 PM


All times are GMT -4. The time now is 08:24 AM.


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