From 6312e2b2913bc7de6f3c0ba30b993e2b4714edf1 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 5 Dec 2007 13:56:00 +0100 Subject: stable 2007.12.05 13:56 --- tex/generic/context/mptopdf.tex | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tex/generic') diff --git a/tex/generic/context/mptopdf.tex b/tex/generic/context/mptopdf.tex index 84a8aa380..bb9f27d0c 100644 --- a/tex/generic/context/mptopdf.tex +++ b/tex/generic/context/mptopdf.tex @@ -112,6 +112,7 @@ \def\processMPfile#1 % {\pdfoutput=1 + \pdfpkresolution600 \pdfcompresslevel=9 \chardef\makeMPintoPDFobject=1 \hsize=100in @@ -143,4 +144,32 @@ %D file can be converted to \EPS\ using for instance the %D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT. +%D A few helpers: + +{\catcode`\.=12 + \catcode`\p=12 + \catcode`\t=12 + \gdef\WITHOUTPT#1pt{#1}} + +\def\withoutpt#1% + {\expandafter\WITHOUTPT#1} + +\def\negatecolorcomponent#1% #1 = \macro + {\scratchdimen1pt\advance\scratchdimen-#1\onepoint + \ifdim\scratchdimen<\zeropoint\scratchdimen\zeropoint\fi + \edef#1{\withoutpt\the\scratchdimen}} + +\let\negatedcolorcomponent\firstofoneargument + +\def\negatedcolorcomponent#1% + {\ifdim\dimexpr1pt-#1pt\relax<\zeropoint + 0pt% + \else + \expandafter\withoutpt\the\dimexpr1pt-#1pt\relax + \fi} + +\def\negatecolorcomponent#1% #1 = \macro + {\edef#1{\negatedcolorcomponent{#1}}} + + \dump -- cgit v1.2.3