TEXDIRFLATTEN(1)
π TEXDIRFLATTEN(1) π
okay bestie, welcome to the texdirflatten man page, she's a Perl script and she's here to gather up all your LaTeX chaos into one little folder π
β¨ NAME β¨
texdirflatten β collects all components of a (La)TeX file in a single output directory β i.e., it flattens its hierarchy. π
πΈ SYNOPSIS πΈ
texdirflatten [-1|--onetex] [-f|--file input.tex] [-o outputdir]
[--imgexts .ext1,.ext2,...] [--debug] [-V|--version]
[-?|--help]
π¦ DESCRIPTION π¦
So basically, this Perl script goes through a LaTeX file recursively, scanning all the child files, and it collects the deets on every included file and other data file β think graphics, BiBTeX bibliography files, all of it. π
Then all of those component files get put into one single directory, which is the whole "flattening the document's directory tree" moment. Iconic.
Why do you care? Because it's literally perfect for distributing manuscripts to your collaborators, or for submitting to journals. no cap. π«Ά
β¨ OPTIONS β¨
--file,-f_input.tex`_ β specifies the input (La)TeX file. like, the main character file. π--onetex,-1β if you specify this, it produces a single TeX file by expanding all\inputand\includecommands in place. one file to rule them all fr fr.--output,-o_outputdir_ β the directory to collect all the files in.texdirflattenwill copy each source file, graphics and bibliography file to this directory. It will be created if it is unexistent (yes, "unexistent", we're keeping that π). If unspecified, it defaults toflat/. ποΈ--imgexts.ext1,.ext2[,...]β prepends to the prioritized list of image extensions to search when trying to find the image to copy to the output folder. The first file with the extension found will be copied and the search stops. Default order is"",.eps,.pdf,.pstexβ note that it includes files with no extension. If you're usingpdflatex, you may want to add PDF before EPS with--imgexts .pdf. Don't forget the dot before the extension! β οΈ--debugβ enables copious amounts of debugging output. super useful if something is going wrong. π--version,-Vβ displays the current version number and the usage, and exits. π«--help,-?β show this manual page. hi bestie, you found it π₯°
π EXAMPLES π
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
π CAVEATS π
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
π BUGS π
Bug reports and patches are welcome. bring them to me, I'll love them ππ
π AUTHOR π
Cengiz Gunay <cengique<AT>users.sf.net>
π COPYRIGHT AND LICENSE π
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.
and that's the whole page bestie!! this one is texdirflatten-v1.3, dated 2017-07-03 β go flatten some manuscripts, you absolute legend π¦β¨π
π¦ where this page comes from
- alpine 3.24: texmf-dist-binextra-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms