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 03-28-2017, 02:57 PM   #1
jcsalomon
Enthusiast
jcsalomon began at the beginning.
 
jcsalomon's Avatar
 
Posts: 47
Karma: 10
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Non-<hn> tag in TOC: complement to sigil_not_in_toc

A series of books I’m typesetting each begin with a sort of one-sentence “Once upon a time…” preface. Since the dead-tree version had this formatted similar to headings, I coded the prefaces thus:
Code:
<body>
  <h2 title="Preface">Once there was a world [text elided]…</h2>
</body>
Trouble is, Amazon decided to reset the start-reading location to the next page, Chapter 1, probably because that had the first text in <p> tags.

My thought is to recode the preface as specially-styled text, something like
Code:
<body>
  <p class="preface" title="Preface">Once there was a world [text elided]…</p>
</body>
where p.preface is styled in CSS the same as h2. But of course this breaks Sigil’s header-identifier code for (re)building the Table of Contents.

What’s the best path forward? Is it better to include an empty
Code:
<h1  title="Preface"></h1>
tag for this, or is there a complement to sigil_not_in_toc that will cause Sigil to recognize a non-hn element as belonging in the TOC?
jcsalomon is offline   Reply With Quote
Advert
Old 03-28-2017, 03:26 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,699
Karma: 83110310
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
First off... the reason Amazon reset your start point may have nothing to do with this. They typically change the start point to the first "normal" page of text following the ToC. And there's plenty of other super-secret criteria they use, as well it seems. Point being: They're going to start your book where they want your book to start some times.

That said ...

I'm not entirely following the question. You WANT the entry to be in the ToC, in seems, but why exactly do you not want to use the "title" attribute to set the ToC text?
DiapDealer is online now   Reply With Quote
Old 03-28-2017, 03:40 PM   #3
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 987
Karma: 448520
Join Date: Dec 2012
Device: Kindle
Amazon seems to have a policy of ignoring prefaces, forewords, acknowledgements, indeed anything that in a traditionally designed book would have "front matter" paginated in lower case roman numerals. I think you would do best to call it something other than "preface" -- say "Marker" or "A Thought" -- in the H heading, followed by your epigram in a conventional paragraph.

I have had pretty good luck uploading epubs to the KDP that have no "text" semantic (SRL) at all. Most such books open at the cover rather than at page one, chapter one.
Notjohn is offline   Reply With Quote
Old 03-28-2017, 03:46 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,699
Karma: 83110310
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Notjohn View Post
Amazon seems to have a policy of ignoring prefaces, forewords, acknowledgements, indeed anything that in a traditionally designed book would have "front matter" paginated in lower case roman numerals. I think you would do best to call it something other than "preface" -- say "Marker" or "A Thought" -- in the H heading, followed by your epigram in a conventional paragraph.

I have had pretty good luck uploading epubs to the KDP that have no "text" semantic (SRL) at all. Most such books open at the cover rather than at page one, chapter one.
Please don't make this a discussion about Amazon's start-point allocation algorithm (which is decidedly "not Sigil-related"). I'm trying to ascertain what is being asked of Sigil specifically.
DiapDealer is online now   Reply With Quote
Old 03-28-2017, 04:42 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 46,843
Karma: 35378405
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
This thread has nothing to do with Sigil.
JSWolf is offline   Reply With Quote
Old 03-28-2017, 05:35 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,699
Karma: 83110310
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
This thread has nothing to do with Sigil.
I will be the judge of that, Jon. And I don't agree with you.

The question asked as to whether there is a complementary class name like "sigil_not_in_toc" that can be used to cause non-header tags to be included in TOC generation is certainly relevant to Sigil. The answer is no, but this is definitely the right place to ask such a question.

@jcsalomon: There's nothing like that for auto TOC generation, but you can use the TOC editor (after the TOC is generated) to manually add a non-header tag entry to the TOC. You'd have to remember to re-add it if you ever re-generated the TOC, but it's possible to achieve.
DiapDealer is online now   Reply With Quote
Old 03-28-2017, 06:12 PM   #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: 20,234
Karma: 19856334
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Astak Pocket Pro, K4NT,Galaxy Tab 2
Quote:
Originally Posted by JSWolf View Post
This thread has nothing to do with Sigil.
It is a Sigil topic because the real discussion is making Sigil's TOC tool recognize title= regardless if it is used with a H# tag

Amazon is just the cause for needing this work around
theducks is offline   Reply With Quote
Old 03-28-2017, 08:09 PM   #8
jcsalomon
Enthusiast
jcsalomon began at the beginning.
 
jcsalomon's Avatar
 
Posts: 47
Karma: 10
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Quote:
Originally Posted by DiapDealer View Post
I'm not entirely following the question. You WANT the entry to be in the ToC, in seems, but why exactly do you not want to use the "title" attribute to set the ToC text?
Oh, I’d be very glad to set the ToC text with the "title" attribute; what I’m trying to avoid is non-semantic use of <h1> tags.

