[OS X TeX] Variable

Peter Dyballa Peter_Dyballa at Web.DE
Sat May 13 05:51:43 EDT 2006


Am 13.05.2006 um 04:59 schrieb Alain Schremmer:

> What I do right now is create one form, 1.tex, make 24 copies and  
> then change the filename of the copies to 2.tex, 3.tex, … 25.tex  
> and then, in each file, replace "1-" by "filenumber-".

A bit of shell might accelerate (could be AppleScript can do it also):

	#!/bin/sh
	i=1
	j=1
	while [ $i -le 25 ]; do
	    while [ $j -le 3 ]; do
	        cat template.tex | sed -e s/i-j/${i}-${j}/g -e s/ij/${i}${j}/ 
g > ${i}.tex
	        j=`expr $j + 1`
	    done
	    i=`expr $i + 1`
	    j=1
	done

The inner loop increments j from 1 to 3 while i is constant from the  
outer loop. It also changes certain strings in the LaTeX template  
file to numerical values. This is then saved in ${i}.tex -- since I  
don't understand what the file is finally going to contain, the first  
contents will be overwritten twice. Some change is needed here! But  
this needs understanding the case ...

When the inner loop has finished i is incremented by 1 and j reset to  
1. The inner loop can start again with a new value for i ...

--
Greetings

   Pete

If you're not confused, you're not paying attention


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list