10-22-2013, 03:28 AM | #1 |
Connoisseur
Posts: 87
Karma: 39898
Join Date: Jul 2013
Location: Canberra, Australia
Device: Kobo Clara HD, Kobo Libra H2O
|
Preventing chemical symbol from being split by page or line break
If I have a chemical symbol in an epub (eg H2O, the chemical symbol for water, with the "2" subscripted), I find that it can get broken across a line or page, with the H separated from the 2O. Is there any way to prevent this happening?
|
10-22-2013, 03:41 AM | #2 |
Interested in the matter
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
H&+#8288;2&+#8288;O
Without the + |
Advert | |
|
10-22-2013, 07:09 AM | #3 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
This didn't work in Sigil. Entity 187 did. But I didn't investigate further than that.
Last edited by mrmikel; 10-22-2013 at 11:43 AM. |
10-22-2013, 07:58 AM | #4 |
Addict
Posts: 243
Karma: 359054
Join Date: Nov 2012
Device: default
|
I'm not sure that's entirely undesirable - suppose
you had the molecular formula for penicilln or something. But you could try putting the whole thing in a span Code:
span.nobreak { page-break-inside: avoid; } <span class="nobreak">H<sub>2</sub>O</span> |
10-22-2013, 08:03 AM | #5 |
Addict
Posts: 265
Karma: 724240
Join Date: Aug 2013
Device: KyBook
|
may also need white-space:nowrap
|
Advert | |
|
10-22-2013, 10:09 AM | #6 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
The page-break-inside avoid is ignored by a lot of readers, so it is a bit hit and miss. The reason is the internal HTML tag which is required for the subscript.
white-space: nowrap is also not supported by a lot of readers... There is no real solution for this. What you might try is creating an SVG with the formula and insert that as image. You can use text in SVG and all readers must support that according to the specifications. |
10-22-2013, 11:24 AM | #7 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
display:inline-block could help, but it's not required by the epub spec. Maybe display:inline-table
|
10-22-2013, 01:27 PM | #8 |
Interested in the matter
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
|
10-23-2013, 03:06 AM | #9 |
Interested in the matter
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
That's it!
Use the character U +2082 (sub-index two) H₂O |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Preventing Page Title from Being Inserted into Article Text | buffaloseven | Recipes | 0 | 07-25-2013 11:39 PM |
split words at end of line | Smknox | Introduce Yourself | 4 | 08-26-2012 04:03 AM |
Too big gaps between paragraphs, sentences split with break in between.... | martienne | Workshop | 3 | 07-11-2011 01:39 PM |
how to insert break-line | schuster | Recipes | 1 | 05-24-2011 03:19 PM |
Book Designer - Page Break Line is not showing? | pitolee | Sony Reader | 6 | 04-19-2007 09:26 PM |