Comprehensive TeX Archive Network
Cover Upload Browse Search

Direc­tory tex-archive/support/latexpand

    latexpand - Flatten LaTeX file by expanding \include and \input, ... and
    remove comments

    latexpand [options] FILE...

            --verbose        show what's going on
            --keep-comments  don't strip comments (comments are lines
                             starting with %, and anything below
            --empty-comments keep empty comments (i.e. % at end of lines) for clarity
            --keep-includes  don't expand \input and \include directives
                             Expand \usepackage{...} directives if the
                             corresponding .sty file is found in
            --expand-bbl FILE
                             Expand the bibliography by inlining FILE
                             (should be a *.bbl file)
            --help           this help message
            --output <file>, -o <file>
                             generate output in <file>
            --explain        generate explanatory comments in output
            --show-graphics  show included graphics
                             colon-separated list of possible graphics extensions
                             (used by --show-graphics to find the actual graphics files)

    The most common use of latexpand is to simplify distribution of source
    LaTeX files, typically to satisfy the requirement of editors and
    archival sites (springer,, ...) who force the authors to
    submit sources. One does not necessarily want to submit sources with
    comments, and uploading a document made of several files including each
    other is a bit painful. By default, latexpand answers both problems by
    outputing a single LaTeX file that contain no comment.

    The latest version of latexpand is available here:

    Versions are uploaded to from time to time:

    Please, report bugs to Matthieu Moy <>.

  Known bugs
    latexpand currently ignores \begin{verbatim} ... \end{verbatim}, and
    will therefore process any \include, \input, ... directives that appear
    within verbatim environments (while it shouldn't).

    It would be nice to remove code between \begin{comment} and
    \end{comment} too if \usepackage{comment} is used.

    Code like


    will produce the incorrect


    A workaround is to use --empty-comments when such tricky usage of the
    comments package is done.


Name Notes


Name Size Date Notes
Makefile 482 2013-08-22 17:18
README 2729 2014-04-04 13:49
latexpand 7434 2014-03-23 21:53
version.txt 103 2014-04-04 13:49

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

la­t­ex­pand – Ex­pand \in­put and \in­clude in a LaTeX doc­u­ment

La­t­ex­pand is a Perl script that sim­ply re­places \in­put and \in­clude com­mands with the con­tent of the file in­put/in­cluded. The script does not deal with \in­cludeonly com­mands.

Pack­age De­tailsla­t­ex­pand
Ver­sion 2014-04-04
Li­censeBSD Style Li­cense
Main­tainerMatthieu Moy
Matthew Lovell (in­ac­tive)
David J. Musliner (in­ac­tive)
Con­tained inTeXlive as la­t­ex­pand
MikTeX as la­t­ex­pand
Topics TeX-re­lated-file man­age­ment
Guest Book Sitemap Contact