View Full Version : New epub ... TOC not working


Sharlene
10-18-2011, 03:21 PM
I am in the process of creating an epub file.

Everything looks good in html format, it looks good in Calibre, works well in Adobe Digital Editions ... but ... when it's transferred to the Sony Reader the TOC doesn't work.

When i click on a specific chapter from the TOC it jumps down to the area just before the page break, instead of just after the page break where the chapter actually starts. I've changed the coding between

page-break-after: always;
and
page-break-before: always;

nothing is working.

Does anyone know why this is happening, and how I would be able to fix it?

Thank you :help:

Toxaris
10-19-2011, 04:50 AM
Since the Sony readers uses ADE, I think is also does not work well in ADE...

Anyway, how did you create your TOC? Could you post your opf and nxc file?

Sharlene
10-19-2011, 11:50 AM
My TOC is in my xml file as follows:

<li><a href="#prologue">Prologue</a>
<li><a href="#chapter1">Chapter 1</a>
<li><a href="#chapter2">Chapter 2</a>

Called to:

<span id="prologue"><p class = "chapter">Prologue</p></span>
<span id="chapter1"><p class = "chapter">Chapter 1</p></span>
<span id="chapter2"><p class = "chapter">Chapter 2</p></span>

This is what's in my 'chapter' parameters:

p.chapter
{
page-break-before: always;
margin-top:1em;
margin-bottom:1em;
text-indent: 0em;
text-align: center;
font-weight: bold;
font-size: 1.5em;
}

I don't have a .nxc file. the .opf file is attached

Please do keep in mind that this is my first ebook ever, so if there's something that i'm majorly missing, please let me know.

I've also tried the "Force use of auto-generated Table of Contents" option in Calibre .... but that didn't help either.

Thanks.

DaleDe
10-19-2011, 02:06 PM
Get rid of the span and place the id in the p. It would be better is the p were h2 or h3 anyway since semantics of a a chapter heading is better to be called a heading rather than a paragraph. Then you can drop the class simplifying things further.

The pages are working like you coded them. The id is search for and then the p is encountered resulting in a page break.

Dale

Toxaris
10-19-2011, 02:25 PM
I agree with DaleDe. Get rid of the spans, they are not necessary and use header tags. After all, that's what they are for.

Also, you say you don't have a toc.ncx? I think you must have, I believe it is a requirement for the inline TOC. Just as a question, why are you making a separate TOC instead of the normal inline TOC?

Sharlene
10-19-2011, 02:31 PM
Thank you so much for your help DaleDe. I will try that.

Toxaris, as this is my first ebook, I'm just learning as i go along. I don't really know much about inline TOC's or not ... I just put one in because the book i'm doing has chapters. How do you create an inline TOC? and does it work with every ebook format?

JSWolf
10-19-2011, 02:44 PM
No need for IDs. Just have your ToC open the file it should be opening. Given that each chapter should be a separate XML file, just call it as needed.

Also, since this is an ePub, please remove the internal ToC. It's just not needed and doesn't look good. Just do the ToC in toc.ncx. The worst thing done in an ePub is an internal ToC with all the headers linking to this internal ToC. I find that really poor and ugly too. Remember, this is ePub, not mobipocket and ePub does not need a ToC page.

Sharlene
10-19-2011, 04:09 PM
oh. um. Each chapter is supposed to be a different file?? I just have one file as the whole manuscript. Is that all totally wrong?? Do I have to go and break everything into its individual sections?

JSWolf
10-19-2011, 04:20 PM
oh. um. Each chapter is supposed to be a different file?? I just have one file as the whole manuscript. Is that all totally wrong?? Do I have to go and break everything into its individual sections?

Yes, you do. If you don't, it may not work on mobile devices.

DaleDe
10-19-2011, 04:48 PM
oh. um. Each chapter is supposed to be a different file?? I just have one file as the whole manuscript. Is that all totally wrong?? Do I have to go and break everything into its individual sections?

