GeneralMultiple Source File Rendering

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
rgrice
Posts: 10
Joined: Fri Mar 09, 2012 2:25 pm

Multiple Source File Rendering

Post by rgrice »

Hi,

Apologies in advance if I've posted this in the wrong area.

Basically my question is just this. Is there any way in which multiple source files can be processed by XeLaTeX to create the corresponding separate PDF files within one XeLaTeX session?

For example, the following XeLaTeX call just creates the first file "59dab.pdf", not "62dab.pdf" or "96dab.pdf".

Code: Select all

/home/rgrice/PPA/build/DTP/XML2Tex:> xelatex -interaction=batchmode -output-directory=/home/rgrice/PPA/runtime/tmp \
/home/rgrice/PPA/runtime/tmp/59dab.tex \
/home/rgrice/PPA/runtime/tmp/62dab.tex \
/home/rgrice/PPA/runtime/tmp/96dab.tex
Therefore if I have multiple source files in a directory can I process them in one XeLaTeX call rather than calling XeLaTeX for each individually to create the three PDF files. I have 2200+ source files that I wish to process and calling XeLaTeX for each one is quite time consuming.


Thanks
Richard

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Multiple Source File Rendering

Post by Stefan Kottwitz »

Hi Richard,

on Linux I would use find and xargs, compiling all .tex files in a directory and all subdirectories:

Code: Select all

find "." -name "*.tex" | xargs xelatex
On Windows - I would boot Linux. ;-) Or use andLinux or Cygwin. Or a Windows scripting language.

Stefan
LaTeX.org admin
rgrice
Posts: 10
Joined: Fri Mar 09, 2012 2:25 pm

Re: Multiple Source File Rendering

Post by rgrice »

Hi Stefan,

Thanks again for the quick reply ... yes I'm working on RedHat Linux so xargs sounds perfect.

However, when I run the command

find "." -name '*.tex' | xargs xelatex

to process the three files 59dab.tex, 62dab.tex and 96dab.tex it seems to process just the first file 59dab.tex.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Multiple Source File Rendering

Post by Stefan Kottwitz »

Hi Richard,

you could do it with just the find command and the -exec option, instead of using xargs:

Code: Select all

find "." -name "*.tex" -exec xelatex '{}' \;
Stefan
LaTeX.org admin
Post Reply