The interface of aldordoc is not identical to its implementation in aldordoc.sty.nw, see Section 25.4. This script is intended to translate the aldordoc interface to LATEX commands that are directly understandable by LATEX with included style file aldordoc.sty.nw.
The program assumes a file as input. The file can either be in Noweb format or a LATEX file. Noweb code chunks are left completely untouched.
The program is run as a filter and produces an output file that has exactly the same number of lines as the input file.
Each line is treated as one unit. For that reason LATEX commands that are to be translated must appear completely on one line.
After handling several special cases, the following while loop calls the main function adtranslateLine.