CTAN Comprehensive TeX Archive Network

Direc­tory support/texdirflatten

    texdirflatten - Collects all components of a (La)TeX file in a single
    output directory -- i.e., flattens its hierarchy.

    texdirflatten [-1|--onetex] [-f|--file input.tex] [-o outputdir]
    [--imgexts .ext1,.ext2,...] [--debug] [-V|--version] [-?|--help]

    This Perl script parses a LaTeX file recursively, scanning all child
    files, and collects details of any included and other data files, such
    as graphics and BiBTeX bibliography files. These component files, are
    then all put into a single directory (thus "flattening" the document's
    directory tree). This is useful in distributing manuscripts to
    collaborators or in submitting to journals.

    --file, -f *input.tex*
        Specifies input (La)TeX file.

    --onetex, -1
        If specified, produces a single TeX file by expanding all \input and
        \include commands in place.

    --output, -o *outputdir*
        Directory to collect all files. texdirflatten will copy each source
        file, graphics and bibliography file to this directory. It will be
        created if it is unexistent. If unspecified, it defaults to "flat/".

    --imgexts *.ext1,.ext2[,...]*
        Prepends to the prioritized list of image extensions to search when
        trying to find the image to copy to output folder. The first file
        with the extension found will be copied and search stopped. Default
        order is "", ".eps", ".pdf", ".pstex" (note that it includes files
        with no extension). If using pdflatex, one may want to add PDF
        before EPS with "--imgexts .pdf". Don't forget the dot before the

        Enables copious amounts of debugging output - useful if something is
        going wrong.

    --version, -V
        Displays the current version number and the usage and exits.

    --help, -?
        Show this manual page.

    The following example scans "manuscript.tex" in the current directory
    and gathers it and all its components in the "submit_01/" directory:

     $ texdirflatten -f manuscript.tex -o submit_01

    Please take backups before running this command. No warranties
    whatsoever provided.

    You may need to run "epstopdf" on EPS files if you are using "pdflatex":

     $ for i in *.eps; do epstopdf $i; done

    Bug reports and patches are welcome.

    Cengiz Gunay <cengique<AT>users.sf.net>

    Copyleft 2003-2017, Cengiz Gunay

    This library is free software; you may redistribute it and/or modify it
    under the same terms as Perl itself.

Down­load the con­tents of this pack­age in one zip archive (9.2k).

texdirflat­ten – Col­lect files re­lated to a job in a sin­gle di­rec­tory

The Perl script parses a file re­cur­sively, scan­ning all child files, and col­lects de­tails of any in­cluded and other data files. Th­ese com­po­nent files, are then all put into a sin­gle di­rec­tory (thus “flat­ten­ing” the doc­u­ment’s di­rec­tory tree).

Home pagehttps://github.com/cengique/texdirflat­ten
Bug trackerhttps://github.com/cengique/texdirflat­ten/is­sues
Li­censesPerl Artis­tic Li­cense
Main­tainerCen­giz Gü­nay
Con­tained inTeX Live as texdirflat­ten
MiKTeX as texdirflat­ten
TopicsFile man­age­ment
Guest Book Sitemap Contact Contact Author