| 
			
			 | 
		#1 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90 
				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?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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 +  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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 12:43 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 244 
				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>
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 265 
				Karma: 724240 
				Join Date: Aug 2013 
				
				
				
				Device: KyBook 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			may also need white-space:nowrap
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 frumious Bandersnatch 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,570 
				Karma: 20150435 
				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
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Interested in the matter 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421 
				Karma: 426094 
				Join Date: Dec 2011 
				Location: Spain, south coast 
				
				
				Device: Pocketbook InkPad 3 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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-26-2013 12:39 AM | 
| split words at end of line | Smknox | Introduce Yourself | 4 | 08-26-2012 05:03 AM | 
| Too big gaps between paragraphs, sentences split with break in between.... | martienne | Workshop | 3 | 07-11-2011 02:39 PM | 
| how to insert break-line | schuster | Recipes | 1 | 05-24-2011 04:19 PM | 
| Book Designer - Page Break Line is not showing? | pitolee | Sony Reader | 6 | 04-19-2007 10:26 PM |