MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Superscript in titles (https://www.mobileread.com/forums/showthread.php?t=70377)

paulpeer 01-19-2010 07:03 AM

Superscript in titles
 
I'm working on a book with many superscripts in the titles. If I create the code as follows

<h3>TITLE<sup><a href="#sdfootnote24sym" id="sdfootnote24anc">24</a></sup></h3>

the book view looks perfecly but the TOC shows: TITLE24

If I change the code to

<h3>TITLE</h3> <sup><a href="#sdfootnote24sym" id="sdfootnote24anc">24</a></sup>

the TOC is perfect, but the book view looks stupid (superscript on next line).

Does anyone has a suggestion?

Thanks!

Valloric 01-19-2010 08:15 AM

I don't think you'll ever be able to get text display as superscript in the TOC. Not because of Sigil, but because I doubt you can express a superscript in the NCX file. The NCX doctype is, well, "ncx". It's not HTML. I doubt there's a "<sup>" tag (I could be wrong).

What I would do is this:
Code:

<h3 title="TITLE^24">TITLE<sup><a href="#sdfootnote24sym" id="sdfootnote24anc">24</a></sup></h3>
That is, display the superscript correctly in the book, but use the common "^" notation for the TOC. The "title" attribute overrides the content of the element for the TOC generation.

paulpeer 01-19-2010 11:17 AM

Quote:

Originally Posted by Valloric (Post 747119)
The "title" attribute overrides the content of the element for the TOC generation.

Yeees! That's the trick I was looking for. Thanks very much, Valloric!

rogue_ronin 01-19-2010 05:48 PM

If the NCX allows unicode, then you could fake it by using superscript characters directly:

Code:

TitleČ⁴
m a r

Valloric 01-19-2010 05:54 PM

Quote:

Originally Posted by rogue_ronin (Post 747848)
If the NCX allows unicode, then you could fake it by using superscript characters directly.

Damn good idea. An NCX is still an XML file, and thus uses Unicode. And since Sigil is fully Unicode aware and exports everything as UTF-8, you can use this:
Code:

<h3 title="TitleČ⁴">
But there's a good chance a Reading System will screw up the rendering. Try it in ADE first.

Jellby 01-20-2010 09:37 AM

But if the "24" is just a note call, I don't think anyone would want it showing in the TOC.

And using Unicode is not always a solution. It does not work if you have "M<sup>lle</sup>" or "3.<sup>er</sup>" in your titles (although in these cases, rendering the superscripts as normal text is an acceptable solution).


All times are GMT -4. The time now is 06:35 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.