Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2012, 12:08 PM   #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, 12:36 PM   #2
theducks
Grand Sorcerer
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: 15,259
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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
 
Advertisement
Old 02-28-2012, 03: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: 3,183
Karma: 7180223
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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, 04: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: 119
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, 04: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: 9,539
Karma: 44002482
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 05:11 PM.
DiapDealer is offline   Reply With Quote
Old 02-28-2012, 05:09 PM   #6
theducks
Grand Sorcerer
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: 15,259
Karma: 6020309
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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, 08: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, 08: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: 9,539
Karma: 44002482
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, 08: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, 08: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: 9,539
Karma: 44002482
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 09:05 PM.
DiapDealer is offline   Reply With Quote
Old 02-29-2012, 09: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: 38,530
Karma: 19637653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
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, 09: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: 9,539
Karma: 44002482
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 09:48 PM.
DiapDealer is offline   Reply With Quote
Old 02-29-2012, 10: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, 11: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: 9,539
Karma: 44002482
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, 11: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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 11:33 AM.


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