diff options
author | Hans Hagen <pragma@wxs.nl> | 1999-12-30 00:00:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 1999-12-30 00:00:00 +0100 |
commit | dd50c74f0702bff05e96d5d3994316405414663e (patch) | |
tree | 1afbfa61cdd0721fa4eea8892972a6a183b05610 /tex/generic/context/m-metapo.tex | |
parent | b386eada290e225dc25484133c2bc5697024a822 (diff) | |
download | context-dd50c74f0702bff05e96d5d3994316405414663e.tar.gz |
stable 1999.12.30
Diffstat (limited to 'tex/generic/context/m-metapo.tex')
-rw-r--r-- | tex/generic/context/m-metapo.tex | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/tex/generic/context/m-metapo.tex b/tex/generic/context/m-metapo.tex new file mode 100644 index 000000000..6c2fa6fee --- /dev/null +++ b/tex/generic/context/m-metapo.tex @@ -0,0 +1,89 @@ +%D \module +%D [ file=m-metapo, +%D version=1999.03.26, +%D title=\LATEX\ Modules, +%D subtitle=\METAPOST\ Inclusion, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ distribution and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D We quit when \CONTEXT\ is found and use some deep down +%D macro to trigger this: + +\ifx\undefined\dodoplaceexternalfigure \else \expandafter \endinput \fi + +%D \macros +%D {includeMPgraphics} +%D +%D This rather small \LATEX\ module is dedicated to David +%D Arnold. It takes care of including the fonts used in +%D \METAPOST\ graphics in the file. This hack is needed when +%D one uses another \DVI\ driver than \DVIPS. This module +%D falls back on the generic \CONTEXT\ support module: + +\ifx\undefined\includeMPfonts \input supp-mps.tex \relax \fi + +%D Instead of using \type {\includegraphics}, one should use its +%D little brother \type {\includeMPgraphics}. This macro takes +%D the same arguments. + +\def\includeMPgraphics#1#% + {\leavevmode\vbox\bgroup\hbox\bgroup + \def\includeMPgraphics##1% + {\includeMPfonts{##1}% + \includegraphics#1{##1}% + \egroup\egroup}% + \includeMPgraphics} + +%D An example of using this module is given below: +%D +%D \starttypen +%D \documentclass[10pt]{article} +%D +%D \usepackage{graphicx} +%D \usepackage{m-metapo} +%D +%D \begin{document} +%D \includeMPgraphics{somefile.1} +%D \includeMPgraphics[angle=90]{somefile.2} +%D \end{document} +%D \stoptypen +%D +%D This module needs \type {supp-mps} and \type {supp-mis}, +%D that both are present in the \CONTEXT\ path. +%D +%D Pleas do not forget to say \type {prologues:=2} at the +%D top of the metapost file! +%D +%D For non \LATEX\ (and \CONTEXT) users we provide an +%D alternative inclusion macro. This one has no optional +%D arguments. + +\ifx\includegraphics\undefined + + \ifx\undefined\dogetEPSboundingbox \input supp-eps.tex \relax \fi + + \def\includeMPgraphics#1% + {\hbox\bgroup + \includeMPfonts{#1}% + \dogetEPSboundingbox{#1}{\dimen2}{\dimen4}{\dimen6}{\dimen8}% + \vbox to \dimen8 + {\forgetall + \hsize\dimen6 + \vfill + \hbox to \hsize + {\special + {PSfile="#1"\space + llx=\EPSllx\space + lly=\EPSlly\space + urx=\EPSurx\space + ury=\EPSury\space}}}% + \egroup} + +\fi + +\endinput |