MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   ToC Formatting Help? (https://www.mobileread.com/forums/showthread.php?t=340541)

RMOP 07-09-2021 12:21 PM

ToC Formatting Help?
 
:help:

I've got an ePub version of a 19th century novel that I'm nearly done with. I modified it w Calibre's editor from one I found somewhere online. It had several font inconsistencies that I corrected, and all is good to go except for the table of contents showing hyperlinks to the preface and separate chapters. Chapter links function properly and appear in order and in columns, but the columns are of unequal length. The first column contains about twice the number of links as the remaining four columns, which are filled (part way) from the bottom up. It leaves me with one long column on the left, and four short columns on the right. Aesthetically unattractive. The entries for the links appear identical, and I've been unable to find a solution. I'm a novice at editing ePub, so assume I'm missing something quite simple.

Anyone willing to take a look at the book and tell me what's amiss? I would be grateful.

Many thanks.

DNSB 07-09-2021 12:31 PM

Quote:

Originally Posted by RMOP (Post 4137443)
:help:

I've got an ePub version of a 19th century novel that I'm nearly done with. I modified it w Calibre's editor from one I found somewhere online. It had several font inconsistencies that I corrected, and all is good to go except for the table of contents showing hyperlinks to the preface and separate chapters. Chapter links function properly and appear in order and in columns, but the columns are of unequal length. The first column contains about twice the number of links as the remaining four columns, which are filled (part way) from the bottom up. It leaves me with one long column on the left, and four short columns on the right. Aesthetically unattractive. The entries for the links appear identical, and I've been unable to find a solution. I'm a novice at editing ePub, so assume I'm missing something quite simple.

Anyone willing to take a look at the book and tell me what's amiss? I would be grateful.

Many thanks.

If you want to attach the epub to a message here, you are likely to get more advice than you could shake a stick at.

JSWolf 07-09-2021 12:41 PM

Quote:

Originally Posted by RMOP (Post 4137443)
:help:

I've got an ePub version of a 19th century novel that I'm nearly done with. I modified it w Calibre's editor from one I found somewhere online. It had several font inconsistencies that I corrected, and all is good to go except for the table of contents showing hyperlinks to the preface and separate chapters. Chapter links function properly and appear in order and in columns, but the columns are of unequal length. The first column contains about twice the number of links as the remaining four columns, which are filled (part way) from the bottom up. It leaves me with one long column on the left, and four short columns on the right. Aesthetically unattractive. The entries for the links appear identical, and I've been unable to find a solution. I'm a novice at editing ePub, so assume I'm missing something quite simple.

Anyone willing to take a look at the book and tell me what's amiss? I would be grateful.

Many thanks.

There is a very simple solution. That is to delete the HTML ToC. It's not needed. Just edit the NCX ToC. When you use the ToC function from the ePub software, it's going to display the NCX ToC and not the HTML ToC. The Only time I ever see the HTML ToC (if I've not deleted it) is when I pass by it to get to reading the book.

This advice only works if you are making an ePub 2 eBooks.

Turtle91 07-09-2021 01:12 PM

If, on the other hand, you are trying to stick to the original formatting as much as possible, you will want to keep the html ToC. Wolfie's comment is correct for newer books, and non-kindle books that don't require an HTML ToC.

As DNSB mentioned you can post the ePub here (it's obviously out of copyright)...or... you can just post the html/css of the ToC.... it sounds like a simple Table error...inconsistent number of TDs per TR, or something like that.

JSWolf 07-09-2021 03:18 PM

Quote:

Originally Posted by Turtle91 (Post 4137457)
If, on the other hand, you are trying to stick to the original formatting as much as possible, you will want to keep the html ToC. Wolfie's comment is correct for newer books, and non-kindle books that don't require an HTML ToC.

As DNSB mentioned you can post the ePub here (it's obviously out of copyright)...or... you can just post the html/css of the ToC.... it sounds like a simple Table error...inconsistent number of TDs per TR, or something like that.

If it's true that the OP is trying to duplicate the original ToC, there's no need for that as page numbers are not going to be of any use in the ToC. The only way page numbers in the ToC will be of any use is if the reading software adds them and then it will only add them to the NCX ToC (aka KOReader).

RMOP 07-09-2021 04:20 PM

1 Attachment(s)
OK. Yes, I'm just hacking away at what someone else got almost right. Know very little about this. Well, there was a lot of editing of wrongly formatted poetry, actually, which had been assigned a courier font for some reason. Fixed that, added italics to the verse and (found) typo, so it looks pretty good to my eye. But the ToC links bother me. So, I've attached the latest revision of this book. For the curious, it's "Phantastes," by George MacDonald, long out of copyright. It should be a less painful read from this ePub book than for me. It was reading the unedited version that drove me to do as many fixes as I could.

Many thanks.

Doitsu 07-09-2021 05:11 PM

You'll need to wrap the first 5 chapter links also in

Code:

<div colspan="1" rowspan="1" class="calibre6">
...
</div>

Spoiler:
Code:

<?xml version="1.0" encoding="utf-8"?>
<!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>
  <title>Phantastes, a Faerie Romance for Men and Women</title>
  <link href="stylesheet.css" rel="stylesheet" type="text/css"/>
  <link href="page_styles.css" rel="stylesheet" type="text/css"/>
</head>

<body class="calibre">
  <h2 class="calibre_3" id="calibre_pb_2">Contents</h2>

  <div class="calibre_5">
    <blockquote class="calibre_6">
      <p class="calibre_"><span class="calibre4"> <a shape="rect" href="#filepos4894">PREFACE</a> </span></p>
    </blockquote>

    <blockquote class="calibre_6">
      <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_003.html#filepos6322"> <big class="calibre5"><span class="bold">PHANTASTES A FAERIE ROMANCE</span></big> </a> </span></p>
    </blockquote>
  </div>

  <div class="calibre_5">
    <br class="calibre1"/>

    <div colspan="1" rowspan="1" class="calibre6">
      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_004.html#filepos8334">CHAPTER I</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_005.html#filepos17383">CHAPTER II</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_006.html#filepos20881">CHAPTER III</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_007.html#filepos47820">CHAPTER IV</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_008.html#filepos69672">CHAPTER V</a> </span></p>
      </blockquote>
    </div>

    <div colspan="1" rowspan="1" class="calibre6">
      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_009.html#filepos86816">CHAPTER VI</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_010.html#filepos102702">CHAPTER VII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_011.html#filepos120020">CHAPTER VIII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_012.html#filepos127680">CHAPTER IX</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_013.html#filepos140986">CHAPTER X</a> </span></p>
      </blockquote>
    </div>

    <div colspan="1" rowspan="1" class="calibre6">
      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_014.html#filepos157741">CHAPTER XI</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_015.html#filepos170815">CHAPTER XII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_016.html#filepos187314">CHAPTER XIII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_017.html#filepos236146">CHAPTER XIV</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_018.html#filepos250836">CHAPTER XV</a> </span></p>
      </blockquote>
    </div>

    <div colspan="1" rowspan="1" class="calibre6">
      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_019.html#filepos260890">CHAPTER XVI</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_020.html#filepos264245">CHAPTER XVII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_021.html#filepos275311">CHAPTER XVIII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_022.html#filepos284841">CHAPTER XIX</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_023.html#filepos323509">CHAPTER XX</a> </span></p>
      </blockquote>
    </div>

    <div colspan="1" rowspan="1" class="calibre6">
      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_024.html#filepos343023">CHAPTER XXI</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_025.html#filepos354707">CHAPTER XXII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_026.html#filepos372633">CHAPTER XXIII</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_027.html#filepos400783">CHAPTER XXIV</a> </span></p>
      </blockquote>

      <blockquote class="calibre_6">
        <p class="calibre_"><span class="calibre4"> <a shape="rect" href="index_split_028.html#filepos408002">CHAPTER XXV</a> </span></p>
      </blockquote>

      <p class="calibre_"><br clear="none" class="calibre1"/> <br clear="none" class="calibre1"/></p>

      <hr class="calibre3"/>

      <p class="calibre_"><br clear="none" class="calibre1"/> <br clear="none" class="calibre1"/> <a shape="rect" id="filepos4894"> </a></p>
    </div>
  </div>
</body>
</html>


JSWolf 07-09-2021 05:36 PM

What you are trying to do with the HTML ToC is just a big huge no. It's going to look awful.

JSWolf 07-09-2021 05:43 PM

After looking at this eBook in ADE and the Calibre editor, it has some serious errors that stop it from displaying correctly in ADE.

Turtle91 07-09-2021 06:56 PM

1 Attachment(s)
Yes, there are a lot of huge errors...

I did take a few minutes to do some very basic cleanup and styling so you can use it as a starting point. Everything should work fine now, but I would definitely give it another walk through. I'm sure there are others on MR that would do things differently, but this will at least get you started! ;)

There are some basic tutorials in MR's Wiki that will help immensely. Most of the errors I noticed were from not putting the correct closing tags around your elements( <p></p>, <h5></h5>, <div></div>, etc.)

I also added a slightly larger cover image. The one you had was only 286px high - much too small! The one I added is too small as well, but 500px is at least viewable.

It would be really nice if you could scan, or otherwise locate, the illustrations at the end of each chapter!

Cheers!

phillipgessert 07-09-2021 06:58 PM

I think you may be better off just trashing that TOC and letting Sigil build a new one. I don't think this columnar approach works well and the code looks very messy. Did not expect to see tons of <blockquote>s in a TOC.

Turtle91 07-09-2021 07:01 PM

Quote:

Originally Posted by phillipgessert (Post 4137549)
I think you may be better off just trashing that TOC and letting Sigil build a new one. I don't think this columnar approach works well and the code looks very messy. Did not expect to see tons of <blockquote>s in a TOC.

I agree - that was the approach I took...but to get the auto ToC to run I had to correct the other issues in the ePub! :eek:

DNSB 07-09-2021 07:42 PM

1 Attachment(s)
I realized after playing with the copy from this thread that I had downloaded and done some cleanup on a copy from, I think, Gutenberg a while back. I've attached that copy to this message as a cleaner starting point.

RMOP 07-09-2021 09:08 PM

Easy if you know what you're doing, which I do not. Many thanks. It was the charm.

Yes, even in my ignorance, I suspected that the file I had was a bit of a mess. I don't know enough to even make a mess like that, much less clean it up!

hobnail 07-10-2021 12:08 AM

Quote:

Originally Posted by RMOP (Post 4137578)
Easy if you know what you're doing, which I do not. Many thanks. It was the charm.

Yes, even in my ignorance, I suspected that the file I had was a bit of a mess. I don't know enough to even make a mess like that, much less clean it up!

In the future you could start with a better version or put your nose to the grindstone and learn html. The Project Gutenberg version is probably usable. The one on wikisource looks reasonable as well; click on the Download EPUB link on the left. https://en.wikisource.org/wiki/Phantastes It's also available here in the mobileread library, but in lrf format, which calibre can convert to epub (comes out all bold though).

JSWolf 07-10-2021 04:12 AM

Learning HTML/CSS is a good place to start.

RMOP 07-10-2021 10:11 AM

Quote:

Originally Posted by hobnail (Post 4137618)
In the future you could start with a better version or put your nose to the grindstone and learn html.

Yeah, were my nose not already against so many other grindstones! I once had a rudimentary knowledge of html, but a long time ago, and I've not kept up.

I perused the countless offerings on the Kindle store. Most were simple knockoffs of the project Gutenberg material. However, one or two included the illustrations from the 1905 edition. Same for Lilith. I looked at the samples for a few, and found one of each book better than anything I'm likely to produce, so will probably purchase those. I don’t mind paying someone a pittance who has already done a better job than I could manage.

Thanks to all who have reminded me of what I knew when I previously tried my hand at making an ebook: its harder than it seems.


All times are GMT -4. The time now is 06:55 PM.

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