next up previous
Next: Coordinates and Dimensions Up: Advanced Features Previous: Advanced Features

ePiX, and the epic and eepic Styles

The LATEX epic and eepic styles define commands \path, \dashline, and \dottedline, that take a list of ordered pairs as argument and print the corresponding connect-the-dots path (or dashed/dotted path). These commands are used in a LATEX picture environment just like any LATEX object. Computers are good at generating lists of numbers. In ePiX, you write some lines such as


  /* Comment: The squaring function */
  double f(double t) { 
    return t*t; 
  }

  /* Graph f for t in [-1,1] using 20 steps */ 
  plot(f, -1, 1, 20);
When ePiX is run, the plot command writes the following ePiX stanza to the output file:

%% plot:
\path(0,50)(5,40.5)(10,32)(15,24.5)(20,18)(25,12.5)(30,8)
  (35,4.5)(40,2)(45,0.5)(50,0)(55,0.5)(60,2)(65,4.5)(70,8)
  (75,12.5)(80,18)(85,24.5)(90,32)(95,40.5)(100,50)
%%
%%---------------------------------------------------------%%
The actual numbers depend on the Cartesian bounding box, and on h_size and v_size, the LATEX dimensions of the figure; in this example, ePiX has generated a parabola that fits into a LATEX picture 100 units wide and 50 high.

The .eepic file written by ePiX is human-readable (even formatted and commented), and it may be instructive to look at the output of a short figure. You may edit the output file by hand if necessary, though it is safer (and usually easier) to change the source file and re-run ePiX. Note that ePiX will overwrite an existing .eepic file if so directed. In summary, ePiX is a LATEX pre-processor; it turns a human-friendly picture description into a marked-up list of numbers for LATEX .

An ePiX figure is layered: Objects are drawn over objects that come earlier in the file. Most ePiX objects are transparent, but when using color it is noticeable whether a blue curve goes over or under a magenta one (say). There are only a few ePiX commands that explicitly cover objects under them, but in a complicated figure even the implicit ``masking'' effect bears consideration. Among the commands that do cover previous layers are the masklabel commands, which draw an opaque white rectangle under labels, and circ, which draws a white-filled circle 4 true pt in diameter.


next up previous
Next: Coordinates and Dimensions Up: Advanced Features Previous: Advanced Features
hwang
2002-06-06