Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 10-12-2018, 09:33 AM   #1
James Jesse
Junior Member
James Jesse began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2018
Device: none
Line Numbering possible?

Hello dear forum users,
I am a teacher and had the idea of printing some short stories (from the Projekt Gutenberg) for my students.

I have used this site to extract epubs quickly and imported those into my Calibre library.

Is there a way to add line numbering in Calibre itself?
I have tried to search the forum, but couldn't find a thread that had answers to my question.
The line numbers essential for the intended use in school.

I would deeply appreciate any advice on this subject.
James Jesse is offline   Reply With Quote
Old 10-12-2018, 10:11 AM   #2
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
much depends on how you define a " line". because different device settings will change how many words appear in a "line" on the screen.
if you need to preserve the word count per line from some original source, you'd arguably be better of with non re-flowable pdf, not epub
ssame issue will of course apply to " page"
both line and page make not a lot of sense on an e-reader where everything can be scaled up or down by each user
stumped is offline   Reply With Quote
Advert
Old 10-12-2018, 05:31 PM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by James Jesse View Post
Hello dear forum users,
I am a teacher and had the idea of printing some short stories (from the Projekt Gutenberg) for my students.

I have used this site to extract epubs quickly and imported those into my Calibre library.

Is there a way to add line numbering in Calibre itself?
I have tried to search the forum, but couldn't find a thread that had answers to my question.
The line numbers essential for the intended use in school.

I would deeply appreciate any advice on this subject.
Quote:
Originally Posted by stumped View Post
much depends on how you define a " line". because different device settings will change how many words appear in a "line" on the screen.
if you need to preserve the word count per line from some original source, you'd arguably be better of with non re-flowable pdf, not epub
ssame issue will of course apply to " page"
both line and page make not a lot of sense on an e-reader where everything can be scaled up or down by each user


Paragraph numbers would be a more sensible option than line or page numbers.

The calibre viewer will display them if the Reference mode button is pressed, see attachment.

I am not aware of any way to get paragraph numbers injected into the epub itself, but that doesn't mean there isn't a way.

BR
Attached Thumbnails
Click image for larger version

Name:	1.jpg
Views:	270
Size:	354.1 KB
ID:	166876  
BetterRed is offline   Reply With Quote
Old 10-12-2018, 05:58 PM   #4
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
"Line" does not seem to have a practical definition for an e-book except as a paragraph. If that is what you mean, then there are 2 fairly simple ways to produce a number before every paragraph which will also be visible printed:

1) Edit the Calibre regex-function "Auto-Number." I have tested this and it works fine and is best if you want the numbering to go from 1 to the very last paragraph.

2) The easiest is to use the auto-numbering capabilities of CSS. This will do the numbering by chapter, which is how it is usually done. The other advantage is that the number can be styled to stand out. Add to your stylesheet:

Code:
body {
  counter-reset: para; /* Set a counter named 'para' */
}

p::before {
  counter-increment: para;  /* Increment value by 1 */
  content: counter(para) " ";  /* Display value with space */
  font-weight: bold;
}
Brett Merkey is offline   Reply With Quote
Old 10-19-2018, 11:31 AM   #5
James Jesse
Junior Member
James Jesse began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2018
Device: none
Quote:
Originally Posted by Brett Merkey View Post

2) The easiest is to use the auto-numbering capabilities of CSS. This will do the numbering by chapter, which is how it is usually done. The other advantage is that the number can be styled to stand out. Add to your stylesheet:
Thank you for your answer.
This solution has indeed added numbers to the paragraphs which seem to correspond to the lines.

Then I converted the epub to doc for printing and there are no numbers visible. Shouldn't there be some at this point?
James Jesse is offline   Reply With Quote
Advert
Old 10-19-2018, 01:27 PM   #6
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
Originally Posted by James Jesse View Post
Then I converted the epub to doc for printing and there are no numbers visible. Shouldn't there be some at this point?
The code I posted is effective for the ePub format you mentioned as well as for AZW3, the other format that Calibre offers edit tools. By converting to a non-html format, you have essentially deleted that code.

If you have an ePub book that you judge to be ready for print, open the ePub in the Calibre viewer and select the "Print to PDF" tool. Then open the .pdf file created and print with whatever options your pdf viewer allows.

The line numbers will be in place, just as they were in the original ePub book.
Brett Merkey is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
italic at end of line causes next line to start with a space ebookreadr Sigil 29 03-20-2017 11:25 AM
Auto-numbering Mondriaan Calibre 3 07-12-2015 07:20 AM
Glo Page Numbering dixieknits Kobo Reader 3 01-06-2013 04:43 PM
Series Numbering adrian1944 Calibre 3 10-17-2010 01:59 PM


All times are GMT -4. The time now is 07:11 AM.


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