![]() |
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?
|
H&+#8288;2&+#8288;O
Without the + |
This didn't work in Sigil. Entity 187 did. But I didn't investigate further than that.
|
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 { |
may also need white-space:nowrap
|
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. |
display:inline-block could help, but it's not required by the epub spec. Maybe display:inline-table
|
Quote:
|
That's it! :smack:
Use the character U +2082 (sub-index two) H₂O |
| All times are GMT -4. The time now is 06:01 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.