SGML for Windows NT: Setting up a free SGML/XML editing and publishing system on Windows/Cygwin | ||
---|---|---|
Prev | Chapter 11. Using shell scripts to publish DocBook documents | Next |
dbjade [-d stylesheet] [-h] [-i name] [-p prefix] [-t outformat] {docbook-file...}
This script transforms a DocBook document and creates either HTML, RTF, TeX, DVI, PostScript, or PDF output.
The -d option allows to choose between several stylesheets. This may e.g. be a new driver file for the DocBook stylesheets. The -d s option in this script is a driver file that I use. This won't be present on your system unless you use the dbslide package. I left the code in here to give you an idea how to implement this.
dbjade -h displays a short usage screen and exits.
Use the -i option to specify the name of a parameter entity to include the corresponding marked sections of the SGML source.
If you want the output files to have a filename prefix, specify this with the -p option. This is useful to avoid filename conflicts if you have to keep several DocBook output files in a single directory.
Use the -t option to specify the output format. Possible values are:
creates HTML output from the SGML source
creates Rich Text Format (RTF) output from the SGML source
creates TeX output from the SGML source for further processing with JadeTeX. You can edit the .tex file e.g. to adjust the pagebreaks
creates DVI output from the SGML source
creates Postscript output from the SGML source
creates Portable Document Format (PDF) output from the SGML source
creates Postscript output from an intermediate .tex file.
creates PDF output from an intermediate .tex file.
If you use one of the TeX-based output formats, the script attempts to run the minimum number of passes through jadetex or pdfjadetex sufficient to get references and indices correct. Up to three passes are normal.
In contrast to plain OpenJade, this script takes care that all output files are generated in the present working directory. Without the -o switch, OpenJade would create HTML output in the present working directory and all other output in the directory where the SGML source is.
This script uses the following external programs, all of which are installed on your system if you followed this tutorial:
(open)jade
jadetex
pdfjadetex
dvips
diff
Modify the following variables to adapt the script to your site:
the full path to the DocBook stylesheet driver file for HTML output
the full path to the DocBook stylesheet driver file for print output
either openjade or jade
the full path to the DocBook SGML declaration
~# dbjade -i wcygwin -p cyg -t ps dbfile.sgml |
This command will transform the file dbfile.sgml to a Postscript document. The output filename will be cygdbfile.ps. The sections marked with <![ %wcygwin[ ... ]]> will be included.
If you now find out that TeX didn't get some of the pagebreaks correct, go back to the intermediate TeX file dbfile.tex and insert \pagebreak commands where appropriate. Now build your Postscript file again with the command:
~# dbjade -i wcygwin -p cyg -t tps dbfile.sgml |
In contrast to the first command, this command will rebuild the Postscript document from your modified TeX file. If you simply run the first command again, this TeX file will be replaced again with OpenJade's output, discarding your changes.