In addition to what Martin has replied (and I would reiterate the non-requirement of the .dtx
format), a very useful utility is Scott Pakin's ctanify
script, which packages your stuff into a format specifically designed for upload to CTAN and inclusion into TeXLive. The script works out of the box on Linux and OS X and under Cygwin for Windows.
For example, a fairly simple package or class would likely have the following components:
mypackage.sty
(the package itself)
mypackage.tex
(the package documentation source)
mypackage.pdf
(the compiled package documentation)
README
(a plain text README file (with no extension))
Using ctanify
all I need to do is issue the following command (assuming I'm within the directory of the package):
ctanify --no-tds mypackage.* *.tex=doc README
and this will produce a tar.gz
file containing copies of all the files,
By default, ctanify
will include a .tds.zip
file which contains versions of the files with the .sty
file in /tex/latex/mypackage
, the documentation in /doc/latex/mypackage
. This format is useful for packages with a complex structure. For small packages which contain just a few files, CTAN doesn't recommend a including a .tds.zip
file within the tarball so in this example I have added the --no-tds
option which prevents the inclusion of the .tds.zip
file.
Here's a breakdown of the arguments I gave to the command:
mypackage.* % will automatically deal with .sty, .cls, .pdf, .dtx and .ins
*.tex=doc % put all .tex files into the doc folder
README % include the README file (will go into the /doc folder)
I've just described the simple use. Of course if your package or class has a more complicated set of files, the command would need to be modified appropriately. For example, if you have .tex
files that are part of the package itself and not part of the documentation you wouldn't use *.tex
but would specify mypackage.tex=doc
for the documentation source and a separate specification for the other .tex
files.