Mobileread
"Invisible chapter title" but visible in TOC
#1  dxcore35 01-09-2020, 12:23 AM
Hello,

How to archive the automatic recognition of the chapter, but not show chapter title in the book?
* With solution that is file format indepedent (azw3 \ epub)

Example:

- Copyright page with no visible title in HTML body
- After auto-generating chapters (for example in Calibre > EPUB edit >Generate chapters from all headings)
- The copyright page should be recognized

Thanks a lot for suggestions!
Reply 

#2  hobnail 01-09-2020, 05:19 PM
I'm not sure if I understand your question but try
Code
<h2 class="nodisplay" title="Chapter title here">Chapter title here</h2>
and in your CSS file put
Code
.nodisplay {
display: none;
}
The stuff between the quotes for title= gets picked up the the table of contents generator (overrides what's between the begin and end tags), if I remember correctly.
Reply 

#3  hobnail 01-09-2020, 05:20 PM
If the above does what you want perhaps you could use an empty h2 tag
Code
<h2 title="TOC stuff goes here" />
so then you don't need the CSS.
Reply 

#4  Turtle91 01-09-2020, 10:07 PM
Quote hobnail
If the above does what you want perhaps you could use an empty h2 tag
Code
<h2 title="TOC stuff goes here" />
so then you don't need the CSS.
Yes, but I think the page still leaves a place holder for an empty tag. You would need to tell it not to allocate space for the tag.
Code
<h2 style="display:none" title="TOC stuff goes here" />
or
<h2 style="display:none" title="TOC stuff goes here"></h2>
This is a technique I use regularly for Dedication, Copyright, etc. pages.
Reply 

#5  hobnail 01-09-2020, 10:51 PM
Quote Turtle91
Yes, but I think the page still leaves a place holder for an empty tag. You would need to tell it not to allocate space for the tag.
Code
<h2 style="display:none" title="TOC stuff goes here" />
or
<h2 style="display:none" title="TOC stuff goes here"></h2>
This is a technique I use regularly for Dedication, Copyright, etc. pages.
Thanks. I hadn't thought of that.
Reply 

#6  dxcore35 01-10-2020, 01:18 AM
Either CSS solution either direct HTML solution works!
Thank you all, friend.
Reply 

Today's Posts | Search this Thread | Login | Register