Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-07-2020, 08:26 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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
Attached Thumbnails
Click image for larger version

Name:	1-EditorTOC.JPG
Views:	156
Size:	21.3 KB
ID:	183288   Click image for larger version

Name:	2-InlineTOC_As Generated.JPG
Views:	160
Size:	22.5 KB
ID:	183289   Click image for larger version

Name:	3-InlineTOC Reapplied.JPG
Views:	160
Size:	17.5 KB
ID:	183290   Click image for larger version

Name:	4-ADE_TOC.JPG
Views:	152
Size:	33.3 KB
ID:	183291  
Attached Files
File Type: epub Test_TOC.epub (2.9 KB, 155 views)
phossler is offline   Reply With Quote
Old 11-07-2020, 08:51 PM   #2
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
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.
hobnail is offline   Reply With Quote
Advert
Old 11-07-2020, 09:07 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
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:
Originally Posted by hobnail View Post
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.
ADE rendering an epub2 file and other epub2 renderers will use the ncx file as the source for ToC information. An inline HTML ToC is not necessary and not used by the renderer. The ncx file format is XML not HTML. To quote: "XML stores data in plain text format. This provides a software- and hardware-independent way of storing, transporting, and sharing data." You will notice that you can not link a stylesheet to the ncx file anymore than you can link it to the opf file.

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
DNSB is offline   Reply With Quote
Old 11-07-2020, 11:24 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 11-08-2020, 11:25 AM   #5
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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.
phossler is offline   Reply With Quote
Advert
Old 11-08-2020, 11:35 AM   #6
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: 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'
theducks is offline   Reply With Quote
Old 11-08-2020, 01:00 PM   #7
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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.
phossler is offline   Reply With Quote
Old 11-08-2020, 05:40 PM   #8
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
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.
deback is offline   Reply With Quote
Old 11-08-2020, 05:46 PM   #9
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: 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.
JSWolf is offline   Reply With Quote
Old 11-08-2020, 05:48 PM   #10
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: 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:
Originally Posted by deback View Post
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>
But do you always need this ToC? Is it somehow different enough to the NCX ToC? In most cases, it's not different enough and the internal ToC can be left out without any problem because it's not going to be used.
JSWolf is offline   Reply With Quote
Old 11-08-2020, 06:06 PM   #11
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 935
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by deback View Post
Here is my template that I have saved in a text file
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 *).
thiago.eec is offline   Reply With Quote
Old 11-08-2020, 10:55 PM   #12
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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.
phossler is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 01:36 AM.


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