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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-13-2010, 10:42 PM   #1
EricDP
Groupie
EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 339490
Join Date: May 2010
Device: nook, BlackBerry
Continuing numbered lists (ol) in ADE

I have a list that has a break in it, and then continues. Using the (deprecated) "start" or "value" tags don't work in ADE, and neither does using CSS auto-content. For example, I tried the following sample, but it didn't work:

In stylesheet:
Code:
OL#page_one { counter-reset: item }
OL#page_two { counter-reset: item 5 }
LI { display: block }
LI:before {
		content: counter(item) ". ";
		counter-increment: item;
		display:block;
}
In body:
Code:
<ol id="page_one">
	<li>Division Bell</li>
	<li>Atom Hearth Mother</li>
	<li>Relics</li>
	<li>Dark Side of the Moon</li>
	<li>Wish You Were Here</li>
</ol><ol id="page_two">
	<li>The Wall</li>
	<li>More</li>
	<li>Piper at the gates of Dawn</li>
	<li>Final Cut</li>
	<li>Meddle</li>
</ol>
I also tried just starting a new list and having a bunch of empty entries with font-size: 0em; so they wouldn't show up, but some readers seems to have a minimum font size, so those show no matter what I do.

Any thoughts on other alternatives that might work?
EricDP is offline   Reply With Quote
Old 07-14-2010, 03:36 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,002
Karma: 43118253
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
Does this really not work?

Code:
<ol>
  <li value="10">Line 10</li>
  <li value="20">Line 20</li>
</ol>
HarryT is offline   Reply With Quote
 
Advertisement
Old 07-14-2010, 03:52 AM   #3
nomesque
Snooty Bestselling Author
nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.nomesque ought to be getting tired of karma fortunes by now.
 
nomesque's Avatar
 
Posts: 1,485
Karma: 1000000
Join Date: Aug 2009
Location: Ipswich, QLD, Australia
Device: PRS-650
Sorry if I'm chucking something into a discussion I don't understand as well as I think I do (HTML and XML background), but - are you basically trying to do this:

Quote:
Numbered list
Other text
Continue numbered list
?

Have you tried *wince* using the same ol id?

ie:

Code:
<ol id="page_one">
	<li>Division Bell</li>
	<li>Atom Hearth Mother</li>
	<li>Relics</li>
	<li>Dark Side of the Moon</li>
	<li>Wish You Were Here</li>
</ol><ol id="page_one">
	<li>The Wall</li>
	<li>More</li>
	<li>Piper at the gates of Dawn</li>
	<li>Final Cut</li>
	<li>Meddle</li>
</ol>
Does that cause nasty things to happen in Epub validation?
nomesque is offline   Reply With Quote
Old 07-14-2010, 04:01 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,002
Karma: 43118253
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
On www.w3.org it specifically says:

Quote:
In ordered lists, it is not possible to continue list numbering automatically from a previous list or to hide numbering of some list items. However, authors can reset the number of a list item by setting its value attribute. Numbering continues from the new value for subsequent list items.
HarryT is offline   Reply With Quote
Old 07-14-2010, 10:40 AM   #5
EricDP
Groupie
EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 339490
Join Date: May 2010
Device: nook, BlackBerry
Quote:
Originally Posted by HarryT View Post
Does this really not work?

Code:
<ol>
  <li value="10">Line 10</li>
  <li value="20">Line 20</li>
</ol>
Works in Sigil, does not work in ADE.
EricDP is offline   Reply With Quote
Old 07-14-2010, 10:49 AM   #6
EricDP
Groupie
EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 339490
Join Date: May 2010
Device: nook, BlackBerry
Quote:
Originally Posted by nomesque View Post
Have you tried *wince* using the same ol id?

ie:

Code:
<ol id="page_one">
	<li>Division Bell</li>
	<li>Atom Hearth Mother</li>
	<li>Relics</li>
	<li>Dark Side of the Moon</li>
	<li>Wish You Were Here</li>
</ol><ol id="page_one">
	<li>The Wall</li>
	<li>More</li>
	<li>Piper at the gates of Dawn</li>
	<li>Final Cut</li>
	<li>Meddle</li>
