Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Formatting EPUB with line numbers

Explorer ,
Oct 19, 2019 Oct 19, 2019

Hi, I'm trying to format a long poem as an EPUB, and it needs to have line numbers for every fifth line.

Here is an example of what I want it to look like:

small text.png

When the reader enlarges the font, some lines may run on to the next line. I want the numbering to accomodate this, for example:

large text.png

Note that line number 35 still begins with the word "acerepe", etc.

How can this be achieved in InDesign? I have seen an EPUB where this is done, so I'm quite sure it's possible.

Thanks for your help.

TOPICS
EPUB
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2019 Oct 19, 2019

Hi Rex: You will have to run a separate story alongside of the poem.

 

You can get Excel to type up the list of numbers for by typing 5, 10 into two empy cells and then using the fill handle to repeat the list by 5s (see https://support.office.com/en-us/article/automatically-number-rows-76ce49e3-d8d2-459b-bd85-ee1d3973e...).

 

Then place a threaded frame next to the story, paste in the numbers, align the top number with line 5 and set the space after to 5x the leading for the paragraph so that they automatically line up correctly. 

 

~Barb

 

Screen Shot 2019-10-19 at 8.10.46 AM.png

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2019 Oct 19, 2019

Thanks Barb. This is how I've formatted the print version already, so this solution is handy for me.

I have two separate text boxes: one for text, one for numbers. When I export to EPUB, the EPUB shows all the text first, then all the line numbers. I'm not sure how to get these to show side-by-side in the EPUB.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2019 Oct 19, 2019

I should also mention that I haven't used the threaded frame, just two plain old text boxes, so I'm not sure how to do that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 19, 2019 Oct 19, 2019

InDesign doesn't technically have this function. A clunky work-around is putting a second column beside the main text, of course:

https://indesignsecrets.com/numbering-lines-of-text.php

 

I recall a couple of plugins:

https://www.id-extras.com/products/line-numbers/

http://store.eprinttools.in/index.php?route=product/product&product_id=71

 

And a free script:

https://indesignsecrets.com/quickly-add-line-numbers-with-this-free-script.php

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2019 Oct 19, 2019

Hi Rex: Do you need this to be a reflowable ePub? This works well for a fixed-layout ePub.

Screen Shot 2019-10-19 at 8.27.24 AM.png

I don't see how you can accomplish this as a reflowable ePub—they are designed to reflow when viewed on different screen sizes and orientation. When layout is important, use a fixed-layout ePub.

 

~Barb

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2019 Oct 19, 2019

> they are designed to reflow

What happens to tables?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 19, 2019 Oct 19, 2019
LATEST

Optionally use css to take care of this. But you would have to test how well this works in epub readers. Here is an example:

 

.stanza {
margin-left: 4em;
position: relative; /* for right alignment */
}

.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;
/* right aligned */
position: relative;
right: -266px;
}

 

 

Then

 

<div class="stanza">
 <p>Ei 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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2019 Oct 19, 2019

Hi Jongware: If you use a table the content will reflow, but the line numbers will also reflow and won't line up.

 

~Barb

 

Screen Shot 2019-10-19 at 8.51.21 AM.png

Screen Shot 2019-10-19 at 8.51.11 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines