View Single Post
Old 01-16-2015, 09:51 AM   #15
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,852
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Automatic numbering of verses under ADE 4.02

In this post:

https://www.mobileread.com/forums/sho...56&postcount=9

Doitsu developed a clever method to use automatic numbering of verses; he utilized pseudo-elements under the form of unordered list. I borrowed some of his thoughts to do something similar but without using lists. The code I used was as follows:

Spoiler:
Code:
body {
  counter-reset: verse 0;
}

h3 {
   text-align: center;
}

.stanza {
   margin-left: 4em;
}

.stanza p {
  margin: 0;
  line-height: 1.2em;
}

.stanza p:nth-child(6n+7) {
    text-indent: 1em;
}

.stanza p:nth-child(6n+6) {
    margin-bottom: 1em;
}

.stanza p:nth-child(5n+5):before {
    float: left;
    margin-left: -4em;
    font-size: 70%;
    content: counter(verse);
    counter-increment: verse 5;
}

.dropcap {
    float: left;
    color: blue;
    line-height: 1.2em;
    font-size: 3em;
    font-weight: bold;
    margin: -0.2em 5px -0.3em 0;
}


and

Spoiler:
Code:
  <h3>IL CINQUE MAGGIO</h3>

  <div class="stanza">
    <p><span class="dropcap">E</span>i fu. Siccome immobile,</p>
    <p>Dato il mortal sospiro,</p>
    <p>Stette la spoglia immemore</p>
    <p>Orba di tanto spiro,</p>
    <p>Cosģ percossa, attonita</p>
    <p>La terra al nunzio sta,</p>

    <p>Muta pensando all’ultima</p>
    <p>Ora dell’uom fatale;</p>
    <p>Nč sa quando una simile</p>
    <p>Orma di pič mortale</p>
    <p>La sua cruenta polvere</p>
    <p>A calpestar verrą.</p>

    <p>Lui folgorante in solio</p>
    <p>Vide il mio genio e tacque;</p>
    <p>Quando, con vece assidua,</p>
    <p>Cadde, risorse e giacque,</p>
    <p>Di mille voci al sonito</p>
    <p>Mista la sua non ha:</p>
  </div>


Since Doitsu had already added an automatic bottom margin after the sixth verse, inspired on his ideas, I also added automatic indenting. As we can see, is practically Doitsu's original code but without using unordered list. The ebooks looks great under Sigil, Kindle and surprisingly also works under ADE 4.02 with epub3 conversion. Here you can watch a screenshot:

Click image for larger version

Name:	Image1.png
Views:	6853
Size:	50.5 KB
ID:	133861

That means that the ereaders based on RMSDK could show automatic numbering Below you can check the respective epub3 ebook and thank you very much Doitsy for being the first in thinking to use counters for this task.
Attached Files
File Type: epub Poetry_with_side_numbers_epub3.epub (3.1 KB, 815 views)
RbnJrg is offline   Reply With Quote