Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 03-28-2017, 10:40 PM   #1
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Empty <h1></h1> for ToC target?

(For context, see the thread Non-<hn> tag in TOC: complement to sigil_not_in_toc in the Sigil forum.)

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>
  <h1 title="Preface">Once there was a world [text elided]…</h1>
</body>
The “title="Preface"” causes Sigil’s ToC generator to give this text the correct entry everywhere. I also have this set as the SRL.

Trouble is, Amazon decided to reset the start-reading location to the next page, Chapter 1, possibly because that had the first text in <p> tags. (I’m guessing; I’ve read the threads about ’zon and SRL voodoo.) It’s also an abuse of <h1> semantics, and I want to format it slightly differently after all, and….

The obvious solution looks like this:
Code:
<body>
  <h1 title="Preface"></h1>
  <p class="preface">Once there was a world [text elided]…</p>
</body>
But (though I could be misunderstanding something) my online reading warns against having empty <h1> tags. So I could write
Code:
<h1 title="Preface">&nbsp;</h1>
or even
Code:
<h1 title="Preface" style="display:none;">&nbsp;</h1>
But before I make myself nuts with work-arounds—is there anything actually wrong with my initial “obvious solution”?
jcsalomon is offline   Reply With Quote
Old 03-30-2017, 07:31 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,779
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
IIRC An empty h# eats visual space unless it has a class or style that sets a small height somehow. If you want that top margin space, the issue is moot
theducks is offline   Reply With Quote
Old 03-30-2017, 09:22 PM   #3
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
It’s specially-formatted text on its own page; I could even say the space on top is on purpose.

(Though style="display:none;" would even eliminate that.)
jcsalomon is offline   Reply With Quote
Reply

Tags
empty tag, html


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
{TOC} is always empty (BOOK_STRUCTURE_FIELDS not loaded?) botmtl Library Management 4 06-11-2016 11:12 PM
Problem with TOC with empty chapters Matak Conversion 1 09-27-2014 11:54 PM
Can a toc.ncx point to an empty content tag? twedigteam ePub 7 02-08-2013 11:57 AM
toc.ncx navpoint content=src empty? KevinH Sigil 6 11-23-2009 01:39 PM
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working Magitek LRF 0 05-06-2009 01:25 PM


All times are GMT -4. The time now is 04:11 AM.


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