Possible Duplicate:
Replace \input{fileX} by the content of fileX automatically
I'm developping a framework for managing LaTeX project's dependencies but I can't figure out if there is a simple way of getting a preprocessed LaTeX file.
For instance, if my main.tex looks like :
\documentclass{article}
...
\newcommand{\specialpath}[0]{../foo/}
\input{\specialpath extracommands}
...
\begin{document}
\input{introduction}
...
\end{document}
I want to have:
\documentclass{article}
...
% Content of ../foo/extracommands.tex
\usepackage{minted}
\newcommand{\whatever}
% end
...
\begin{document}
% Content of introduction.tex
\section{Introduction}
\lipsum[1-4] % Or even the developpement of the command
% end
...
\end{document}
In other words, is there an equivalent of the gcc flag -E for LaTeX (or an utility capable of doing that)?
\include{}will most likely translate directly into a TeX primitive like\input. It might be easier to get the raw TeX out, but I'm not even sure if and how that could be done. – Kerrek SB Dec 03 '11 at 20:53\catcode\`@=1 @input{file}– Aditya Dec 04 '11 at 05:52\inputstatements? E.g., what about the\usepackage, or\documentclass? – Bruno Le Floch Dec 04 '11 at 07:40\inputcan be hidden within macro expansions => perhaps we want to expand\usepackage... A simpler (but different) possibility is to add thefilecontentsof all files given by\listfiles(or by a suitable hack into the TeX primitive\input). – Bruno Le Floch Dec 04 '11 at 07:44