They do not need to all be in separate files. For use on mobile devices the files should be less than 300KBytes so it really depends on how long the book is and how long each chapter is. There is a free download called Sigil that has its own forum here on MobileRead. It is an excellent tool for creating ePub. It will deal with most of the boiler plate and allow you to worry about the content.

Dale

Sharlene
10-19-2011, 05:10 PM
Thank you so much for all of your help. The epub file as it stands now is at 465KB

I won't be able to test the TOC until tomorrow, so I will post more then. In the meantime I will look into Sigil.

JSWolf
10-19-2011, 05:18 PM
Sounds like it would need to be split. That's the way to do it to make sure that everything works. Also, if you can get a hold of a reader such as a Sony Reader to make sure everything works that would be good.

Toxaris
10-20-2011, 02:56 AM
Splitting each chapter in a separate file is usually a good thing to do. It is not always required. It has some advantages, one of them is maintenance.
Your epub will probably give issues, since the uncompressed size is larger than 285kb. That figure is usually a save size. If you split on chapter, almost certain no individual XHTML file will be larger than 285kb.

Sharlene
10-27-2011, 12:30 PM
Sorry it's been a while. Thank you all for your help. I got the TOC to work :) Now i'm on to new things...ie. separating chapters and imbedding fonts :) See you guys around on the boards.

ChaJudLeoBit
01-25-2014, 07:11 AM
On this subject of chapters, if anyone is still around, I'd like to add a question.

I built the TOC of a book in Sigil, but when it was being uploaded to B&N, they said they were not detecting chapters. Anyone know how I can fix this?

Thanks!

theducks
01-25-2014, 12:09 PM
On this subject of chapters, if anyone is still around, I'd like to add a question.

I built the TOC of a book in Sigil, but when it was being uploaded to B&N, they said they were not detecting chapters. Anyone know how I can fix this?

Thanks!

Which TOC did you build (write) ?
EPUB does not need an 'inline' (xhtml) TOC

ChaJudLeoBit
01-26-2014, 03:54 AM
Thank you so very much for your reply.

I used the TOC builder in Sigil that uses headings. I took a screen shot of the TOC and my manifest to show you.


The B&N instructions say this:

Manifest The manifest identifies every file contained in the epub if a file is not identified, it will not be accessible. Example of different file statements:

< item id="pt" href="my_page.xpgt" media-type="application/vnd.adobe-page- template+xml" />
< item id="style" href="mystyle.css" media-type="text/css" />
< item id="image001" href="image001.jpg" media-type="image/jpeg" />
< item id="image002" href="image002.png" media-type="image/png" />
< item id="cover" href="cover_page.xhtml" media-type="application/xhtml+xml" />
< item id="toc" href="content_page.xhtml" media-type="application/xhtml+xml" />
< item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
Note that item id "toc" refers to the physical contents page while item id "ncx" refers to the file that controls eBook navigation.


And I am afraid to make any big changes in my manifest until I understand what I need to change.

Can you offer any advice?

Thanks!
Cat:thanks:

Hitch
01-26-2014, 04:34 AM
Thank you so very much for your reply.

I used the TOC builder in Sigil that uses headings. I took a screen shot of the TOC and my manifest to show you.


The B&N instructions say this:

Manifest The manifest identifies every file contained in the epub if a file is not identified, it will not be accessible. Example of different file statements:

< item id="pt" href="my_page.xpgt" media-type="application/vnd.adobe-page- template+xml" />
< item id="style" href="mystyle.css" media-type="text/css" />
< item id="image001" href="image001.jpg" media-type="image/jpeg" />
< item id="image002" href="image002.png" media-type="image/png" />
< item id="cover" href="cover_page.xhtml" media-type="application/xhtml+xml" />
< item id="toc" href="content_page.xhtml" media-type="application/xhtml+xml" />
< item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
Note that item id "toc" refers to the physical contents page while item id "ncx" refers to the file that controls eBook navigation.


