![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,626
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Question about TOC
Hello,
I've got a question about generating TOC. I have a book which has something like this: Code:
<h1>Title</h1> <h3>Author</h3> Thanks in advance. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,020
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Build a title= \1-\2 using regex into the H1 (or H3 excluding H1 from the TOC ?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,626
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Ok, thank you, I'll try that.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,626
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
As h1 and h3 are shown, I've created a new h4, which doesn't appear in the text (display: none), and goes inside the toc.
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Thanks Terisa for the question and the ducks for providing an answer.
I have tried to solve this problem but never got it right. Now works perfectly. ![]() Last edited by skil-phil; 12-04-2023 at 05:09 AM. Reason: missing word |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,928
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
My personal preference is to add a title="blah de blah" to one of the header tags and then limit the ToC generation to that tag.
That is for the original example: Code:
<h1>Title</h1> <h3>Author</h3> Code:
<h1>(.*?)<h1> <h3>(.*?)</h3> Code:
<h1 title="\1 - \2">\1<h1> <h3>\2</h3> |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,626
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Thank you, it's a very good option (I think the same one than theducks' but I hadn't caught it right).
Last edited by Terisa de morgan; 12-04-2023 at 03:26 PM. |
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,626
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
A last question. How do you include the title in the toc instead of the content of the h1?
Answer: Mark checkbox: Use title from headers (I should have read before asking) Last edited by Terisa de morgan; 12-04-2023 at 03:40 PM. |
![]() |
![]() |
![]() |
#9 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,020
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:
![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Yet another TOC question | Jabby | Sigil | 25 | 01-27-2011 11:14 AM |
Another TOC question, I think | Jabby | Sigil | 0 | 11-23-2010 10:18 AM |
6.0 TOC question | Amalthia | Calibre | 3 | 07-30-2009 12:45 PM |
BD TOC Question | Novasea | Workshop | 5 | 10-27-2008 11:38 AM |
toc question | zelda_pinwheel | IMP | 4 | 01-18-2008 10:49 AM |