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

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2018, 02:58 PM   #1
alegriadelarte
Junior Member
alegriadelarte began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2018
Device: epub
How to generate a TOC as a page in the eBook?

Hello,

I wish to create a table of content from headers h1 to h4 so that the headers cascade in an automatically generated html page.

I know that there is the "Modify TOC" button, but I haven't found a way to actually generate a page and further more I wish to put this page in my ebook between two chapters.


The resulting page might look as such

Title1
___Title11
___Title12
Title2
___Title21
______Title 212

Thanks
alegriadelarte is offline   Reply With Quote
Advert
Old 05-12-2018, 03:40 PM   #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: 21,577
Karma: 20950032
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab 2(RIP)
Once you have a NCX TOC (that is what you create with the TOC tool),

Select Tools:Table of contents: Insert Inline TOC

That inserts the file TOC.xhtml near the front. Move it to where you want it
theducks is offline   Reply With Quote
Old 05-13-2018, 10:42 AM   #3
alegriadelarte
Junior Member
alegriadelarte began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2018
Device: epub
Generates exactly what I was looking for.

But the issue is that toc.xhtml appears of the screen on a smartphone, with a padding-left about 1/3 of the screen.

I tried
.level1 { font-size: 170%; padding-left: -1em; padding-top: 3em; }
.level2 { font-size: 60%; padding-left: 0em;}
.level3 { font-size: 80%; }

To no avail

Last edited by alegriadelarte; 05-13-2018 at 05:10 PM.
alegriadelarte is offline   Reply With Quote
Old 05-14-2018, 03:52 AM   #4
alegriadelarte
Junior Member
alegriadelarte began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2018
Device: epub
the TOC has its own css on which the stylesheet.css does not apply (for example if one sets body{ background-color: red;} one sees that it does not apply on the TOC)


Where is the css of the TOC??
alegriadelarte is offline   Reply With Quote
Old 05-14-2018, 05:54 AM   #5
Nicolas F
Zealot
Nicolas F doesn't litterNicolas F doesn't litter
 
Posts: 129
Karma: 108
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by alegriadelarte View Post
the TOC has its own css on which the stylesheet.css does not apply (for example if one sets body{ background-color: red;} one sees that it does not apply on the TOC)


Where is the css of the TOC??
It's at the top of the TOC file itself in the <head> element.
just change or add your css code inside the <style type="text/css"> element
Nicolas F is offline   Reply With Quote
Old 05-14-2018, 09:42 AM   #6
alegriadelarte
Junior Member
alegriadelarte began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2018
Device: epub
>It's at the top of the TOC file itself in the <head> element.
I tried, but fails to work.

The TOC file is really treated independly from the others
alegriadelarte is offline   Reply With Quote
Old 05-14-2018, 03:04 PM   #7
Nicolas F
Zealot
Nicolas F doesn't litterNicolas F doesn't litter
 
Posts: 129
Karma: 108
Join Date: Jan 2016
Device: Kobo Glo HD
It works for me. Did you also change the style for the li element?

Your problem might also be that the <li> and <ul> element are rendered by default with a text indent. So if you don't want the text to be indented add:
Code:
text-indent:0
Nicolas F is offline   Reply With Quote
Reply

Tags
toc pages

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate TOC and linebreaks AlanHK Sigil 24 09-25-2017 08:37 PM
How to generate a physical TOC? Books987 Conversion 2 01-24-2015 11:08 PM
html does not generate TOC iliakan Conversion 3 01-05-2015 01:56 PM
Can't tell ebook-convert to NOT generate inline TOC for Mobi EliW Conversion 17 05-10-2013 11:08 AM
How to generate cover from the first page of an ebook? purgatorios Library Management 2 11-17-2012 07:42 AM


All times are GMT -4. The time now is 02:01 PM.


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