Scripting a TeX document - (or other way to number pdf pages)

p.echols at comcast.net p.echols at comcast.net
Tue Apr 13 23:59:40 UTC 2010


----- "Aart Koelewijn" <aart at mtack.xs4all.nl> wrote:

> On Tue, 13 Apr 2010 18:00:09 +0000, p.echols wrote:
> 
> > 
> > Actually, that is exactly what I was looking for, someone to tell
> me
> > that the idea is not in the "realm of realistic" and not to go
> there!
> > 
> > My limited understanding of LaTeX is that you create a source file
> that
> > has both text and markup.  That file is then interpreted when
> printed. 
> > Would it be in the realm of realistic for someone such as yourself
> to
> > identify the segments that would have to be in a script to do such
> a
> > thing?  My analogy in "fake" html would be
> > 
> > <document>
> > <head>
> > -Format code
> > -Font Code
> > -etc
> > </head>
> > <text position=bottom-left>
> > Page Number 0001
> > </text>
> > <pagebreak><text position=bottom-left> Page Number 0002
> > </text>
> > <pagebreak><text position=bottom-left> Page Number 0003
> > </text>
> > </document>
> > 
> > (For the critics, I am not good at html, but I know this is wrong,
> and
> > why and that's not the point)
> > 
> > The changing parts in such a page would be few, and the result
> easily
> > scriptable.  For my purposes, I would not have to understand the
> LaTeX
> > code for it to work.  Something you might think of as a fun
> challenge?
> > 
> 
> I once did almost all my textwriting with LaTeX, but have hardly used
> it 
> for some time. But the nice thing about LaTeX is, that keeps lay-out
> and 
> text separated as much as possible. In that it is a bit like HTML.
> 
> Now, the first line of a LaTeX file will be something like:
> 
> \documentclass[english, dutch, a4paper, 10pt]{article}
> 
> And if you will have pagenumbers or not and where they will be is
> usually 
> part of that documentclass. You will never see pagenumbers mentioned
> in 
> your LaTeX file itself. You can change your pagesize or your fontsize
> 
> whenever you want, and then the pagenumbers will be in the new places,
> 
> automatically.

But can you explicitly give page breaks?  If so then your script could say:

* * *
echo '\documentclass [ appropriate formatting for page numbers](article)'
x=2
while [ $x -le $total_number_of_pages ]
do
echo "[page break symbol]"
x=$[$x+1]
done

* * *

Now you would have a document with no text, but a bunch of pages that would "print" blank except for the page number.  If you think that is even remotely possible, I'll try and do some reading up on it.  Thanks!




More information about the ubuntu-users mailing list