PSTricks

The program eukleides allows to include arbitrary PSTricks macros with parameters computed itself. Probably most usefully, it allows arbitrary PSTricks graphics objects to be drawn with coordinates generated by a Eukleides construction.

The syntax is meant to be reasonably close to how one would enter PSTricks code directly into a (La)TeX document. A PSTricks macro starts with a backslash, followed by the PSTricks macro name (e.g. pscircle). There may be an optional list of PSTricks options, enclosed in square brackets (i.e. []), and an optional list of parameters, enclosed in parentheses. We first give a simple example illustrating all of these features, and then explain the syntax in detail.

A B C equilateral
draw(A, B, C, dotted)
\pscurve[arrows="->"](A, B, C)

This produces the following figure:

The detailed syntax is explained below.

Options

Options should be given in form option=value where option is a legitimate PSTricks option name and value is either a quoted string (e.g. arrows="->") or a Eukleides numerical expression (e.g. radius=distance(A,B)). Quotes are removed from strings before emitting PSTricks code. All documented option names should work unquoted, but in case of problems, you can enclose the option name in quotes (e.g. "obscureParameter"=3.145).

A B C equilateral
draw(A, B, C, dotted)
\pscurve[showpoints="true", linewidth=.05, arrows="->"](A, B, C)

The previous example modifies our running example as shown below:

Parameters

Parameters to PSTricks macros should be given as a comma separated list of point expressions, numerical expressions, or quoted strings. Points are output in form (x,y) and quoted strings and numerical expressions are output inside braces. This means that the statement:

\psline("<<->>", A, B)

is translated into the following PSTricks code:

\psline{<<->>}(0.0000,0.0000)(6.0000,0.0000)

Caveats

This brief documentation cannot hope to explain PSTricks to a novice. For more information, you are referred to the documention included with PSTricks, or to the book The LaTeX Graphics Companion by M. Goosens, F. Mittelbach and S. Rahtz. To make matters worse, no checking is done to the PSTricks code generated. This means that it is easy to generate syntactically incorrect TeX using this feature of eukleides. Finally, all PSTricks macros are currently ignored by xeukleides.



Go to: Reference index Previous page Next page Concept index Command index