I have a pgfplots main.tex file which plots a graph from an input file. I would like to run it on 100 input files and automate creating 100 PDF pictures. How can I do that?
The files are named as frame1, frame2, ..., frame100.
I have a pgfplots main.tex file which plots a graph from an input file. I would like to run it on 100 input files and automate creating 100 PDF pictures. How can I do that?
The files are named as frame1, frame2, ..., frame100.
The way to pass an argument to a TeX file is pdflatex "\\def{\\foo}{bar}\\include{filename}".
For example, say filename.tex contains the following.
\documentclass{article}
\begin{document}
The passed-in argument was ``\eggs.''
\end{document}
Then, if I compile it with pdflatex "\\def\\eggs{wine}\\include{filename}", the PDF says 'The passed-in argument was "wine." '
This allows you to pass arguments to a TeX file in a shell script, which to me is usually easier than trying to get one call to pdflatex to output multiple PDFs; it also doesn't need \write18.
#!/bin/bash
for i in {1..100}
do
pdflatex "\\def\\inputname{frame$i}\\include{main}"
done
\foreach \frame in {frame1,frame2,...,frame100}{<code that plots from a file where you substitute the file name with \frame>}. – Manuel Oct 02 '15 at 17:54standalonehas an optionmulti={tikzpicture}so everytikzpicturegets its own page. – Manuel Oct 02 '15 at 18:20