View Full Version : Simple code for verse breaks in poetry using Sigil?


pstjmack
08-09-2011, 08:24 AM
Can anyone please tell me the simplest, no-brain way to ensure consistent breaks between verses in poetry when creating ePub books with Sigil?

I don't want to do indents; I don't want to centre text; I don't want to play fancy tricks with the margins. All I want to do is make sure that verses come out with a break after them, to separate them consistently and make sure it's possible to see where a verse begins and ends.

As everyone is probably aware, hard returns don't work. What does? Some kind of consistent find/replace function to do bulk changes on Gutenberg-derived html or txt would be a bonus, but really I just want the basic code.

This is driving me mad with frustration: someone please help!

Jellby
08-09-2011, 08:31 AM
Add <br/> at the end of each verse in code view (I don't know if there's an equivalent in book view).

charleski
08-09-2011, 02:42 PM
div.verse {
margin: 1.2em 15%;
page-break-inside: avoid
}

Then wrap the paragraphs for each verse in
<div class="verse">
...
</div>
tags.

pstjmack
08-12-2011, 01:49 AM
Sorry, charleski, do you mean that at the start of the whole document there should be:

div.verse {
margin: 1.2em 15%;
page-break-inside: avoid
}

?

Toxaris
08-12-2011, 02:09 AM
No, that part has to go into the stylesheet. Then do the following:
<div class="verse">
<p>Line 1</p>
<p>Line 2</p>
<p>Line 3</p>
<p>Line 4</p>
</div>
<div class="verse">
<p>Line 1</p>
etc...

Of course instead of paragrapgs you could also use blockquotes.

pstjmack
08-12-2011, 07:30 AM
The Project Gutenberg epub of Gray's "An Elegy Wrote in a Country Church Yard" actually seems to get the formatting right for once in a Gutenberg epub file. The code looks like this:

<div class="poem">
<div class="stanza">
<span>When the voices of children are heard on the green<br /></span> <span>And whisp'rings are in the dale,<br /></span>
<span>The days of my youth rise fresh in my mind,<br /></span>
<span>My face turns green and pale.<br /></span>
</div>
</div>

The results look like they should come out perfectly in Sigil Book View, but unfortunately in FBReader they all come out the same as ever - no breaks between verses.

pstjmack
08-12-2011, 07:37 AM
No, that part has to go into the stylesheet. Then do the following:
<div class="verse">
<p>Line 1</p>
<p>Line 2</p>
<p>Line 3</p>
<p>Line 4</p>
</div>
<div class="verse">
<p>Line 1</p>
etc...

Of course instead of paragrapgs you could also use blockquotes.

And how do I create the style sheet? So far on the project files I've created, there's no style sheet in the Styles folder of the Book Browser.

DaleDe
08-12-2011, 11:07 AM
Check our wiki on CSS to learn about creating a file. FBReader does not fully support CSS.

Faster
08-12-2011, 03:42 PM
When you want a blank line put:
<p >&nbsp;</p>

charleski
08-12-2011, 04:29 PM
When you want a blank line put:
<p >&nbsp;</p>

:rofl::chinscratch::rofl:

No, do it in the css.

Faster
08-12-2011, 05:40 PM
"Can anyone please tell me the simplest, no-brain way to ensure consistent breaks between verses in poetry when creating ePub books with Sigil?"

Pablo
08-12-2011, 05:55 PM
"Can anyone please tell me the simplest, no-brain way to ensure consistent breaks between verses in poetry when creating ePub books with Sigil?"

Have a look at my epub tutorial (see my signature).

shall1028
08-13-2011, 02:14 AM
"...the simplest, no-brain way..."

Unfortunately your question is akin to those such as "how long is a piece of string?" All those who do answer your question believes that their method is the simplest or fastest way to accomplish the task and for them it probably is.

The section in Pablo's tutorial PDF is pretty simple and probably should be the one you use to keep the semantic people happy.

If you don't give a toss about the semantic people just use one <p> per stanza with <br /> at the end of each line and use your own <p>&nbsp;</p> between stanzas.

It's not what I personally use (nor Pablo's method) but since I do know "how long a piece of string is" I am happy to keep my method to myself.

Faster
08-13-2011, 03:46 AM
Whoa there! I'm quoting the original poster and making the point to charleski about what was asked for.
@ Pablo - your "tutorial" is simplistic and I passed that level long ago, but congratulations on getting a plug in for your post. Keep at it!
@ shall1028 - try reading the full thread and noting who the poster is before sounding off.

shall1028
08-13-2011, 01:18 PM
Whoa there! I'm quoting the original poster and making the point to charleski about what was asked for.

My hesitant and vague apology. The "" marks were somewhat unnoticeable with the bold text in between and the post was so far down the list from the original poster's post that it was easy enough to assume a second person looking for the same sort of thing.

I blame Twitter for the whole thing.