# [pdftex] TeX as a composition server?

John Culleton john at wexfordpress.com
Mon Oct 25 21:23:59 CEST 2010

On Monday 25 October 2010 14:56:02 James Quirk wrote:
> Peter,
>
> > Basically, yes.  I just want to see how fast TeX can compose a
> > few tens of thousands of pages of text.  It could all be "Lorem
> > ipsum ..." or whatever.
>
> A few lines of Perl, Python, Ruby, or whatever, is all you need.
> For instance:
>
> #------------------start--------------------------------
> my $n = 100000; > my$lorem = <<'TXT';
> Lorem ipsum dolor sit amet, consectetur adipisicing elit,
> sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
> nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
> in reprehenderit in voluptate velit esse cillum dolore eu fugiat
> nulla pariatur. Excepteur sint occaecat cupidatat non proident,
> sunt in culpa qui officia deserunt mollit anim id est laborum.
>
> TXT
>
> open LTX,">","lorem.tex";
> for($i=0;$i<$n;$i++) {
>    print LTX $lorem; > } > print LTX <<'TAIL'; > \end{document} > TAIL > #------------------end-------------------------------- > > generates a document of 13044 pages. > > James > > > Thanks, > > -pd Or in Gvim editor highlight a batch of text and then hit "p" command repetitively. This could be a single line like \input foo or 100 such lines. TheTeX \input command inserts the context of foo in the stream of text. File foo can be any text file. The base TeX file would have 10000 reptititions of the \input command. So any program or method that could generate 10,000 lines like \input foo could do it. I would do it in Open Cobol with code like MAIN-ROUTINE. OPEN OUTPUT FOOFILE. PERFORM FOO-WRITE 10000 TIMES. CLOSE FOOFILE. STOP RUN. FOO-WRITE. WRITE FOOLINE . However too many modernists would faint dead away. -- John Culleton, Wexford Press "Create Book Covers with Scribus"$5.95 at