(Or an empty <h1 title="Preface"></h1> set; I could be misunderstanding what I’m reading, but it seems leaving the element empty might have bad effects, though I’ve not seen this in my own testing.)

Quote:
Originally Posted by DiapDealer View Post
The question asked as to whether there is a complementary class name like "sigil_not_in_toc" that can be used to cause non-header tags to be included in TOC generation is certainly relevant to Sigil. The answer is no […].

@jcsalomon: There's nothing like that for auto TOC generation, but you can use the TOC editor (after the TOC is generated) to manually add a non-header tag entry to the TOC. You'd have to remember to re-add it if you ever re-generated the TOC, but it's possible to achieve.
Thanks. This is obscure enough that I won’t ask for such a feature to be added (and I’ll ask elsewhere in the forums about the semantically best way to indicate this), but I’d have used it if the feature was already there.
jcsalomon is offline   Reply With Quote
Old 03-28-2017, 10:14 PM   #9
Tex2002ans
Guru
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 794
Karma: 3804739
Join Date: Jul 2012
Device: Nook
Quote:
Originally Posted by DiapDealer View Post
The question asked as to whether there is a complementary class name like "sigil_not_in_toc" that can be used to cause non-header tags to be included in TOC generation is certainly relevant to Sigil. The answer is no, but this is definitely the right place to ask such a question.
Maybe a class "sigil_in_toc" or "sigil_include_in_toc"?

In HTML5, it seems like the title attribute is now allowable in any tag (XHTML1.1 + HTML 4.01 allowed a subset):

https://www.w3schools.com/tags/att_global_title.asp

although its overuse may interfere with accessibility:

https://www.paciellogroup.com/blog/2...use-and-abuse/
https://www.w3.org/TR/html/dom.html#the-title-attribute

Maybe non-<h#> could only be included in Sigil's auto-TOC if you use a combination of both a specific sigil class + title:

Code:
<p><span class="sigil_include_in_toc" title="Monetary Theory">Monetary Theory.</span> Monetary theory in the 1860s was reliant upon [...]</p>
Quote:
Originally Posted by jcsalomon View Post
Thanks. This is obscure enough that I won’t ask for such a feature to be added (and I’ll ask elsewhere in the forums about the semantically best way to indicate this), but I’d have used it if the feature was already there.
Hmmmm... do you have a screenshot of how it looks in the original book? You may be able to change the display of the <h2> headings slightly while still getting the point across (maybe using a float?).

I would still lean heavily towards the solutions using <h#> tags for chapter titles.

Side Note: There was only a handful of books I worked on that I can recall which had sidebar/inline headings... I discussed one at length years ago in the topic, "A better workflow":

https://www.mobileread.com/forums/sh...96#post3029896

although in my specific case they were slightly superfluous subheadings and not actual main chapter titles (so it didn't matter too much that I used <span> instead of <h3>).

Luckily the book has been retypeset many times over the years, so you can see multiple ways different typographers tackled the same issue:

Original Publication (1941): Attachment 134015
My Sidebar EPUB: Attachment 134016
My Inline EPUB: Attachment 134017
Routledge (2008): Click image for larger version

Name:	Routledge2008Hayek.png
Views:	23
Size:	122.0 KB
ID:	155855

Some later printings even removed the subheadings entirely (I would have to go hunting through my files for comparison images).

Quote:
Originally Posted by Notjohn View Post
Amazon seems to have a policy of ignoring prefaces, forewords, acknowledgements, indeed anything that in a traditionally designed book would have "front matter" paginated in lower case roman numerals. I think you would do best to call it something other than "preface" -- say "Marker" or "A Thought" -- in the H heading, followed by your epigram in a conventional paragraph.
I agree. Amazon's backend probably looks specifically for a set of keywords like "Preface" so it can avoid placing the SRL there.

Last edited by Tex2002ans; 03-28-2017 at 10:23 PM.
Tex2002ans is offline   Reply With Quote
Old 03-30-2017, 12:05 PM   #10
jcsalomon
Enthusiast
jcsalomon began at the beginning.
 
jcsalomon's Avatar
 
Posts: 47
Karma: 10
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
I’m definitely using <h#> for chapter titles; just trying to avoid this for the epigram/preface. (And I’ve opened a thread for discussion of the best way to accomplish that: Workshop › Empty <h1></h1> for ToC target?.)
jcsalomon is offline   Reply With Quote
Reply

Tags
table of contents

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
suggestion: tag groups should use Calibre tag hierarchy comox Calibre Companion 53 05-25-2015 07:22 PM
Add h2 tag to chapter heading to make TOC Ozman Editor 4 08-26-2014 07:00 AM
sigil_not_in_toc GMcG Sigil 10 03-27-2013 01:34 PM
Can a toc.ncx point to an empty content tag? twedigteam ePub 7 02-08-2013 11:57 AM
Strange problem with TOC showing .html tag TongueTied Kobo Reader 8 07-16-2012 07:03 AM


All times are GMT -4. The time now is 05:17 PM.


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