dtxgen(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸŽ€ NAME πŸŽ€

okay so bestie, welcome to dtxgen(1) from the DekDoc scripts family πŸ’–

dtxgen β€” generate a template for a LaTeX self-extracting .dtx file. that's the whole vibe. it makes the skeleton so you don't have to πŸ¦‹


✨ Synopsis ✨

dtxgen [options] basename.[sty,cls]

🌈 Options (the quick lil preview) 🌈

  • -h,--help β€” print short help and exit
  • -H,--Help β€” print full documentation via less and exit
  • -V β€” print version and exit
  • -s,--short=X β€” set short, one-liner, package description to X
  • -v,--version=X β€” set initial version to X. Default: 1.00
  • -d,--date=X β€” set initial version’s date to X. Default: current date
  • -m,--mail=X β€” set your email address to X. Default: $EMAIL
  • -n,--name=X β€” set your name to X. Default: $NAME
  • -c,--class=X β€” (class packs only) set class to be preloaded to X. Default: article
  • -f,--format=X β€” set latex format to be used for compilation to X. Default: pdflatex
  • -b,--body=X β€” existing style or class X to be used instead of demo
  • -i,--history β€” replace standard Change History section with simpler one.

🫢 Description 🫢

so dtxgen creates a template for a self-extracting .dtx file, based on the model described by Joseph Wright (www.texdev.net20091006a-model-dtx-file/). it's giving very useful for those who plan to create a new Documented LaTeX Source (.dtx) file. no cap 🧚

Usage example, periodt:

dtxgen -n 'your name' -m 'your@email.ad' myclass.cls

The script takes some variables such as:

  • name and email address of the author,
  • a short description of the class or package generated from the .dtx file,
  • a date

…and it pulls them from environment variables, or from command line options, and generates, among more, a template for the .dtx file with some minimal examples. Of course, the user will have to replace those examples with the real work β€” bestie that part is on you πŸ™ˆ β€” but the dates, basename, author's name and email address are already in place and, depending on whether you used a .cls or a .sty extension in the argument, it is formatted to be either a class or a package source file. iconic behavior tbh πŸ‘‘

If you have an environment with your name and email address defined in NAME and EMAIL, you could simply type:

dtxgen myclass.cls

and you would end up with five files: myclass.dtx, myclass.cls, myclass.pdf, README.md, and Makefile. five!! that's a whole squad πŸ’…


πŸ’– Options πŸ’–

dtxgen recognizes the following options:

  • -h,--help β€” Prints help information and exits.
  • -H,--Help β€” print full documentation via less and exit
  • -V β€” Prints the script's version and exits.
  • -s,--short=X β€” A short, one-liner, description for the class or package. By default, the string /A new LaTeX class/ or /A new LaTeX package/ will be used.
  • -n,--name=X β€” Your name (first name, followed by surname). Alternatively, you can set a default value in the environment variable |NAME|; if you do so and still use this option, the option's value wills have priority.
  • -m,--mail=X β€” Your email address. Alternatively, you can set a default value ins the environment variable |EMAIL|; if you do so and still use this option, the option's value will have priority.
  • -c,--class=X β€” For class templates only: inserts a |dClass{...}|, so that the new class will start with the properties of the |...| class. The default is |article|.
  • -v,--version=X β€” Set the initial version; by default 1.00 wil be used.
  • -d,--date=X β€” Set the initial version's date. By default, the current date will be used. The date should be entered in the yyyymmdd format, although it will be stored the LaTeX way: yyyy/mm/dd.
  • -f,--format=X β€” Latex format to be used for compilation. The default is pdflatex, but you may need another format, like xelatex of lualatex.
  • -i,--history β€” Create a section History instead of the standard Change History section. The standard Change History allows very detailed reports, but most people contine themselves to global remarks about changes between versions, appearing at one place in the document. The --␣history option provides a straightforward history section, formatted in a longtable environment.

🌸 Makefile 🌸

The Makefile can be used to compile new versions of your work; it contains the following targets:

  • all β€” (the default) generate the style or class file, the pdf-documentation, and a README.md file.
  • distclean β€” remove all files that can be regenerated,
  • clean β€” same, except the style or class file, the pdf-documentation, and a README.md file.
  • inst β€” install in the user's TeX tree,
  • install β€” install in the local TeX tree (uses sudo)
  • zip β€” produce a zip file ready for upload to CTAN

πŸ’œ Author πŸ’œ

Wybo Dekker (wybodekker@me.com)


Released under the GNU General Public License (www.gnu.orgcopyleftgpl.html)


ok that's the whole page bestie, go make a .dtx and slay πŸ’…βœ¨

and for the cute sign-off: this is dtxgen version 1.09, dated July 31, 2025, filed under dtxgen(1) πŸŽ€πŸ¦‹ bye bestie!! πŸ’–

πŸ“¦ where this page comes from