From 85b7bc695629926641c7cb752fd478adfdf374f3 Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 4 Jul 2010 15:32:09 +0300 Subject: stable 2010-05-24 13:10 --- tex/context/base/m-graph.mkii | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tex/context/base/m-graph.mkii (limited to 'tex/context/base/m-graph.mkii') diff --git a/tex/context/base/m-graph.mkii b/tex/context/base/m-graph.mkii new file mode 100644 index 000000000..db7538e98 --- /dev/null +++ b/tex/context/base/m-graph.mkii @@ -0,0 +1,72 @@ +%D \module +%D [ file=m-graph, +%D version=2000.08.06, +%D title=\CONTEXT\ Extra Modules, +%D subtitle=\METAPOST\ graph module support, +%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. + +%D I finally finished graph support, if only because I could +%D not stand the idea that Karel Wesseling would revert to +%D \PiCTeX. + +% pre 2000.08.06 version +% +% \forceMPTEXgraphictrue +% +% \startMPinitializations +% initialize_numbers ; % make sure that pseudo typesetting is set up +% input graph ; % load the graph package +% Autoform := "@g" ; % change the % template char into @ +% \stopMPinitializations + +%D The latest version does things more automatically (and +%D efficiently when no text processing is needed). For +%D definitions embedded in your document, you need to +%D use \type {@} as template character, in external files, +%D \type {%} is also supported. + +\startMPinclusions + input graph ; +\stopMPinclusions + +%D Graphics that have \type {begingraph} in them are +%D recognized as such and force handling of embedded \TEX\ +%D code. + +\forceMPTEXcheck{begingraph} + +%D If you run into troubles, try: +%D +%D \starttyping +%D \forceMPTEXgraphictrue +%D \stoptyping +%D +%D A demo can be run with: +%D +%D \starttyping +%D texexec --mode=demo --pdf m-graph +%D \stoptyping + +\startMPinclusions + % @# is X_ or Y_; $ is Gxcvlin_ or Gycvlin_; l and h are numeric or string + % It would not be OK to set (@#low,@#high) to a pair expression because $ might + % try to rescale @#low when evaluating the right-hand side for @#high. + vardef Gsetr_@\#(suffix $)(expr l, h) = + Gclbnds_@\# ; + if @\#ctyp>0 : + @\#low = if abs @\#ctyp<>log: $ fi Mlog_Str l ; + @\#high = if abs @\#ctyp<>log: $ fi Mlog_Str h ; + else : + -@\#high = if abs @\#ctyp<>log: $ fi Mlog_Str l ; + -@\#low = if abs @\#ctyp<>log: $ fi Mlog_Str h ; + fi + enddef ; +\stopMPinclusions + +\endinput -- cgit v1.2.3