nisus.com
https://www.nisus.com/forum/

auto page numbers in body of text
https://www.nisus.com/forum/viewtopic.php?f=18&t=6494
Page 1 of 1

Author:  ngazidja [ 2016-10-18 23:56:36 ]
Post subject:  auto page numbers in body of text

Yes: is it possible to have auto page numbers in the body of a text or just in the headers/footers? Inserting a page number only inserts to the current page and I want a page number on every page (without having to manually insert into every page).

(Background: I'm clunkily trying to print out 200 copies of a one page form, each of which has a unique serial number. I designed the form in NWP and then realised that rather than printing out 200 copies and hand-numbering them, I could auto this... perhaps? Maybe if the whole document was just one big header? Is that scary or what?)

(Nope, can't make the header cover the whole page - only to 159 mm. Maybe we could fix this? :) )

Author:  ngazidja [ 2016-10-19 00:21:50 ]
Post subject:  Re: auto page numbers in body of text

Ok, I've sort of answered my own question: yes and no (if anyone's interested). Since my form was a table, and perfectly sized for the page, I inserted an auto page no. in the appropriate place, copied the whole table and pasted 200 copies. So the page number has to be manually inserted, but holding down cmd-v for 30 seconds is pretty close to auto-inserting on 200 pages.

Author:  phspaelti [ 2016-10-19 01:54:19 ]
Post subject:  Re: auto page numbers in body of text

I'm glad to hear that you got this to work, but usually a more appropriate way to do this would be via macro which can quickly insert number as "stamps" in any sequence and without regard to the page number. Such a macro can also be tailored to insert the number in whatever place you desire.
Below is the code that would replace place holders of the shape "###" with running numbers from 1 to however many.
Code:
$doc = Document.active

$nums = $doc.text.findAll “###”

$counter = $nums.count
foreach $num in reversed $nums
   $num.text.replaceInRange $num.range, $counter
   $counter -= 1
end

Author:  ngazidja [ 2016-10-19 02:00:00 ]
Post subject:  Re: auto page numbers in body of text

Thanks for that. It certainly sounds like a more professional way of doing it (although for me, way slower. :) )

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/