diff options
author | Karl Berry <karl@freefriends.org> | 2008-04-16 00:48:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-04-16 00:48:06 +0000 |
commit | a35845a36ac2ee5a72f83f3820bf60c59285f07c (patch) | |
tree | c81c1d4244e6e1264709b1d3fadeb9b57ad31c50 /Master/texmf-dist/doc | |
parent | 206a7fd1b0bc3f4ed9a490a9b8582e08a7b3b020 (diff) |
metapost package dviincl
git-svn-id: svn://tug.org/texlive/trunk@7436 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/0czytaj.sla | 48 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/0dviincl.inf | 63 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/README | 63 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/README.pl | 48 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/storyx.tex | 22 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/test-bop.mp | 18 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/test-bop.tex | 13 | ||||
-rwxr-xr-x | Master/texmf-dist/doc/metapost/dviincl/testit.bat | 44 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/dviincl/testit.sh | 18 |
9 files changed, 337 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/dviincl/0czytaj.sla b/Master/texmf-dist/doc/metapost/dviincl/0czytaj.sla new file mode 100644 index 00000000000..ec0ddde7653 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/0czytaj.sla @@ -0,0 +1,48 @@ +DVIINCL: made in BOP s.c., bop@bop.com.pl; public domain software +[This is `README' in Polish (slash notation)] + +Chcia/loby si/e czasem w/l/aczy/c do obrazka METAPOST-owego +stron/e z przygotowanego wcze/sniej pliku .dvi (zw/laszcza +w kontek/scie prezentacji Bachotkowo-PDF-owo-typograficznej). +Czasem mo/ze to by/c prostsze ni/z wciskanie kodu +TeX-owego mi/edzy znaczniki `btex' i `etex', +szczeg/olnie w przypadku plik/ow wielostronicowych. + +Marcin Woli/nski wpad/l na pomys/l, by do tego celu wykorzystywa/c +program DVITOMP. Problem wszak/ze w tym, /ze DVITOMP pstrzy +plik wynikowy znacznikami `mpxbreak', nie tolerowanymi +przez METAPOST-a w normalnym trybie przetwarzania. +Ale nie ma /zadnych przeciwwskaza/n, /zeby wynik programu +DVITOMP wst/epnie przetworzy/c, cho/cby AWK-iem lub PERL-em, +a najlepiej... METAPOST-em! + +BOP proponuje nast/epuj/acy spos/ob post/epowania: + +1. Plik .dvi konwertujemy programem DVITOMP: + dvitomp plik_DVI plik_MPX + +2. Przetwarzamy plik MPX za pomoc/a METAPOST-a: + mpost \vardef ifi = str plik_MPX enddef; vardef ofi = str plik_MPY enddef; input fix_brks.mp + (por. za/l/aczony testit.bat dla DOS/WIN32 lub skrypt testit.sh dla U*X); + Powstaje plik MPY, chytrze zmieniony w stosunku do pliku MPX -- wstawione + zostaj/a po prostu instrukcje warunkowe. + + Program `fix_brks.mp' korzysta z za/lo/zenia, /ze operacja `mpxbreak' + umieszczana jest bez zb/ednych spacji w osobnym wierszu. Gdyby jaki/s + wariant DVITOMP-a dzia/la/l inaczej, trzeba by zmodyfikowa/c `fix_brks.mp'. + +3. W pliku METAPOST-owym, w kt/orym chcemy stron/e (strony) wykorzysta/c, + nale/zy skorzysta/c z makierka `fix_page' zdefiniowanego + w pliczku `fix_page.mp', np. tak: + ... + picture p; + p:=fix_page(10,"plik.mpy"); % ,10' to przyk/ladowy numer strony, + % "plik.mpy" to przyk/ladowa nazwa + draw p; + ... + +4. I ju/z. + +Komentarze mile widziane. + +Kontakt: bop@bop.com.pl diff --git a/Master/texmf-dist/doc/metapost/dviincl/0dviincl.inf b/Master/texmf-dist/doc/metapost/dviincl/0dviincl.inf new file mode 100644 index 00000000000..14bca16996e --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/0dviincl.inf @@ -0,0 +1,63 @@ +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. + +SYNOPSIS + +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 + construction: + ... + 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 diff --git a/Master/texmf-dist/doc/metapost/dviincl/README b/Master/texmf-dist/doc/metapost/dviincl/README new file mode 100644 index 00000000000..14bca16996e --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/README @@ -0,0 +1,63 @@ +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. + +SYNOPSIS + +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 + construction: + ... + 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 diff --git a/Master/texmf-dist/doc/metapost/dviincl/README.pl b/Master/texmf-dist/doc/metapost/dviincl/README.pl new file mode 100644 index 00000000000..ec0ddde7653 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/README.pl @@ -0,0 +1,48 @@ +DVIINCL: made in BOP s.c., bop@bop.com.pl; public domain software +[This is `README' in Polish (slash notation)] + +Chcia/loby si/e czasem w/l/aczy/c do obrazka METAPOST-owego +stron/e z przygotowanego wcze/sniej pliku .dvi (zw/laszcza +w kontek/scie prezentacji Bachotkowo-PDF-owo-typograficznej). +Czasem mo/ze to by/c prostsze ni/z wciskanie kodu +TeX-owego mi/edzy znaczniki `btex' i `etex', +szczeg/olnie w przypadku plik/ow wielostronicowych. + +Marcin Woli/nski wpad/l na pomys/l, by do tego celu wykorzystywa/c +program DVITOMP. Problem wszak/ze w tym, /ze DVITOMP pstrzy +plik wynikowy znacznikami `mpxbreak', nie tolerowanymi +przez METAPOST-a w normalnym trybie przetwarzania. +Ale nie ma /zadnych przeciwwskaza/n, /zeby wynik programu +DVITOMP wst/epnie przetworzy/c, cho/cby AWK-iem lub PERL-em, +a najlepiej... METAPOST-em! + +BOP proponuje nast/epuj/acy spos/ob post/epowania: + +1. Plik .dvi konwertujemy programem DVITOMP: + dvitomp plik_DVI plik_MPX + +2. Przetwarzamy plik MPX za pomoc/a METAPOST-a: + mpost \vardef ifi = str plik_MPX enddef; vardef ofi = str plik_MPY enddef; input fix_brks.mp + (por. za/l/aczony testit.bat dla DOS/WIN32 lub skrypt testit.sh dla U*X); + Powstaje plik MPY, chytrze zmieniony w stosunku do pliku MPX -- wstawione + zostaj/a po prostu instrukcje warunkowe. + + Program `fix_brks.mp' korzysta z za/lo/zenia, /ze operacja `mpxbreak' + umieszczana jest bez zb/ednych spacji w osobnym wierszu. Gdyby jaki/s + wariant DVITOMP-a dzia/la/l inaczej, trzeba by zmodyfikowa/c `fix_brks.mp'. + +3. W pliku METAPOST-owym, w kt/orym chcemy stron/e (strony) wykorzysta/c, + nale/zy skorzysta/c z makierka `fix_page' zdefiniowanego + w pliczku `fix_page.mp', np. tak: + ... + picture p; + p:=fix_page(10,"plik.mpy"); % ,10' to przyk/ladowy numer strony, + % "plik.mpy" to przyk/ladowa nazwa + draw p; + ... + +4. I ju/z. + +Komentarze mile widziane. + +Kontakt: bop@bop.com.pl diff --git a/Master/texmf-dist/doc/metapost/dviincl/storyx.tex b/Master/texmf-dist/doc/metapost/dviincl/storyx.tex new file mode 100644 index 00000000000..1e6eeba5298 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/storyx.tex @@ -0,0 +1,22 @@ +\hsize55mm \vsize50mm \raggedbottom +%%% +\hrule +\vskip 1in +\centerline{\bf A SHORT STORY} +\vskip 6pt +\centerline{\sl by A. U. Thor} +\vskip .5cm +Once upon a time, in a distant + galaxy called \"O\"o\c c, +there lived a computer +named R.~J. Drofnats. + +Mr.~Drofnats---or ``R. J.,'' as +he preferred to be called--- +was happiest when he was at work +typesetting beautiful documents. +\vskip 1in +\hrule +\vfill\eject +%%% +\end diff --git a/Master/texmf-dist/doc/metapost/dviincl/test-bop.mp b/Master/texmf-dist/doc/metapost/dviincl/test-bop.mp new file mode 100644 index 00000000000..a348a2798d7 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/test-bop.mp @@ -0,0 +1,18 @@ +% Admittedly silly but instructive example; +input fix_page; + +def silly_display expr p = + draw p shifted (.5,.25) withcolor red; draw p; + pickup pensquare scaled .5pt; + bboxmargin:=0; + draw bbox p withcolor blue; + pickup pencircle scaled .5pt; + draw lrcorner p -- ulcorner p withcolor blue; + draw urcorner p -- llcorner p withcolor blue; +enddef; + +beginfig(101); silly_display fix_page(1, "storyx.mpy"); endfig; +beginfig(102); silly_display fix_page(2, "storyx.mpy"); endfig; +beginfig(103); silly_display fix_page(3, "storyx.mpy"); endfig; + +bye. diff --git a/Master/texmf-dist/doc/metapost/dviincl/test-bop.tex b/Master/texmf-dist/doc/metapost/dviincl/test-bop.tex new file mode 100644 index 00000000000..b64a6b8fad5 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/test-bop.tex @@ -0,0 +1,13 @@ +\input epsf +\nopagenumbers + +\leftline{The first page:} +\epsffile{test-bop.101} +\vfill +\leftline{The second page:} +\epsffile{test-bop.102} +\vfill +\leftline{The third page (the result of missing `setbounds'):} +\epsffile{test-bop.103} + +\end diff --git a/Master/texmf-dist/doc/metapost/dviincl/testit.bat b/Master/texmf-dist/doc/metapost/dviincl/testit.bat new file mode 100755 index 00000000000..69371474a41 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/testit.bat @@ -0,0 +1,44 @@ +@echo off + +:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: +:: PREPARE: +:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: + +:: setting the environment variable texfonts is needed by dvitomp: + +:: mp by Piet van Oostrum and emTeX +:: set texfonts=c:/emtex/tfms! +:: set tex_call=call tex &plain \input +:: set mp_call=mp &plain +:: set dvitomp_call=c:\emtex\mp\mplib\dvitomp + +:: fpTeX, MiKTeX, DJ Delorie +set mp_call=mpost &mpost +set dvitomp_call=dvitomp + +:: COMMON +set tex_call=call tex \input +set dvips_call=dvips -F -K +:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: +:: DO JOB: +:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: + +%tex_call% storyx +%dvitomp_call% storyx.dvi storyx.mpx +:: it is advisable to avoid quotes -- hence the `str' operation: +%mp_call% \vardef ifi = str storyx.mpx enddef; vardef ofi = str storyx.mpy enddef; input fix_brks.mp +%mp_call% test-bop.mp +%tex_call% test-bop.tex +%dvips_call% test-bop.dvi + +:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: +:: CLEAN: +:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: + +del storyx.dvi +del storyx.log +:: del storyx.mpx +:: del storyx.mpy +del test-bop.dvi +del test-bop.log +del test-bop.10* diff --git a/Master/texmf-dist/doc/metapost/dviincl/testit.sh b/Master/texmf-dist/doc/metapost/dviincl/testit.sh new file mode 100644 index 00000000000..6d665c45f24 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/dviincl/testit.sh @@ -0,0 +1,18 @@ +#!/bin/sh +## simple test of DVI file inclusion in EPS file generated by METAPOST +tex storyx +dvitomp storyx.dvi storyx.mpx +## it is advisable to avoid quotes -- hence the `str' operation: +mpost "\vardef ifi = str storyx.mpx enddef; vardef ofi = str storyx.mpy enddef; input fix_brks.mp" +mpost test-bop.mp +tex test-bop.tex +dvips test-bop.dvi -o test-bop.ps +## CLEAN: +rm storyx.dvi +rm storyx.log +# rm storyx.mpx +# rm storyx.mpy +rm test-bop.dvi +rm test-bop.log +rm test-bop.10* + |