next up previous contents index
Next: The Path Class Up: Attributes Previous: Color and Shading   Contents   Index

PSTricks

PSTricks is a powerful collection of macros, by Timothy van Zandt [5] and others, for incorporating PostScript in LATEX. ePiX uses PSTricks primarily for color filling, but does not yet work seamlessly. PSTricks should be used in a file only when absolutely necessary. The discussion below assumes PSTricks is needed in the file. The command

  use_pstricks(bool);
sets an internal flag that determines whether a path is drawn as an eepic path or as a PSTricks psline. When issued before begin(), this command also synchronizes the PSTricks unitlength and line width with ePiX, and sets the fill style to solid. PSTricks may be activated and deactivated freely, but the first activation must occur in the preamble.

While pstricks is active, commands of the form

  fill_color("<color name>");
  psset("<pstricks command>");
are used to set attributes such as the style and color of paths and filling. The default fill color is "white". This snippet, taken from the sample file contour.xp, shows how to define a new color and use psset().
  use_pstricks();      // synchronize length, etc.
  begin();
  use_pstricks(false); // temporarily disable
  ...
  std::cout << "\n\\newrgbcolor{orange}{1 0.7 0.2}";
  psset("fillcolor=orange, linecolor=green, linewidth=1.5pt");
The PSTricks manual should be consulted for information.

Two major incompatibilities involve and filling and color. Unless the fill style is set explicitly to none, PSTricks fills all paths, even if they are not closed. Second, PSTricks manipulates colors by named strings, so raw output is required to exploit the full power of PSTricks from ePiX.


next up previous contents index
Next: The Path Class Up: Attributes Previous: Color and Shading   Contents   Index
Andrew D. Hwang 2004-09-04