| 1 |
README_HPS, version 0.3 |
| 2 |
|
| 3 |
last modified Wed Jul 19 11:34:52 MDT 1995 |
| 4 |
|
| 5 |
This is an alpha release of a hacked version of dvips v5.58 for |
| 6 |
converting HyperTeX into HyperPostScript that in turn can be run |
| 7 |
through the Adobe distiller to produce a PDF file with chapter and |
| 8 |
section numbers, references, equation numbers, etc. all links. |
| 9 |
This program is intended for use with the TeX and LaTex macros |
| 10 |
modified to create HyperTeX (see http://xxx.lanl.gov/hypertex/). |
| 11 |
With these macros, TeX and LaTex can be converted into HyperTeX |
| 12 |
without any additional work by the user. The linking information |
| 13 |
is stamped into the dvi file via a set of html: \special commands. |
| 14 |
Normally conversion to PostScript involves a loss of this information. |
| 15 |
This program preserves all of the information in the Hyperdvi file |
| 16 |
and makes it available to all PostScript interpreters, as well as |
| 17 |
the Adobe PDF distiller. In addition, the HyperPostScript produced will |
| 18 |
work with ordinary PostScript interpreters as well. |
| 19 |
The software itself is availabe at http://nqcd.lanl.gov/people/doyle/ |
| 20 |
or at ftp://gita.lanl.gov/people/doyle . |
| 21 |
|
| 22 |
INSTALLATION: |
| 23 |
|
| 24 |
To compile this program, just follow the usual instructions. Since |
| 25 |
this version stems from the latest version of dvips, you should |
| 26 |
install the up-to-date versions of config.* and the *.pro files. |
| 27 |
You can edit the Makefile to put these in some other place besides |
| 28 |
the usual one. Compiling with the -DHPS option (enabled by default |
| 29 |
in the Makefile) will produce the hacked version of dvips. Disabling |
| 30 |
this option will produce the version of dvips that you already know |
| 31 |
and love. I have made an effort to keep my changes to the dvips |
| 32 |
source code minimal. Most of the important stuff is in the source |
| 33 |
file hps.c. Almost all of the changes to the dvips source code |
| 34 |
are mandated by the need for putting information at the beginning |
| 35 |
of the PostScript file that isn't normally available until the |
| 36 |
entire dvi file has been completely processed. Thus, two temporary |
| 37 |
files are created when running the program to create HyperPostScript, |
| 38 |
head.tmp and body.tmp. One can freely delete these after running |
| 39 |
the program. |
| 40 |
|
| 41 |
The files modified from the 5.58 dvips distribution are: |
| 42 |
dvips.c, dvips.h, paths.h, dosection.c, dopage.c, dospecial.c, output.c, |
| 43 |
header.c, Makefile, and a very minor (irrelevant) change to afm2tfm.c. |
| 44 |
|
| 45 |
Files added are README_HPS.txt, CHANGES_HPS.txt, hps.c, and hps.lpro. |
| 46 |
|
| 47 |
Anyone interested in going all the way to PDF is encouraged to install |
| 48 |
PostScript versions of the TeX fonts on their system. The Adobe PDF |
| 49 |
readers are extremely slow when dealing with bitmapped fonts. There |
| 50 |
is, however, a bug in the Adobe distillers that requires a workaround |
| 51 |
for certain characters. See below for more info. Commercial versions |
| 52 |
of the fonts are available from BlueSky and public domain versions are |
| 53 |
available at ftp://ftp.shsu.edu/pub/tex/fonts/postscript/bakoma/ and |
| 54 |
ftp://ftp.shsu.edu/pub/tex/fonts/postscript/paradissa/ . |
| 55 |
MS-DOS/Windows user beware: The latest Adobe Type Manager doesn't like |
| 56 |
the BlueSky fonts. I haven't tried the public domain ones. (On a new |
| 57 |
and different PC I was able to get the Blue Sky fonts installed with |
| 58 |
ATM and it works fine. Your mileage may vary. July 19, 1995.) |
| 59 |
|
| 60 |
USAGE: |
| 61 |
|
| 62 |
After compiling with -DHPS, a user can invoke the Hyperdvi to |
| 63 |
HyperPostScript conversion with the -z flag. If the flag is |
| 64 |
omitted, dvips simply will revert back to the default behavior and |
| 65 |
skip over the html: \special commands. |
| 66 |
|
| 67 |
There appears to be a bug in the Adobe distillers. For optimization |
| 68 |
purposes the distillers drop trailing blanks (character code 32) |
| 69 |
from strings. Unfortunately, the PostScript fonts use this character |
| 70 |
code for certain characters (notably the Greek letter psi), and |
| 71 |
so these characters are dropped. This bug still appears in the 2.0 |
| 72 |
distiller. |
| 73 |
|
| 74 |
-----HACK ALERT----- |
| 75 |
|
| 76 |
One way around this is to change all the trailing blanks of strings to |
| 77 |
a character code that isn't in the font. The default behavior is to |
| 78 |
substitute a blank for a missing character, i.e. the distiller is |
| 79 |
fooled into substituting the right character. For instance, with the |
| 80 |
BlueSky fonts, one can globally replace " )" with "\200)" and get the |
| 81 |
desired result. With the public domain fonts, one will probably have |
| 82 |
to use a character code in the range 128 to 191 since these fonts |
| 83 |
duplicate the first 32 characters starting at 192 to avoid MS-DOS |
| 84 |
problems. Fortunately, a simple sed will accomplish the replacements. |
| 85 |
|
| 86 |
OTHER NOTES: |
| 87 |
|
| 88 |
The program is rather straightforward and operates by converting |
| 89 |
the dvi html: href \specials into pdfmark operators in the PostScript |
| 90 |
that specify the links. The html: name \specials are combined into |
| 91 |
a PostScript dictionary with all of the target information. The |
| 92 |
hps.pro header tries to gracefully handle various contingencies. |
| 93 |
If the resulting HyperPostScript file is handed off to an ordinary |
| 94 |
PostScript interpreter, the pdfm operators are automatically defined |
| 95 |
to pop the irrelevant information off the stack. On the other hand, |
| 96 |
if it is handed to a distiller, the PostScript program in the header |
| 97 |
tries to determine of what vintage the distiller is so that various |
| 98 |
enhancements of the pdfmark operator can be used or ignored (color, |
| 99 |
border dashing, etc.). Thus the resulting files can be distilled |
| 100 |
using either the latest PC versions or the older Unix versions. |
| 101 |
The hps.pro header was written by Tanmoy Bhattacharya |
| 102 |
(http://nqcd.lanl.gov/people/tanmoy/tanmoy.html) with some additions |
| 103 |
by me. Other PostScript interpreters are free to pick up the pdfm |
| 104 |
operators as well. For instance, Tanmoy has hacked Ghostview to |
| 105 |
pick up the links and make them active. This can be found at |
| 106 |
ftp://gita.lanl.gov/people/tanmoy/hypertex/ . |
| 107 |
|
| 108 |
THINGS TO DO: |
| 109 |
|
| 110 |
1) More robust error checking and avoidance. |
| 111 |
2) Escaping html correctly for external URL's. |
| 112 |
3) More support for external URL's |
| 113 |
4) More flexibility in the appearance of links on the page |
| 114 |
5) Automatically get the papersize and margins correct (hardcoded at the |
| 115 |
moment). |
| 116 |
6) Make C source more platform independent (which T. Rokicki has tried |
| 117 |
very hard to maintain). Code has only been tested on NeXT |
| 118 |
3.3 (Motorola and HP) and Sun/SPARC (SunOS 4.1.4), and HP-UX 9.0.5. No |
| 119 |
effort has been made to make the code portable for MS-DOS, OS/2, VMS, |
| 120 |
or any other of the platforms that appear in the #ifdef statements. |
| 121 |
Code improvements for MS-DOS and OS/2 are forthcoming. |
| 122 |
|
| 123 |
DISCLAIMER: |
| 124 |
|
| 125 |
This software is made available without any implied warranties. See |
| 126 |
http://xxx.lanl.gov/disclaimer.html for a more complete disclaimer. |
| 127 |
|
| 128 |
COPYRIGHT: |
| 129 |
|
| 130 |
The HyperPostScript additions to dvips are Copyright (C) 1994, 1995 by |
| 131 |
Mark Doyle and the University of California. You may modify and |
| 132 |
use this program to your heart's content, so long as you send |
| 133 |
modifications to Mark Doyle and abide by the rest of the dvips |
| 134 |
copyrights. |
| 135 |
|
| 136 |
The hps.lpro file is Copyright (C) 1994, 1995 by Tanmoy Bhattacharya, Mark |
| 137 |
Doyle, and the University of California. You may modify and use |
| 138 |
it to your heart's content, so long as you send modifications |
| 139 |
to Tanmoy Bhattacharya or Mark Doyle and abide by the rest of the |
| 140 |
dvips copyrights. |
| 141 |
|
| 142 |
Mark Doyle |
| 143 |
[email protected] |
| 144 |
http://nqcd.lanl.gov/people/doyle/ |