View Full Version : Exporting epub with InDesign: I lose blank lines!


tibiafry
03-31-2009, 07:14 AM
When I export an epub from InDesign, all blank lines get lost in the procces.

For instance there is this line

then a blank line between this one on the indesign document

But on the epub (and xhtml source) It's seen like this:

For instance there is this line
then a blank line between this one on the indesign document

How can I force it to detect how many blank lines i left?

Thanks

Jellby
03-31-2009, 07:25 AM
Don't leave blank lines, use vertical spacing instead. I have never used InDesign, but I guess you can assing some vertical space above the "then a blank line between..." paragraph or below the previous one.

tibiafry
03-31-2009, 07:33 AM
Don't leave blank lines, use vertical spacing instead. I have never used InDesign, but I guess you can assing some vertical space above the "then a blank line between..." paragraph or below the previous one.

That is not an option since our books are already made. We must convert them now into ebooks. And doing so in all of the books will drive the guys at the design department even more crazy. And I don't want them to eat me :rofl:.

Any other way?

JSWolf
03-31-2009, 07:40 AM
That is not an option since our books are already made. We must convert them now into ebooks. And doing so in all of the books will drive the guys at the design department even more crazy. And I don't want them to eat me :rofl:.

Any other way?
Yes there is a way. Create a CSS entry for the paragraphs where you want the space to come before. Then use that for all those section in the XML files.

It's not as hard as it sounds. Could maybe be easier if you have all the paragraphs without an indent like in some books.

if you want to send me one of your eBooks in ePub, I cna have a go at it if you also point out where you want the spaces.

Jellby
03-31-2009, 07:41 AM
Open the XHTML generated in the ePUB file by InDesign. Are the "empty lines" there in any way (maybe an empty <P> or <DIV> tag)? If they are, you could post-process the ePUB to add something (&nbsp;) there.

If they aren't, there might be a way to run a macro/script that finds empty lines and adds a space or non-breaking space there. Then maybe when creating the ePUB these empty lines will not be lost.

tibiafry
03-31-2009, 07:43 AM
Yes there is a way. Create a CSS entry for the paragraphs where you want the space to come before. Then use that for all those section in the XML files.

It's not as hard as it sounds. Could maybe be easier if you have all the paragraphs without an indent like in some books.

if you want to send me one of your eBooks in ePub, I cna have a go at it if you also point out where you want the spaces.

I've already tried this. Editing the css, and I have that no-indent paragraph and it's just what I want to get, but It also messes up other places where it shouldn't be. Wouldn't it be easier if the export function did what it should (export everything, and not just waht it wants to). hehe.

No it's not there at all. I've searched it. I was writting a post winning to mobipocket cause it eated the lines and realized that it isn't there even on epub. Maybe post processing the xhtml is an option. But it will suck lol.

PS: can I force a page jump in epub? like <hr> or something lol

Jellby
03-31-2009, 11:12 AM
PS: can I force a page jump in epub? like <hr> or something lol

You can use the CSS properties "pagebreak-before: always" or "pagebreak-after: always".

tibiafry
04-01-2009, 03:08 AM
You can use the CSS properties "pagebreak-before: always" or "pagebreak-after: always".

That's very interesting. Any other special CSS properties I could learn?

A link or something?
Thanks.

Jellby
04-01-2009, 05:58 AM
Hmm... I don't know what's "special", but I got most of my information from http://www.w3schools.com/Css/default.asp (or rather, google searching for different things often directed me there).

tibiafry
04-01-2009, 10:52 AM
Hmm... I don't know what's "special", but I got most of my information from http://www.w3schools.com/Css/default.asp (or rather, google searching for different things often directed me there).

Ok, thanks, but now:

I really need to know how to get at least this output

<p>&nbsp;</p>

for each blank line I have in my InDesign document. It's getting a pain in the *** having to do a special style editing every time i need 1, 2, 3 or 4 blank lines before/after a paragraph.

Thanks.

P.s.: I was searching the problem on google and this thread is the first result :S

cerement
04-02-2009, 02:38 AM
I really need to know how to get at least this output
<p>&nbsp;</p>
for each blank line I have in my InDesign document. It's getting a pain in the *** having to do a special style editing every time i need 1, 2, 3 or 4 blank lines before/after a paragraph.
Ideally, you want to separate the display aspects into CSS and leave just the content in the XHTML file. Handcoding things is relatively straightforward, but I don't know enough about InDesign to go about telling you how to handle the automatic conversions.

