MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Workshop (https://www.mobileread.com/forums/forumdisplay.php?f=178)
-   -   TOC troubles in Kindle Previewer (https://www.mobileread.com/forums/showthread.php?t=237704)

r_tist_22 04-14-2014 11:28 PM

TOC troubles in Kindle Previewer
 
Hi,

Each chapter listed in my TOC is appearing on its own separate page. I observed this error in Kindle Previewer as well as the previewer in KDP when going to test prior to publishing to Amazon (in MOBI). (no issue with the ePub for iBook)

When I checked Sigil YouTube movies, my code appears to be correct. So what is getting lost in translation? See code below. Does it want me to only set the h1 tag once with breaks between each chapter? I'm sure I originally had that but did not like the appearance as when text wrapped the spacing was identical regardless of if a hard break or a wrap (which didn't look so good). When I finally re-coded like this, and tested in iBooks, that did the trick.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../Styles/Style0001.css" rel="stylesheet" type="text/css" />

<title>Table of Contents</title>
</head>

<body>
<h2><i>Table of Contents –&nbsp;Part I</i></h2>
<hr class="hline_gradient" />

<h1><a href="../Text/preface.xhtml">Preface</a></h1>

<h1><a href="../Text/chapter_1.xhtml">Chapter 1</a></h1>

<h1><a href="../Text/chapter_2.xhtml">Chapter 2</a></h1>

<h1><a href="../Text/chapter_3.xhtml">Chapter 3</a></h1>

<h1><a href="../Text/chapter_4.xhtml">Chapter 4</a></h1>

<h1><a href="../Text/chapter_5.xhtml">Chapter 5</a></h1>

</body>
</html>

Any advice to make these all appear on the same TOC page in the MOBI format?

Thank you.
https://www2.mobileread.com/i/smiliestext/thankyou.gif

mncowboy 04-16-2014 09:13 AM

The items in your TOC should not be styled as an h1 - that is causing the page breaks. Use a regular paragraph, styled as you need. Something like this:

<p class="toc1"><a href="../Text/preface.xhtml">Preface</a></p>
<p class="toc1"><a href="../Text/chapter_1.xhtml">Chapter 1</a></p>

This will keep the entries on one page.
Bob

HarryT 04-16-2014 09:13 AM

Please post in the correct forum. Moved to the Kindle file formats section.


All times are GMT -4. The time now is 09:10 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.