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 04-16-2022, 10:00 PM   #1
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
<h2 title="xx">

Hello,

When a chapter heading has a chapter name as well as a chapter number, I normally use something like this. (You can guess what the classes do without the css code)

PHP Code:
  <h3>1<span class="hide"– The Country of Lost Borders</span></h3>
  <
p>*</p>
  <
class="chapterh3">The Country of Lost Borders</p
I have seen mention on the forum about using the following...
PHP Code:
<h3 title="1 - The Country of Lost Borders">1</h3
But it never seems to work for me. Image shows how I use it.

Could someone tell me where I am going wrong?

Thanks.
Attached Thumbnails
Click image for larger version

Name:	heading_title.jpg
Views:	114
Size:	101.3 KB
ID:	193275  
Karellen is online now   Reply With Quote
Old 04-16-2022, 11:15 PM   #2
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,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Did you regenerate the TOC after making that change?
(it does work for me the last time I did that in Sigil)
theducks is offline   Reply With Quote
Advert
Old 04-16-2022, 11:22 PM   #3
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,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by theducks View Post
Did you regenerate the TOC after making that change?
(it does work for me the last time I did that in Sigil)
OK Tried with Calibre 5.99.8 and it does NOT work (tried various generate from options)
Tried with Sigil 1.9.2 (and prior) and it works

I think you found a weak spot
theducks is offline   Reply With Quote
Old 04-16-2022, 11:31 PM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
OK Tried with Calibre 5.99.8 and it does NOT work (tried various generate from options)
Tried with Sigil 1.9.2 (and prior) and it works

I think you found a weak spot
Great, thanks @theducks for confirming I am not completely incompetent.

I have been trying to use this on and off for the last few weeks and I couldn't figure out where my mistake was. I thought it was a epub v3.0 function only, but (I think it was) @KevinH confirmed it should work in v2.0 also.

(And yes, I did refresh and regenerate the TOC. Usually I blank it, save/exit the toc editor, then back in and regenerate.)

Hopefully @kovidgoyal might be able to look at the issue.

Thanks again @theducks
Karellen is online now   Reply With Quote
Old 04-17-2022, 12:36 AM   #5
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
Another Sigil user here. A possible trick that might be useful.

I also use the title= thing.

Code:
<h2 title="One - The storm">One <span>The storm</span></h2>
In my CSS I have

Code:
h2 span, h1 span {
    display: block;
}
This puts the chapter number on a separate line above the title, or more correctly, the chapter title is on a separate line below the chapter number. I also have additional styling to make the chapter number small caps and the title bold. The table of contents just gets the chapter title, no number.

I think it was turtle91 who shared this trick.

Last edited by hobnail; 04-17-2022 at 12:40 AM.
hobnail is offline   Reply With Quote
Advert
Old 04-17-2022, 12:37 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,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You are welcome.
For now, why not use Sigil's TOC tool? (it only works on H# tags)
(I use both, but prefer some of the options that Calibre offers for odder cases)
theducks is offline   Reply With Quote
Old 04-17-2022, 05:47 AM   #7
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,015
Karma: 129333114
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 Karellen View Post
Hello,

When a chapter heading has a chapter name as well as a chapter number, I normally use something like this. (You can guess what the classes do without the css code)

PHP Code:
  <h3>1<span class="hide"– The Country of Lost Borders</span></h3>
  <
p>*</p>
  <
class="chapterh3">The Country of Lost Borders</p
I have seen mention on the forum about using the following...
PHP Code:
<h3 title="1 - The Country of Lost Borders">1</h3
But it never seems to work for me. Image shows how I use it.

Could someone tell me where I am going wrong?

Thanks.
Make the chapter number <h1 and the chapter title <h2 but you have to use classes or define <h1 and <h2 in CSS.
JSWolf is offline   Reply With Quote
Old 04-17-2022, 07:11 PM   #8
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by hobnail View Post
Another Sigil user here. A possible trick that might be useful.

I also use the title= thing.

Code:
<h2 title="One - The storm">One <span>The storm</span></h2>
In my CSS I have

Code:
h2 span, h1 span {
    display: block;
}
This puts the chapter number on a separate line above the title, or more correctly, the chapter title is on a separate line below the chapter number. I also have additional styling to make the chapter number small caps and the title bold. The table of contents just gets the chapter title, no number.

