Download Documentation - Nickalls.org

Transcript
CHAPTER 17. PRINTING—THE STAND-ALONE (SA) MODULE
RWD Nickalls

# copy the .dvi file to have a gnn.dvi filename
system ("cp -v prtanes6.dvi $dvifilename");
# make the .ps files
$psfilename="anes-".$gnn.".ps";
system ("dvips $dvifilename -o $psfilename");
print (printlog "...........LATEX ...done\n");
# now make the pdf files
system ("pdflatex prtanes6.tex");
$pdffilename="anes-".$gnn.".pdf";
# copy the .pdf file to include a ..gnn.pdf filename
system ("cp -v prtanes6.pdf $pdffilename");
17.7
Typeset the drug file using LATEX 2ε
Processing the drug file (log file) is slightly more complicated owing to the fact that the
typesetting is done using LATEX 2ε . Consequently, since the anaesthetists can enter data
using the keyboard we need to filter out all non-TEX material (essentially to ‘escape’
certain ASCII characters; for example, we would modify % rightarrow \% etc). This
conversion is currently done by the Perl program base2texd.pl, which processes the
original log-file (baselog.data) to the ‘filtered’ file baselognew.data.
We now typeset the ‘filtered’ drug-file and create the output formats .dvi, .ps,
and .pdf on the fly as before. The TEX file for the graphs is prtdrug.tex. The style
option is prtdrug2.sty. We create the PostScript files using dvips. We create the
.pdf files using pdflatex.
# process the baselog.data file
system ("perl ./base2texd.pl");
# now latex the prtdrug file
system ("latex ./prtdrug.tex");
# copy the .dvi file to have a anes-drug.dvi filename
system ("cp -v prtdrug.dvi anes-drug.dvi");
# make the PS version of the .dvi file
system ("dvips anes-drug.dvi -o anes-drug.ps");
# make the pdf file
system ("pdflatex prtdrug.tex");
# copy the .pdf file to have a gnn.pdf filename
system ("cp -v prtdrug.pdf anes-drug.pdf");
17.8
Printing the paper sheets
Finally, we print out all the sheets making up the Anaesthesia Record. This currently
consists of one or more ‘drug’ sheets (the log file), together with a number of 1-hour
graphic sheets presenting the measured parameters. These are usually printed out in the
operating theatre and placed in the patient notes.
In practice a small Perl program (printall.pl) sends the final files to the printer
in reverse order as follows.
#!/usr/bin/perl