Printing scripts Generated by the Geneva/Irvine Synchronous Editor Printing a script created by the script editor can be done in either of 2 ways: - use "print-script" - use "PS-convert" and print the resulting file print-script: "print-script" is the easier way, as it can be done with few parameters and in a single command. It can be used on any Sun system, but not yet on "ics" or "bonnie". The command is: print-script [-P] [{-2,-4,-8}] [-]* " This runs "PS-convert" on the script file name given to create a PostScript-language form of the script, which it then sends to a PostScript printer. Each page is given as a header: - the (column row) coordinates at which that page would be laid if the whole script were spread out on a large flat surface; - the name of the script file -- especially useful when a project consists of a large number of individual scripts; - and the date of the last modification of the script. See below, under PS-convert, about activity during the printing of the script. "print-script" leaves a new file in the script's directory, with the name ","".PS.reduced" (e.g. ",mod1.needs-help.e.PS.reduced"). This is the actual PostScript file that got sent to the printer. (Because of the way the printing system works, print-script must not delete the file for itself at the time of printing.) The leading "," causes the UNIX file system to delete this file automatically after (usually) 24 hours. This is to avoid leaving PostScript forms of scripts that will probably soon be modified, outdating the PostScript file; however, if there is some reason to keep the file, simply deleting the leading "," will achieve this. Required parameter: * (e.g. mod1.needs-help, newton-in-space) This is the basic name of the script (as opposed to the name of its message file, which for English-language scripts has ".e" appended to the basic name). Since this is the only required parameter, a print-script command can be as simple as print-script mod2.exc.n-desu print-script friendly-mailer.novice Optional parameters: * -P (e.g. -Pps2000, -P430) Lets you specify the printer on which to print the script. This must be one of the department's PostScript printers. The older set of printers called "Imagens" will not work for printing scripts. The recommended printer, especially if you're working in the ICS building, is the ps2000, in the mail room on the 4th floor. It is a fast, high-volume printer, better suited to the large number of pages typically needed for a script printout. (Printers such as the 2308b in the ETC trailer, or the 8300c in the counselling trailer, are Imagens, so they *cannot* be used for script printing.) To be consistent with other local UNIX printing programs, print-script will check the environment variable PRINTER (not LPRINTER) if the -P parameter is not given. Consult "man ipr" for more information about PRINTER. * -{2,4,8} (e.g. -2, -8) The number of pages of script to print per side of an actual sheet of paper. The script pages are reduced in size and turned side to side to do this. "-2" is recommended, not only to save paper, but to let more nodes of the script show at once. More than -2 may be difficult to read, as the lines become finer, but is nevertheless available. "print-script" uses the program "mpage" to apply this option to PS-convert's output; for up to date information on what it allows, type "man mpage". * more parameters If you know that the printer you're going to use accepts other parameters beyond the ones print-script recognises, you can add them in here, and they will be forwarded to the printer. They must of course each begin with "-", like almost all UNIX parameters -- otherwise "print-script" will think your parameter is a script file. Typically there is no need to do this, but for users interested in doing so, these are the actual programs that "print-script" uses to run the printers. You can enter "man " for each one to see what parameters it takes. for the ps2000 : "qpr" for the 430 (ps430, ps430-qrm) : "lpr" for the "sparc2" (in IERF): "lpr" for any other: "ipr" REQUIREMENTS: To run print-script or PS-convert, the name "Times-Roman.AFM" must be in your current directory. If it is not there, creating it is straightforward, and is described below; or else you can "cd" to a directory that does contain it. "print-script" is found in ~usj/bin, available on the sun3's and sun4's. To use it, make sure "~usj/bin" appears in the command that creates your "path" variable, usually either in your .login file or your .cshrc file. Using PS-convert: PS-convert (for "PostScript-convert") does not itself print anything; but it creates a rendition of your script in the PostScript page-setting language, in a file which can then be sent to a PostScript printer. When using it directly, rather than from print-script, the command is "PS-convert " - is the name of the file containing the script's message text. The script editor mandates that this be the , with a language indication letter appended -- in our case, ".e". - is the name of the PostScript file PS-convert will create. Simply appending ".PS" to the is recommended. It is also wise to start the name with a comma "," so that the UNIX file system will delete it after 24 hours, preventing an accumulation of printouts whose fidelity to the current script will be unknown. - gives the font that PS-convert will use for the text of the script. It will use this name to find the file "Times-Roman.AFM", which lets it measure the size of text on the pages it's creating. At present, "Times-Roman" is the mandatory parameter for this. It is *highly* recommended this file not be copied around to many different script directories; instead, symbolic links should be made to the one copy, from every directory where it is needed. See below for the procedure to do this. - supplies a heading for PS-convert to add to the top of each page. If it's surrounded with double-quotes, it may contain almost anything, including spaces. If you want a date on the listing, it must be included in this header. PS-convert does not supply one itself. For any that is not supplied on the command line, PS-convert will ask interactively, and offer a default for each one it asks for (except the script file name). PS-convert, in its present version, reports the stages of reading the script and laying it out on pages, somewhat as other conversion programs such as "latex" or "dvips" do; however, it is more verbose than many. This is mainly to let the user with a very large script follow its progress, as it is not yet clear that PS-convert will successfully get through the entirety of every script it tries to convert. In later, more stable versions, this listing will probably be optional, or absent. PS-convert has a built-in limit of 5000 nodes in one script. Since this is the same limit as the current version of the script editor has, it should not cause an immediate problem. LISTING PROBLEMS: To the extent that it can find them without aborting prematurely, PS-convert attempts to report problems it runs into. At present, there are really only two that are reported (at least for scripts that the script editor has validated): - failing to find a message in the message file whose key is given in the script file. This is usually caused by the bug described below, if the script is acceptable to the script editor. - having too much text in a node to fit it on a page. This may well happen to comment and documentation nodes that try to give detailed information. PS-convert will report those lines of the node that could not be made to fit on the page, ending with the node's ID number, in square brackets. It can only be fixed by using the script editor to break the node into at least 2 smaller ones, then redoing the printing. KNOWN BUGS: - PS-convert assumes your script has been checked and declared validated by the script editor; it makes no allowance for structural errors, such as a gap leaving part of the script not connected to the rest. It will either crash or fail to print that part of the script. - The script editor does not care about letter case (upper or lower) in the message file's message names (this has been part of ETC's and Geneva's definition of keyed message files for years). So if the casing happens to disagree between the two files, the script editor will not be affected. However, PS-convert *is* case sensitive, and will report having been unable to find messages under those names, which it will list. - PS-convert does not seem to be aware that an arc leaving a test box is allowed to point to any type of node at all, including another test. It prints such directly linked test boxes as if they were part of the same test cascade. - PS-convert does not always correctly find the boundaries of text in the nodes, particularly upper case text, and therefore sometimes lets it flow well past the righthand side of comment or documentation nodes. - For the parameter "Times-Roman", it is not possible to supply a directory with the path (e.g. ~/Intermed/scripts/mod1/Times-Roman.AFM"), since PS-convert is actually expecting it as a font name, not the name and path of a file. This forces a copy of or link to Times-Roman.AFM to be required in the current directory when printing a script. - PS-convert's layout of script components does not resemble the way they are arranged in the script file itself. Flow and content are preserved, but not organisation. Merges of flow are almost never drawn. Creating a symbolic link: A symbolic link is a UNIX file containing the name of another UNIX file. The UNIX file system recognises it and applies all requested operations to the other file named. A symbolic link is created by the command "ln -s " (e.g. ln -s /usr/ucb/vi my-vi" creates a link in the current directory called "my-vi", which points to the true file /usr/ucb/vi). For linking to Times-Roman.AFM, do the following: "ln -s ~usj/Intermed/script-printing/Times-Roman.AFM Times-Roman.AFM" in the directory where you want the link to be put. Consult "man ln" to find out more about links (they can be very useful).