View Full Version : wondering how to create chapters....


crazyknitter42
11-01-2010, 05:43 PM
I have a nook, and am in the process of creating some documents as pdf to be converted to epub.
I want to give these documents 'chapters', so that I can search faster on the nook.
Is there a tutorial somewhere? Or can someone tell me a bit of how to do this with calibre?

HarryT
11-01-2010, 06:17 PM
Don't create PDF files if you're subsequently going to want to convert to some other format; PDF files convert very badly to other formats. Save your files in a format such as HTML which can easily be converted. If you save a separate HTML file per chapter, you'll automatically have chapter breaks in the resulting ePub file.

st_albert
11-01-2010, 09:07 PM
Or, rather than breaking into individual files yourself, just insure that each chapter has a header such as

<h2>Chapter One</h2>

etc. when the file is saved as one big HTML file.

Then tell calibre to look for the h2 tag and break chapters based on that.

Ankh
11-01-2010, 09:55 PM
Then tell calibre to look for the h2 tag and break chapters based on that.

I am not sure (and would like to be corrected if I am wrong) that this is equivalent to what HarryT suggested.

I think that calibre will create TOC entries based on <h2> tags, but will not create an individual xhtml file for each chapter. I know for sure that ADE on my prs505 favours bigger number of smaller files inside epub. A chapter per xhtml file is about right.

st_albert
11-01-2010, 10:47 PM
I am not sure (and would like to be corrected if I am wrong) that this is equivalent to what HarryT suggested.

I think that calibre will create TOC entries based on <h2> tags, but will not create an individual xhtml file for each chapter. I know for sure that ADE on my prs505 favours bigger number of smaller files inside epub. A chapter per xhtml file is about right.

Not exactly what HarryT was suggesting. He suggested you manually break the text apart into chapters. I am suggesting you let calibre do that. Yes, it really will. Here's how:

If you are converting, say, one single html file to epub, and in that html file all your chapters have an <h1>Chapter so-and-so</h1> header you can put the html file into calibre and click on "convert books." In the pop up menu, select the "structure detection" tab and use the wizard for "detect chapters at" to indicate what the chapter tags are (<h1> in the above example). For "chapter mark" select "pagebreak" in the drop-down box.

Then on the "EPUB output" page, be sure "Do not split on page breaks" is NOT checked. That should cause calibre to break up the book by chapter, when you perform the conversion.

crazyknitter42
11-02-2010, 09:19 AM
Thanks. I am going to give this a try.
:thanks:

jbcohen
11-02-2010, 09:23 AM
Personally I think this is a function of the word processor that you are using to acomplish the task. Open Office has a function to acomplish that at the click of an icon. I think its the only office suite that provides for this.

crazyknitter42
11-02-2010, 07:05 PM
I tried it. It didn't work. So, I am trying to figure out what I did wrong or what I need to do differently.

Ankh
11-02-2010, 09:44 PM
I am suggesting you let calibre do that. Yes, it really will. Here's how:

If you are converting, say, one single html file to epub, and in that html file all your chapters have an <h1>Chapter so-and-so</h1> header you can put the html file into calibre and click on "convert books." In the pop up menu, select the "structure detection" tab and use the wizard for "detect chapters at" to indicate what the chapter tags are (<h1> in the above example). For "chapter mark" select "pagebreak" in the drop-down box.

Then on the "EPUB output" page, be sure "Do not split on page breaks" is NOT checked. That should cause calibre to break up the book by chapter, when you perform the conversion.

Worked like a charm. Thanks, have some karma.

st_albert
11-02-2010, 10:44 PM
I tried it. It didn't work. So, I am trying to figure out what I did wrong or what I need to do differently.

So am I. Care to provide some details as clues?

What did you start with?

What settings did you use (in calibre)?

What was the result? I.e. what happened that you did not want/expect?

Any error messages? Or other wierdness that seemed strange to you?

etc.

If I understand what you were trying to do, I think it should work almost with default calibre settings. At least, it has for me. I have converted pdf -> html via pdftohtml + pdfreflow, then html -> epub via calibre.

The last step has worked a treat for me so far. The first two steps, not so much. Which is why HarryT recommended that you NOT start with a pdf.

YMMV

Ankh
11-02-2010, 11:53 PM
If I understand what you were trying to do, I think it should work almost with default calibre settings.

Not almost, those are the default settings in the latest release.

st_albert
11-03-2010, 12:33 AM
Not almost, those are the default settings in the latest release.

What I meant by "almost" was that one MAY have to modify the settings to identify chapter headers. Otherwise, the defaults will stand.

Glad you were able to make it work for you. It is a powerful piece of software, especially for those who are willing to put forth some effort to discover how it might work for them.

Just sayin' :D

Toxaris
11-03-2010, 06:25 AM
Of course you can also load your epub in Sigil (or HTML) and place chapter marks there. Works like a charm and you can easily if the result is what you want.

crazyknitter42
11-03-2010, 04:04 PM
So am I. Care to provide some details as clues?

What did you start with?

What settings did you use (in calibre)?

What was the result? I.e. what happened that you did not want/expect?

Any error messages? Or other wierdness that seemed strange to you?

etc.

If I understand what you were trying to do, I think it should work almost with default calibre settings. At least, it has for me. I have converted pdf -> html via pdftohtml + pdfreflow, then html -> epub via calibre.

The last step has worked a treat for me so far. The first two steps, not so much. Which is why HarryT recommended that you NOT start with a pdf.

YMMV

I know how to convert a pdf to a html, but what is this "pdfreflow"?

Stange, when I put in the <h1>chapter-so-and-so</h1> my document did not accept it as a "code" but just letters part of the chapter so my. :smack:
What did I do wrong?

Ankh
11-03-2010, 06:49 PM
It is a powerful piece of software, especially for those who are willing to put forth some effort to discover how it might work for them.

And those who continue to closely follow it's development. Which is not easy, considering how productive Kovid is.

There was a time when calibre would not by default split chapters into separate (x)html files. The Baen's Honorverse ePubs are that way, and they were converted using (one of the previous versions of) Calibre.

st_albert
11-04-2010, 07:28 PM
I know how to convert a pdf to a html, but what is this "pdfreflow"?

Stange, when I put in the <h1>chapter-so-and-so</h1> my document did not accept it as a "code" but just letters part of the chapter so my. :smack:
What did I do wrong?

we are talking about html files, are we not? If so was the <h1>whatever</h1> tag inside the <body> section?

as for pdfreflow, I'm talking about the javascript program, not the Calibre utility.

See http://www.mobileread.com/forums/showthread.php?t=83094