Is it possible to compile a tex file with command line arguments passed to the tex file? For example, a tex file merge.tex
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-,fitpaper]{1.pdf}
\includepdf[pages=-,fitpaper]{2.pdf}
\end{document}
I want to be able to use this like a shell command, where I can specify any two pdf files to replace 1.pdf and 2.pdf at each compilation of the tex file, something like pdflatex merge.tex first.pdf second.pdf.
Thanks.
first.pdfandsecond.pdf. Then you include always those pdf files in your tex file and finally the script runspdflatex merge.tex. – Sigur May 08 '15 at 15:01