summaryrefslogtreecommitdiff
path: root/tex/context/base/m-graph.mkii
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-07-04 15:32:09 +0300
committerMarius <mariausol@gmail.com>2010-07-04 15:32:09 +0300
commit85b7bc695629926641c7cb752fd478adfdf374f3 (patch)
tree80293f5aaa7b95a500a78392c39688d8ee7a32fc /tex/context/base/m-graph.mkii
downloadcontext-85b7bc695629926641c7cb752fd478adfdf374f3.tar.gz
stable 2010-05-24 13:10
Diffstat (limited to 'tex/context/base/m-graph.mkii')
-rw-r--r--tex/context/base/m-graph.mkii72
1 files changed, 72 insertions, 0 deletions
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