---
name: "prerex"
section: "5"
platform: "linux"
package: "texlive-doc"
version: "2026.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/prerex/5"
---

# prerex(5)

## NAME

prerex\_format -- a format for prerequisite-chart descriptions

## DESCRIPTION

This manual describes the format of  prerequisite-chart descriptions that can be processed by  **\[pdf\]latex** (normally using a suitable  [**prerex.sty**(7)](/prerex.sty/7.md) style file) and edited using the [**prerex**(1)](/prerex/1.md) interactive editor (or by any conventional text editor).

## TERMINOLOGY

A prerequisite chart consists of a number of  *course boxes,* linked by  *arrows.* Courses are either *half* or *full,* and may be *required* or *optional* (or neither). Each course box can contain a course *code* (upper left corner), a course  *title* (lower half), and *timetable* information (upper right corner). An arrow can be either a *prerequisite* (solid), a *corequisite* (dotted), or  *recommended* (dashed). When a conventional arrow would be inappropriate, a *mini* course just above a target box can be used.

## STRUCTURE

The file should contain exactly one instance of a LaTeX environment

**\\begin{chart}** *instruction ...* **\\end{chart}**

with at most one  *instruction* per line. Note that a program such as  [**prerex**(1)](/prerex/1.md) analyzes prerex-format files  *without* using TeX; for example,  macro definitions will be ignored and macro calls will  not be expanded.

Instructions may be preceded by white space. Lines that start with % are treated as comments and ignored. The order of instructions is not significant except that the instruction for the source and target box o an arrow should  *precede* the instruction for the arrow.  The instruction formats are described in the following sections.

## COURSE BOXES

The instructions producing course boxes have the following forms:

**\\halfcourse** *x,y***:{***code***}{***title***}{***timetable***}**

**\\fullcourse** *x,y***:{***code***}{***title***}{***timetable***}**

**\\reqhalfcourse** *x,y***:{***code***}{***title***}{***timetable***}**

**\\reqfullcourse** *x,y***:{***code***}{***title***}{***timetable***}**

**\\opthalfcourse** *x,y***:{***code***}{***title***}{***timetable***}**

**\\optfullcourse** *x,y***:{***code***}{***title***}{***timetable***}**

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:

-

  **\\halfcoursec** *x,y***:{***code***}{***title***}{***timetable***}{***color***}**

-

  **\\fullcoursec** *x,y***:{***code***}{***title***}{***timetable***}{***color***}**

-

  **\\reqhalfcoursec** *x,y***:{***code***}{***title***}{***timetable***}{***color***}**

-

  **\\reqfullcoursec** *x,y***:{***code***}{***title***}{***timetable***}{***color***}**

-

  **\\opthalfcoursec** *x,y***:{***code***}{***title***}{***timetable***}{***color***}**

-

  **\\optfullcoursec** *x,y***:{***code***}{***title***}{***timetable***}{***color***}**

## MINI COURSE BOXES AND TEXT

A mini course is produced by an instruction of the form

**\\mini** *x,y***:{***code***}**

A text line is inserted into the chart by an instruction of the form

**\\text** *x,y***:{***line-of-text***}**

The maximum allowed length of a course-code may be smaller that the maximum allowed for a line of text.

## ARROWS

Arrows between course boxes (or from a mini to a course box) are produced by instructions of the form

**\\prereq** *x0,y0,x1,y1***:**

**\\coreq** *x0,y0,x1,y1***:**

**\\recomm** *x0,y0,x1,y1***:**

These produce, respectively, solid, dotted, and dashed arrows from the course box (or mini) centered at coordinates *x0,y0* to the course box centered at coordinates *x1,y1.*

In some implementations,  certain arrows by default have a non-zero curvature.  It is possible to override the default curvature  for a particular arrow by using the instructions

**\\prereqc** *x0,y0,x1,y1;c***:**

**\\coreqc** *x0,y0,x1,y1;c***:**

**\\recommc** *x0,y0,x1,y1;c***:**

where *c* is an integer in the range -100: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.

## COORDINATE GRID

The following instruction produces a coordinate grid, which is useful for editing a diagram:

**\\grid**

This is normally placed before all the other instructions so that grid lines are in the background, covered by course boxes, minis, and arrows.

## WEB LINKS

Course boxes may be linked to web addresses.   The URL for course boxes may be set by the user by redefining the **\\CourseURL** command; when called for a course box, it is supplied with three arguments, the *x* and *y* coordinates of the box, mini, or textline, and the *code* argument of the course box. For example,

**\\renewcommand{\\CourseURL}\[3\]{http://www.cs.queensu.ca/undergraduate/courses/#3.html}**

is appropriate for courses at the School of Computing, Queen's University. The first two arguments can be used to display the coordinates of a box, mini, or textline in some PDF viewers while the mouse hovers over it when the source file is being edited.

## AUTHOR

R. D. Tennent (rdt@cs.queensu.ca)

## SEE ALSO

[**prerex**(1)](/prerex/1.md), [**prerex.sty**(7)](/prerex.sty/7.md).
