/flap

Flattening latex projects

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

FLaP — Flat LaTeX Projects

FLaP FLaP ad32e1e0 27d8 0133 8e78 7af7072ae828 master FLaP

Flap is a simple utility that flattens LaTeX projects. It takes a well organised LaTeX project — one you so carefully crafted — and merged it into a vulgar single LaTeX file in a flat directory.

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.

Another one? There already a couple of tools that merge latex project such as latexpand, flatex or flatten. As far as I know, they only merge TeX files, without moving graphics around. I learned recently about texdirflatten, which seems to be an alternative, but I haven’t tried it.

Installation

FLaP requires Python 3 (3.2, 3.3 and 3.4 are tested). The easiest way to install FLaP is to use pip using pip install flap.

Alternatively, you may download the sources distribution and use python setup.py install

Usage Example

Use FLaP in the command line:

$> python3 -m flap project/main.tex output/directory

See also the online documentation.

Contact

If you get the change to give it a try, please report any bugs, issues or feature request using the issue tracker. Should you need any further information, feel free to email me

TODO

Here is a list of features, which are not yet supported:

  1. Support for backward relative links in directives, for instance \input{../img/foo}.

  2. Support for star-form of directives, such as \includegraphics*{foo}

  3. Adjust copyright and credits in flap.init.py

  4. Support for includegraphics with full path

  5. Support for spaces in graphics files

  6. Clean support for .tex

  7. Support for relative paths (e.g. main.tex includes tex/file1.tex includes tex/file2.tex)