ARLATEX(1)
β¨ ARLATEX(1) β¨
okay so this is arlatex(1), from the User Commands section of the manual, and bestie, it is such a slay little archiver. let me put you on. π«Ά
πΈ NAME πΈ
arlatex β archive a number of ancillary LaTeX files into a master .tex file
π SYNOPSIS π
arlatex [--outfile=filename.tex] --document=filename.tex filename ...
arlatex --version
arlatex --help
π DESCRIPTION π
so arlatex is an archiving program, like shar, tar, zip, etc. BUT β and this is the part where it's giving main character energy β unlike all those other archivers, arlatex is built specifically for LaTeX. π
here's the vibe: you hand arlatex the name of a master .tex file plus a bunch of ancillary files that master file leans on (think .tex, .sty, .cls, and .eps files). and from all of that, arlatex spits out one single file that, when you run it through latex, does two things at once: it regenerates all those ancillary files and compiles the document into a .dvi file. no cap. π₯
arlatex has a few advantages over other archiving programs, and honestly? obsessed:
- The
.texfiles produced byarlatexare in a plain-text format. so they're perfectly portable and trivial to e-mail to colleagues. β¨ arlatexneeds only LaTeX to run. There is no dependence on any external tools. π§- There is no explicit extraction step. As the generated document is run through
latex, it extracts the ancillary files and builds the document in the same step. The user runninglatexmay not even notice that additional files are being produced. π
so how does the magic happen? arlatex works by writing a number of "\begin{filecontents*}" ... "\end{filecontents*}" blocks to the output file, followed by the contents of the master file. (In fact, any LaTeX comments at the beginning of the master file are hoisted to the top of the generated file. This enables the author to draw attention, if so desired, to the fact that ancillary files will be generated.) The "filecontents*" environment, part of standard LaTeX2e, writes its contents verbatim to a specified file. π
β¨ OPTIONS β¨
--versionβ Output thearlatexscript's version number. tiny lil flex, we love her π--helpβ Output briefarlatexusage information. when you just need the sparknotes π¦--document=.tex fileβ Specify the master document. The output fromarlatexis this file with all of the other files named on the command line prepended to it. Note that"--document"is a mandatory parameter;arlatexwill abort with an error message if"--document"is not specified. π¨--outfile=.tex fileβ Specify the output file. The output file looks just like the master document, but with a number of"filecontents*"environments preceding the"\documentclass"line. If"--outfile"is not specified, output will be written to the standard output device. π
π EXAMPLES π
okay imagine: you have a paper called paper.tex that loads a custom package with "\usepackage{mypackage}". You want to submit the paper to a conference, but you want to be absolutely certain that mypackage.sty doesn't get lost as your paper is shuttled from person to person. bestie, that's a nightmare scenario. Here's how arlatex can be of use:
arlatex --document=paper.tex mypackage.sty --outfile=paper-submit.tex
When paper-submit.tex is processed with latex, it builds just like the original paper.tex, except that it additionally creates a mypackage.sty in the current directory:
This is TeX, Version 3.14159 (Web2C 7.3.1)
(paper-submit.tex
LaTeX2e <1999/12/01> patch level 1
Babel <v3.6Z> and hyphenation patterns for american, french, german,
ngerman, italian, nohyphenation, loaded.
LaTeX Warning: Writing file `./mypackage.sty'.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 1999/09/10 v1.4a Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size12.clo)) (mypackage.sty)
.
.
.
As another example, here's how you could bundle together all of the files needed to build a large document for longevity:
arlatex --document=thesis.tex abstract.tex introduction.tex
background.tex approach.tex experiments.tex relatedwork.tex
conclusions.tex before.eps after.eps fast.eps slow.eps
podunkUthesis.cls --outfile=thesis-all.tex
As the number of files to archive together increases it becomes more cumbersome to run arlatex manually. Fortunately, using arlatex with bundledoc is straightforward. bundledoc finds all of the files needed to build the document, and arlatex combines them into a single file. The following are examples of the "bundle:" line you might use in a bundledoc configuration file:
Unix:
bundle: (arlatex --document=$BDBASE.tex $BDINPUTS \
--outfile=$BDBASE-all.tex)
Windows:
bundle: arlatex --document=%BDBASE%.tex %BDINPUTS% \
--outfile=%BDBASE%-all.tex
See the bundledoc documentation for more information. π
π CAVEATS π
no fr, read this part.
arlatex makes use of LaTeX's "filecontents*" environment. It passes "filecontents*" the "overwrite" option to indicate that existing files with the same name should be overwritten. Be forewarned that building the generated file will overwrite the files used to create it. π like, the thing eats its own source. be so careful.
It is best to avoid bundling binary files (e.g., included graphics) with arlatex. These typically do not extract cleanly. π«
π SEE ALSO π
bundledoc(1), latex(1), shar(1), tar(1), zip(1)
π¦ AUTHOR π¦
Scott Pakin, scott+bdoc@pakin.org
and that's the whole page, bestie!! this was v1.1, dated 2025-02-26, and honestly? iconic. go bundle something. πβ¨π
π¦ where this page comes from
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- debian trixie: texlive-extra-utils 2024.20250309-2
- fedora 44: texlive-bundledoc 12:svn74306-105.fc44 Β· LPPL-1.3c
- fedora 44: texlive-bundledoc 12:svn74306-111.fc44 Β· LPPL-1.3c
- opensuse-leap 16.0: texlive-bundledoc-doc 2025.221.3.5svn74306-160000.3.1 Β· LPPL-1.0
- ubuntu questing: texlive-extra-utils 2024.20250309-2
- ubuntu resolute: texlive-extra-utils 2025.20260124-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms