Author Topic: How to have a line counter appearing on my pages?  (Read 225 times)

Marie

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
How to have a line counter appearing on my pages?
« on: September 28, 2018, 11:53:34 am »
Hello.
I'm very new to Scribus and I checked the forum but didn't find an answer to that question: how can I have the number of each line appearing in my document?
For context, I only want the numbers to appear for some textboxes, and if possible, I'd like to parameter myself which lines are taken into account, and which are not. Also, I'd like the number of only every 5 line to show.
I know I ask a lot, but that's the last thing I lack before I can ditch MS Word for good.  ::)

Exemple :
Quote
1 Once upon a time, in a far far away land, a princess was imprisoned by an evil sorceress.
   She couldn't even see what was outside her prison, for there was no other window than a tiny hole in the
   ceiling, allowing a dim light inside.
   One day, she grew tired of all this crap, and decided to act, instead of sitting on her hands like she always had done.
5 She grabbed the knife and fork the evil sorceress gave her for her to ear, and she began to take out the mortar
   between the stones.
   Maybe this way she would be free one day?

If you think that's at all possible, please help!  ;)

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1646
  • Karma: 24
    • the graphics lab
Re: How to have a line counter appearing on my pages?
« Reply #1 on: September 28, 2018, 12:14:47 pm »
no, that's not currently possible with scribus.

i understand in which context you might use it, and -- in a very different context -- i also could have used it.
but i wonder if and how scribus could provide that, without making its interface even more complex.

depending on the way you have defined your document, i can create a script for you that automates the typing of the numbers, but you will have to put a second frame on the left of your "real" text frame... and make sure that you have a fixed line height.
the result is similar to what you see in the document linked above:

- you don't need the zebra background of course
- and i can let you specify how often the number appears.

just ask for it, if you want the script... it's not that hard to create...

Marie

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: How to have a line counter appearing on my pages?
« Reply #2 on: September 28, 2018, 01:57:41 pm »
Thank you for your swift reply. Yes, I'd be glad to know how to add the script, if you would be so kind. I had thought of the solution of a separate column/box, but I guess I will have to count the lines myself, since I doubt any script would keep counting on a linked text box on the next page? This is for a 4 pages document.

That's sad, however, that Scribus can't do that. I'm sure it would be a fun interface with many options and all.  :D
And definitely, hand-writing the numbers on the document after printing it is not satisfactory.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1646
  • Karma: 24
    • the graphics lab

Marie

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: How to have a line counter appearing on my pages?
« Reply #4 on: September 28, 2018, 07:17:03 pm »
It works! Thanks a lot.  ;D But you should know that, if there's anything at all written in the textbox where you try to apply the script, there's an error pop up window that won't go whatever you do. I had to force Scribus to reboot.  :-[
Also, it doesn't like to be applied to several linked boxes on different pages. But it works great on a one-page document.  :)

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1646
  • Karma: 24
    • the graphics lab
Re: How to have a line counter appearing on my pages?
« Reply #5 on: September 28, 2018, 07:23:19 pm »
yep, it's meant to be started on each page again...

i probably could have make it go through the all chain... but i've preferred to keep it a bit simpler...
... it's not a full solution to lines numbering... only an ok workaround.

about the message crashing scribus: i get the same thing so:

- which version of scribus are you using (1.5.4? svn? git?)
- on which os? (i'm on linux)

i was thinking that something was wrong on my computer (and since i was trying it on a modified self compiled version...), but if you also see the issue, then there might be a real problem...

(i've tested it with 1.4 while creating the script and, there, the messages are correctly shown)

Marie

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: How to have a line counter appearing on my pages?
« Reply #6 on: September 28, 2018, 07:35:07 pm »
I use 1.5.4 version and I'm on Mac OSX (Sierra).

(Line numbers starting anew on each page can't work for me. But I have a good deal of one-page documents too)

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1646
  • Karma: 24
    • the graphics lab
Re: How to have a line counter appearing on my pages?
« Reply #7 on: September 28, 2018, 07:43:55 pm »
... you can set the first line number for each frame.

just put the number in the input box...
and if you really need a version that flows in the chained frames i can probably easily do it...
i just have to check if i have all the information...
just tell me if you really need it.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1646
  • Karma: 24
    • the graphics lab
Re: How to have a line counter appearing on my pages?
« Reply #8 on: September 28, 2018, 07:49:41 pm »
i've simplified the call to the message box with the alert and now it does not crash scribus 1.5 anymore.

you can download the new version of the script from the same place as before:

https://raw.githubusercontent.com/aoloe/scribus-script-collection/master/numbered-lines/numbered-lines.py

Marie

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: How to have a line counter appearing on my pages?
« Reply #9 on: September 28, 2018, 07:57:40 pm »
Thanks a lot! I've noticed the nice option for numbers, which allows me to start at line 1, then 5, then 10, etc., but if I have to start again on a new page, that means having to hand-count the lines before in order to get the right one, since I don't number every line. So it would be a great improvement for me if it could flow in the chained frames. But I don't expect you to take time for something nobody else seems to need.  :-X