Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following situation: I have to produce 60+ files in latex, each one from a .txt file, and with one master file (tex): I mean, I have a 1- or 2-page file per situation (a .txt file, in UTF8 with its own file name), and I need to compile them with the same master .tex file.

After that, the produced pdf file should take the .txt name (otherwise it'll overwrite the same file and at the end I´ll have only one "master.pdf"

Can it be possible, rathe than copy/paste for each one?

I'm using OSX 10.8.3, and TeXShop

share|improve this question
With a few lines of Python (comes pre-installed on the Mac) or some shell scripting this should be possible. You can also pass variable to TeX during the compiler run, e.g. to name the file to be included. How is the txt file included in the TeX code? –  Uwe Ziegenhagen Apr 3 '13 at 20:32
See for example stackoverflow.com/questions/1465665/… –  Uwe Ziegenhagen Apr 3 '13 at 20:35
Is there a way for you to revert the situation? I mean input the master from the children... That definitely would be easier, especially for the name of the pdf. –  T. Verron Apr 3 '13 at 21:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.