This is epix.info, produced by makeinfo version 4.9 from epix.texi. This is the manual for ePiX, Version 1.2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Andrew D. Hwang  File: epix.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) ePiX manual *********** This is the manual for ePiX, Version 1.2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Andrew D. Hwang * Menu: * Introduction :: * Getting Started :: * Reference Manual :: * Advanced Topics :: * Software Freedom:: * Acknowledgments:: * Function Index:: * Concept Index:: --- The Detailed Node Listing --- Introduction * Changes in Version 1.2:: * Software Dependencies:: * Installation:: Getting Started * Running `ePiX':: * The Drawing Model:: * Tutorial:: * `C++' Basics:: * Animation:: * Layout Tricks:: Reference Manual * File Structure:: * Picture Size and Aspect Ratio:: * Color:: * Scene Attributes:: * Drawing Attributes:: * Creating and Drawing Objects:: * More About `C++':: * Attribute Quick Reference:: Advanced Topics * Hidden Object Removal:: * Extensions:: * Programmer's Guide::  File: epix.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top 1 Introduction ************** `ePiX', a collection of batch utilities, creates mathematically accurate figures, plots, and animations containing `LaTeX' typography. The input syntax is easy to learn, and the user interface resembles that of `LaTeX' itself: You prepare a scene description in a text editor, then "compile" the input file into a picture. `LaTeX'- and web-compatible output types include a `LaTeX' picture-like environment written with `PSTricks', `tikz', or `eepic' macros; vector images (`eps', `ps', and `pdf'); and bitmapped images and movies (`png', `mng', and `gif'). `ePiX''s strengths include: * Quality of output: `ePiX' creates accurate, publication-quality figures whose appearance matches that of `LaTeX'. Typography may be put in a figure as easily as in an ordinary `LaTeX' document. * Ease of use: Figure objects and their attributes are specified by simple, descriptive commands. * Flexibility: Objects are described by attributes and Cartesian location; as in `LaTeX', printed appearance is determined when the figure is compiled. A well-designed figure can be altered dramatically, yet precisely, with command-line switches or minor changes to the input file. * Power and extendibility: `ePiX' inherits the power of `C++' as a programming language; variables, data structures, loops, and recursion can be used to draw complicated plots and figures with just a few lines of input. External code can be incorporated in a figure with a command line option or by using a Makefile. * Economy of storage and transmission: For a document containing many figures, a compressed tar file of the `LaTeX' sources and `ePiX' files is typically a few percent the size of the compressed PostScript file. * License: `ePiX' is _free software_. You are granted the right to use the program for whatever purpose, and to inspect, modify, and re-distribute the source code, so long as you do not restrict the rights of others to do the same. In short, the license is similar to the terms under which theorems are published. `ePiX' facilitates logical, as opposed to visual, structuring of mathematical figures, analogous to the relationship between `LaTeX' and a word processor. A few stylistic defaults streamline the creation of simple figures, but there are few internal restrictions on the contents or appearance of a figure; aesthetic and practical decisions are left to you. If you are a: * Potential user, you may wish to skip immediately to "Software Dependencies" before investing additional time. * New user, proceed from here until you have enough understanding to run the software, then experiment with the samples files while reading Chapter *Note chapter:started::, , or return to the manual as needed. * More advanced user, browse at will, probably starting with Chapter *Note chapter:ref-man::, . This manual is relatively conversational, and occasionally redundant, especially between portions meant for readers at different levels of familiarity. Throughout, you are assumed to be familiar with `LaTeX' and basic linear algebra: the description of points, vectors, lines, and planes in three-dimensional space. Other material, such as `C++' syntax, is introduced as needed. * Menu: * Changes in Version 1.2:: * Software Dependencies:: * Installation::  File: epix.info, Node: Changes in Version 1.2, Next: Software Dependencies, Prev: Introduction, Up: Introduction 1.1 Changes in Version 1.2 ========================== `ePiX' 1.2.x has been written almost entirely from scratch. The conceptual model is unchanged, but there are a few changes of syntax. If you're new to `ePiX', please skip straight to Section *Note section:software_deps::, . Except as noted below, `ePiX' 1.0 files will compile under Version 1.2. Generally, global variables have been deprecated or removed, and should be replaced by function calls in new files. The following changes are either required, or else strongly recommended (and may become mandatory). * (Mandatory) The global variable tix in a `flix' file must be manipulated through the function tix(). * (Mandatory) The command `use_pstricks()' is obsolete. PSTricks output is obtained systematically as an output format. * (Mandatory) Deprecated "aliases" no longer exist: `triple' (for the `P' class), `D' (for `Deriv'), and `I' (for `Integral'). Lowercase trig function names conflicted with the standard namespace and have been removed. * (Mandatory) Geometric object commands (`circle', `plane', `segment', and `sphere'), which formerly created class objects, now perform drawing just as `ellipse', `line', `rect', etc., do. The classes are available with capitalized names (`Circle', etc.). * (Mandatory) Camera orientation is controlled with functions named `tilt', `pan', and `roll'; each rotates the camera about an axis through the viewpoint, not through the target. * (Recommended) The global size variables x_min, x_max, y_min, y_max, x_size, and y_size should be replaced by the function calls xmin(), etc. (No underscores.) * (Suggested) The camera may be accessed through the function `cam()'. * (Suggested) The size and bounding box are given in one command, such as `picture(P(-1,0), P(1,1), "4x3in")'. The old syntax will be retained indefinitely. * Output is cleanly separated from the internal representation. Figures may be written with a choice of macros--`PSTricks', `tikz', and `eepic' at present--and new output types are easily coded so long as the format supports arbitrary line segments, color, and the ability to place a `LaTeX' box at a specified location. * Colors are a manipulable data type, available in RGB, CMY, CMYK, and Gray models. `xcolor'-style operations, such as color model conversion, blending, superposition, and inversion are provided. The camera has a filter which affects the colors of all scene elements. Filters performing CMYK separation are provided. * Color filling is controlled with declarations, similarly to line colors in `ePiX' 1.0. Arrows and markers of type spot, dot, ddot, and circ are now colored like other markers. Parametric surfaces may be color-shaded. If a figure contains many shaded elements, a color-capable output format (e.g.\ `PSTricks' or `tikz') should be used for efficiency. Filled regions are implemented as fine hatching in `eepic'. * An `axis' class provides coordinate axes with labels in a variety of styles: decimals or scientific notation of specified precision, fractions, trig fractions, logarithmic labels in arbitrary (integer) base, and user-supplied styles. * `ePiX' 1.2.x performs page layout. Sub-figures may be manipulated flexibly. The sample files give several applications. * Non-member intersection operators for circles, planes, spheres, and segments are provided. A "non-generic" intersection does not throw an exception, but instead returns an undrawable "malformed" object.  File: epix.info, Node: Software Dependencies, Next: Installation, Prev: Changes in Version 1.2, Up: Introduction 1.2 Software Dependencies ========================= If you run GNU/Linux, a BSD, or Solaris, you probably have (and can surely install) all the external software needed to use `ePiX'. On Mac OS X, you will need the Apple developer tools and an X server (XCode and XDarwin on the Tiger disks), and the free `fink' package manager to build a GNU environment. For Windows, you'll need to install Cygwin and several packages. Detailed instructions are given below. "Under the hood", an input file is successively converted to a `LaTeX' picture; `dvi'; PostScript, `pdf' or `eps'; and if desired, to a bitmapped image or movie. Four shell scripts--`epix', `laps', `elaps', and `flix'--automate the various file format conversions. `ePiX' consists of a `C++' library, header, and shell scripts, and requires GNU `bash' and a compiler _for normal use_. For complete functionality, you need `g++' (Version 3.2 or later), `bash', a text editor (`ePiX' works particularly well with `emacs'), a `LaTeX' distribution, `Ghostscript', `gv' (or your favorite PS/PDF previewer), and `ImageMagick'. GNU `grep' and `sed' are good to have. You may need additional "developer packages" (`binutils', `make') in order to build `ePiX'. The more up to date your software is, the better your experience is likely to be, but bleeding edge versions are not necessary, or even always desirable. Aside from their reliance on specific programs, `ePiX''s shell scripts are written using Unix-style pathnames. Thus, the most straightforward way to use `ePiX' is to install a GNU environment. Jay Belanger's `emacs' mode allows you to write, compile, and view `ePiX' figures without leaving `emacs'. If you use another editor, you'll want to create template source files so you don't have to type boilerplate code each time you write a new figure. Cygwin can be used to run `ePiX' under Windows. Download `setup.exe' from `http://www.cygwin.com', then install the packages you need. The following are recommended, and sufficient for the actions described in this manual. (Archive) bzip2, tar (Devel) binutils, coreutils, gcc, gcc-g++, make, sed (Editors) emacs, emacs-X11, vim (Graphics) ImageMagick, ghostscript-base, ghostscript-x11, gv (Publishing) tetex (all) (Shells) bash, bash-completion (X11) X-start-menu-icons, X-startup-scripts, XFree86-lib-compat, xorg-x11-fscl, xorg-x11-fsrv  File: epix.info, Node: Installation, Prev: Software Dependencies, Up: Introduction 1.3 Installation ================ `ePiX' is distributed over the World-Wide Web as source code. Packages may be found at `http://mathcs.holycross.edu/~ahwang/epix/ePiX.html' The latest stable release is also on the CTAN mirrors, in the `graphics' directory. (Some users of Red Hat have reported file permission problems when unpacking the CTAN tarballs. If you encounter this difficulty, please try downloading the sources from the project main page.) Unpack the compressed tar file with the appropriate command: tar -zxvf epix-x.y.z.tar.gz tar -jxvf epix-x.y.z.tar.bz2 (`x.y.z' is the version number) or, if your `tar' doesn't do decompression, gunzip -c epix-x.y.z.tar.gz | tar -xvf - bzcat epix-x.y.z.tar.bz2 | tar -xvf - `cd' to the source directory, `epix-x.y.z'. The `INSTALL' file contains detailed installation instructions. If you're impatient, the short of it is `./configure [--options]; make; make install'. Run `./configure --help' for a list of options. By default, `ePiX' installs in subdirectories of `/usr/local'; if you want to install elsewhere, supply `./configure' with the appropriate `--prefix'. You may also want to consult `POST-INSTALL' for information on setting your `PATH' variable so your shell can find `ePiX'. The manual and sample files are in `/usr/local/share/doc/epix'. There are two mailing lists, one for user questions, one for development discussion. Please visit `http://savannah.nongnu.org/mail/?group=epix' to subscribe.  File: epix.info, Node: Getting Started, Next: Reference Manual, Prev: Introduction, Up: Top 2 Getting Started ***************** This chapter describes the basics of creating figures in `ePiX' for readers familiar with `LaTeX' but completely new to `C++'. No detailed knowledge of `C++' is needed to use `ePiX', only a bit of grammar that is easily absorbed by example. Section *Note section:running::, describes the commands (shell scripts) comprising `ePiX', and explains how to set up a graphical environment using standard *nix programs. Section *Note section:overview::, briefly describes figure creation. Section *Note section:tutorial::, presents a few files side-by-side with their output, and should be read at a computer so you can run the exercises. * Menu: * Running `ePiX':: * The Drawing Model:: * Tutorial:: * `C++' Basics:: * Animation:: * Layout Tricks::  File: epix.info, Node: Running `ePiX', Next: The Drawing Model, Prev: Getting Started, Up: Getting Started 2.1 Running `ePiX' ================== An "input file" is a human-written figure specification containing `ePiX' commands. An "output file" is machine-created, and is included directly into a `LaTeX' document with the appropriate packages. Conversion ("compiling" a figure) is accomplished with four shell scripts, `laps', `epix', `elaps', and `flix'. Each script has a preferred extension for its input files, and is invoked with a command of the form