View Single Post
Old 04-23-2014, 04:39 AM   #38
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JLius View Post
I guess the answers to my initial question are a lot more complicated than the question itself
I don't understand half of what you guys are talking about, but I find it interesting none the less.
Actually, the answer to your question is really simple. <u> is not a valid element in an EPUB's XHTML code, which is why you got an error message that translates to "that thing's not allowed here!" The solution is, as stated earlier, to change all your U elements to SPAN elements that are associated with a CSS rule that says to underline the contents. Other posts have gone into more detail on that front; there's no need for me to repeat it.

Quote:
Originally Posted by JLius
Mind to elaborate on that? Where is this dtb:depth value set, and how do I tweak it so that epub check catches the deviations?
It's in your NCX file, which is probably named toc.ncx, and you'll see it near the beginning of the file. If you don't have any nesting in your table of contents, that value should be 1 - because you have a "flat TOC" which is one level deep. However, Calibre will give it a value of 2.

"Nesting" in that sense is, for instance, something like this:

Book One: The Larch
- Part I
-- Chap 1
-- Chap 2
- Part II
-- Chapman
-- Cleese
-- Palin
Book Two: Canada

... and so on. That structure shows a TOC that is three levels deep. The "Book X" is the first level, "Part Y" is the second, and "Chapter Z" is the third. Thus, for that TOC, the META tag in the NCX header that has the name "dtb:depth" should have a value of 3.

However, Calibre will assign a value of 4, because it's silly that way. I can't explain better without going pretty far into the weeds, and we're not exactly on paved ground as it is.

Quote:
Originally Posted by JLius
But I don't keep any of Calibre's CSS, I erase it and replace it with my own. I clean up the html, trying to keep the style as simple as possible. I also us Calibre to generate a TOC.
I'm actually in the process of writing a book, too. I'm doing it all from scratch, though; I use LibreOffice* for the actual writing, and I maintain a CSS file that correlates to the style names I've defined. Despite how the usual guides say to do things,** I'm keeping each book element (part dividers, chapters, dedication, etc.) in a separate file, but I'm using the same template for all of it. This way, as I complete or edit a chapter, I can add it to the EPUB-in-progress and check it out.

If I were using Calibre, I'd be afraid that it would merrily rename all of my classes and thereby break that link between my hand-tooled CSS file and the LibreOffice-generated HTML.

* Weirdly, the Portable version works better for me than the "real" Windows version. I don't know why, but the "real" version exports uppercase HTML tags while the Portable version exports lowercase tags. Pretty much all I have to do is replace the header, unwrap the text, convert <br> to <br/>, and I'm good to go. If anyone reading knows how to automate those steps, I'd really like to know. I can do it in a few seconds, but that's every time on every file...

** Smashwords says to use one big document, but I'm hoping that by the time I'm done, their "direct EPUB upload" feature will be out of beta and will be set up to cross-generate to their other formats. I don't trust meat grinders.
Rev. Bob is offline   Reply With Quote