Create an external file from within a LaTeX document

Scott Pakin
Packaged on:
9/24/2019 8:11:38 PM
Number of files:
Size on disk:
137.21 kB

LaTeX2e’s filecontents and filecontents* environments enable a LaTeX source file to generate external files as it runs through LaTeX. However, there are two limitations of these environments: they refuse to overwrite existing files, and they can only be used in the preamble of a document. The filecontents package removes these limitations, letting you overwrite existing files and letting you use filecontents/filecontents* anywhere. As of September 2019 the author tells us: “This package is no longer necessary due to its functionality having moved into recent LaTeX kernels. It’s probably better not to move the package to obsolete because users may need it to rebuild old documents. Version 1.5 provides full functionality when run with an older kernel but issues a warning message and disables itself when run with a newer kernel.”