And I am afraid to make any big changes in my manifest until I understand what I need to change.

Can you offer any advice?

Thanks!
Cat:thanks:

Did you tell NookPress to use the original file you uploaded, versus a file that they will create "over" the file, inserting their own CSS, etc.?

Hitch

ChaJudLeoBit
01-26-2014, 05:45 AM
Did you tell NookPress to use the original file you uploaded, versus a file that they will create "over" the file, inserting their own CSS, etc.?

Hitch

I sent an e-mail to the person who attempted the upload to find out if this was an option. If she chose the second, this would cause the program to be unable to detect chapters?

Hitch
01-27-2014, 04:58 AM
I sent an e-mail to the person who attempted the upload to find out if this was an option. If she chose the second, this would cause the program to be unable to detect chapters?

Well, I suspect that you have two issues.


I'm not sure about this one, as it's not clear from your post if your content item in the manifest si simply a sample, or all of it, but I thought you'd said previously that you were splitting the main body of the book into chapter files, but now I don't see that on your manifest; I see a single file indicating content. As I said, not sure about that one.
You used a paragraph style for your chapter heads? Not a heading style? Try copying your file, and then regex (search and replace) all your paragraph class headers with Header class headers. Then submit to NookPress, and see if you get a different result.


Never forget: headers are NOT FOR STYLING. They are NOT for crafting how something LOOKS. Headers should not be used instead of creating a CSS class for something like, Bold, 24pt. They are structural. An H2 belongs, outline-wise, below an H1. An H3, below an H2, etc. Somethat like this:

h1.
H2.
H3.

etc.

Paragraphs should go beneath headers, in their appropriate respective levels. It's entirely possible that NookPress only looks for header-classed Chapter heads. It's just an idea as to why NookPress may be failing. If you've not separated out the chapters with splits, do that also.

Hitch

ChaJudLeoBit
01-31-2014, 03:13 AM
Well, I suspect that you have two issues.


I'm not sure about this one, as it's not clear from your post if your content item in the manifest si simply a sample, or all of it, but I thought you'd said previously that you were splitting the main body of the book into chapter files, but now I don't see that on your manifest; I see a single file indicating content. As I said, not sure about that one.
You used a paragraph style for your chapter heads? Not a heading style? Try copying your file, and then regex (search and replace) all your paragraph class headers with Header class headers. Then submit to NookPress, and see if you get a different result.


Never forget: headers are NOT FOR STYLING. They are NOT for crafting how something LOOKS. Headers should not be used instead of creating a CSS class for something like, Bold, 24pt. They are structural. An H2 belongs, outline-wise, below an H1. An H3, below an H2, etc. Somethat like this:

h1.
H2.
H3.

etc.

Paragraphs should go beneath headers, in their appropriate respective levels. It's entirely possible that NookPress only looks for header-classed Chapter heads. It's just an idea as to why NookPress may be failing. If you've not separated out the chapters with splits, do that also.

Hitch

I used headers, but I may have chosen H2 instead of H1 because they came out SO BIG. I will go check right now.

I take that back. All chapter headings are H1.
I'll include a screen shot of the chapter list and my TOC.

Toxaris
01-31-2014, 03:45 AM
I used headers, but I may have chosen H2 instead of H1 because they came out SO BIG. I will go check right now.

That is why Hitch already said that the header styles are for structure, not display. By default H1 is big, but you can easily mold into your liking with some CSS. What important is the identification of the header with the header tags.

Have you also created a XHTML TOC as apparently is required by B&N?

Hitch
01-31-2014, 03:53 AM
I used headers, but I may have chosen H2 instead of H1 because they came out SO BIG. I will go check right now.

I take that back. All chapter headings are H1.
I'll include a screen shot of the chapter list and my TOC.

Actually, I was talking, or recalling, Charlene's post in this: http://www.mobileread.com/forums/showpost.php?p=1793822&postcount=3 in which she'd used a paragraph class for chapterheads. My bad.

