MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Formatting TOC (https://www.mobileread.com/forums/showthread.php?t=170557)

jackibar 02-28-2012 12:08 PM

Formatting TOC
 
Is there any way to format the Table of Contents that Sigil generates? For example, having the h2 tags indent a certain amount and the h3 tags indent a certain amount. It seems the way it is defaulting is to leave a much larger indent than I would prefer...

theducks 02-28-2012 12:36 PM

Quote:

Originally Posted by jackibar (Post 1983917)
Is there any way to format the Table of Contents that Sigil generates? For example, having the h2 tags indent a certain amount and the h3 tags indent a certain amount. It seems the way it is defaulting is to leave a much larger indent than I would prefer...

Sigil does not "generate" a TOC (inline page) that can be formatted.
Sigil will create the NCX file from H# tags, that is used by many readers to display the 'Contents Menu' (this has no provision for style formatting)

Toxaris 02-28-2012 03:57 PM

As theducks says, the TOC the readers display is based on the toc.ncx file. The layout is defined by the reader, not the ePUB.
If you create an inline TOC (which I don't recommend), you have complete control over the layout. However, you have to maintain it yourself.

GeneS 02-28-2012 04:24 PM

Quote:

Originally Posted by jackibar (Post 1983917)
Is there any way to format the Table of Contents that Sigil generates? For example, having the h2 tags indent a certain amount and the h3 tags indent a certain amount. It seems the way it is defaulting is to leave a much larger indent than I would prefer...

If I'm understanding the jackibar's question, a degree of control can be asserted by adding appropriate code in the CSS file generated by Sigil.

e.g.,

h2 {text-align: left; text-indent: 10%}
h3 {text-align: left; text-indent: 20%}

etc.

DiapDealer 02-28-2012 04:37 PM

But Sigil doesn't create anything that those CSS attributes can be assigned to.

theducks 02-28-2012 05:09 PM

Quote:

Originally Posted by GeneS (Post 1984311)
If I'm understanding the jackibar's question, a degree of control can be asserted by adding appropriate code in the CSS file generated by Sigil.

e.g.,

h2 {text-align: left; text-indent: 10%}
h3 {text-align: left; text-indent: 20%}

etc.

That only affects the Chapter heading display, Not the TOC
If care is used, a
Code:

<h2>Chapter 1 <br />The Never Ending Chapter</h2>
Will display as a single line in the NCX TOC and as 2 lines (with margins) in the Chapter head.

jackibar 02-29-2012 08:22 PM

Thanks for the info...! Okay - IF I did want to create an inline TOC manually in addition to the NCX TOC that Sigil automatically generates - is there any way to have the GO TO TOC go to my inline TOC *instead of* the NCX TOC? What I'm trying to do is have a "long version" of the TOC inline that includes all the subheadings as links within each chapter - but I DON'T want the NCX to include all these subheadings because I want my "jump to next" feature to just go from chapter to chapter - not all the little sub-sections...

Can this be done?!

DiapDealer 02-29-2012 08:27 PM

Quote:

Originally Posted by jackibar (Post 1986002)
Thanks for the info...! Okay - IF I did want to create an inline TOC manually in addition to the NCX TOC that Sigil automatically generates - is there any way to have the GO TO TOC go to my inline TOC *instead of* the NCX TOC? What I'm trying to do is have a "long version" of the TOC inline that includes all the subheadings as links within each chapter - but I DON'T want the NCX to include all these subheadings because I want my "jump to next" feature to just go from chapter to chapter - not all the little sub-sections...

Can this be done?!

It sounds like you're speaking Kindle/Amazon. If so, the answer is definitely maybe. If not, ignore me. ;)

jackibar 02-29-2012 08:36 PM

Yes - Kindle :)

I've been able to do this using MobiPocket Creator - but I'm trying to use Sigil on my Mac instead of having to use my PC laptop... I like the way Sigil works WAY better for everything else - so if I can just get this TOC situation figured out, I'll be a Sigil convert :)

DiapDealer 02-29-2012 08:57 PM

Once you create and style your HTML TOC you just need to identify it as a TOC. If it has its own html file, just right click on the file in the Book Browser and select "Table of Contents" from the Add Semantics menu. That's the easiest method. That will make your GO TO TOC functionality work after you convert to MOBI.

If it's not in its very own html file... then you're going to have to manually add a reference to the guide section of the opf file that refers to an anchor in the html where your ToC starts.

Just pick a file in the epub and mark it as a TOC (even if it's not... you can unmark it later). You can then go to the opf file and see the general syntax for the TOC reference tag in the guide section.

EDIT: all the above is predicated on using kindlegen to convert the epub to MOBI. Calibre has a weird habit of homogenizing the inline TOC and the NCX file so they match (even when you tell it not to add the TOC).

JSWolf 02-29-2012 09:40 PM

Putting a ToC (page of useless links) in an ePub is just really bad form. ePub has toc.ncx. If you use calibre to convert to Mobipocket, then it will generate a ToC page for the Mobipocket file using the ToC in toc.ncx.

DiapDealer 02-29-2012 09:44 PM

Quote:

Putting a ToC (page of useless links) in an ePub is just really bad form. ePub has toc.ncx. If you use calibre to convert to Mobipocket, then it will generate a ToC page for the Mobipocket file using the ToC in toc.ncx.
Read the whole thread. Calibre's auto ToC generation can't accomplish what the OP wants (a different inline ToC than the NCX ToC) in the resultant MOBI.

jackibar 02-29-2012 10:11 PM

Thanks SO much for your help, DiapDealer! I actually tried it before I saw your "Edit" - and using Calibre it still kept my 2 TOC's intact! The only thing I'm experiencing now is my inline TOC is putting page breaks at the end of each book "section" even though I didn't put page breaks in the TOC... Is there a way to make it keep the whole TOC as a continuous one instead of with page breaks? I'm SO close to having this how I want it!!

DiapDealer 02-29-2012 11:01 PM

Quote:

Originally Posted by jackibar (Post 1986093)
Thanks SO much for your help, DiapDealer! I actually tried it before I saw your "Edit" - and using Calibre it still kept my 2 TOC's intact! The only thing I'm experiencing now is my inline TOC is putting page breaks at the end of each book "section" even though I didn't put page breaks in the TOC... Is there a way to make it keep the whole TOC as a continuous one instead of with page breaks? I'm SO close to having this how I want it!!

The only thing I can think of is that you're using H1 or H2 tags for your book sections in the inline ToC. Calibre will usually insert page breaks before h1,h2 tags. I would just use regular <p> tags for the ToC entries. You can always use css to make them a little bigger or bolder. But in general; if it's not a header, don't use header tags.

jackibar 02-29-2012 11:54 PM

That was it! Thanks so much!

huebi 03-01-2012 06:59 AM

Inline TOCS are the first thing i'm throwing out of every eBook. My reader goes to the inline TOC with the appropriate button pressed and the inline toc is -- yes where is it? At the end? Page 1? page 2? Useless crap.

DiapDealer 03-01-2012 08:32 AM

Quote:

My reader goes to the inline TOC with the appropriate button pressed and the inline toc is -- yes where is it? At the end? Page 1? page 2? Useless crap.
It's no skin off my back if you don't like inline ToCs, but why on earth would where they're physically located—beginning or end—have any bearing on their usefulness (personal preferences aside)? :blink:

huebi 03-01-2012 09:37 AM

If i would like to go to an inline TOC, what do i have to do? Going to page 2? Or 3? Or to the end? Or ist the toc located at the same place in every book? The built-in TOC is always at the the place...

JSWolf 03-01-2012 10:02 AM

Quote:

Originally Posted by huebi (Post 1986382)
Inline TOCS are the first thing i'm throwing out of every eBook. My reader goes to the inline TOC with the appropriate button pressed and the inline toc is -- yes where is it? At the end? Page 1? page 2? Useless crap.

I also remove the links page. This is just there because of Kindlegen. That's the only reason. And when they put links back to the links page in every header, I delete those too. We don't need then and we don't want them.

Most ePub that have a links page also have a link in the proper ToC to this links page. In order to get to the link to go to the links page, we have to go to the ToC. So since we are there at the ToC, why would we then want to go to the links page to then go to the place we want when we can just go there from the ToC?


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

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