</ol>
I hadn't tried it, but it doesn't work either - not even in Sigil. It resets the counter.

ADE is so broken it doesn't seem to implement the 'content' tag at all. For example, I changed
Code:
content: counter(item) ". ";
to
Code:
content: counter(item) ".x. ";
to see if it was counting and just not resetting properly - the "x." doesn't even show up. It's just doing a regular OL without looking at what specific content I want to include.

Has anybody had any success with content in either ADE or Sigil? You should be able to do things like
Code:
content: "Chapter " counter(item);
and have that work too, showing "Chapter 1", "Chapter 2", etc., but I can't seem to make it work in ADE or Sigil.
EricDP is offline   Reply With Quote
Old 07-14-2010, 11:45 AM   #7
Peter Sorotokin
speaking for myself
Peter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it is
 
Posts: 139
Karma: 2166
Join Date: Feb 2008
Location: San Francisco Bay Area
Device: PRS-505
Quote:
Originally Posted by EricDP View Post
I hadn't tried it, but it doesn't work either - not even in Sigil. It resets the counter.
XHTML 1.1 (unlike HTML 4) does not support value attribute.

Quote:
ADE is so broken it doesn't seem to implement the 'content' tag at all.
Of course, if you read OPS spec, you'd see that counter property cannot be used in this context in EPUB (remark for counter property says "[9] Must not be used within a style sheet whose @media value is other than aural"). But I am asking for too much, I know.

OPS is not really geared to truly open-ended styling. You best bet is to have some sort of transformation step (e.g. XSLT) as a part of packaging process. That would also allow you to use custom markup that can capture more semantics, which is useful for books.
Peter Sorotokin is offline   Reply With Quote
Old 07-14-2010, 12:38 PM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,002
Karma: 43118253
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
Quote:
Originally Posted by Peter Sorotokin View Post
XHTML 1.1 (unlike HTML 4) does not support value attribute.
What's the replacement for it, Peter? I'm really surprised that there's no way to implement numbered lists with numbers that you can choose yourself; it seems an extremely "retrograde" step to remove such a facility without providing a substitute.
HarryT is offline   Reply With Quote
Old 07-14-2010, 03:01 PM   #9
Peter Sorotokin
speaking for myself
Peter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it is
 
Posts: 139
Karma: 2166
Join Date: Feb 2008
Location: San Francisco Bay Area
Device: PRS-505
Quote:
Originally Posted by HarryT View Post
What's the replacement for it, Peter? I'm really surprised that there's no way to implement numbered lists with numbers that you can choose yourself; it seems an extremely "retrograde" step to remove such a facility without providing a substitute.
I think it will reappear in HTML5/XHTML5.

The sad truth is that automatic list numbering and counters are not integrated in CSS2. Supposedly, CSS3 will fix it with list-item counter name, but the spec as it stands is still incomplete (it does not explain how to handle nested numbered lists).

Also CSS numbering scheme is too simplistic does not match any real-world word processors, so its utility is very limited. It does work for simple things, but the moment you get into complex document transformations, the easiest thing to do is to simply insert all the generated content yourself.
Peter Sorotokin is offline   Reply With Quote
Old 07-14-2010, 03:24 PM   #10
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,002
Karma: 43118253
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
Thank you for that explanation.
HarryT is offline   Reply With Quote
Old 07-14-2010, 04:47 PM   #11
EricDP
Groupie
EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 339490
Join Date: May 2010
Device: nook, BlackBerry
Quote:
Originally Posted by Peter Sorotokin View Post
the easiest thing to do is to simply insert all the generated content yourself.
That's where I'm at now. Next challenge is getting the alignment correct - to pivot around the dot etc..

For example, center this so it will a pivot around the "." (and, of course, the "." isn't centered, and it will still wrap pages so a centered 'inline-block' table can't be used). Argh!

Code:
           Part I
      I.   A chapter
     II.   Another
    III.   Now we're getting somewhere

           Part II
     IV.   And it continues
 XXIX.   Getting exciting...
