11-07-2020, 08:26 PM | #1 |
Wizard
Posts: 1,078
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
TOC Formatting Question
Is there any way to have Heading formatting carried over to the Editor TOC?
I have some superscript and subscript formatting in the H1 and the TOC editor does not apply it in in the Editor TOC Editor I made an inline TOC and it was not there either but I could re-apply it at least I know that there's 2 TOCs in an epub. ADE seems to use both, the NCX(??) on the left, and the inline one as the TOC (I'm assuming that Calibre assigns TOC as the semantic for the inline TOC file) Probably not possible to format the NCX(??) TOC, but for the inline file that Calibre generates, it'd be nice if character formatting from the Hx could be carried over. Right now, every time the inline TOC is regenerated, I have to re-apply any special formatting |
11-07-2020, 08:51 PM | #2 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
The same thing happens with Sigil. From start.xhtml I copied the stuff between the body tags into a new .xhtml file in a new epub3 in Sigil and generated the table of contents and the sub and superscripts are lost.
|
Advert | |
|
11-07-2020, 09:07 PM | #3 | |
Bibliophagist
Posts: 35,665
Karma: 145624988
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
If you are creating an epub3, you can use formatting in the nav document and you can see this if the nav document is in the spine and you are viewing that document. Otherwise, it will be displayed as a plain text document. Last edited by DNSB; 11-07-2020 at 09:15 PM. Reason: Added comment about epub3 nav document |
|
11-07-2020, 11:24 PM | #4 |
creator of calibre
Posts: 43,896
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Im afraid not. ToC title are canonically represented as plain text. the inline toc is generated from this canonical representation
|
11-08-2020, 11:25 AM | #5 |
Wizard
Posts: 1,078
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
@DNSB - thanks for explaining the NCX. I never thought about it being XML so that explains it
@KG - bummer. I prefer to use an inline TOC for a 'complicated' book, and fortunately most times there is no need to tweak the TOC text. |
Advert | |
|
11-08-2020, 11:35 AM | #6 |
Well trained by Cats
Posts: 29,834
Karma: 54837878
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Paul, I understand a bit about using a inline TOC for a 'complicated book' because you can include a lot more (first lines, long chapter titles) than works cleanly with the NCX.
OTOH The NCX TOC works outside the flow of the book. There is no Out and Back when simply viewing. The device keeps the NCX 'on the side' |
11-08-2020, 01:00 PM | #7 |
Wizard
Posts: 1,078
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
@theducks -- I agree there are advantages to both.
|
11-08-2020, 05:40 PM | #8 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
For inline TOCs, after generating them, I copy the STYLE section from a text file over the STYLE section in the inline TOC. The STYLE section in the text file is a template that I created a long time ago after formatting the STYLE section in an inline TOC the way I wanted it to be. This way, a simple copy and paste is needed each time I generate an inline TOC, instead of having to format it each time.
Here is my template that I have saved in a text file: <style type="text/css"> li { list-style-type: none; font-size: 0.85em; padding-left: 0; margin-left: 0; margin-bottom: 0.1em; } a { color: blue; text-decoration: none; } a:hover { color: red; } </style> </head> <body id="calibre_generated_inline_toc"> <h3 style="text-align: center;">CONTENTS</h3> Last edited by deback; 11-08-2020 at 05:42 PM. |
11-08-2020, 05:46 PM | #9 |
Resident Curmudgeon
Posts: 74,177
Karma: 129333564
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
If you have an internal ToC you want to be able to easily get to, you an add an entry in the ToC for this. In most cases, there's nothing special about an internal ToC and if that is the case, just drop the internal ToC. It's what I do.
|
11-08-2020, 05:48 PM | #10 | |
Resident Curmudgeon
Posts: 74,177
Karma: 129333564
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
11-08-2020, 06:06 PM | #11 |
Guru
Posts: 935
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Have you tried using a snippet?
It is saved right in the editor, and you can invoke it just by typing your predefined trigger (let's say: T), and then pressing CTRL+J. You can also define placeholders for your template. For instance, I have a snippet for SVG covers. I use placeholders for image url, height and width; you can jump throughout then with CTRL+J, saving you a lot of time. I think it is really useful. Also, you can pre-select some text and press CTRL+J, before typing your trigger. This way, your selected text will replace one of your placeholders (the one marked with *). |
11-08-2020, 10:55 PM | #12 |
Wizard
Posts: 1,078
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Not sure if this applies
Ref: https://manual.calibre-ebook.com/cus...ates-et-cetera There is a file with the CSS that gets incorporated into an inline TOC I copied C:\Program Files\Calibre2\app\resources\templates\inline_toc_ styles.css to C:\Users\userid\AppData\Roaming\calibre\resources\ templates\inline_toc_styles.css and customized it. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aura ONE device-TOC formatting | Sam Sahara | Kobo Reader | 1 | 08-24-2018 07:36 AM |
Formatting the TOC | RickAltman | Conversion | 1 | 11-13-2014 12:43 AM |
Inline TOC formatting | phossler | Editor | 9 | 03-29-2014 06:05 AM |
Formatting TOC | jackibar | Sigil | 18 | 03-01-2012 09:02 AM |
line formatting formatting question | daesdaemar | Workshop | 9 | 02-06-2009 11:47 AM |