[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

page numbering and script-generated lout

From: Joe Beach
Subject: page numbering and script-generated lout
Date: Thu, 08 Apr 2004 07:54:10 -0600


I am sending this reply to both address@hidden and the
lout list address@hidden For everyone on the Lout list, I received
the following e-mail from T. J. Walker at Software Solutions. My
response follows it. If anyone has answers for T.J.,  please send them
to address@hidden and the lout list address@hidden,
rather than to me. 

On Wed, 2004-04-07 at 21:53, SoftwareSolutions.Net wrote:
> Hi Joe!
> Thank goodness and thank you very much for responding.
> There is so little updated data on the net about lout - I was starting to
> think it was a dead package.
> I am using soupermail (PERL), lout and ghostscript on a linux server to
> produce very complicated legal forms from data supplied by user on simple
> forms.  Had to learn what little I know about lout from scratch (from the
> available documentation).
> Not being a hard core programmer - think I'm doing OK - have about 25 of
> the forms working pretty good but have run into a big problem with getting
> pages numbers (specifically - page x of x) to work - hell, took me 4 hours
> just to get plain old "Page X" to work :-).
> After hours of trial and error - playing with custom setup files, etc - I
> think it might be that the indexing or cross-referencing system of lout is
> turned off or never initialized (what ever that means - found some obscure
> mention of it in one of the docs -  about running lout -x).  What shows on
> the page footers now is Page "whatever" of ?? - read something about lout
> putting questions marks when it can't find indexed data or something - but
> that doesn't help much.
> Anyway, have been using hard @NP page breaks and manually inserting "Page X
> of X" at the bottom of each page - but since the size of the content varies
> depending on what data the user supplies - have been running into problems
> with that.  Hence, the many, many hours of trying to figure out how to get
> the automated page breaks/ page numbering to work.  I think it might be as
> simple as "initializing" the indexing engine or something - although I have
> 25+ separate directories, each with its own .lout file calling the system.
> Think there might be someone out there who help this poor brain-damaged
> soul?

I took a quick look in the User Guide for Lout 3.29. On page 48, it
describes a predefined tag called last.page. If you use the command
@PageOf {last.page}, the result is the last page of the document. To
have lout list the page numbers as "Page x of y", I think you should
edit the doc setup file (or whatever setup file you are using) and
change some of the entries in the headers section. For example, if you
are using "Simple" headers, I think you could do something like:

@PageHeaders    { Simple } # None Simple Titles NoTitles
@OddTop address@hidden Page @PageNum of @PageOf {last.page}}} 
@EvenTop address@hidden Page @PageNum of @PageOf {last.page}}} 

I haven't actually done this to know for sure that it will work, but it
looks like it should to me. 

For my installation of Lout, the cross-referencing happens by default.
However, it can take Lout more than one pass to get everything
cross-referenced. Typically, if I view the postscript and there are ? in
places where there should be page numbers or something, I run lout a few
more times and they get resolved. Depending on your setup, you may need
to remove the old lout.li and *.ld files to give lout a fresh start
after you have changed the markup file substantially. I don't know the
specifics of when you need to do that, I just do it if there are
problems showing up in the postscript. People who are more familiar with
the lout internals could probably say something more meaningful about

Joe Beach

reply via email to

[Prev in Thread] Current Thread [Next in Thread]