In your file paper.txt, mark examples with \\label (where label is a string) and reference them with <<label>>. Wrap citations in <{...}>. Then enter perl ref-resolver.pl paper.txt. Choose a numbering style at the prompt. The output file paper.txt.numbered has all your examples and example references resolved, your citations collected at the end, and the special mark-up removed. Update: The current version, 1.4, handles numbering for (sub(sub))sections, via #(SUB(SUB))SEC: mark-up.
Include documentation in your script, using the special LaTeX environments defined by this script, in the spirit of literate programming. Then run generateDocumentation.pl on the script. The output is a latexable file containing your documentation.
generateDocumentation.pl documentation LaTeX class file
Maintained by Christopher Potts. Last update: 2006-06-09