View Full Version : start a new page in an epub book ?


NASCARaddicted
08-08-2009, 02:22 PM
In a normal book, at the end of the chapter, the remaining page usually is empty. The next chapter starts on the next page. Can this also be done on ebooks (especially in epub files) ?

Right now, when I scan a book or convert an ebook, I save it as html files and convert it to epub. So is there an html code that tells the ebook reader to continue on the next page ? The simplier the better.

You know like when you want to start a new paragraph, you use the "br" command. Is there something similar for an entire page ?

Thanks in advance.

yekim54
08-08-2009, 02:44 PM
In a normal book, at the end of the chapter, the remaining page usually is empty. The next chapter starts on the next page. Can this also be done on ebooks (especially in epub files) ?

Right now, when I scan a book or convert an ebook, I save it as html files and convert it to epub. So is there an html code that tells the ebook reader to continue on the next page ? The simplier the better.

You know like when you want to start a new paragraph, you use the "br" command. Is there something similar for an entire page ?

This will insert a page break in html:

<br style="page-break-after:always">

jgray
08-09-2009, 05:47 AM
I don't know what device you are reading on, but a proper epub renderer should start a new "page" (screen) at chapter headings. So, you can use normal <h1>, <h2>, etc. tags. I would suggest not forcing things with <br/> tags. That may cause problems and is not semantic.

Jellby
08-09-2009, 06:33 AM
I don't know what device you are reading on, but a proper epub renderer should start a new "page" (screen) at chapter headings.

Hmm... Proper ePUB renderers should start a new page when a new file (inside the ePUB) begins and whenever a manual pagebreak (with the page-break-before or page-break-after CSS properties) is encountered.

Usually ePUB creators split the files at chapter headings, but if they don't, the renderer should not add a spurious pagebreak there.

NASCARaddicted
08-09-2009, 07:34 AM
I don't know what device you are reading on, but a proper epub renderer should start a new "page" (screen) at chapter headings. So, you can use normal <h1>, <h2>, etc. tags. I would suggest not forcing things with <br/> tags. That may cause problems and is not semantic.

I use a Bebook (as stated under my screenname) and I already use tags like <h1> and <h2> for new chapters. I convert my files with Calibre (the newest version, 0.6.5).

So far yekim was correct,
<br style="page-break-after:always"> works. It starts a new page at the beginning of the new chapter.

The only strange thing so far is: The book starts with <h1> author name and the next line says <h2> book name. Even though the page-break-after command comes later, the author name and the book name are on 2 different pages. So the ebook right now starts with the author name and the rest of the page is empty ...

Also, I have to check what is if there are pictures included. I don't want to start a new page just because of a picture. But right now I have no time to check.

As for br commands: so far I always used <br/> to start a new line (not page) is that wrong ? Should I use </p> instead ?

ilovejedd
08-09-2009, 12:39 PM
The only strange thing so far is: The book starts with <h1> author name and the next line says <h2> book name. Even though the page-break-after command comes later, the author name and the book name are on 2 different pages. So the ebook right now starts with the author name and the rest of the page is empty ...

As for br commands: so far I always used <br/> to start a new line (not page) is that wrong ? Should I use </p> instead ?
Hmm, does the book name contain any of the words book, section, part or chapter by any chance? I remember one of files I was converting using Calibre kept breaking up on the title. Apparently, it was because it found "Party" in the title. If you're using something else to create your ePUB, then I have no idea what's causing it. Best way would be to unzip the ePUB and study the contents.

<br/> is for line breaks. If you want to signify a paragraph, the correct tag to use is <p></p>.

Jellby
08-10-2009, 06:11 AM
The only strange thing so far is: The book starts with <h1> author name and the next line says <h2> book name. Even though the page-break-after command comes later, the author name and the book name are on 2 different pages. So the ebook right now starts with the author name and the rest of the page is empty ...

Maybe Calibre is automatically adding a page (file) break before <h2> too?

DaleDe
08-11-2009, 01:22 AM
Maybe Calibre is automatically adding a page (file) break before <h2> too?

Yes it would. Calibre has a search routine that would do this automatically. You can use h1 one place to mean chapters and another place meaning the title and expect it to figure this out on its own.

Dale

NASCARaddicted
08-11-2009, 05:29 AM
thanks so far, I finally managed to solve the problem.

The new page between author and book name only happened when I used <br style="page-break-after:always">. And just to add: the author was h1, the bookname was h3, while the chapter names are in h2

So I looked at Calibre and saw the part with "pagebreak before". Since I use h2 only on chapters, I told Calibre to do a pagebreak before h2 .... and now everything looks fine.

K-Thom
08-18-2009, 08:11 PM
You may also use Sigil as editor for non-DRM epub files and include the page breaks easily into existing epubs. Never tried it with html, but afaik it should work, too.

The only strange thing so far is: The book starts with <h1> author name and the next line says <h2> book name. Even though the page-break-after command comes later, the author name and the book name are on 2 different pages. So the ebook right now starts with the author name and the rest of the page is empty ...

Did you add/delete anything between those two lines? I always have to take care of this, when I add the "style="page-break-after:always" first and the heading format later and use WYSIWYG to change a <br> into <p> in order two separate lines for author and title.
Check the source code. It's very likely you'll find a "style="page-break-after:always" between the two lines.

So I looked at Calibre and saw the part with "pagebreak before". Since I use h2 only on chapters, I told Calibre to do a pagebreak before h2 .... and now everything looks fine.

Ah, forgot about this calibre option. Happened to me in the beginning, too. ;)