Display Line Numbers in InDesign (CS4 onwards)

This script enhances InDesign’s feature-set. You can now add line numbers to your InDesign pages.

Works with: InDesign CS4, CS5, CS5.5, CS6, and the new CC (Creative Cloud) on Windows and Mac computers.

New! Version 3.4 Now Released!

  • New feature: Three Four placement options (Outside Margin, Left Margin, Right Margin, Inside Margin) allows you to choose where the numbers should appear on the page.

New! Version 3.3 Now Released!

  • New feature: Restart line-numbering based on paragraph style(s). Whenever a user-specified paragraph style is encountered, the numbering will restart from one.

To download a demo, click here.

To purchase the full version of the script, click on the “Buy Now” button toward the bottom of this page.

Main Features

  • Add line numbers to selected paragraph styles only.
  • Add numbers at user-selected intervals: 5 … 10 … 15 … 20 or 3 … 6 … 9 … 12 etc.
  • The line numbers are placed in a text frame with their own object style, and the line numbers are given their own paragraph style – so you can quickly and easily change all aspects of the line-number formatting.
  • Optimized for speed.

Uses

  • Add line numbers to your book design. Poetry, academic editions of classic texts, and many other books require line numbers in the margins. This script gives you all the flexibility you need to easily add such numbers.
  • As a book designer, you may often receive corrections from authors and editors that say something like: “23rd line from bottom, please add a comma.” With this script you can speed things up, as InDesign will now display line numbers besides each line (see screenshots below). The Display Line Numbers script can add line numbers to a single text frame, or to an entire story.

How To Use the Script

In the script dialog box (shown below), select whether you wish to add numbers to the entire document, the current story, or the selected text frame only.

Choose whether you wish to add numbers to each line or at intervals (between 1 and 20) – simply select your desired interval from the dropdown menu.

Choose whether you would like the numbering to restart on each page, or whether an entire story should be renumbered consecutively.

Choose where you’d like the numbers to be placed. There are 3 options in the dropdown menu: “Outside Margin” will place the numbers in the left margin on a left-hand page, and in the right margin on a right-hand page. The other two options will force the numbers to always be placed in the left or right margin, respectively, regardless of which page they appear on.

Choose which paragraph styles you’d like to number: double-click on a paragraph style in the list on the left to select/deselect it, or use the “Select All” and “Deselect All” button at the bottom of the list.

Finally, you can choose to restart the numbering whenever the script reaches a certain paragraph style. For instance, in a book of poetry, you may want the numbering to restart whenever the script reaches a paragraph style called “Poem Title” so that the numbering in each poem restarts at 1. To do this, select the desired paragraph style in the list, and click on the Restart button. The paragraph style will be marked with a {RESTART} tag in the list (for an example, see screenshot below). To remove the tag, simply click on the Restart button again.

Screenshot of Line Numbers 3.4.0 Script

 

Once you have set all the options (which are stored with the document so it is not necessary to set them more than once) simply click on the Replace Numbers buttons. You may also click on the Add Numbers buttons. The difference between these two buttons is as their name suggests: The Replace Numbers button will delete any existing line number frames before applying the new line numbers, whereas the Add Numbers button will simply add a new set of numbers on the page and not delete any previous number frames. Although this behavior can be useful on occasion, you will normally want to use the Replace Numbers button because this avoids inadvertently creating two sets of line numbers on the same page.

To remove numbers from the document, you can click on the Remove Numbers button. Alternatively, you can delete the special layer created by the script (in the Layers panel) to remove all the line numbers throughout the document.

Tips

  • To choose the distance you would like the numbers to be from the main text frame, there are two options:
    (1) Via the Line Numbers Object Style. Edit the style: Under the Text
    Frame General Options tab, modify the value of the Right (or Left) Inset
    Spacing field as needed.
    (2) Via the Line Numbers Paragraph Style. Edit the style: Under the
    Indents and Spacing tab, modify the value of the Right (or Left) Indent
    field as needed.
  • Hover the mouse of many of the controls in the dialog box to see a brief explanatory note.

For the technically minded: The script adds a new text frame or text frames alongside the selected frames. In this new text frame it adds the line numbers. The new text frame is placed on a special layer created by the script. The script creates an object style which is applied to the numbers text frame, as well as a paragraph style which is applied to the numbers paragraphs. A new RGB swatch is also created.

You can download a demo version of this script here.

A single license for this script is available at $49 USD. For multiple licenses, please contact us to arrange a discount.

The terms of the license permit the installation of the script on a single user’s computer. The script is copyright. It is illegal to make unauthorised copies of the script.

To purchase the full version for only $49, click the “Buy Now” button, or email us. Your will receive your full, unlocked script normally within one working day.

For just $49, this script is an amazing timesaver for anyone working on long documents in InDesign.

Add Line Numbers to InDesign

Before

Add Line Numbers to InDesign

After

  1. #1 by j on February 24, 2012 - 7:38 am

    Hi,

    This jai, this script is inserted the line numbers page wise only that means each page has starting with number 1. But my requirement is inserting number continuously for instant my chapter 1 has 30 pages, and line numbers should be every 5 lines have to insert 5, 10, 15, 20, 25, 30, 35, ……). Can u give me the demo script according to my request.

  2. #2 by kamal on March 1, 2012 - 3:25 am

    I am creating a document that needs to have line numbers appear every for every 5 lines of text. Using the list function, I want to get a number for every line 5, 10, 15, 20, 25, etc. the line numbers should be follow on continuous page. For instance page 1 has complete with 25 lines, the next page should be continuous with 30, 35, etc.

    Is this possible in your script.

  3. admin

    #3 by admin on March 1, 2012 - 5:41 am

    Hi,

    Version 2.0 of the script, due out very soon, will have options for numbering lines at intervals the user selects (5…10…15 or 3…6…9 etc.) as well as several other improvements, including numbering an entire document consecutively (if page 1 ends with line 22, page 2 will begin with line 23 etc.).

    Stay tuned!

    Thanks,
    Ariel

  4. #4 by Janus on April 4, 2012 - 11:28 am

    Is it (or rather: will it at some point be) possible to only add line numbering to certain styles?

    I want my paragraph styles to be numbered consecutively throughout the story, but NOT headings, lists, or other styles; and they shouldn’t count towards line numbering, either.

    Will that be available at some point, do you think?

  5. admin

    #5 by admin on May 21, 2012 - 7:29 am

    Thanks for the suggestion. It is now (version 3.0) available.

    Ariel

  6. #6 by Gregory on September 11, 2012 - 2:24 pm

    Dear Ariel,
    I need to number the lines of a long poem (400 pages) continuously in increments of five. More importantly, I need to be able to suppress the numbering on certain lines that contain rubrics so that it skips those lines (the rubrics are actually bold to distinguish them from the text). The problem can also be seen in terms of numbering paragraphs because each line of verse is separated by a hard return. Finally, I have involved footnotes that can not be affected. Will your script address all of these issues?

  7. #7 by Jeff on September 12, 2012 - 5:21 am

    I wonder if the script can be enhanced to allow numbering only of selected text. I have a text that needs line numbering item-by-item for short items; imagine a numbered series of short prose texts whose annotation is keyed to line numbers (so the numbers can’t be made a hard part of the text as with poetry). There are several items on a page, and I’d prefer to avoid splitting them each into a separate frame if I can (although I’ve already got a script for that…)

  8. admin

    #8 by admin on September 12, 2012 - 5:47 am

    Hi Gregory,

    I think the script will be able to do what you need.

    You can choose exactly which paragraph styles to add numbers to, so if your paragraphs with rubrics can be assigned a different para style to the regular poem text that does need numbers, you can tell the script to number only the poem text and not the paragraphs with rubrics.

    The script should not affect your footnotes.

    At any rate, there is a link to a demo version of the script on the web page, so feel free to try it and see.

    Good luck,
    Ariel

  9. admin

    #9 by admin on September 12, 2012 - 5:51 am

    Hi Jeff,

    The script could be enhanced to number the current selection only. It may take me a while to get round to doing that.

    Is there some way you might use the paragraph styles settings to accomplish what you want meanwhile? For instace, you could, even temporarily, apply a unique paragraph style to the text you want numbered. Then, in the script options, select only that unique paragraph style to be numbered, and select “This frame only”. Run the script. Finally, reaaply the original paragraph style to the text.

    Might that work?

    Ariel

  10. #10 by Jeff on September 12, 2012 - 8:49 am

    Thanks, Ariel.

    That does seem less time-consuming than chopping up frames. I’ll implement that for the time being, but it would be a real time-saver to be able to number selected text.

    Jeff

  11. #11 by Jeff on September 12, 2012 - 9:07 am

    Hi Ariel,

    Just thought of something else. It would be desirable for the numbers to appear in the fore margin: that is, to the left of text on the left-hand page and to the right on the right-hand page. How can I manage this?

    Thanks,
    Jeff

  12. admin

    #12 by admin on November 25, 2012 - 5:17 pm

    Hi Jeff,

    As we discussed by email, the script does in fact work that way by default!

    Thanks,
    Ariel

  13. #13 by Yasmine on June 17, 2013 - 9:08 am

    Hi Ariel,

    this add-on would exactly fit my purpose if it allowed to restart from 1 at each new paragraph in the selected style (or whenever a embedded style appears) : would it be possible?

    Thanks,
    Yasmine

  14. admin

    #14 by admin on June 18, 2013 - 6:12 am

    Hi Yasmine,

    Yes, that should be possible. Good idea for a feature request!

    Contact me at admin@freelancebookdesign.com to discuss if you want to take this up further.

    Ariel

  15. admin

    #15 by admin on July 9, 2013 - 6:20 am

    The feature Yasmine asked for – to restart numbering based on paragraph style – has now been added (from version 3.3).

    Ariel

  16. #16 by Bob Cornigans on August 8, 2013 - 5:21 pm

    It would appear from the image on this web page that version 3.3 of this script seems to be perfect for my needs as an English reader needing at times to number line of poetry or other lines of a prose passage that I need to reference for my students, but I’m not sure how to activate the script for use in InDesign in order to test it. I use a Mac and clicking on the unzipped file (LineNumbers3.3.0.Demo.jsxbin) from my desktop opens a window that asks me to choose what appears to be a programming language. Excuse my computer illiteracy, but I’m lost. Am I supposed to activate this script through InDesign?

  17. admin

    #17 by admin on August 9, 2013 - 6:44 am

    Hi Bob,

    To install the line numbers script (and any other scripts on this website), simply put the file LineNumbers3.3.0.Demo.jsxbin into the InDesign scripts folder, and then double click on that file from within InDesign’s script panel to run.

    Here’s an excellent link that explains clearly how to install InDesign scripts:

    http://www.danrodney.com/scripts/directions-installingscripts.html

    Ariel

  18. #18 by Alex on October 1, 2013 - 7:21 am

    Well, I’m at a total loss as to understand how this script works, and I’m certainly not going to buy it until I do. I’m trying to add line numbers to a long Victorian poem with seven long cantos, with the numbering beginning with each new canto. I have tried giving the paragraphs of each canto a new paragraph style, but it still does not work.

  19. admin

    #19 by admin on October 1, 2013 - 7:57 am

    Hi Alex,

    If I’ve understood correctly, you want the numbering to restart at the beginning of each canto.

    What you need to do is:
    (1) Make sure that the first paragraph of each canto has a special paragraph style (you could call the style “First Para of Canto”).
    (2) Select the first word of the poem, or one of the text frames containing the poem. This will tell the script which text you want to add numbers to.
    (3) Run the Line Numbers script (you can try this with the demo version). In the list of paragraph styles on the left, select all the paragraph styles besides which line numbers should appear.
    (4) Tick the checkbox that says “Restart numbering based on paragraph style”.
    (5) Now, again in the list of paragraph styles on the left, locate the paragraph style you created in step (1) above, and (here’s the tricky part) double-click on it while pressing CTRL-ALT on the keyboard. The word {RESTART} should appear next to the paragraph style name at this stage. This tells the script to restart the numbering whenever it encounters the selected paragraph style.
    (6) Since it sounds like you do not want the numbering to restart each page, but only each canto, deselect the option that says “Restart numbering each page”.
    (7) In the “Add line numbers to what?” box, select the option that says “This Story Only” (if it isn’t already selected).
    (8) Click on replace numbers.

    That’s it. Once the script finishes running, all the poem should be nicely numbered, with the numbering restarting with each canto.

    Good luck. Post back if you have any questions.

    Ariel

  20. #20 by Alex on October 1, 2013 - 5:03 pm

    Thank you, Ariel.

    This is a little tricky, and not immediately obvious – I still think that it should be a lot easier and quicker to do this in inDesign – but I think I should be able to get it to work from here.

    The instruction about {RESTART} appears to be central to getting it to work correctly and that you just need to style the first paragraph in each section (canto)

    Thanks for your help.

  21. #21 by Alex on October 4, 2013 - 7:18 am

    One question, and that is when I resize the text box to which the numbers apply, and resize the numbers to match, the numbers on successive boxes which have not been resized don’t match up. Am I missing some step here?

    At the moment I have to have everything absolutely right and in place before I run the script, and it is very difficult to adjust post facto. Any suggestions?

  22. #22 by Alex on October 4, 2013 - 7:19 am

    Incidentally, I have decided to introduce myself to doing the work using the book feature in Indesign which means that each canto is a separate document. It will make the line script a little bit easier too.

  23. admin

    #23 by admin on October 5, 2013 - 7:39 am

    Hi Alex,

    I’m not entirely sure I follow your description of the problem, but it seems to me that you needn’t worry about the line numbers. Just adjust the text frame/s as you like, and then rerun the line-numbers script. When you click on “Replace numbers” it will first delete any existing numbers, and then add new ones — and that way everything should align properly.

    Note that you do not need to set all the options in the line numbers script each time you run it: the script remembers your options from the last time.

    Likewise, if you change the formatting of the line numbers by adjusting the line numbers paragraph style, those changes you made will be remembered.

    Ariel

  24. #24 by Alicia on December 9, 2013 - 12:11 pm

    I wanted to thank you, Ariel, for writing a fantastic script and for helping me work out various issues on my side of things. You have been very helpful, courteous, and professional. I sincerely appreciate the work you’re doing!
    Alicia

  25. admin

    #25 by admin on December 10, 2013 - 6:16 am

    Thanks Alicia. Much appreciated!

  26. #26 by Paul Luna on December 27, 2013 - 10:54 am

    Hi Ariel

    I am very impressed with this script. Can you consider adding the following functionality? Good style for line numbering poetry is to position numbers to the right of the poem on both left and right pages. This also applies to line numbering in an asymmetric layout. Can you add the ability to select inner or outer margins on left and right pages? Also, I sometimes set parallel text editions. It seems that your script will not observe the presence of two stories (one on the left pages for the original language, one or the right pages for the translation) when numbering. Is it possible to correct this? I can send an example.

    Many Thanks

    Paul

  27. #27 by Rene on February 6, 2014 - 2:44 am

    Hi Ariel,

    thanks for your wonderful script. I’m looking for an option to change on which side of the document the line numbers appear. Currently the line numbers appear on every page on the right-hand side but I need them on the left so I have to manualy drag them from one side to another.

    Thanks in advance
    Rene

  28. admin

    #28 by admin on February 6, 2014 - 3:22 am

    Hi Rene,

    Thanks for your comment. The script normally puts the numbers in the outside column, so on the right-hand page they will be in the right outside margin, and on the left-hand page they will be in the left outside margin.

    Is this not what’s happening for you?

  29. #29 by Rene on February 6, 2014 - 6:20 am

    Hi Ariel,

    thanks for your reply. Thas exactly what’s happing, but basiclly I’m working on single sided documents. Not as you mentioned on double paged documents. So it looks like all my pages/spreads are right handed. Didn’t find an option in InDesign to change the binding from left to right.

    Thanks
    Rene

  30. admin

    #30 by admin on February 6, 2014 - 6:25 am

    I see. Yes, you’re not the first who’s asked for this option. I’ll try and add it to the script.

    Meanwhile, if it’s urgent for you, I can make a temporary hard-wired solution for you. Send me an email (via the Contact page).

  31. admin

    #31 by admin on February 6, 2014 - 8:24 am

    To Paul, Rene and anyone else who needs this option:

    Line Numbers version 3.4.0 is now available. The user can now choose where to place the line numbers:

    (a) In the outside margin of the page (left margin for the left page, right margin for the right page);

    (b) Always in the left margin; and,

    (c) Always in the right margin.

  32. #32 by Lori Holland on February 10, 2014 - 2:32 pm

    Hi Ariel: I just bought your script last week, and I see you added a feature that I DO need. How to I get the updated script? I need the numbers to the left of the text on both pages, as you describe below.

    thank you!

    Lori

  33. admin

    #33 by admin on February 10, 2014 - 3:46 pm

    Hi Lori. I just sent you the updated version.

  34. #34 by Penelope Bonnar on March 25, 2014 - 3:01 pm

    We just purchased the line-numbering script and it’s wonderful! Our templates have wide (about 2 inch) left margins on both right and left pages. The places the line numbering text frame right next to the main text frames on the left so the numbering is about 3/8 inch to the left of the main text flow. So the script places the text frame in the left margin — quite a distance from where our manual text numbering goes. Is there a way to tweak the script so that the line-numbering text frame is positioned where our template calls for it?

  35. admin

    #35 by admin on March 25, 2014 - 3:04 pm

    Hi Penelope,
    I think I’ve understood what you’re asking, but a screenshot would really help. Could you send me a screenshot so I can take a look and see what can be done? Please send it to admin (at) freelancebookdesign.com

    Thanks!
    Ariel

  36. #36 by Penelope Bonnar on March 26, 2014 - 2:30 pm

    Thanks for your quick response. I’ve sent you a screenshot with a bit more explanation.

  37. #37 by Stefan on April 4, 2014 - 2:01 pm

    Hi Ariel!
    I would like to buy the script. Is it possible to place the Numbers “inside margin”?
    Thanks
    Stefan

  38. admin

    #38 by admin on April 5, 2014 - 11:50 am

    Hi Stefan,

    I seem to have overlooked that option! Let’s put it this way: By the time you buy the script, it will be possible — guaranteed ;-)

    (PS The inside-margin placement option is now available in version 3.4.2)

  39. #39 by Jamie on September 8, 2014 - 6:58 pm

    Ariel,

    This script is great. Wonderful work. The only thing keeping me from buying it is the option to start numbering at a specified number. For instance, I need to be able to begin numbering at line 5 and then number every 10th line from there. So 5, 15, 25, 35, 45, etc.

    Possible?

  40. admin

    #40 by admin on September 9, 2014 - 3:05 am

    Hi Jamie,

    Not quite possible in the current version 3.4.5, but very easy to do on my end. I also think it’s an excellent feature request. So what I can do if you make the purchase, is: (a) send you the regular full script; (b) send you a custom-made version hardwired to do what you want (5, 15, 25 etc.); (c) when I get round to adding this feature to the UI, hopefully soon, I’ll send out a free upgrade.

    HTH,
    Ariel

  41. #41 by Antoinette on November 21, 2014 - 2:23 pm

    Does anyone know how to set the line numbers up so it skips blank lines and continues with the numbering sequence?

  42. #42 by Pam Terry on December 12, 2014 - 5:23 am

    Can you make number line start on the number I choose?
    I have an InDesign that is in 2 files because of it’s size. I want to stary the 2nd file”s number line to start at the next number numerical at the start of the 2nd file.

  43. admin

    #43 by admin on December 12, 2014 - 5:29 am

    Hi Pam,

    Unfortunately, this is not possible right now. However, it makes sense as a feature request, so I will definitely put it on the “To Do” list…

(will not be published)