09-16-2018, 07:58 AM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2018
Device: Samsung Galaxy Tab S3
|
How to force superscripts inline ?
Is there a CSS script I can add (or any other solution) to force superscripts (or subscripts) to be "inline" (on the same level as the text) ? I have tried reducing the font size for the superscripts, and increasing the line spacing, but neither is a good solution. Thanks in advance for any suggestions.
|
09-16-2018, 09:46 AM | #2 | |
Wizard
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
Code:
line-height: 0; Code:
line-height: normal; |
|
Advert | |
|
09-16-2018, 10:39 AM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2018
Device: Samsung Galaxy Tab S3
|
Bernie, Thanks for your reply. I went to
preferences/conversion/common options/look & feel/styling/Extra CSS and added: .end-note { line-height: 0; } but it does not change the output. I am a 'newbie' to CSS, so apologies in advance, but....any idea what I'm doing wrong? (I did also try "line-height: normal;"). Thanks ! |
09-16-2018, 12:07 PM | #4 |
The Grand Mouse 高貴的老鼠
Posts: 71,507
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
I beleive the only way around this problem is to have a fixed line height, e,.g.
line-height: 1.2em; But this will annoy people who like to have a different line height on their reader. |
09-16-2018, 12:21 PM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2018
Device: Samsung Galaxy Tab S3
|
Thanks, pdurrant; Unless I'm doing something wrong, pasting
sup { line-height: 1.2em; } in Look & Feel / Styling / Extra CSS does not solve the problem (the superscript is still elevated so that it changes the line spacing). |
Advert | |
|
09-16-2018, 12:49 PM | #6 | |
Wizard
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
See screenshot I find were a sup or sub is used, get the css property name see the highlighted areas in the File preview and text editor sections. See screenshot two I go to the css file and edit the css property values. Note these are just the general ones that I use, for some I will add font bold and letter spacing--example a linked footnote. See screenshot three for what is looks like in the calibre ebook viewer. bernie |
|
09-16-2018, 01:26 PM | #7 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2018
Device: Samsung Galaxy Tab S3
|
There is a learning curve here. :-( I will tackle this next weekend. Thank you very much!!
|
09-16-2018, 04:47 PM | #8 |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
@Justin:
You haven't fully described what you mean by "inline" superscripts or what your goal is in terms of usage. The style property to use normally to keep superscripts inline is vertical-align. Values of this is what you want probably. Here are two rulesets I use all the time: the first SUP is for footnotes references and the like. The SUP with class "ordinal" is what I use for ordinal numbers (like 1st, 2nd, etc.) Code:
sup { vertical-align: super; font-size: 0.8em; padding: 0 4px; font-weight: bold; } sup.ordinal { vertical-align: text-top; font-size: 0.8em; padding: 0; font-weight: normal; } Last edited by Brett Merkey; 09-16-2018 at 05:02 PM. |
09-16-2018, 09:16 PM | #9 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can actually do this fairly easily using the "Transform styles" feature of the Look & feel section of the conversion dialog. Create a rule something like:
If the vertical-align is not baseline remove the property. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Line spacing with sub- and superscripts | lizzielou | Conversion | 3 | 08-15-2016 11:34 AM |
How do I reduce line spacing when I have superscripts | jrjung | Conversion | 2 | 09-04-2015 03:36 PM |
Aura HD Superscripts rendered as subscripts | Nick Payne | Kobo Reader | 4 | 01-07-2015 03:47 AM |
superscripts and subscripts lost in ePub | cyberbaffled | ePub | 3 | 10-13-2009 11:52 AM |
Superscripts in LRF | dynabook | Calibre | 6 | 09-10-2008 01:26 PM |