Comprehensive TeX Archive Network

Direc­tory tex-archive/graphics/metapost/contrib/macros/dviincl

DVIINCL: made in BOP s.c., bop@bop.com.pl; public domain software
[This is a short information about the DVIINCL utility]

One of the auxiliary programs belonging to every METAPOST package
is DVItoMP, converting a DVI into a METAPOST file. Hence the idea
(due to Marcin Woli/nski) of including a DVI page into the EPS
files generated by METAPOST.

There are, however, several problems to overcome:
  (1) Some DVI items are neglected by DVItoMP, most notably
      `special' commands;
  (2) DVItoMP expects that each page in a DVI file contains
      a vrule of width 1sp positioned at the right lower
      corner of the page; thanks to it, MPtoDVI knows the size
      of the bounding box of a page. If such a rule do not occur
      in the dvi file, the result of conversion is unpredictable,
      e.g., Oostrum's (DOS) implementation simply doesn't write
      `setbounds' commands (which are responsible for assigning
      the proper bounding box to a translated DVI page), while
      Delorie's (Web2C) implementation generates `setbounds'
      commands corresponding to an empty box;
  (3) MP files generated by DVItoMP contain special directives,
      `mpxbreak', that METAPOST does not accept in its ``normal'' mode;

Ad 1. This imposes limits on the possible applications.
Ad 2. It is reasonable to ignore the `setbound' command if the source
      DVI is not generated by MPtoTeX+TeX.
Ad 3. A simple postprocessor is sufficient to circumvent the problem;
      the treatment is so simple, that it can be even METAPOST itself.


1. Use DVItoMP to convert a DVI file into the corresponding MPX file:

dvitomp DVI_file MPX_file

2. Proceed the resulting MPX with METAPOST:

mpost \vardef ifi = str MPX_file enddef; vardef ofi = str MPY_file enddef; input fix_brks.mp

   (cf. a batch file testit.bat for DOS/WIN32 or testit.sh for U*X);
   In the resulting MPY_file, `mpxbreak' directives are replaced with
   `if' commands.

   The program `fix_brks.mp' basic assumes that `mpxbreak' directives occur
   in separate lines, without superfluous spaces.

3. The METAPOST file making use of such a DVI page should use the following
   picture p;
   p:=fix_page(10,"file.mpy"); % `10' is an imaginary page number,
                               % "file.mpy" is an imaginary file name
   draw p;
   where  `fix_page' is a macro defined in file `fix_page.mp'.

4. That's all.

Comments are welcome

e-mail contact: bop@bop.com.pl


Name Size Date Notes
0czy­taj.sla 1927 2000-01-04 01:00
0dvi­incl.inf 2476 2000-01-04 01:00
README 2476 2000-01-04 01:00
README.pl 1927 2000-01-04 01:00
fix_brks.mp 807 2000-01-04 01:00
fix_page.mp 188 2000-01-04 01:00
sto­ryx.tex 415 2000-01-04 01:00
test-bop.mp 544 2000-01-04 01:00
test-bop.tex 238 2000-01-04 01:00
testit.bat 1319 2000-01-04 01:00
testit.sh 474 2000-01-04 01:00

Down­load the con­tents of this pack­age in one zip archive (7.7k).

dvi­incl – In­clude a DVI page into out­put

DVI­toMP is one of the aux­il­iary pro­grams avail­able to any pack­age; it con­verts a DVI file into a file. Us­ing it, one can en­vis­age in­clud­ing a DVI page into an EPS files gen­er­ated by . Such files al­low pages to in­clude other pages.

Pack­age De­tailsdvi­incl
Li­censePublic Do­main Soft­ware
Con­tained inTeXlive as dvi­incl
MikTeX as dvi­incl
Topics DVI pro­ces­sor
Guest Book Sitemap Contact