Answers.Body: <p>It turns out the chapter file names were incorrectly listed in the OEBPS TOC.</p>
  
  <p>I resolved the issue by:</p>
  
  <ol>
  <li><p>Opening the first file (navigational TOC) in the OEBPS folder of the unpacked .ePub (.zip)</p></li>
  <li><p>Correcting the 'h-#' portion of the href  in each  tag by incrementing by 1. For instance, the first href which was <code>"@public@vhost@g@gutenberg@html@files@1250@1250-h@1250-h-0.htm.html#link2H_PART1"</code>, becomes <code>"@public@vhost@g@gutenberg@html@files@1250@1250-h@1250-h-1.htm.html#link2H_PART1"</code>.</p></li>
  <li><p>Saving and repackaging the .ePub</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-30T00:02:39.210Z
Answers.LastActivityDate: 2020-01-30T00:02:39.210Z
Answers.UserDisplayName: Trever Thompson
Answers.Body: <p>It looks like the anchor tags were put in the wrong place. If you unzip the .epub, you'll see that the link for Part 1</p>
  
  <pre><code>&lt;p&gt;&lt;a id="link2H_PART1"&gt;&lt;!--  H2 anchor --&gt;&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>is at the end of the first (navigational TOC) file, <code>1250-h-0.htm.html</code> rather than the file for Part 1, <code>1250-h-1.htm.html</code>. </p>
  
  <p>If you move each of those links to the beginning of the correct file (right after the <code>&lt;body&gt;</code> tag and before the <code>&lt;h2&gt;</code> would be a good place) then that should fix your problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-30T00:03:33.973Z
Answers.Text: I appreciate the suggestion, but it seems as if the solution was something else
Answers.UserDisplayName: Trever Thompson
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-29T22:43:52.193Z
Answers.LastActivityDate: 2020-01-29T22:43:52.193Z
Answers.UserDisplayName: beaker
Body: <p>The Table of Contents of <a href="http://www.gutenberg.org/ebooks/1250" rel="nofollow noreferrer">this .ePub file</a> seems to incorrectly link to one page previous to the desired page. For instance if 'Part 2' is clicked, it directs to the last page of 'Part 1'. I have looked over the source files, but it is unclear to me how I can rectify this issue.</p>
  
  <p>Any help in fixing this file will be greatly appreciated</p>
  
Tags: <epub><calibre><table-of-contents><container.xml>
Title: Fix broken eBook Table of Contents?
UserDisplayName: Trever Thompson
ThreadText: # Fix broken eBook Table of Contents?
  
  (Asked by: username_0 on 2020-01-29)
  
  The Table of Contents of [this .ePub file](http://www.gutenberg.org/ebooks/1250) seems to incorrectly link to one page previous to the desired page. For instance if 'Part 2' is clicked, it directs to the last page of 'Part 1'. I have looked over the source files, but it is unclear to me how I can rectify this issue.
  
  Any help in fixing this file will be greatly appreciated
  
  **Tags:** epub, calibre, table-of-contents, container.xml
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2020-01-30. Score: 0 | Accepted answer
  
  It turns out the chapter file names were incorrectly listed in the OEBPS TOC.
  
  I resolved the issue by:
  
  1. Opening the first file (navigational TOC) in the OEBPS folder of the unpacked .ePub (.zip)
  2. Correcting the 'h-#' portion of the href in each tag by incrementing by 1. For instance, the first href which was `"@public@vhost@g@gutenberg@html@files@1250@1250-h@1250-h-0.htm.html#link2H_PART1"`, becomes `"@public@vhost@g@gutenberg@html@files@1250@1250-h@1250-h-1.htm.html#link2H_PART1"`.
  3. Saving and repackaging the .ePub
  
  
  ---
  
  ### Answer by username_1 on 2020-01-29. Score: 0
  
  It looks like the anchor tags were put in the wrong place. If you unzip the .epub, you'll see that the link for Part 1
  
  ```
  <p><a id="link2H_PART1"><!--  H2 anchor --></a></p>
  
  ```
  
  is at the end of the first (navigational TOC) file, `1250-h-0.htm.html` rather than the file for Part 1, `1250-h-1.htm.html`.
  
  If you move each of those links to the beginning of the correct file (right after the `<body>` tag and before the `<h2>` would be a good place) then that should fix your problem.
  
  > **Comments:**
  > **username_0**: I appreciate the suggestion, but it seems as if the solution was something else  
  
  ---
  
  