Vis-a-vis this:

I sent an e-mail to the person who attempted the upload to find out if this was an option. If she chose the second, this would cause the program to be unable to detect chapters?

Allowing Nook to make changes to the book allows it to override the CSS, so, yes: it could. Not necessarily will, but could. Why don't you just use your own test account at NookPress and test it yourself? That's what I do when I have a client doing the driving, and I'm not there to see what's happening.

I don't see any immediate reason that your book's chapters shouldn't be detected, except one hairball possibility, which I'd love to say is nuts, but: is it possible that NookPress now also looks for an HTML TOC? Which you don't appear to have in your ePUB? Yes, yes, I know: not needed for ePUB2, and preferably, not used, but I wonder if NookPress is now looking at Word-generated TOC's, which are inline TOC's, for chapters? Just a ponderment.

Also, vis-a-vis this:

I used headers, but I may have chosen H2 instead of H1 because they came out SO BIG.

That's what CSS is for. Fix them there, rather than then choosing a different heading.

Without seeing more, it's very difficult to know what's going on there.

ETA: I see Toxaris got to this post first. What he said.

Hitch

Simon_M
01-31-2014, 05:54 AM
That's what CSS is for. Fix them there, rather than then choosing a different heading.

I was going to add this, but you beat me to it! Just to elaborate, level headings (h1/2/3 etc) really have semantic value more than aesthetic - they signify the 'level' of a heading, helping mark out sections from sub-sections and sub-sections of sub-sections. Where possible, best practice is to use the next level down from the nearest parent heading, and if devices style it undesirably then adjust the size using CSS. Each device/rendering engine will have very different ideas of how large/small any particular level heading might need to be displayed at any given font/location.

mrmikel
01-31-2014, 08:22 AM
This can be a concept that can be hard to grasp, but there really are two DIFFERENT kinds of tags.

One group, like i, em, b are for prettying up the text. Others like h, are for telling the reader- Attention, this is division of the book, a part, chapter, or subsection.

If it is just for you and you never you use an index, you can get away with mixing them like a mad cocktail party. If it is for publication or someone else, mixing them will give you a hangover as whatever program, publisher or e-reader tries to figure out where the chapters are.

DaleDe
01-31-2014, 11:35 AM
This can be a concept that can be hard to grasp, but there really are two DIFFERENT kinds of tags.

One group, like i, em, b are for prettying up the text. Others like h, are for telling the reader- Attention, this is division of the book, a part, chapter, or subsection.

If it is just for you and you never you use an index, you can get away with mixing them like a mad cocktail party. If it is for publication or someone else, mixing them will give you a hangover as whatever program, publisher or e-reader tries to figure out where the chapters are.

Actually em is really designed for semantics just as h tags, not for prettying the text. This is why it replaced the i tag. CSS is still used to decide how it should be styled in the book display but em really says to emphasize this text.

And h2 is a perfectly acceptable starting point in a TOC. You do not need to begin with an h1. Some users have been known to use h1 for the title.

Dale

mrmikel
01-31-2014, 01:46 PM
I stand corrected. But I don't want to have an ereader decide how it should be emphasized. I like the i!

In most readers, the h1 is very very large, so starting with h2 makes perfect sense.

LadyKate
02-04-2014, 07:19 AM
I do my conversions using one file and find that calibre does a great job of splitting the file into chapters when I code it right. Much simpler to keep the entire file together for editing purposes and let the program handle interpreting the code for the splits.

As for not doing a Table of Contents I'm curious why. I personally like a table of contents with a link back for anthologies.

Toxaris
02-04-2014, 10:16 AM
As for not doing a Table of Contents I'm curious why. I personally like a table of contents with a link back for anthologies.

Because an ePUB2 has an internal TOC already...

DiapDealer
02-04-2014, 10:28 AM
An ePub doesn't NEED an inline HTML toc. This is certain.

