View Single Post
Old 02-27-2018, 04:08 PM   #1
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 329
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
strange dropcap behavior with/without merged xhmtl

h1 ~ p:first-of-type, /*use for split xhtml */
h2 + p /*use for merged xhtml*/ {
text-indent: 0;
/*unindents first p following every h1*/}
h1 ~ p:first-of-type:first-letter, /*use for split xhtml*/
h2 + p:first-letter /*use for merged xhtml*/ {
color: red;
font-size: 3em;
float:none;
line-height: 0.5em;
/*float:none makes TALLcap*/}
If you split xhtml segments at every <h1> you can use the pseudo code to create dropcaps at the first letter of the first <p> following every <h1> when converting to PDF. If the xhtml segments are merged into a single file (to avoid page breaks before <h1>) then the pseudo code does not function and there are no dropcaps. Of course, normally, you would NOT merge the <h1> xhtml segments; I did that to prevent page breaks before every <h1>. However, if you also have <h2> subchapters you may actually want to prevent page breaks between every <h2>. If so, the above code for <h2> is a "work around" which lets you make drop caps no matter if the xhtml segments are merged or split. These are TALLcaps because dropcaps (float:left) are not well behaved. Best regards, Pop
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2018-02-27 15-04-37.png
Views:	211
Size:	41.0 KB
ID:	162535  
rjwse@aol.com is offline   Reply With Quote