Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-02-2013, 09:38 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Q: CSS 'counter', 'counter-increment', etc.

I came across the CSS content, counter, counter-increment, and counter-reset and thought that these would be a great ( = 'easy') way to number sections and chapters.

Works great (text, TOC, etc.) in Sigil and in Calibre viewer, but in ADE and the Kindle the numbering and the content (like 'Section, 'Topc', 'Area' below don't appear.

Is this a lack of functionality in ADE and Kindle, or is there a workaround?


Code:
body
{
counter-reset:section;
}
h1
{
counter-reset:subsection;
}
h2
{
counter-reset:subsubsection;
}
h1:before
{
counter-increment:section;
content:"Section " counter(section) ". ";
}
h2:before 
{
counter-increment:subsection;
content:"Topic " counter(section) "." counter(subsection) " ";
}
h3:before 
{
counter-increment:subsubsection;
content:"Area "counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}


Paul
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	300
Size:	62.4 KB
ID:	107581  
Attached Files
File Type: epub Test CSS Counter.epub (3.1 KB, 195 views)

Last edited by phossler; 07-04-2013 at 05:03 PM.
phossler is offline   Reply With Quote
Old 07-02-2013, 09:53 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
I can across the CSS content, counter, counter-increment, and counter-reset and thought that these would be a great ( = 'easy') way to number sections and chapters.

Works great (text, TOC, etc.) in Sigil and in Calibre viewer, but in ADE and the Kindle the numbering and the content (like 'Section, 'Topc', 'Area' below don't appear.

Is this a lack of functionality in ADE and Kindle, or is there a workaround?


Code:
body
{
counter-reset:section;
}
h1
{
counter-reset:subsection;
}
h2
{
counter-reset:subsubsection;
}
h1:before
{
counter-increment:section;
content:"Section " counter(section) ". ";
}
h2:before 
{
counter-increment:subsection;
content:"Topic " counter(section) "." counter(subsection) " ";
}
h3:before 
{
counter-increment:subsubsection;
content:"Area "counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}


Paul
I think you found one of the CSS things that is not part of the EPUB spec, but works in some viewers

Rule of thumb: don't count on these kinds of Features, they will fail when you most need them
theducks is offline   Reply With Quote
Advert
Old 07-02-2013, 10:11 PM   #3
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
I think you found one of the CSS things that is not part of the EPUB spec, but works in some viewers

Rule of thumb: don't count on these kinds of Features, they will fail when you most need them
Darn, I was afraid that it was too easy.

Out of curousity, where do such CSS things get used then, browsers only???

I'll keep them in mind tho, maybe EPUB4 will allow them

Paul
phossler is offline   Reply With Quote
Old 07-03-2013, 08:10 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
Darn, I was afraid that it was too easy.

Out of curousity, where do such CSS things get used then, browsers only???

I'll keep them in mind tho, maybe EPUB4 will allow them

Paul
EPUB uses a subset of HTML and CSS.
So Web Browsers is the most common.

BTW Just because it IS allowed in the EPUB spec, does not mean that all devices support it. Just ask the professionals that visit here

TEST on different target devices, not just emulators.

And don't count on Sigil or Calibre's viewers either way (pass or fail). They have their render quirks also.
theducks is offline   Reply With Quote
Old 07-03-2013, 09:33 AM   #5
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,527
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by phossler View Post
I can across the CSS content, counter, counter-increment, and counter-reset and thought that these would be a great ( = 'easy') way to number sections and chapters.

Works great (text, TOC, etc.) in Sigil and in Calibre viewer, but in ADE and the Kindle the numbering and the content (like 'Section, 'Topc', 'Area' below don't appear.

Paul
Hi Paul;

Regarding Kindle, (at least K4NT) IT WORKS! I compiled your epub with Kindlegen 2.9 and the mobi I got shows numbering as should be.

Regards
Rubén
Attached Thumbnails
Click image for larger version

Name:	screen_shot-9189.gif
Views:	286
Size:	20.9 KB
ID:	107606  
RbnJrg is offline   Reply With Quote
Advert
Old 07-03-2013, 09:41 AM   #6
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@RbnJrg -- thanks, I used Calibre's convert to make the AZ3 and the Kindle previewer. I'll go back and double check and then use kindlegen to make a mobi file and see if that's better. I usually prefer AZ3 since I can select Publisher Font

@theducks -- you're right, I should have used the actual device. Lesson learned

Paul
phossler is offline   Reply With Quote
Old 07-03-2013, 10:24 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
@RbnJrg -- thanks, I used Calibre's convert to make the AZ3 and the Kindle previewer. I'll go back and double check and then use kindlegen to make a mobi file and see if that's better. I usually prefer AZ3 since I can select Publisher Font

@theducks -- you're right, I should have used the actual device. Lesson learned

Paul
I have been around before there was computer modeling .
Even then, we still built a bunch and tested the * out of them (Heat, cold, humid, drop...).
Then we gave some to users to destroy use.
theducks is offline   Reply With Quote
Old 07-03-2013, 11:44 AM   #8
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
Quote:
Originally Posted by phossler View Post
Out of curousity, where do such CSS things get used then, browsers only???
Well, most CSS happens in web pages! eBooks are just a minor backwater, using a dumbed-down version of XHTML.

Last edited by exaltedwombat; 07-03-2013 at 12:03 PM.
exaltedwombat is offline   Reply With Quote
Old 07-03-2013, 12:01 PM   #9
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
I have been around before there was computer modeling
I used to repair torn punch paper tape before we could load the computer

Paul

Last edited by phossler; 07-03-2013 at 12:04 PM.
phossler is offline   Reply With Quote
Old 07-03-2013, 12:12 PM   #10
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,527
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by phossler View Post
@RbnJrg -- thanks, I used Calibre's convert to make the AZ3 and the Kindle previewer. I'll go back and double check and then use kindlegen to make a mobi file and see if that's better. I usually prefer AZ3 since I can select Publisher Font

Paul
Yes, use Kindlegen instead of Calibre. And of course, to use this kind of feature, you must work with azw3 since the old mobi format doesn't support counters (actually doesn't support anything )
RbnJrg is offline   Reply With Quote
Old 07-03-2013, 01:39 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
I used to repair torn punch paper tape before we could load the computer

Paul
The object was to load it onto the ASR33 so it did not tear in the first place (2 clean trash cans worked well for really long tapes )
theducks is offline   Reply With Quote
Old 07-03-2013, 02:37 PM   #12
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Yes, use Kindlegen instead of Calibre. And of course, to use this kind of feature, you must work with azw3 since the old mobi format doesn't support counters (actually doesn't support anything )
Using Kindlegen 2.9 seems to 'honor' the counter CSS, so that's a lot of progress.

But it makes a MOBI file, is there a way to get the AZW3 file so that Publisher Font is supported?

Thanks again

Paul
phossler is offline   Reply With Quote
Old 07-03-2013, 03:20 PM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,445
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by phossler View Post
Using Kindlegen 2.9 seems to 'honor' the counter CSS, so that's a lot of progress.

But it makes a MOBI file, is there a way to get the AZW3 file so that Publisher Font is supported?

Thanks again

Paul
Paul:

Why do you believe that Publisher Font isn't supported with KindleGen? And what will you do for the fallback coding for the mobi (k7) version? Did KG support that for the K7's?

Hitch
Hitch is offline   Reply With Quote
Old 07-04-2013, 05:52 AM   #14
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by phossler View Post
But it makes a MOBI file, is there a way to get the AZW3 file so that Publisher Font is supported?
By default, KindleGen will create a hybrid mobi file that contains both AZW3 and MOBI7 files. AZW3 capable devices and apps will automatically display only the AZW3 part. (If you want to save space you can unpack the azw3 part with the KindleUnpack Calibre plugin.)

BTW, if you're only interested in auto-incrementing counters, you won't need to use KindleGen, because Calibre generated AZW3 files support auto-incrementing counters just fine, as long as you select AZW3 and not MOBI as the target format.

However, as Hitch has pointed out, if you preparing a book for submission to Amazon KDP, you'll have to implement fall-back styles, which makes the use of auto-incementing pointer moot, because there's no point in using auto-incrementing counters and hard-coded numbers, because you might as well only use hard-coded numbers.
Doitsu is offline   Reply With Quote
Old 07-04-2013, 10:22 AM   #15
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@Doitsu --

Quote:
BTW, if you're only interested in auto-incrementing counters, you won't need to use KindleGen, because Calibre generated AZW3 files support auto-incrementing counters just fine, as long as you select AZW3 and not MOBI as the target format.

However, as Hitch has pointed out, if you preparing a book for submission to Amazon KDP, you'll have to implement fall-back styles, which makes the use of auto-incementing pointer moot, because there's no point in using auto-incrementing counters and hard-coded numbers, because you might as well only use hard-coded numbers.
Apoligies -- you are correct about Calibre supporting counters just fine ... except in the AZW3 TOC page which is as far as i looked (Big shame on me). Probably not needed in the TOC anyways,since the H1, H2, etc. structure accomplish the same thing

Since the stuff I do is for personal or family use, I can live with that, and now that I understand how counters are used, I think I can make my life easier. The last PD book I re-formatted ('cleaned') had 3-4 Parts (h1), and about 60 Chapters (h2), all numbered the hard way

Thanks to all

Paul
Attached Thumbnails
Click image for larger version

Name:	Kindle TOC.jpg
Views:	290
Size:	96.1 KB
ID:	107640  
phossler is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
line-counter needed schuster Calibre 4 05-15-2011 12:15 PM
Classic over the counter iandix Barnes & Noble NOOK 7 02-07-2010 05:48 AM
No Page Counter andavane Bookeen 2 10-25-2009 04:32 AM


All times are GMT -4. The time now is 12:26 AM.


MobileRead.com is a privately owned, operated and funded community.