Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2012, 11:08 AM   #1
jackibar
Enthusiast
jackibar began at the beginning.
 
Posts: 38
Karma: 12
Join Date: May 2010
Device: iPhone apps
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...
jackibar is offline   Reply With Quote
Old 02-28-2012, 11:36 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by jackibar View Post
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)
theducks is offline   Reply With Quote
Advert
Old 02-28-2012, 02:57 PM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
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.
Toxaris is offline   Reply With Quote
Old 02-28-2012, 03:24 PM   #4
GeneS
eBook Enthusiast
GeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enoughGeneS will become famous soon enough
 
GeneS's Avatar
 
Posts: 120
Karma: 726
Join Date: Dec 2007
Location: US
Device: Sony PRS-350, Astak PocketPro, iPhone, Asus eee Pad Transformer
Quote:
Originally Posted by jackibar View Post
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.
GeneS is offline   Reply With Quote
Old 02-28-2012, 03:37 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
But Sigil doesn't create anything that those CSS attributes can be assigned to.

Last edited by DiapDealer; 02-28-2012 at 04:11 PM.
DiapDealer is offline   Reply With Quote
Advert
Old 02-28-2012, 04:09 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by GeneS View Post
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.
theducks is offline   Reply With Quote
Old 02-29-2012, 07:22 PM   #7
jackibar
Enthusiast
jackibar began at the beginning.
 
Posts: 38
Karma: 12
Join Date: May 2010
Device: iPhone apps
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?!
jackibar is offline   Reply With Quote
Old 02-29-2012, 07:27 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by jackibar View Post
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.
DiapDealer is offline   Reply With Quote
Old 02-29-2012, 07:36 PM   #9
jackibar
Enthusiast
jackibar began at the beginning.
 
Posts: 38
Karma: 12
Join Date: May 2010
Device: iPhone apps
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
jackibar is offline   Reply With Quote
Old 02-29-2012, 07:57 PM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
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).

Last edited by DiapDealer; 02-29-2012 at 08:05 PM.
DiapDealer is offline   Reply With Quote
Old 02-29-2012, 08:40 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
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.
JSWolf is offline   Reply With Quote
Old 02-29-2012, 08:44 PM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
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.

Last edited by DiapDealer; 02-29-2012 at 08:48 PM.
DiapDealer is offline   Reply With Quote
Old 02-29-2012, 09:11 PM   #13
jackibar
Enthusiast
jackibar began at the beginning.
 
Posts: 38
Karma: 12
Join Date: May 2010
Device: iPhone apps
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!!
jackibar is offline   Reply With Quote
Old 02-29-2012, 10:01 PM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by jackibar View Post
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.
DiapDealer is offline   Reply With Quote
Old 02-29-2012, 10:54 PM   #15
jackibar
Enthusiast
jackibar began at the beginning.
 
Posts: 38
Karma: 12
Join Date: May 2010
Device: iPhone apps
That was it! Thanks so much!
jackibar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd formatting needs correction and TOC leday Sigil 10 12-01-2010 12:47 PM
[KOBO] Strip existing formatting to apply my own default formatting to all books digital_steve Calibre 2 08-10-2010 06:34 PM
Calibre and FORMATTING how to stop it altering my formatting? nerys Calibre 37 07-23-2010 02:35 AM
Calibre and FORMATTING how to stop it altering my formatting? nerys Calibre 0 02-28-2010 04:51 PM


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


MobileRead.com is a privately owned, operated and funded community.