home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / text / tex / 14415 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.8 KB  |  90 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!brunix!doorknob!jgm
  3. From: jgm@cs.brown.edu (Jonathan Monsarrat)
  4. Subject: Re: Venn diagrams
  5. In-Reply-To: Richard P Hayes's message of Mon, 21 Dec 92 23:45:01 EST
  6. Message-ID: <JGM.92Dec22162718@vegas.cs.brown.edu>
  7. Sender: news@cs.brown.edu
  8. Organization: Dept. of Computer Science, Brown University
  9. References: <21DEC92.25650416.0078.MUSIC@MUSICA.MCGILL.CA>
  10. Date: Tue, 22 Dec 1992 21:27:18 GMT
  11. Lines: 77
  12.  
  13.  
  14. Well... it's not an sty file. It's PostScript! But will this help you? :)
  15.  
  16. The below PostScript code defines some Venn diagrams and gives some
  17. examples of how to use them. Do you have to be a PostScript
  18. programmer? I don't think so. If I'm wrong, let me know and I'll patch
  19. together what you need it to look like.
  20.  
  21. -Jon
  22. %! Jon Monsarrat   jgm@cs.brown.edu   Brown University %! Obfuscated PostScript
  23. (LcHdBidZi_hdQ6[PaVa1b4c6F"J4b/>$O<)(di_zk{:UFfUg;ABF)(2n>]Eh:u?<)(P"M#R\(:$T<)
  24. ([gXfSZ]f\\dZbeZeb^fH;`?dR=ZS7)(K P!U!: H<)(9l9cCf:o?$)(7W4]6`:X;=)(U"W#_%:"R-)
  25. (A 5"<&Y%K"F"M,M,S\)i3e.M5F_PZR9>lP-)(wBxEuEs7x;uBq:q<q>hFh7o:=Nj<)(Z#]#b#:$R-)
  26. (m+m+k3S!R+d,;"^<)(GFP\\RamZf;TAP{X{fd<{C7)(4840N2:6N=)([ Z#^&:!c<)(<%?$C$:#8<)
  27. (D!J"L#:!B<)/a{def}def/M{exch}a/S{repeat}a/Q{{40 add}if}a 18{{}forall/R M a/x 2
  28. /y 3/z 5 3{R M mod 1 eq a}S x Q M y Q moveto 57 sub{3{y Q M x Q M 6 2 roll}S
  29. curveto}S z{fill}{stroke}ifelse}S showpage
  30.  
  31.  
  32. ------------------------------- venn.ps ------------------
  33. %!Adobe-2.0 EPSF
  34. %%Creator: Jonathan Monsarrat (jgm@cs.brown.edu)
  35. %%CreationDate: 12/11/92
  36. %%Title: venn.ps
  37. %%BoundingBox: 0 50 450 250
  38. %% PostScript hack by Jon Monsarrat
  39. %% This figure is part of the answer to Exercise 5.1-1 in our CS253 book
  40.  
  41. /radius 20 def
  42. /Symbol findfont 12 scalefont setfont
  43.  
  44. /circle { 2 copy moveto radius 0 rmoveto radius 0 360 arc} def
  45. /venn {
  46.   0 0 moveto 150 0 lineto 150 150 lineto 0 150 lineto
  47.   fill
  48.  
  49. } bind def
  50.  
  51. %  [  str str  shift  -  ]
  52. /shift
  53. {
  54.   0 setgray grestore
  55.   95 10 moveto dup stringwidth pop 2 div neg 0 rmoveto show
  56.   50 10 moveto dup stringwidth pop 2 div neg 0 rmoveto show
  57.   23 61 moveto (A) show
  58.   67 61 moveto (B) show
  59.   45 29 moveto (C) show
  60.   A stroke B stroke C stroke
  61.   90 0 translate
  62. } bind def
  63.  
  64. /A { 38 59 circle } def
  65. /B { 60 59 circle } def
  66. /C { 50 45 circle } def
  67.  
  68. gsave
  69.  
  70. 0 50 translate
  71.  
  72. gsave .5 setgray A clip venn (A) (\310) shift
  73. gsave .5 setgray B clip newpath C fill ((B\307C)) (=) shift
  74. gsave .5 setgray A fill newpath B clip newpath C fill (A\310(B\307C)) (=) shift
  75. gsave .5 setgray A fill B fill ((A\310B)) (\307) shift
  76. gsave .5 setgray A fill C fill ((A\310C)) () shift
  77.  
  78. grestore
  79. 0 150 translate
  80.  
  81. gsave .5 setgray A clip venn (A) (\307) shift
  82. gsave .5 setgray B C clip venn ((B\310C)) (=) shift
  83. gsave .5 setgray A clip newpath B fill C fill (A\307(B\310C)) (=) shift
  84. gsave .5 setgray A clip newpath B fill ((A\307B)) (\310) shift
  85. gsave .5 setgray A clip newpath C fill ((A\307C)) () shift
  86.  
  87.  
  88.  
  89. showpage
  90.