FLaP — Flat LaTeX Projects
FlaP is an utility that flattens LaTeX projects. It takes a well organised LaTeX project—one you carefully crafted—and merged it into a single LaTeX file in a flat directory. Images, bibliography and others resources are moved around as well.
What does FLaP support? The list of supported directives includes most commonly used LaTeX directives, such as
\includegraphics, etc. Yet, FLaP does not support these directives when I we use them within verbatim environments or within user-defined commands.
Why? Some publishers require such a flat structure when you submit the sources of your manuscripts, and I got tired to flatten the sources by hand.
Yet Another One? There is already a couple of tools that merge LaTeX projects such as latexpand, flatex, flatten or texdirflatten. As far as I know, they do not support directives such as
\includeonlyand only merge TeX files, without moving graphics around (except for
FLaP requires Python 3.3, 3.4, 3.5 or 3.6. Not that it does not work with Python 3.2.
$> pip install flap
$> flap my/project/main.tex my/output