If the source file satisfies the constraints of the prerex(5) format, a chart description may be edited using the prerex(1) interactive editor (as well as any conventional text editor).
within which the following commands may be used to produce course boxes, minis, text-lines, and arrows. The order of commands is not significant except that the commands for the source and target boxes of an arrow should precede the command for the arrow.
where x,y are the coordinates of the centerpoint of the box, relative to the origin of the coordinate system at the lower-left corner of the diagram. The code, title, and timetable arguments are arbitrary (well-bracketed) text, possibly with LaTeX markup.
The following are similar but take an additional argument to specify the (non-default) background color of the course box:
The following instruction places a line of text centered at the coordinates:
There are several differences between minis and text-lines. The maximum length allowed for a course-code may be less than that for a text-line. A sans-serif font and a reduced font size is used for a course-code. A course-code may be hyperlinked but a text-line is not (except when the coordinate grid is on). A \parbox command may be used in the text-line argument if more than one line is desired.
These produce, respectively, solid, dotted, and dashed arrows from the course box (or mini or text-line) centered at coordinates x0,y0 to the course box centered at coordinates x1,y1.
Arrows by default have a non-zero curvature (unless they are very short). It is possible to override the default curvature for a particular arrow by using the instructions
where c is an integer in the range 0-100 specifying the desired curvature; for example, c=0 will produce a straight arrow. To change the default curvature, the user program may redefine the \DefaultCurvature command.
The grid lines will be covered by course boxes and arrows. The \grid command also redefines the \CourseURL command so that, if the mouse cursor is placed over a box or mini in (some) PDF viewers, the coordinates of the box, mini, or text-line will be displayed as follows: in the status bar in xpdf and gpdf, and in a "tooltip" in recent versions of kpdf (now re-named okular), evince, and the Adobe Reader. Similarly, the coordinates of the source and target boxes of arrows are displayed if the mouse hovers over the mid-point of an arrow, Such coordinate displays make it easier to edit chart descriptions. When the grid is on, the mid-point of every arrow is highlighted by a "bullet".
The prerex package at http://www.ctan.org/tex-archive/graphics/prerex/ has a patch for kpdf/okular(1) to make it display URIs in tooltips and also capture coordinates of course boxes, arrows and background points in the X selection clipboard (for pasting into a command being composed at the prerex(1) prompt). There is also a GUI frontend vprerex(1) to the prerex(1) editor which incorporates a minimalistic prerex-enabled PDF viewer.
where the argument should be in the range 0-100; 0 means no curvature.
where the arguments supplied at the call are the x and y coordinates of the box or mini and the course code.
where LightYellow is defined by
which defines the absolute size of a coordinate unit; this yields 10 pixels per coordinate unit if the chart is converted to an image at 125 dpi.
These must be re-defined together if the image-map data are to be correct.
which is the y-coordinate of the top of the diagram (reduced to 65 in landscape mode); the nominal diagram width is \textwidth / \unit + 10.
The following define the thicknesses of the three kinds of arrows, and the thickness of bold boxes:
The following command is used to change to a smaller size for course codes, timetable information, and mini-course codes:
The following command defines the baseline adjustment for the stand-alone arrows and boxes; this parameter is font-dependent.
To convert a chart to a compact but reasonably high-quality image, it is suggested to use the convert(1) tool of ImageMagick(1) as follows:
or
The density parameter specifies the number of pixels per inch; if this is too small, the image is of poor quality, and if it is too large, the image file is too big. By default, the shell script generated by prerex.sty crops the image at the southeast corner. It is possible to use a PNG compression application such as optipng(1) to reduce the file-size of the cropped image (without loss of quality).
To improve the appearance, boxes are drawn with slightly rounded corners. The half-course boxes are assigned a minimum height to give a more uniform appearance to horizontal rows of such boxes. The mini and text boxes have white frames and their fill colour is white, which is assumed to be the background colour of the chart. A text box is not normally hyperlinked; however, if the coordinate grid is on, it is hyperlinked and its chart coordinates are encoded in the URI.
Arrows with a small height and arrows whose source and target points have equal x or y coordinates are always draw straight (using a specialized and simpler macro) unless an explicit non-zero curvature argument is provided. If the coordinate grid is on, a hyperlink with the source and target coordinates is placed at the mid-point of the arrow. A wider background white edge is drawn below an arrow to improve the appearance of crossing arrows; the background also ensures visibility of the arrow when the coordinate grid is on. A thin white arrow (with a visible arrowhead) is drawn beneath the visible arrow to obtain a thin arrowhead.
When the coordinate grid is drawn, the CourseURL command is re-defined to pass node coordinates in URIs. Also, two "anchor" hyperlinks are inserted at the southwest and northeast corners of the diagram to allow prerex-enabled PDF viewers to compute chart coordinates.
To support HTML versions of charts, prerex.sty generates a script to crop a chart image at the southeast corner, allowing descriptive notes below the chart to be treated as ordinary text. Also, it generates image-map data for use with an HTML image map. To obtain absolute page coordinates, the zsavepos, zposx and zposy commands are used; the page coordinates are converted into pixel coordinates for cropping and image-map use.