%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