If all of the <p> tags are getting the same space before, then in the external stylesheet, you would add something along the lines of:
p {padding-top: 1em}
If the amount of spacing was variable, then simplest (though not "best practice"), is something like:
<p style="padding-top: 2em">This is paragraph 1</p>
<p style="padding-top: 1em">This is paragraph 2</p>

jttraverse
12-04-2010, 01:01 AM
Hi everyone,
I have a similar question in regards to having InDesign keep the spaces that already exist ahead of certain paragraphs when the book is exported to ePub format.
In most books, there is some space ahead of certain blocks of text/paragraphs because it makes reading easier or it separates parts of the story, etc. In my case there might be three or four paragraphs that tell part of the story, basically one set of paragraphs, and then I may use some blank space, a break between the preceding block of text/paragraphs and the following one (like I'm about to do here :)

I want to keep this spacing, but I see a lot of suggestions to simply use "Space before" or "Space after" to put the space in. But I find that puts space before -every- paragraph, leaving each paragraph separated by white space from all the others. That's definitely not what I'm trying to accomplish.

There must be some simple way to have InDesign export what I've written -as it is- without removing all the empty spaces and shoving all the paragraphs together. The idea of changing the entire written book to put a space before specific paragraphs simply because InDesign can't seem to interpret existing lines/spaces is nightmarish. Likewise, having to export InD to ePub then open the file in Sygil or something to edit the ePub sounds a bit embarrassing for a program like InDesign. (If you export to Pdf it comes out looking perfect, blank space and all...so why not handle it going to ePub?)

Any suggestions on how to export a document as it is and have InD convert to ePub and get it right? The help will be greatly appreciated.
-JTT

Adjust
12-04-2010, 03:19 AM
InDesign DOES remove all empty spaces...(which makes sense) If you ID file is correctly formatted using style sheets, then it will styled like this:

ChapterName
Body No Indent
body
body
body


bodySpaceabove
body
body
body

if you don't then after you make the epub. You need to edit the Template.CSS file (I use dreamweaver)

Copy and past the body style and simply add space above and rename it :

p.body {
font-family: "Minion Pro", serif;
line-height: 1.30em;
font-size: 0.96em;
margin-bottom: 0.00em;
margin-top: 0.00em;
text-indent: 0.00em;
margin-right: 0.00em;
margin-left: 0.00em;
text-align: justify;
font-weight: normal;
font-style: normal;
color: rgb(0,0,0);

p.bodyspaceabove {
font-family: "Minion Pro", serif;
line-height: 1.30em;
font-size: 0.96em;
margin-bottom: 0.00em;
margin-top: 1.5em;
text-indent: 0.00em;
margin-right: 0.00em;
margin-left: 0.00em;
text-align: justify;
font-weight: normal;
font-style: normal;
color: rgb(0,0,0);

Then go through you xhtml files and apply the relevant style.

JSWolf
12-04-2010, 03:12 PM
That is awful looking CSS code. Way too much crap in it and lines that don't need to exist.

When you go into the CSS to edit it, also fix the poor coding as well.

Adjust
12-04-2010, 04:58 PM
That is awful looking CSS code.

:alright: Maybe poor code, but it at least it shows the op how to fix his problem. I don't see how picking apart someones post, does that. :2thumbsup

tjpanda
12-09-2010, 09:04 PM
Not fair to call it poor code, that is CSS as ID generates it. There is an advantage of doing it this way: it provides a basic set of key attributes whose values can be easily modified, even by someone who is not skilled with CSS.

Using extra spaces and blank lines for formatting is poor form even in layouts intended solely for print. HTML is designed to suppress such extraneous content and at its heart EPUBs are just a version of HTML. Controlling white space on the page is the job of CSS. Doing it any other way is really futile.

grapplegirl
12-14-2010, 10:05 AM
do not create your blank lines with paragraph returns. ePub doesn't support that. apply a style sheet with space after that matches your leading.

Toxaris
12-14-2010, 01:43 PM
do not create your blank lines with paragraph returns. ePub doesn't support that. apply a style sheet with space after that matches your leading.

ehm, ePub does. Just add an &nbsp; and your off to go. Not a nice solution, but it works. It is better to do it with stylesheets though.

eBookLuke
12-14-2010, 09:00 PM
InDesign is not the best tool to create ePubs…
After many tries I loose all hopes* and I build my own tool to build professional looking ePubs.

Luke

*Italian locution, I don't know if it is the same in perfect English

Adjust
12-15-2010, 07:21 PM
InDesign is not the best tool to create ePubs…
After many tries I loose all hopes* and I build my own tool to build professional looking ePubs.

It is if you are converting Print editions to ePub.