Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-28-2015, 03:44 PM   #1
rewyn
Miskatonic U. Class of 97
rewyn began at the beginning.
 
rewyn's Avatar
 
Posts: 20
Karma: 10
Join Date: Apr 2015
Location: Ethersphere
Device: iPad, Kindle, Nook,
Poetry problem again?!

Well here is my new dilemma with poetry...

I have a chapter which has a centered, italic epigraph at the top of the main page; however, that epigraph also has a poem written in stanza form in it.

Is there a way to wrap the stanza that it retains the align left, but is also centered within the rest of the epigraph?

Been trying this:

<div class="epicenter">
<p class="verse">"The Spirit of the Lord is upon me,</p>

<p class="verse2">because he has anointed me</p>

<p class="verse3">to bring good news to the poor.</p>
</div>

div.epicenter {
clear: both;
float: center;
font-style : italic;
margin-top: 1em;
line-height: 1.2em;
display: inline-block;
}

So far I'm stuck. Anyone have a clue how I can do this, or if I simply cannot let me know also.
rewyn is offline   Reply With Quote
Old 08-28-2015, 06:03 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,817
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
float: center ???? right or left or none

text-align: center
theducks is offline   Reply With Quote
Advert
Old 08-29-2015, 11:21 AM   #3
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,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
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:

Click image for larger version

Name:	Image1.png
Views:	324
Size:	82.8 KB
ID:	141488

Below you can check the respective epub.

Regards
Rubén
Attached Files
File Type: epub Centered Block - Left Aligned text.epub (2.4 KB, 192 views)
RbnJrg is offline   Reply With Quote
Old 08-29-2015, 11:30 AM   #4
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Has nothing to with Sigil. This is a plain epub(xhtm/css question. Damn, why are those questions always put into this forum and in addition not moved by moderators?
rubeus is offline   Reply With Quote
Old 08-29-2015, 12:51 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,817
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Moderator Notice
moved out of Sigil. This issue is not caused BY Sigil
theducks is offline   Reply With Quote
Advert
Old 08-29-2015, 06:53 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,101
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
One thing to watch out for is the length of your stanza lines. If they are too long for the display widh you will get word-wrapping that makes the lines look funny:

eg:

There once was a man from
Nantucket
Who kept all his cash in a
bucket.
But his daughter, named
Nan,
Ran away with a man
And as for the bucket,
Nantucket.


Cheers,
Turtle91 is offline   Reply With Quote
Old 08-29-2015, 07:59 PM   #7
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,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Turtle91 View Post
One thing to watch out for is the length of your stanza lines. If they are too long for the display widh you will get word-wrapping that makes the lines look funny:

eg:

There once was a man from
Nantucket
Who kept all his cash in a
bucket.
But his daughter, named
Nan,
Ran away with a man
And as for the bucket,
Nantucket.


Cheers,
Yes, you are right; for that reason I said the OP must "play" with the width of the div "stanza". But if the stanza lines are still too long, the OP should adjust the "div.stanza p" style with a negative indent and a positive left margin so the stanza lines look like:

Code:
    There once was a man from 
        Nantucket
    Who kept all his cash in a 
        bucket.
    But his daughter, named 
        Nan,
    Ran away with a man
    And as for the bucket, 
        Nantucket.
Regards
RbnJrg is offline   Reply With Quote
Old 08-31-2015, 01:29 PM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Is there any way to reproduce the layout usually used in printed poetry, which is to align wrapping lines with the end of the initial line? I can't think of a way to reproduce that in an ePub (other than to use a fixed page layout, of course).
HarryT is offline   Reply With Quote
Old 08-31-2015, 02:35 PM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Not that I know. I asked for this a long time ago (almost 6 years): http://www.daisy.org/epub/?q=issues/...-option-poetry
Jellby is online now   Reply With Quote
Old 08-31-2015, 02:51 PM   #10
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Yes, because it's not even right-justification in the usual sense of the word. The wrapped line is right justified with respect to the end of the left-justified initial line, not with respect to the right margin.
HarryT is offline   Reply With Quote
Old 08-31-2015, 03:26 PM   #11
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,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by HarryT View Post
Is there any way to reproduce the layout usually used in printed poetry, which is to align wrapping lines with the end of the initial line? I can't think of a way to reproduce that in an ePub (other than to use a fixed page layout, of course).
Hi Harry;

With css2, you can't get what you want. But with css3 and epub3 (supported by the new ADE 4.x), yes, you can There is a new property called "text-align-last" that allow us to align the last line of a text block. Of that way, if you use, for example the following style for stanzas:

Code:
.stanza {
     text-align: left; /* or text-align: justify; */
     text-align-last: right;
}
you'll have what you were looking for.

Regards
Rubén
RbnJrg is offline   Reply With Quote
Old 08-31-2015, 03:50 PM   #12
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
It wouldn't work for more than two lines (what would be the desired behaviour here?), and according to http://www.w3schools.com/cssref/css3...align-last.asp "text-align-last" only works with "text-align: justify", although firefox doesn't seem to care. In addition, the last line is aligned with the "container", not with the actual previous line.

Nevertheless, it's better than nothing. Still no way to add the bracket before the last line, I guess.
Jellby is online now   Reply With Quote
Old 08-31-2015, 04:53 PM   #13
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,101
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Jellby View Post
It wouldn't work for more than two lines (what would be the desired behaviour here?), and according to http://www.w3schools.com/cssref/css3...align-last.asp "text-align-last" only works with "text-align: justify", although firefox doesn't seem to care. In addition, the last line is aligned with the "container", not with the actual previous line.
Not only is the last line aligned with the container, but any line that is only 1 line long...by definition that is the last line, so it would be aligned to the right.


Quote:
Originally Posted by Jellby View Post
Nevertheless, it's better than nothing.
Slowly getting there....
Turtle91 is offline   Reply With Quote
Old 08-31-2015, 05:02 PM   #14
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,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Jellby View Post
It wouldn't work for more than two lines (what would be the desired behaviour here?)
Hi Jellby;

w3schools.com gives an example with more than two lines:

http://www.w3schools.com/cssref/tryi...ext-align-last

And you're right; in theory, "text-align" should be "justify" in order that "text-align-last" works. But as you say, it also works with "text-align: left", at least on Firefox.

Quote:
Nevertheless, it's better than nothing. Still no way to add the bracket before the last line, I guess.
Yes, that's a pending task. Maybe with a script in epub3 could be done but really I don't know.

Regards
RbnJrg is offline   Reply With Quote
Old 09-01-2015, 05:05 AM   #15
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Turtle91 View Post
Not only is the last line aligned with the container, but any line that is only 1 line long...by definition that is the last line, so it would be aligned to the right.
Gee, you are right. That makes it unusable, I'm afraid
Jellby is online now   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 01:01 PM.


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