From b6124d63c1af3ac70728f72deb65cb25179997f3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 14 Sep 2006 20:13:16 +0000 Subject: beta update from hans git-svn-id: svn://tug.org/texlive/trunk@2130 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/context/mptopdf.tex | 137 +++++++++++----------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/Master/texmf-dist/tex/generic/context/mptopdf.tex b/Master/texmf-dist/tex/generic/context/mptopdf.tex index 97f2890a645..c9e4057b244 100644 --- a/Master/texmf-dist/tex/generic/context/mptopdf.tex +++ b/Master/texmf-dist/tex/generic/context/mptopdf.tex @@ -2,103 +2,104 @@ %D [ file=mptopdf, %D version=2000.03.27, %D title=\METAPOST, -%D subtitle=conversion to \PDF, +%D subtitle=conversion to \PDF, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. -%D The file \type {mptopdf} provides a quick way to convert -%D \METAPOST\ files to \PDF\ using a slightly stripped down -%D plain \TEX, \PDFTEX, and a few \CONTEXT\ modules. +%D The file \type {mptopdf} provides a quick way to convert +%D \METAPOST\ files to \PDF\ using a slightly stripped down +%D plain \TEX, \PDFTEX, and a few \CONTEXT\ modules. %D %D First generate a format, which in \WEBC\ looks like: %D -%D \starttyping -%D pdftex --ini mptopdf -%D \stoptyping +%D \starttyping +%D pdftex --ini mptopdf +%D \stoptyping %D -%D or: +%D or: %D -%D \starttyping -%D texexec --make --tex=pdftex --format=mptopdf --alone -%D \stoptyping +%D \starttyping +%D texexec --make --tex=pdftex --format=mptopdf --alone +%D \stoptyping %D -%D Since this conversion only works with \PDFTEX\ or \PDFETEX, -%D the session is aborted when another \TEX\ is used. When -%D finished, the resulting \type {fmt} file should be moved to -%D the right location. +%D Since this conversion only works with \PDFTEX\ or \PDFETEX, +%D the session is aborted when another \TEX\ is used. When +%D finished, the resulting \type {fmt} file should be moved to +%D the right location. %D -%D The conversion itself is accomplished by: +%D The conversion itself is accomplished by: +%D +%D \starttyping +%D pdftex &mptopdf \relax filename.number +%D \stoptyping %D -%D \starttyping -%D pdftex &mptopdf \relax filename.number -%D \stoptyping -%D %D The \type {\relax} is needed since we don't want to process %D the file directly. Instead we pick up the filename using %D \type {\everypar}. Since this file is still the first one %D we load, although delayed, the jobname is as we expect. So, %D at least in \WEBC, the result of the conversion comes %D available in the file \type {filename.pdf}. This conversion -%D process is roughly compatible with: +%D process is roughly compatible with: %D -%D \starttyping +%D \starttyping %D texexec --pdf --fig=c --result=filename filename.number -%D \stoptyping +%D \stoptyping %D -%D This uses \CONTEXT, and is therefore slower. Therefore, -%D we provide a small \PERL\ script that does a faster job, -%D using the minimal format. Given that a format is -%D generated, one can say: +%D This uses \CONTEXT, and is therefore slower. Therefore, +%D we provide a small \PERL\ script that does a faster job, +%D using the minimal format. Given that a format is +%D generated, one can say: %D -%D \starttyping -%D mptopdf somefile +%D \starttyping +%D mptopdf somefile %D mptopdf somefile.123 -%D mptopdf mp*.* -%D \stoptyping -%D -%D The results are copied into files named \type -%D {somefile-number}. This mechanism will also be available +%D mptopdf mp*.* +%D \stoptyping +%D +%D The results are copied into files named \type +%D {somefile-number}. This mechanism will also be available %D in a next release of \TEXUTIL. -%D The \TEX\ implementation is rather simple, since we use some +%D The \TEX\ implementation is rather simple, since we use some %D generic \CONTEXT\ modules. Because we need a few register -%D allocation macros, we preload plain \TEX. We don't load -%D fonts yet. +%D allocation macros, we preload plain \TEX. We don't load +%D fonts yet. \input syst-tex -%D We check for the usage of \PDFTEX, and quit if another -%D \TEX\ is used. +%D We check for the usage of \PDFTEX, and quit if another +%D \TEX\ is used. -\ifx\pdfoutput\undefined - \message{Sorry, you should use pdf(e)TeX instead.} - \expandafter \endinput +\ifx\pdfoutput\undefined + \message{Sorry, you should use pdf(e)TeX instead.} + \expandafter \endinput \fi -%D The conversion to \PDF\ is carried out by macros, that -%D are collected in the file: +%D The conversion to \PDF\ is carried out by macros, that +%D are collected in the file: -\input supp-pdf +\input supp-mis +\input supp-pdf \input supp-mpe \MPcmykcolorstrue \MPspotcolorstrue -%D We use no output routine. +%D We use no output routine. -\output{} +\output{} -%D Since we need to calculate and set the bounding box, +%D Since we need to calculate and set the bounding box, %D we definitely don't want to indent paragraphs. -\parindent=0pt +\parindent=0pt %D We use \type {\everypar} to pick up the filename and -%D process the \METAPOST\ graphic. +%D process the \METAPOST\ graphic. -\everypar{\processMPfile} +\everypar{\processMPfile} %D The main macro shows a few \PDFTEX\ primitives. The main %D work is done by the macro \type {\convertMPtoPDF} which is @@ -107,39 +108,39 @@ %D learn a few (\PDF) tricks. Apart from some path %D transformations, which are needed since \PDF\ has a %D different vision on paths, the graphic is positioned in -%D such a way that accuracy in \PDF\ xforms is guaranteed. +%D such a way that accuracy in \PDF\ xforms is guaranteed. \def\processMPfile#1 % - {\pdfoutput=1 + {\pdfoutput=1 \pdfcompresslevel=9 \chardef\makeMPintoPDFobject=1 \hsize=100in \vsize=\hsize - \hoffset=-1in + \hoffset=-1in \voffset=\hoffset \topskip=0pt \setbox0=\vbox{\convertMPtoPDF{#1}{1}{1}}% \ifdim\wd0<1in \message{[warning: width<1in]}\fi \ifdim\ht0<1in \message{[warning: height<1in]}\fi - \pdfpageheight=\ht0 - \pdfpagewidth=\wd0 + \pdfpageheight=\ht0 + \pdfpagewidth=\wd0 \box0 \bye} -%D The \type {\chardef} forces the converter to build a so +%D The \type {\chardef} forces the converter to build a so %D called xform object. This is needed in case the graphic -%D uses special trickery, like shading. +%D uses special trickery, like shading. -%D Since \ACROBAT\ has troubles with figures smaller than -%D 1~inch, we issue a warning. When embedding graphics in -%D documents, a size less that 1~inch does not harm. In -%D order to overload runtime directives in the \PDFTEX\ -%D configuration file, we set the offsets and output method +%D Since \ACROBAT\ has troubles with figures smaller than +%D 1~inch, we issue a warning. When embedding graphics in +%D documents, a size less that 1~inch does not harm. In +%D order to overload runtime directives in the \PDFTEX\ +%D configuration file, we set the offsets and output method %D in the macro. -%D +%D %D The resulting \PDF\ file is about as efficient as such a %D self contained file can be. However, if needed, this \PDF\ -%D file can be converted to \EPS\ using for instance the -%D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT. +%D file can be converted to \EPS\ using for instance the +%D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT. \dump -- cgit v1.2.3