![]() |
#1 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Oct 2013
Device: all e-books
|
Is it possible to apply CSS to Sigil generated TOC?
We use CSS counters to number questions and chapters in our Advocacy Guides.
We update the guides every year and sometimes insert a question or a new chapter or reorder these. The TOC consists of Chapters and an entry for each question, but because it is generated automatically it does not capture the numbering of the headings. So the entries we need are all there, but not numbered. Using CSS to automatically number both makes it much easier to update the guides every year and maintain all the links and internal cross references. We can use CSS to automatically number an HTML TOC, but wonder if I can apply CSS to the navpoint tags within the automatically generated TOC? If so, how? Thanks, Caroline |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
CSS counters aren't supported by ePub 2 (which is what Sigil is limited to).
The data in the navpoint tags of an ncx file are usually displayed however the reading system sees fit. Last edited by DiapDealer; 10-23-2013 at 12:11 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Oct 2013
Device: all e-books
|
Oh drat - well at least we now know what to do when we eventually evolve to EPub 3, eh?
Solves a bunch of questions for this round. thanks, Back to manual numbering ![]() c |
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,142
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Eventually is not going to be any time soon. There are not many devices out there that support ePub 3. Plus, there are a lot of ePub capable readers that will never be updated to handle ePub 3. So don't wait for ePub 3. You'll be waiting a very long time to release your book.
|
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Depends on what programs the readers are ultimately going to be using to read.
If this was a business environment and you knew that everyone was going to be non-ADE readers (iBooks, Readium, ...), or knowing that they were using the newest Kindles only, you can use fancy things like CSS Counters. If you are selling it through B&N/Amazon/other stores (that are not under your direct control)... then yes... you would not be able to do a lot in EPUB. ![]() Maximum compatibility, sadly means that hard-coding the numbers is your best bet. In some cases (dropcaps, smallcaps, ...), you can use more complex CSS in your EPUBs, BUT, you always have to keep in mind graceful degradation. |
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
If you know what reading device will be used, why complicate matters by using an epub format at all? Epub is about pouring text into different sized containers, but necessarily forgoing a lot of control over layout. If you KNOW the screen size and resolution, compose in any program with the features you require, distribute a pdf.
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Repeating this over and over does not make it true. While it has some merit with regard to reflowable electronic text in general, there is no underlying "precept" of the ePub spec that requires the relinquishing of all (or even most) control over layout. If there were such a precept, there'd be no reason for ePub to support CSS at all. It would just render vanilla if no user preferences were specified. Not a terrible idea by any means, just not very real-world relevant. Is it possible you're confusing what ePub is with what you'd prefer it be?
Last edited by DiapDealer; 10-26-2013 at 12:16 PM. |
![]() |
![]() |
![]() |
#9 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Maybe :-) But isn't the reality that although we have some control over styling, we have little over layout?
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
All depends on where you want to draw the line that defines the two. The point is: ePub's not just a text-pour. If it were, you'd simply define paragraphs, headers and other "archetypal" book entities and let fly. Epub and user settings would do the rest. That may be what you do (and there may even be many advantages to that), but by no means, does it have anything to do what ePub is or isn't. That (the "pouring of text and nothing more" analogy) is a personal, reflowable electronic-text philosophy that you wish others to embrace. Which is fine and dandy as long as you don't present it as anything other than such.
Last edited by DiapDealer; 10-26-2013 at 01:25 PM. |
![]() |
![]() |
![]() |
#11 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Quote:
If you're producing personal works of art for your own consumption only, that's something else. But, as I said, if the medium is known and fixed, what's the point of working within the constraints of epub? There are better ways of completely controlling layout and appearance in that case. |
|
![]() |
![]() |
![]() |
#12 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#13 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Well, any format's ABOUT what it's useful for, what it's good at! The same way a spreadsheet is about number-crunching, despite its superficial suitability for displaying tabular data - then you need to print a page out and realise why you'd have been better off starting in Word.
I fear there's less middle ground than we'd like there to be, if our e-publishing is aimed outward, not confined to a closed system. |
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
We're obviously done here.
|
![]() |
![]() |
![]() |
#15 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
MathML would be an extremely important requirement for many books. In the case of a complex math book, you can say something along the lines of: "This EPUB can only be read on any program that supports MathML". Sure, the amount of readers using programs that read MathML means that your potential market is much smaller, but the possibilities of creating this currently using EPUB2 are close to nil (could potentially be produced with a massive amount of SVGs). (much smaller >>> nil) With PDF, you will be forced back into the "page" layout. Although you will have more of the advantages of having fixed-format (MUCH more complex looking books, more advanced typography, etc. etc.). EPUB has the advantage of working on any screen size (plus reflowability, changing fonts, changing colors, changing font-size, changing margins, etc. etc.), while creating a PDF for a specific device means, you will be limited to that "paper size"/resolution. If you have any examples of reflowable PDFs which work well on small/large devices alike, please share... Also, if you have any EPUB2 examples of math books, please point them in my direction, I would LOVE to take them apart. ![]() I would love to see great examples, and any explanations of workflows of how you got from A to B. Side Note: Perhaps this company already has a large catalog of already built content (such as the original poster). The way the workflow is set up, they already have a massive amount of code that uses CSS to generate their numbered lists. It is up to the company to weigh the pros/cons of how much time/effort/money it would take to convert to EPUB2 (hard code numbers), or releasing it as is as EPUB2/3 geared towards programs which can handle more complex CSS (and severely limiting the potential market). Another Side Note: Perhaps these books/documents are not going for sale at all, and perhaps are just there for convenience to users. For example: Here is the 2013 Guidelines as .doc, .odt, .epub, .mobi, .kf8, .pdf, .html, ... Edit: I just thought of this potential solution. Since you already have well marked HTML, but are only missing the auto-generated #s. Would it be possible to have Sigil carry you most of the way? You can have Sigil auto-generate a toc.ncx, you can then come up with some sort of script to manually add in numbers to each navpoint. Code samples of everything could potentially help us iron out problems (a typical chapter, your HTML TOC, your CSS, the toc.ncx, ...)! Last edited by Tex2002ans; 10-26-2013 at 05:48 PM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CSS: Styles for <cite> won't apply | kevlin | Sigil | 4 | 01-11-2012 12:29 PM |
Generated TOC links back to TOC page in the book | Caleb666 | Sigil | 7 | 08-17-2011 11:58 AM |
auto-generated TOC with Sigil 0.4 | bobcdy | Sigil | 2 | 04-05-2011 12:48 AM |
Sigl auto-generated CSS | deckoff | Sigil | 10 | 08-19-2010 03:46 PM |
Calibre's generated css for epub | brewt | Calibre | 7 | 12-29-2008 09:59 AM |