I think it was turtle91 who shared this trick.
Thanks @hobnail, I'll give it a try. Am I right in thinking it is another method to achieve the same outcome? So I can either have a css code for "chapterh2" or css code for "h2 span". Its not really saving anything, (but of course I probably don't have a deep enough understanding to see the differences between the two methods).



Quote:
Originally Posted by JSWolf View Post
Make the chapter number <h1 and the chapter title <h2 but you have to use classes or define <h1 and <h2 in CSS.
h1 and h2 are already in use.
h1 is on the title page (thought I could probably get rid of that)
h2 is used for the parts of the book which are split into days - "Day 1- Contact" and h3 is used for the chapters in "Day 1"

Just to confirm that my issue is with the creation of the TOC which omits the title="" portion of the heading.
Karellen is online now   Reply With Quote
Old 04-17-2022, 10:08 PM   #9
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,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
I'm not very good with complicated CSS, so I usually try and keep it simple and only use title to have something appear in the TOC

Code:
<h1 title="Cover"</h1>

.....


<h1>1 <br/>*"The Country of Lost Borders</h1>

...
so the TOC would have

Cover
1 The Country of Lost Borders
2 The Country of More Lost Borders

etc.

Simple minded, but works for me
phossler is offline   Reply With Quote
Old 04-17-2022, 11:05 PM   #10
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
Quote:
Originally Posted by Karellen View Post
Thanks @hobnail, I'll give it a try. Am I right in thinking it is another method to achieve the same outcome?
The only thing my hack does is allow you to use one h tag, and have two lines, one line the chapter number and one line the chapter title, each with their own styling.

What phossler is doing with a br would also give you two lines but you'd still need to put a span around the part you want styled differently. I don't understand what that asterisk and double quote does. Does it suppress the br so it doesn't show up in the table of contents?
hobnail is offline   Reply With Quote
Old 04-18-2022, 12:26 AM   #11
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by hobnail View Post
I don't understand what that asterisk and double quote does.
No, its just a silly typo-o.
By the time I noticed it was already quoted in other posts, so I left it as is.

I meant to write this, and have no clue what sequence of silly blunders added that extra line

PHP Code:
  <h3>1<span class="hide"– The Country of Lost Borders</span></h3>
  <
class="chapterh3">The Country of Lost Borders</p
Karellen is online now   Reply With Quote
Old 04-18-2022, 05:00 AM   #12
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...0c736b898c67f2
kovidgoyal is offline   Reply With Quote
Old 04-18-2022, 06:26 AM   #13
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,103
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
Fantastic. Thank you @kovidgoyal
I'll test and provide feedback once it is released.

Karellen is online now   Reply With Quote
Old 04-18-2022, 12:27 PM   #14
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
I tested and phossler's trick of using a br in the h1 works. I was wondering if the br would get pulled into the nav.xhtml but with sigil but it does not. Likewise with the span, so that makes sense, it strips out any formatting stuff.

So now I'm wondering why I thought the way I'm doing it was better; I'd still need the span for formatting if I want the chapter title or number formatted different. The thread were I saw this was several years ago so I don't remember the details.
hobnail is offline   Reply With Quote
Old 04-18-2022, 01:02 PM   #15
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,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by hobnail View Post
I tested and phossler's trick of using a br in the h1 works. I was wondering if the br would get pulled into the nav.xhtml but with sigil but it does not. Likewise with the span, so that makes sense, it strips out any formatting stuff.

So now I'm wondering why I thought the way I'm doing it was better; I'd still need the span for formatting if I want the chapter title or number formatted different. The thread were I saw this was several years ago so I don't remember the details.
I have been using the <space><br/><span class trick for a long time
The space before the BR is preferred as it does not obviously displace the next line (really a sore thumb when left-justified)
Note:I am not submitting books for publication in other formats, where this trick might bomb ugly
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having "title Sort" always matching "title" Ansem_93 Library Management 3 02-21-2021 05:48 PM
Remove "Author" from "Title" field ctop Library Management 0 02-25-2020 10:19 PM
Use "short" instead of "full" title for title sort & renaming? wolpi Library Management 2 08-04-2016 05:25 PM
Aura Books not listed by title but just "<title> - <number> - <series>" qee4q Kobo Reader 12 05-10-2015 04:37 PM
A warning for Linux users: slow "Add Books", "Unknown" title and Author rolgiati Library Management 8 07-24-2013 04:36 PM


All times are GMT -4. The time now is 05:16 PM.


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