Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-01-2015, 08:19 AM   #16
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,944
Karma: 185432100
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Quote:
Originally Posted by Jellby View Post
Gee, you are right. That makes it unusable, I'm afraid
Good. I was afraid I'd have to start bothering with epub3.
doubleshuffle is offline   Reply With Quote
Old 09-02-2015, 05:42 AM   #17
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by doubleshuffle View Post
Good. I was afraid I'd have to start bothering with epub3.
Some epub3 features actually simplify the formatting of poems. IMHO, it couldn't hurt to have a look at pseudo classes, which allow you to apply CSS rules based on the number of an element without additional markup.

For example, you could automatically apply CSS rules to the last line of a verse and display line numbers every 5 lines using the following stylesheet:

Code:
ul {
    counter-reset: counter;
    margin-left: .25em;
}

li {
    counter-increment: counter;
    list-style-type: none;
}

ul li:nth-child(5n+5):before {
    left: 0;
    position: absolute;
    padding-left: 1em;
    content: counter(counter);
}

ul li:nth-child(6n+6) {
    text-align: right;
    margin-bottom: 1em;
}

h3 {
    text-align: center;
}
I've attached a slightly updated example file that I posted in a related thread.

Since this is an ePub3 file, it'll only work with Sigil, iBooks, ADE4/RMSK11*, Gitden Reader*, Kindles and other ePub3 apps.

*ADE and Gitden Reader, which both use the Readium engine, generally support pseudo classes, but have problems with counters.
ADE adds phantom numbers and Gitden Reader displays numbers only on the first page.

The only app that displays the test file correctly is iBooks.
Attached Thumbnails
Click image for larger version

Name:	ADE4.png
Views:	293
Size:	89.3 KB
ID:	141599   Click image for larger version

Name:	gitden_reader_android.png
Views:	277
Size:	201.8 KB
ID:	141600  
Attached Files
File Type: epub The_Raven_epub3.epub (5.9 KB, 224 views)
Doitsu is offline   Reply With Quote
Advert
Old 09-02-2015, 06:05 AM   #18
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,944
Karma: 185432100
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Thanks, Doitsu. Interesting feature indeed, especially for the line numbers. About that right-align for the last line of the stanza: I could also set a value for indentation there, I guess? That might be helpful for very long poems that always follow the same stanza pattern.

But I guess support would have to get a bit more widespread before seriously using this.
doubleshuffle is offline   Reply With Quote
Old 09-02-2015, 06:39 AM   #19
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by doubleshuffle View Post
About that right-align for the last line of the stanza: I could also set a value for indentation there, I guess?
You can style it any way you like.
Doitsu is offline   Reply With Quote
Old 01-03-2017, 04:29 PM   #20
cadele
Addict
cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.cadele ought to be getting tired of karma fortunes by now.
 
cadele's Avatar
 
Posts: 372
Karma: 3710372
Join Date: Feb 2010
Device: Kindles, Sony 650
Quote:
Originally Posted by RbnJrg View Post
Yes, there are several ways to do what you want. One aproximation could be:

1. In the .css stylesheet:

Code:
p {
   font-size: 1em;
   text-indent: 1.2em;
   text-align: justify;
}

div.epigraph {
   text-indent: 0;
   text-align: center;
   font-style: italic;
   font-weight: bold;
   font-size: 1.1em;
}

div.epigraph div.stanza {
   width: 60%;  /* You can play here with the width */
   margin: 1em 20%; /* Left and right margins are linked with the width you set */
   padding: 0.5em; /* This is not necessary, only if you want a border around the stanza */
   text-indent: 0;
   text-align: left;
   font-size: 0.8em;
   font-weight: normal;
   border: 1px solid; /* This is not necessary */
} 

div.stanza p {
   margin: 0;
}
2. In your .xhtml file:

Code:
<div class="epigraph">
    This is the title
    <div class="stanza">
       <p>"The Spirit of the Lord is upon me,</p>
       <p>because he has anointed me</p>
       <p>to bring good news to the poor.</p>
    </div>
</div>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula.</p>
This is how it looks in Sigil:

Attachment 141488

Below you can check the respective epub.

Regards
Rubén
I know this is an old thread, but thank you so much for this. Karma to you.

I am useless at CSS, but this has been a great help to me
cadele is offline   Reply With Quote
Advert
Old 01-03-2017, 05:37 PM   #21
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,764
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by cadele View Post
I know this is an old thread, but thank you so much for this. Karma to you.

I am useless at CSS, but this has been a great help to me
You are welcome Cadele Glad that my code was able to help you.
RbnJrg is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Poetry Verses Alignment Problem mtrahan ePub 23 04-05-2015 10:18 PM
poetry cian ePub 2 01-23-2011 02:56 PM
Got POETRY? Dr. Drib Writers' Corner 36 04-02-2009 11:18 AM
Formatting Poetry - A Problem Patricia Sony Reader 8 08-21-2007 02:33 PM


All times are GMT -4. The time now is 04:38 AM.


MobileRead.com is a privately owned, operated and funded community.