| 1 |
DVIINCL: made in BOP s.c., [email protected]; public domain software |
| 2 |
[This is a short information about the DVIINCL utility] |
| 3 |
|
| 4 |
One of the auxiliary programs belonging to every METAPOST package |
| 5 |
is DVItoMP, converting a DVI into a METAPOST file. Hence the idea |
| 6 |
(due to Marcin Woli/nski) of including a DVI page into the EPS |
| 7 |
files generated by METAPOST. |
| 8 |
|
| 9 |
There are, however, several problems to overcome: |
| 10 |
(1) Some DVI items are neglected by DVItoMP, most notably |
| 11 |
`special' commands; |
| 12 |
(2) DVItoMP expects that each page in a DVI file contains |
| 13 |
a vrule of width 1sp positioned at the right lower |
| 14 |
corner of the page; thanks to it, MPtoDVI knows the size |
| 15 |
of the bounding box of a page. If such a rule do not occur |
| 16 |
in the dvi file, the result of conversion is unpredictable, |
| 17 |
e.g., Oostrum's (DOS) implementation simply doesn't write |
| 18 |
`setbounds' commands (which are responsible for assigning |
| 19 |
the proper bounding box to a translated DVI page), while |
| 20 |
Delorie's (Web2C) implementation generates `setbounds' |
| 21 |
commands corresponding to an empty box; |
| 22 |
(3) MP files generated by DVItoMP contain special directives, |
| 23 |
`mpxbreak', that METAPOST does not accept in its ``normal'' mode; |
| 24 |
|
| 25 |
Ad 1. This imposes limits on the possible applications. |
| 26 |
Ad 2. It is reasonable to ignore the `setbound' command if the source |
| 27 |
DVI is not generated by MPtoTeX+TeX. |
| 28 |
Ad 3. A simple postprocessor is sufficient to circumvent the problem; |
| 29 |
the treatment is so simple, that it can be even METAPOST itself. |
| 30 |
|
| 31 |
SYNOPSIS |
| 32 |
|
| 33 |
1. Use DVItoMP to convert a DVI file into the corresponding MPX file: |
| 34 |
|
| 35 |
dvitomp DVI_file MPX_file |
| 36 |
|
| 37 |
2. Proceed the resulting MPX with METAPOST: |
| 38 |
|
| 39 |
mpost \vardef ifi = str MPX_file enddef; vardef ofi = str MPY_file enddef; input fix_brks.mp |
| 40 |
|
| 41 |
(cf. a batch file testit.bat for DOS/WIN32 or testit.sh for U*X); |
| 42 |
In the resulting MPY_file, `mpxbreak' directives are replaced with |
| 43 |
`if' commands. |
| 44 |
|
| 45 |
The program `fix_brks.mp' basic assumes that `mpxbreak' directives occur |
| 46 |
in separate lines, without superfluous spaces. |
| 47 |
|
| 48 |
3. The METAPOST file making use of such a DVI page should use the following |
| 49 |
construction: |
| 50 |
... |
| 51 |
picture p; |
| 52 |
p:=fix_page(10,"file.mpy"); % `10' is an imaginary page number, |
| 53 |
% "file.mpy" is an imaginary file name |
| 54 |
draw p; |
| 55 |
... |
| 56 |
where `fix_page' is a macro defined in file `fix_page.mp'. |
| 57 |
|
| 58 |
|
| 59 |
4. That's all. |
| 60 |
|
| 61 |
Comments are welcome |
| 62 |
|
| 63 |
e-mail contact: [email protected] |