CTAN update: newcommand
LaTeX's \newcommand is fairly limited in the way it processes optional arguments, but the TeX alternative, a batch of \defs and \futurelets, can be overwhelming to the casual LaTeX user. newcommand.py is a Python program that automatically generates LaTeX macro definitions for macros that require more powerful argument processing than \newcommand can handle. newcommand.py is intended for LaTeX advanced beginners (i.e., those who know how to use \newcommand but not internal LaTeX2e commands such as \@ifnextchar) and for more advanced users who want to save some typing when defining complex macros. With newcommand.py, the user specifies a template for a macro's arguments. newcommand.py then custom-generates a macro definition according to the user's specifications and includes a user-friendly "Put code here" comment to indicate where the macro's main code should appear. newcommand.py supports arbitrary interleavings of required and optional arguments, starred macros, mandatory literal text, macros with more than nine arguments, optional arguments delimited by parentheses instead of square brackets, and optional arguments whose value defaults to the value given for a prior argument. The generated macros can easily be pasted into a LaTeX document and edited as desired. This version (2.0) represents a major rewrite of newcommand.py. New features include improved code generation, support for starred macros, and support for more than nine macro arguments.
This package is located at http://tug.ctan.org/tex-archive/support/newcommand . More information is at http://tug.ctan.org/pkg/newcommand (if the package is new it may take a day for that information to appear). We are supported by the TeX Users Group http://www.tug.org . Please join a users group; see http://www.tug.org/usergroups.html .
newcommand – Generate new LaTeX command definitions
Generating any other than the simple \newcommand-style commands, in LaTeX, is tedious (in the least). This script allows the specification of commands in a ‘natural’ style; the script then generates macros to define the command.
|Copyright||2008 Scott Pakin|