I am creating an anthology of poems and songs, and have a main file where I am using \input
to insert separates TeX files which contain the poems.
I was wondering if there was a simpler way of inserting all of the files in alphabetical order based on filename instead of a separate \input
for each file?
Could anybody help?
Thank you to for pointing me in the direction of the other questions - they didn't come up when I googled my queries. I am trying to adapt the code in this post but I am getting 2 errors from it. My code is as follows at the moment
\documentclass{minimal}
\makeatletter%
\def \app@exe {\immediate\write18}
\def \inputAllFiles [#1]{%
\app@exe{cmd /c dir /b *.tex > \jobname.tmp}
\InputIfFileExists{\jobname.tmp}{}{}
\AtEndOfDocument{\app@exe{rm -f #1/\jobname.tmp}}}
\makeatother%
\begin{document}
\inputAllFiles{.}
\end{document}
The errors messages I am getting are both on the line with the \inputAllFiles
command and say: Use of \inputAllFiles doesn't match its definition
and Too many }'s
.
I have tried fiddling around with the code, but noting I seem to do helps. Could anybody help to see where I am going wrong?
\def
command online and that seemed to be the correct syntax. – Nikel King Mar 7 '14 at 22:18