I see no real downside, however, if it's someone's personal preference to include one. Readers aren't forced to utilize them afterall. "Wolfie don't like 'em" was never a valid enough reason in my eyes. ;)

ChaJudLeoBit
02-07-2014, 03:11 AM
Vis-a-vis this:



Allowing Nook to make changes to the book allows it to override the CSS, so, yes: it could. Not necessarily will, but could. Why don't you just use your own test account at NookPress and test it yourself? That's what I do when I have a client doing the driving, and I'm not there to see what's happening.

I don't see any immediate reason that your book's chapters shouldn't be detected, except one hairball possibility, which I'd love to say is nuts, but: is it possible that NookPress now also looks for an HTML TOC? Which you don't appear to have in your ePUB? Yes, yes, I know: not needed for ePUB2, and preferably, not used, but I wonder if NookPress is now looking at Word-generated TOC's, which are inline TOC's, for chapters? Just a ponderment.

Also, vis-a-vis this:



That's what CSS is for. Fix them there, rather than then choosing a different heading.

Without seeing more, it's very difficult to know what's going on there.

ETA: I see Toxaris got to this post first. What he said.

Hitch[/QUOTE]



Interesting thought to create my own NookPress account. I didn't want to accidentally publish someone else's book. But maybe I should try that. The writer is doing the KDP where where can't upload her book anywhere else right now. That's why we haven't been able to check it yet.

I really hope that what you mentioned is why it did this. Y'all said a whole lot of other stuff that went over my head, so I hope it isn't any of that.

Hitch
02-07-2014, 04:34 AM
Interesting thought to create my own NookPress account. I didn't want to accidentally publish someone else's book. But maybe I should try that. The writer is doing the KDP where where can't upload her book anywhere else right now. That's why we haven't been able to check it yet.

I really hope that what you mentioned is why it did this. Y'all said a whole lot of other stuff that went over my head, so I hope it isn't any of that.

Well:


Creating your own NookPress, or KDP account, is pretty much a necessity if you plan on making other people's books. Simply making the account and uploading the book for a TEST isn't publishing it. (Except on Smashwords, which is idiotic, but that's another discussion).
KDP doesn't care if you sell somewhere else. KDP Select does. If she's simply publishing to KDP, then she can publish anywhere else.
Regardless, as you'd just be testing a draft, that means you can check this at Nook now, yourself, instead of trying to troubleshoot it third-hand and via hearsay.


If a lot of what I said went over your head, to use your words, you may want to get your friend some professional assistance with this, because a great deal of what's been discussed on this thread is very, very basic stuff. Fundamental to ebook-making, not advanced at all. I'm not trying to hurt your feelings, or be "mean," but it is. Which is a bit worriesome about the MOBI that is already being uploaded, not to mention the ePUB that seems to have inexplicable errors, not to mention this issue with the chapters not being found, which makes no sense whatsoever to me.

FWIW.
Hitch

Hitch
02-08-2014, 04:29 AM
ChaJudLeoBit:

Question: did you or your friend/client use Scrivener at any point in this process? I have a reason for asking, so if you could answer, that would help everyone here try to troubleshoot this.

Hitch

ChaJudLeoBit
02-21-2014, 03:01 AM
ChaJudLeoBit:

Question: did you or your friend/client use Scrivener at any point in this process? I have a reason for asking, so if you could answer, that would help everyone here try to troubleshoot this.

Hitch

No Scrivener. Only Calibre and Sigil.

I'd love to know your reason for asking. And it looks like I need to get me an account so I can check this myself.

Thanks to everyone. I am new and learning. Everyone starts somewhere. I have no background in programming, so this is why I didn't get all of the techie-stuff above. But this is a good place to learn. Right?

ChaJudLeoBit
02-21-2014, 05:53 AM
All is well

ChaJudLeoBit
02-21-2014, 06:35 AM
Ok, I got it to work by getting rid of the EPUB I had, and converting from the MOBI that was fine.

Thanks!