[OS X TeX] Latex programming

Bruno Voisin bvoisin at mac.com
Sun May 22 18:58:30 CEST 2005


Le 22 mai 05 à 18:10, Alain Matthes a écrit :

> In a folder (FA) i have some files f1; f2; f4; and f5
>
> I would like to compile all the files of the folder
>
> The next code works with success :
>
> with the packages  ifthen and calc and  with a modification of my  
> texmf.cnf file
>
> \newcounter{max}
> \setcounter{max}{6}
> \newcounter{nb}
> \setcounter{nb}{1}
> \whiledo{\value{nb}<\value{max}}{%
> \InputIfFileExists{FA/f\thenb}{}{}
> \setcounter{nb}{\value{nb}+1}}
>
> I need \InputIfFileExists because there is no f3 in the list of files.
>
> Now i would like to compile only the files f1 and f5.
> \newcommand{\set}{1,5}

Are you willing to put together the result of the compilation of all  
f* files in a single PDF file, or are you simply willing to compile  
separately all f* files in a given directory?

- In the second case, you could try, in Terminal, after using "cd" to  
move to the required directory, something like

     apply pdflatex f*.tex

This may require passing on options to pdflatex, to get the desired  
page setup for the output.

- In the first case, you could use LaTeX's \include facility. Namely,  
create a master file of the form

     \documentclass{report}

     \includeonly{f1,f2,f4,f5}
     %\includeonly{f1,f5}

     \begin{document}

     \include{f1}
     \include{f2}
     \include{f4}
     \include{f5}

     \end{document}

In case you want to compile only f1 and f5, comment out the first  
\includeonly and uncomment the second. The drawback of this method is  
that, of course, it's not automated and you have to enter the file  
names manually. And that each new input file will start a new page  
(or even possibly a new right-hand page and add a blank left-hand  
page if necessary).

Bruno Voisin--------------------- 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 Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list