View Full Version : My table of contents is messed up-please help


poisonpenpals
10-07-2012, 10:20 PM
My Table of Contents is messed up. I have the first link going to chapter one but the other links are off target, usually by a page or so. I've searched for this but can't find the answer. It's probably some glaringly stupid newbie mistake I've made but please somebody help me with this. I've been working on it for hours now and my brain hurts. This is what it looks like.

<h1><b>CONTENTS</b></h1>
<a href="#link1"><font color="#0000FF">CHAPTER ONE<br/>
<a href="#link2"><font color="#0000FF">CHAPTER TWO<br/>
<a href="#link3"><font color="#0000FF">CHAPTER THREE<br/>
<a href="#link4"><font color="#0000FF">CHAPTER FOUR<br/>
<a href="#link5"><font color="#0000FF">CHAPTER FIVE<br/>
<a href="#link6"><font color="#0000FF">CHAPTER SIX<br/>
<a href="#link7"><font color="#0000FF">CHAPTER SEVEN<br/>
<a href="#link8"><font color="#0000FF">CHAPTER EIGHT<br/>
<a href="#link9"><font color="#0000FF">CHAPTER NINE<br/>
<a href="#link10"><font color="#0000FF">CHAPTER TEN<br/>
<a href="#link11"><font color="#0000FF">CHAPTER ELEVEN<br/>
<a name="link1"/><h1><b>chapter one</b></h1>
<p>[Book text removed by moderator]

and then the text before and the link for chapter two

[Book text removed by moderator]<br/>
<a name="link2"/><h1><b>chapter two</b></h1>
1<br/>
[Book text removed by moderator]

Link one works fine. from link two and on, everything is off target by like one page or so. If anyone will take pity on me and tell me what I'm doing wrong I would greatly appreciate it. Like sacrifice a goat in honor appreciate it. :D

Jeff L
10-07-2012, 11:12 PM
Try this:

<div class="toc-chap"><a href="xxxx">Chapter 1</a></div>

<div class="toc-chap"><a href="xxx">Chapter 2</a></div>


Add appropriate entry in css for class name like:

.toc-chap {
margin-top: 0.7em;
margin-bottom: 0;
margin-left: 3em;
text-indent: -2em;
}



Then at Chapter x location, avoid using self-closing tags.

<div id=xxx></div>
<a id=xxx name=xxx></a>

In some ereader software, self-closing tags as used in your example would create a link from that location onward until the computer finds something that stops it, like the end of the page.

ghostyjack
10-08-2012, 01:57 PM
Removed post due to OP wanting help with a suspected pirated book.

The post can be put back if prooved otherwise.

JSWolf
10-08-2012, 08:50 PM
Please do not help the OP. The OP is working on a pirated eBook. For the two helpful posts, please edit out the helpfulness.

ghostyjack
10-09-2012, 07:58 AM
Pirated? I didn't realise that was the case. I didn't click what PeterT was refering to.

I'm removing my message and will only put it back if the OP can prove it is for a legit book.

DiapDealer
10-09-2012, 08:38 AM
Going back and deleting previously given advice is a bit extreme. Plus ... no one has any proof whatsoever that the OP isn't working with a personal scan of a physical book they own. Probably not the case... but still.

I too, prefer not to help those who are helping themselves to "free books," but I also think it's possible to be a bit overzealous in that regard. Is answering a question that strictly concerns ePub coding/formatting really assisting anyone in stealing books? I'd suggest reporting the thread to a moderator (and let them determine if the thread should be closed) rather than pleading to other members not to help (and to, in fact, delete their previous responses).

ghostyjack
10-09-2012, 09:04 AM
True, but the OP hasn't indicated either way if it's a scan or a pirate. The fact that they hasn't mentioned it tends to make me think pirate - and being a cynical Englishman tends to make me favour the latter.

They hasn't responded to any of the comments in this thread regarding this thread either. And the fact that their first ever post is a bit suspect, doesn't bode well for me helping them. Can't use past behaviour to determine this.

I agree this is refering to coding/formatting, but the inclusion of the text from a copyrighted book doesn't help. Looking at the poor level of coding in the given example makes me think it resembles being made by someone with a grasp of HTML from an earlier time before ePubs. As the book was published in 1986 seems to confirm this. So for me, this points to pirated and not a scanned book.

WT Sharpe
10-09-2012, 05:37 PM
While MobileRead does realize that discussed copyrighted ebooks are not all unauthorized, MobileRead does not condone any form of copyright infringement. The content of the first post makes it unclear as to whether this is an authorized copy of this work. Identifying information has been removed. Please do not ask for help on pirated books on MR. Failure to observe that rule can cause your MR access to be terminated.