![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,459
Karma: 68781975
Join Date: Oct 2012
Location: Arkansas
Device: Paperwhite 4
|
Creating a TOC in Calibre
I've found a variety of ways to create a TOC, automatically for most books, but some have none of the requirements and I have to create them manually. That's working okay except that I don't know how to make each chapter start on a new page.
I've tried inserting <br> at that point but nothing happens. I've tried referencing a different class in the CSS but again, nothing happens. I'm beginning to suspect I don't know what I'm doing. ![]() I have a background in programming but I'm long retired and I've never dealt with CSS and only a little with HTML. I retired over 20 years ago. At this time of my life I don't really want to learn a new language. So can anyone tell me a simple way to do it? I realize I'm going to get some "Learn CSS" and "Learn HTML" answers and I agree that I should but learning comes hard these days and I'm not going to. Any suggestions will be appreciated, including the ones I mentioned above. ![]() Thanks, Barry |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Moderator Notice I moved this, because I think Editing is the best solution. ways (for EPUB) a)You can use the editor (preview screen) to split chapters (into pieces) b)CSS: page-break-before: always in the chapter title block style AZW3 (output) might honor these if you use Publishers styles on your device There are Cheatsheets for both CSS2 and HTML out there. They are handy, but not a substitute for knowledge ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,459
Karma: 68781975
Join Date: Oct 2012
Location: Arkansas
Device: Paperwhite 4
|
Thanks for this. I realize I am asking you to do my homework, at least a bit. Learning new stuff is difficult these days. You'll understand that in time, with a bit of luck.
![]() My real concern is with epub. Some things don't convert well to mobi or azw3 but most do. Lately I'm reading epub on my phone most of the time though. In CSS how do I know which is the chapter block style? I did try changing references to different CSS styles but that didn't seem to affect anything at all. However those changes were made in the book. I didn't try changing anything in the CSS. Barry |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,459
Karma: 68781975
Join Date: Oct 2012
Location: Arkansas
Device: Paperwhite 4
|
I just tried converting to DOCX and changing it in Libre Office and then converting back. That seems to work, at least so far. When I read the book I'll watch for problems but on a quick look it seems just fine.
Barry |
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() ![]() (this is from a Project Gutenberg book) Code:
<h2 id="pgepubid00004"><a id="Chapter_I"></a><a id="Page_5"></a>Chapter I</h2>
<h3 id="pgepubid00005">PERFUMED PLANET</h3>
So we will apply it to (ALL) H2 instead in the CSS Code:
h1, h2, h3, h4, h5, h6 {
text-align: center;
/* all headings centered */
clear: both;
page-break-before: always;
}
![]() in many case there would be a class="<something>" associated with those particular H2 so you would find .<something> { or it might be h2.<something> { and put it there |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,512
Karma: 78910202
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Also remember that most people put each chapter into its own (x)html file, and this forces a page break at the start of each chapter.
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Sometimes if I have as book that is split almost randomly but has fairly consistent tags for each chapter, I'll merge all the files into a single humongous file and use the main editor [Split as multiple locations] using an XPath to end up with mostly separate chapter files. Always requires some fine tuning and ad hoc merging
But that way each chapter will start on a new page, the file sizes are usually < the 260KB warning, and it's easier to manage |
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2016
Location: Russia
Device: PC
|
When i try to convert docx (or any other format) to fb2, calibre doesn't preserve table on content. Is it normal? I use Calibre 2.0 (XP). In the latest versions it was corrected?
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
That is a terrible way to do what you want to do. If you are using Calibre's eBook editor or Sigil, use the built-in function for splitting HTML files. That's the best way to do it. Then rename the files to something that makes sense. Then all you'll need do from there is fix up the code for the chapter headers (if need be).
|
![]() |
![]() |
![]() |
#10 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
CSS: Code:
h2 { text-align: center; margin-top: 1em; margin-bottom: 1em } Code:
<h2>Chapter 1</h2> |
|
![]() |
![]() |
![]() |
#11 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() Preferences: Common Options: Table of Contents (sidebar) These tend to override the native book sources (mine is blank) |
|
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 24
Karma: 10
Join Date: Mar 2016
Location: Russia
Device: PC
|
I did try with many tries (with changing settings and don't). All the same - fb2 without toc. Did you try it and get list of content?
|
![]() |
![]() |
![]() |
#13 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I suggest you report this at Bugs : calibre, while you're there you might want to peruse other outstanding FB2 Output bugs - tags are on the right. BR |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] calibre not creating content.opf or toc.ncx files during conversion | foxxywith2xs | Calibre | 7 | 12-16-2012 07:49 PM |
Creating a TOC | taraboom11 | Conversion | 2 | 02-04-2011 02:04 PM |
creating a TOC for MOBI | pimpoum | Kindle Formats | 4 | 01-26-2011 09:37 AM |
Creating TOC | thibaulthalpern | 3 | 03-27-2010 04:21 PM | |
Creating TOC for dummies. | Anarel | Calibre | 2 | 01-26-2010 11:48 PM |