XXXIV.   Time to finish
EricDP is offline   Reply With Quote
Old 07-14-2010, 05:02 PM   #12
Peter Sorotokin
speaking for myself
Peter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it isPeter Sorotokin knows what time it is
 
Posts: 139
Karma: 2166
Join Date: Feb 2008
Location: San Francisco Bay Area
Device: PRS-505
Quote:
Originally Posted by EricDP View Post
That's where I'm at now. Next challenge is getting the alignment correct - to pivot around the dot etc..

For example, center this so it will a pivot around the "." (and, of course, the "." isn't centered, and it will still wrap pages so a centered 'inline-block' table can't be used). Argh!
Maybe I am missing something. How about just "display:inline-block; width: 3em; text-align: right" for the label? If your list items are long and have to go to multiple lines, something like "margin: 3em; text-indent: -3em" would help to make the label "hang" on the right.
Peter Sorotokin is offline   Reply With Quote
Old 07-15-2010, 06:38 AM   #13
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,259
Karma: 4801165
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Peter Sorotokin View Post
Maybe I am missing something. How about just "display:inline-block; width: 3em; text-align: right" for the label?
If I remember correctly, inline-block is not in the required CSS subset of ePUB.
Jellby is offline   Reply With Quote
Old 09-07-2010, 09:30 AM   #14
graycyn
Guru
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 832
Karma: 1595268
Join Date: Aug 2010
Location: NE Oregon
Device: Sony T1, Samsung Galaxy Note, Kobo Aura HD, Nook HD+, Nexus 7 (2013)
Well, it's funny I found this thread, because I've been struggling with this exact same thing all night. Have a book with 6 parts, 54 chapters. In my case, the chapters had rather long titles in some instances, so I had to create a span class to make certain of those work and look nice.

I will first say that I am a TOTAL noob at CSS and equally a noob at epub. So don't laugh too hard. I'm trying to make sense of it all with my 53 year old brain and not doing so well! And I was trying to duplicate the style of my old print book. I came pretty close, actually!

I used an unordered list, but then, to line up my decimals, I used as many non-breaking spaces as I needed to do it. And likewise to make my PART headings line up where I wanted.

Quote:
<ul>
<li class="section">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;PART ONE</li>
<li>&nbsp;&nbsp;1. &nbsp;This is a real noob solution</li>
<li>&nbsp;&nbsp;2.&nbsp;&nbsp;but it does seem to work in ADE and on Nook</li>
<li>&nbsp;&nbsp;4.&nbsp;&nbsp;even if it is awkward as hell</li>
<li>&nbsp;&nbsp;5.&nbsp;&nbsp;call me crazy</li>
<li>&nbsp;&nbsp;6.&nbsp;&nbsp;but this problem drove me nuts all night</li>
</ul>
<ul>
<li class="section">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;PART TWO</li>
<li>10.&nbsp;&nbsp;I had 54 chapters</li>
<li>11.&nbsp;&nbsp;so I needed to make those decimals line up</li>
<li>12.&nbsp;&nbsp;this seemed to do it</li>
</ul>
Then I styled the unordered list so that there were no bullets.


Quote:
ul {list-style: none;
list-style-position: outside;
list-style-image: none;
line-height: 1em;
}
It did work for me in ADE and on my Nook! Which is all I care about, since the book I'm doing is an effort just for me. I don't know if it would be a good idea to use this method on something to be actually published though. It might not work on every device.

Just thought I'd post in case it helps anyone.

Last edited by graycyn; 09-07-2010 at 09:32 AM. Reason: Added sentence
graycyn 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
numbered lists, but with a text break soup Sigil 1 07-30-2010 05:27 AM
Numbered list continuation bhuvana786 ePub 4 05-26-2010 02:17 AM
Is this worth continuing? Mare of Earth Writers' Corner 7 06-19-2009 10:55 AM
Are Papers Days Numbered? andyafro News 23 11-21-2008 03:58 PM
Are the Reader's days numbered? WilliamG Sony Reader 32 09-23-2007 03:56 PM


All times are GMT -4. The time now is 09:46 AM.


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