Debian Codegraph @

texmf-dist/doc/latex/prerex/intro.tex

raw
1 \documentclass[11pt]{article}
2 \usepackage[textwidth=6.5in,textheight=8.5in]{geometry}
3 \usepackage[medium,semibold]{cabin}
4 \listfiles
5 \usepackage{prerex}
6
7 \renewcommand{\textfraction}{0.0}
8 \renewcommand{\topfraction}{1.00}
9 \renewcommand{\bottomfraction}{1.00}
10
11 \usepackage[osf]{mathpazo}
12
13 \definecolor{light}{gray}{0.5}
14 \definecolor{bg}{rgb}{0.99,0.96,0.90}
15
16 \usepackage{graphicx}
17
18 \def\LaTeX{\mbox{LaTeX}}
19 \def\TeX{TeX}
20 \def\MikTeX{\mbox{MikTeX}}
21
22
23 \newcommand{\myurl}[1]{\textcolor{blue}{\underline{\textcolor{black}{\url{#1}}}}}
24 \newcommand{\myhref}[2]{\href{#1}{\textcolor{blue}{\underline{\textcolor{black}{#2}}}}}
25
26 \title{Prerex-Formatted Prerequisite Charts\\[1ex]\Large An Introduction}
27 \date{\today}
28 \author{Bob Tennent\\School of Computing, Queen's University\\\texttt{[email protected]}}
29
30 \begin{document}
31 \sloppy
32 \maketitle
33 \thispagestyle{empty}
34
35 \tableofcontents
36
37
38 \section{Introduction}
39 This document is intended to help a user who might want to create or edit prerex-formatted
40 prerequisite charts, but is finding the installation and usage instructions in the \textsc{readme}
41 and manual pages to be incomprehensible.
42
43 \section{Frequently Asked Questions}
44
45
46 \subsection{Prerequisite Charts}
47
48 \subsubsection*{What is a prerequisite chart?}
49
50 A prerequisite chart gives an attractive graphical presentation of courses in a
51 program (or set of related programs), organized by terms or years, linked
52 by pre- and co-requisite arrows, and, when possible, supplemented by
53 timetable information; Figure~\ref{chart}
54 on page~\pageref{chart}
55 is a small example.
56
57 \input{introchart1}
58
59 \subsubsection*{Who would use a prerequisite chart?}
60
61 Prerequisite charts are useful to students selecting courses and planning their
62 programs, and to faculty and staff advising students and managing
63 curriculum development.
64
65 \subsubsection*{The information is in calendars and on-line; why is a prerequisite chart needed?}
66
67 Conventional sources of course, program and timetable information are
68 rarely in a user-friendly format. Faculty and staff advisors, being already
69 fairly familiar with their courses and programs, often do not appreciate
70 how inconvenient it is for students to access all the information they need
71 to make course choices.
72
73 For example, program requirements are typically specified as lists of
74 course codes for required and optional courses; one must look elsewhere to
75 find the titles of the courses, the relations between them, their
76 prerequisites, and the timetabling information.
77
78 As another example, a course description in a calendar typically specifies
79 what the prerequisite courses are, but hardly ever specifies which course
80 or courses the course is prerequisite to. This information may be very
81 important to a student, but to discover it, he or she must search through
82 all the subsequent course descriptions in the calendar. With a prerequisite
83 chart, it is evident at a glance.
84
85 As a third example, consider a student who wants to know whether they can
86 defer a course till the following year without risk of timetable conflicts.
87 With conventional sources of information, such a question can be answered
88 only by doing an exhaustive search through both timetable and calendar for
89 a possible conflict. A prerequisite chart incorporating timetable data provides
90 the necessary information in a compact and usable form, and the question
91 can be answered immediately.
92
93
94 \subsubsection*{If prerequisite charts are so great, why doesn't every university department have them?}
95 Few academic departments have the resources to produce prerequisite charts. If
96 one searches on the web for "prerequisite chart" or "prerequisite diagram,"
97 virtually all of the matches are from departments that one would
98 expect to have expertise in technical drawings.
99 Here are some of these:
100 \begin{itemize}
101 \item Queen's University, Electrical and Computer Engineering\footnote{%
102 \myurl{http://www.ece.queensu.ca/Current-Students/Undergraduate/files/Queens_ECE_prerequisite_graph_2011.pdf}}
103 \item University of Waterloo, Computer Science\footnote{%
104 \myurl{http://www.cs.uwaterloo.ca/current/courses/charts/majorPrereq.shtml}}
105 \item Georgia Tech, Electrical Engineering\footnote{%
106 \myurl{http://www.ece.gatech.edu/academics/undergrad/ee_prereq.html}}
107 \item Georgia State University, Computer Science\footnote{%
108 \myurl{http://www.cs.gsu.edu/sites/default/files/prereq.pdf}}
109 %\item Iowa State University, Civil, Construction, \& Environmental Engineering\footnote{%
110 %\myurl{http://www.ccee.iastate.edu/fileadmin/www.ccee.iastate.edu/academics/mechanical-prereq-0507.pdf}}
111 \item Kansas State University, Mathematics\footnote{%
112 \myurl{http://www.math.ksu.edu/courses/catalog/prereqcht.pdf}}
113 %\item Carleton University, Engineering Physics\footnote{%
114 %\myurl{http://www1.carleton.ca/engineering-design/ccms/wp-content/ccms-files/Engineering-Physics_Aug_19_11.pdf}}
115 \item Penn State, Computer Science\footnote{%
116 \myurl{http://cs.hbg.psu.edu/cs/csprereq.html}}
117 \end{itemize}
118
119 \subsection{Prerex-Formatted Prerequisite Charts}
120
121 \subsubsection*{What file formats are used for prerex-formatted charts?}
122
123 The charts themselves are best distributed in the Portable Document
124 Format (PDF) defined by Adobe; PDFs are readable on any platform and in
125 most browsers using freely-available software (such as the Adobe Reader),
126 printable on any high-resolution printer, relatively compact, and scalable
127 to accommodate paper size, display resolution, or user preference.
128
129
130 Prerex-formatted charts are produced by software that processes simple and convenient
131 text-based descriptions. These descriptions can be edited in any
132 text editor or in the \texttt{prerex} interactive editor discussed in Section~\ref{editor}.
133 The format of chart descriptions is documented
134 in Section~\ref{source}.
135
136 Charts can be converted to Scalable Vector Graphic (SVG)
137 format for posting on the web.
138 SVG images can be rendered directly by all modern web browsers and
139 are comparable to PDF in quality. Wnen compressed (\verb\.svgz\), the
140 size is also comparable to PDF.
141 It is fairly easy to
142 convert charts to SVG images.
143
144 \subsubsection*{What software is needed to produce prerex-formatted prerequisite charts?}
145
146 To process the description of a prerex-formatted chart, the following software is
147 essential:
148 \begin{itemize}
149 \item an up-to-date standard-conforming implementation of \LaTeX, a powerful
150 document processing system based on \TeX, a professional-quality typesetting
151 engine; see Section~\ref{installing}.
152 \item a few additional \LaTeX\ packages, such as \texttt{pgf}, that may not be included in a minimal \LaTeX\ installation; see Section~\ref{additional};
153 \item a file \texttt{prerex.sty} of specialized \LaTeX\ definitions,
154 which is included in the prerex package
155 available at any repository
156 of
157 the Comprehensive TeX Archive Network (CTAN)\footnote{%
158 \myurl{http://www.ctan.org/}}
159 and in many \TeX\ distributions.
160 \end{itemize}
161 The following additional software is optional but recommended:
162 \begin{itemize}
163 \item a PDF viewer that
164 \begin{itemize}
165 \item can be configured to ``watch'' the PDF file so that it re-loads
166 automatically when this is updated, and
167 \item shows hyperlinks
168 in a ``tooltip'' when the mouse hovers over it, which is a convenient way to get
169 the coordinates of course boxes and arrows while editing the description;
170 \end{itemize}
171 see Section~\ref{PDF}.
172 \item suitable fonts; see Section~\ref{fonts}.
173 \item the \texttt{prerex} interactive editor for prerex-formatted charts;
174 see Section~\ref{editor}.
175 \item an integrated \LaTeX\ development environment; see Section~\ref{IDE}.
176 \end{itemize}
177
178 \subsubsection*{Why couldn't I use a program like Visio\textsuperscript{\textregistered}\ or CorelDRAW\textsuperscript{\textregistered}\ to produce a prerequisite chart?}
179 You could, if you have such a program available, are very skilled in its
180 use, and won't be embarrassed
181 distributing a chart that looks amateurish. Look carefully at a prerex-formatted
182 chart and notice the following properties:
183 \begin{itemize}
184 \item Each course box is sized to just enclose the text within it, with
185 uniform standard margins.
186 \item Each arrow between courses is oriented from box centre to box centre,
187 rather than from/to standard "connection points" on the box edges.
188 \item The arrows are "clipped" by the course boxes, but the arrow heads abut
189 the target box exactly.
190 \end{itemize}
191 These desirable properties are not easily achieved using conventional
192 ``do-it-yourself'' drawing software, no matter how ``user-friendly'' it
193 purports to be.
194 The prerex system provides complete flexibility as well as professional
195 quality:
196 \begin{itemize}
197 \item Text within a course box may be partitioned into regions with varying
198 characteristics. For example, the course code and the timetable
199 information on the first line of course boxes are in a smaller font
200 than the course name. The latter is centered and the former are left-
201 and right-justified, respectively. Arbitrary \LaTeX\ formatting can be used
202 for the text.
203 \item Any available Type 1 (Postscript) or TrueType format fonts may be used.
204 The professional-quality
205 typesetting engine takes advantage of kerns and ligatures in the fonts.
206 \item Line thickness for boxes may be varied; in the example diagram, heavier
207 boxes (and bold-face text) are used to indicate that a course is
208 "required" in the program, rather than an option.
209 \item Different styles of connectors can be used, for example to distinguish
210 prerequisites, co-requisites, and recommended prerequisites.
211 \item Various sizes or shapes of course boxes may be used, for example to
212 distinguish between half and full courses.
213 \item Graphic images such as logos can be imported.
214 \item Colours and hyperlinks to on-line course descriptions or calendars are
215 possible.
216 \end{itemize}
217 \subsubsection*{Wouldn't a commercial drafting service be able to produce a professional-looking prerequisite chart?}
218
219 Possibly, but you will almost certainly have to do the global lay-out
220 yourself. A more serious long-term problem is that it is unlikely you will
221 be able to maintain the chart yourself using freely available software. You
222 will be "locked-in" to use the drafting service for every future
223 modification of the chart.
224
225 If you want the quality and maintainability of a prerex-formatted chart but
226 don't think you can produce it yourself, you can outsource the production;
227 check out the following:
228 \myurl{http://www.prerex.com}.
229
230 \subsubsection*{How can a prerex-formatted chart be edited?}
231 University programs and timetables
232 change frequently: courses are added or dropped,
233 pre- or co-requisites or timetabling of courses change, and so on.
234 Use of a separate text-based description file and intelligent processing
235 software make it easy to modify a prerex-formatted chart. If the text within a course
236 box is changed, the size of the box, the length of connectors to and from
237 that box, and the location of arrowheads into the box are all adjusted
238 automatically by the processing software. If a course box must be moved, it
239 is straightforward to edit the relevant instructions for arrows into or
240 from the box because the coordinates specified for an arrow are those of
241 the box centres, rather than those of the edges or corners of the boxes.
242 Small changes can be made with any text editor.
243
244 For creating a prerex-formatted chart or for
245 making substantial changes to an existing chart, the \texttt{prerex} interactive chart editor
246 and the graphical ``wrapper'' \texttt{vprerex} are available;
247 see Section~\ref{editor}.
248 Editing a text file in either of these ways is far easier and
249 faster than trying to fiddle with an image using a mouse.
250
251
252 \section{Viewing and Printing a Prerequisite Chart}
253 \label{PDF}
254
255 A prerequisite chart in Portable Document Format (PDF) can be ``opened'' for
256 viewing or printing in any PDF viewer. The most
257 popular of these is the
258 Adobe Reader.\footnote{\myurl{http://www.adobe.com/prodindex/acrobat/readstep2.html}}
259 However, the Adobe Reader is quite slow to load and somewhat inconvenient to use
260 if one wants to re-load the document after changing it (normally one must first close the document and
261 then re-open it).
262
263 There are faster and more convenient alternatives to the Adobe Reader. One
264 that is
265 available for Windows, Macs, and Linux systems is a
266 ghostscript-based viewer called
267 GSview.\footnote{%
268 \myurl{http://www.cs.wisc.edu/~ghost/}}
269 For Windows or Linux: download and install the most recent version of
270 ghostscript for your platform,\footnote{%
271 \myurl{http://www.cs.wisc.edu/~ghost/doc/AFPL/index.htm}}
272 and then install the most recent version of
273 GSview for your platform.\footnote{%
274 \myurl{http://www.cs.wisc.edu/~ghost/gsview/index.htm}}
275 For Macs: just get
276 MacGSView.\footnote{%
277 \myurl{http://www.cs.wisc.edu/~ghost/macos/index.htm}}
278
279 For Linux systems, other ghostscript-based viewers such as
280 \texttt{gv}\footnote{%
281 \myurl{http://wino.physik.uni-mainz.de/~plass/gv/}}
282 are available. Also,
283 \texttt{xpdf}\footnote{%
284 \myurl{http://www.foolabs.com/xpdf/home.html}}
285 is suitable for any X-window based systems, such as any version of Linux.
286 If Gnome or KDE libraries are installed, variants \texttt{gpdf}, \texttt{kghostview}, \texttt{evince}, and \texttt{kpdf} (now renamed \texttt{okular}) of these programs are available.
287 You may print a prerequisite chart from within any of these viewing applications.
288
289 If you are \emph{editing} a prerequisite chart (using either a text editor on the
290 chart description or
291 the \texttt{prerex} editor), you will want to use a PDF viewer that
292 not only can be configured to ``watch'' the PDF file (so that it re-loads
293 automatically when this is updated), but also
294 shows hyperlinks
295 in a ``tooltip'' when the mouse hovers over it; this is a convenient way to get
296 the coordinates of course boxes and arrows while editing the description.
297 Recent versions of some of these viewing programs have the latter capability.
298 The \texttt{vprerex} ``wrapper'' for the \texttt{prerex} editor includes
299 a built-in \texttt{prerex}-enabled PDF viewer that makes it extremely easy to
300 transfer coordinates from the chart to the editor.
301
302
303 \section{Installing a Basic \LaTeX\ System}
304 \label{installing}
305
306 To ``process'' a chart description, you will need to install an application
307 called \LaTeX, together with several auxiliary applications to convert the
308 output into PDF or other formats.
309
310
311 \LaTeX\ is a powerful document processor based on a professional-quality typesetting program called \TeX. The following web sites
312 will point you to as much information as you might want on \LaTeX\ and \TeX:
313 \begin{itemize}
314 \item \LaTeX\ Project home page\footnote{\myurl{http://www.latex-project.org}}
315 \item \TeX\ Users Group home page\footnote{\myurl{http://www.tug.org/}}
316 \item \TeX\ FAQ\footnote{\myurl{http://www.tex.ac.uk/cgi-bin/texfaq2html}}
317 \end{itemize}
318
319 If you use Windows,
320 we suggest you install the ``basic'' version of
321 MiKTeX.\footnote{%
322 \myurl{http://www.miktex.org/setup.html}}
323 If you use Mac~OS~X, go to
324 the \emph{\TeX\ on Mac OS~X} site.\footnote{%
325 \myurl{http://www.rna.nl/tex.html}}
326 \textsc{Unix} and Linux users should install at least the ``basic'' scheme of TeXLive.\footnote{%
327 \myurl{http://www.tug.org/texlive/}}
328
329 The resulting installation will allow you to process simple \texttt{.tex} files.
330 However, you won't be able
331 to process the description of a prerex-formatted prerequisite chart until
332 some necessary additional software is installed.
333
334 \section{Additional \LaTeX\ Software}
335 \label{additional}
336
337 To process descriptions of prerex-formatted charts, some additional packages
338 are needed.
339 The file \texttt{prerex.sty} from the \texttt{prerex} package is essential;
340 it should be stored
341 in the same folder as the \texttt{.tex} file to be processed
342 (or in
343 a \verb|texmf| tree so the \LaTeX\ system can find it).
344 Other add-ons that may be necessary are as follows:
345 \texttt{pgf},
346 \texttt{tikz},
347 \texttt{multido},
348 \texttt{hyperref},
349 \texttt{textcomp}, and
350 \texttt{xcolor}.
351 If you are using \MikTeX\ or TeXLive, these packages can be installed using their
352 package managers.
353 All of the packages are also available
354 for download from any CTAN\footnote{%
355 \myurl{http://www.ctan.org/}} repository.
356
357 You are now ready to process the description for a chart.
358 Get a command-line
359 prompt, move to the folder with the chart description and issue the following
360 instruction:
361 \begin{verbatim}
362 pdflatex chart
363 \end{verbatim}
364 This operation will overwrite
365 any existing \verb|chart.pdf|, so you should first re-name
366 that file if you want to preserve it.
367
368 \section{Installing a \LaTeX\ Development Environment}
369 \label{IDE}
370 Most beginning
371 users will prefer
372 to use a graphical ``development environment'' which supports editing, processing and
373 previewing of documents, rather than the command-line interface. There are \emph{many} such applications;
374 one called \TeX Works is supported in both MiK\TeX\ and \TeX Live.
375
376 \section{Fonts}
377 \label{fonts}
378
379 Look carefully at the samples in Figure~\ref{samples} on page~\pageref{samples}.
380 \begin{figure}
381 \Huge
382 \begin{list}{}{}\item
383 \begin{tabular}{l}
384 {\fontfamily{ptm}\selectfont Times}\\
385 {\fontfamily{pplj}\selectfont Palatino}\\
386 {\fontfamily{cmss}\selectfont Computer Modern Sans}\\
387 {\fontfamily{phv}\selectfont Helvetica} \\
388 {\fontfamily{fos}\selectfont Open Sans} \\
389 {\fontfamily{Cabin-TLF}\selectfont Cabin}\\
390 {\fontfamily{QuattrocentoSans-TLF}\selectfont Quattrocento Sans}\\
391 {\fontfamily{LinuxBiolinumT-TLF}\selectfont Linux Biolinum}\\
392 {\fontfamily{uop}\selectfont Optima}
393 \end{tabular}
394 \end{list}
395 \caption{Typeface Samples}
396 \label{samples}
397 \end{figure}
398 Times and Palatino are \emph{serifed} typefaces; the serifs are the small projections
399 at the baselines, and sometimes at the tops, of characters.
400 Serifs improve the readability of \emph{long} texts.
401 The others
402 are \emph{sans serif} typefaces; this class of typefaces is more
403 appropriate for use in prerequisite charts where \emph{legibility} of fairly small and short textual fragments is of primary importance.
404
405 There are several \emph{sans serif} options available for \LaTeX.
406 Computer Modern Sans is the default \emph{sans serif} font,
407 and Helvetica should also be available in every \LaTeX\ installation.
408 To get Helvetica (scaled down 20\%), use
409 \begin{verbatim}
410 \usepackage[scaled=0.8]{helvet}
411 \end{verbatim}
412
413 The Open Sans family\footnote{%
414 \myurl{http://www.google.com/webfonts/specimen/Open+Sans}}
415 of fonts, designed by Steve Matteson of
416 Ascender, is supported for use in \LaTeX\ by the \texttt{opensans} package,
417 available from CTAN\footnote{%
418 \myurl{http://www.ctan.org/pkg/opensans}}
419 and in most distributions.
420 The Cabin\footnote{%
421 \myurl{http://www.google.com/webfonts/specimen/Cabin}}
422 and Quattrocento Sans\footnote{%
423 \myurl{http://www.google.com/webfonts/specimen/Quattrocento+Sans}
424 }
425 families of fonts, designed by Pablo Impallari, are supported for use
426 in \LaTeX\ by the \texttt{cabin} and \texttt{quattrocento} packages.
427 The chart in Figure~\ref{chart} on page~\pageref{chart} uses Cabin.
428 The Linux Biolinum fonts are the sans-serif
429 companions to the Linux Libertine family\footnote{%
430 \myurl{http://www.linuxlibertine.org/index.php?id=1&L=1}},
431 designed by Philipp H. Poll, and are supported for use in \LaTeX\ by the
432 \texttt{libertine} package.
433
434 Four URW-Classico fonts, a fairly good clone of Hermann Zapf's Optima, are available in a package
435 of 79~fonts in Type~1 format that may be legally downloaded for non-commercial use
436 from
437 Artifex\footnote{%
438 \myurl{http://www.artifex.com/downloads/}}.
439 The four Classico font files, renamed for use in \LaTeX, with the necessary support files and installation instructions are available
440 from CTAN\footnote{%
441 \myurl{http://www.ctan.org/pkg/classico}}.
442 Note that the font files cannot be distributed commercially without a commercial license; please read the license in the archive
443 before re-distributing them. This restriction does not prevent you from distributing documents
444 that \emph{use} the fonts.
445
446
447 \section{Conversion to Scalable Vector Graphics (SVG) Format}
448
449 One approach is to use \texttt{dvisvgm}\footnote{%
450 \myurl{http://dvisvgm.sourceforge.net/}}
451 to convert the output
452 of \texttt{latex} processing directly into a (compressed) SVG image.
453 Versions
454 since 1.3 generate links in the image from \texttt{hyperref} links in the source file.
455 Use \texttt{dvisvgm} as a global class option and
456 \texttt{hypertex} as a package option to \texttt{hyperref}
457 to ensure that the appropriate drivers are used by \texttt{latex},
458 and invoke \texttt{dvisvgm} as follows:
459 \begin{list}{}{}\item
460 \verb\dvisvgm -n -b dvi -L none ... \.
461 \end{list}
462 Add the \verb\ -z \ option to obtain a compressed image and use the \verb\ -Z scale-factor \
463 option to scale the image height and width.
464 If
465 \texttt{dvisvgm} reports that it can't find Ghostscript,
466 see the \texttt{dvisvgm} documentation for configuration options.
467
468 On Unix-like platforms such as Linux, a small program called \verb\pdf2svg\ is
469 available\footnote{%
470 \myurl{http://www.cityinthesky.co.uk/opensource/pdf2svg/}}; it uses standard
471 libraries (\verb\poppler\ and \verb\cairo\) to implement
472 the conversion.
473
474
475 The \texttt{inkview} application in the open-source \texttt{inkscape}\footnote{%
476 \myurl{http://www.inkscape.org/en/}}
477 package
478 is a convenient SVG image viewer.
479
480
481 \section{Terminology and Coordinate System}
482 Before we discuss the \texttt{prerex} editor and the format
483 of ``source files'' (i.e.,~chart descriptions), we shall summarize the necessary terminology and coordinate
484 conventions.
485
486 A prerequisite chart consists of a number of
487 \emph{course boxes},
488 linked by
489 \emph{arrows}.
490 Courses are either
491 \emph{half}
492 or
493 \emph{full},
494 and may be
495 \emph{required}.
496 Each course box can contain a course
497 \emph{code}
498 (upper left corner),
499 a course
500 \emph{title}
501 (lower half),
502 and
503 \emph{timetable}
504 information
505 (upper right corner).
506 An arrow can be either a \emph{prerequisite} (solid),
507 a \emph{co-requisite} (dotted),
508 or
509 \emph{recommended} (dashed).
510 When a conventional arrow would be inappropriate, it is possible to use
511 a
512 \emph{mini}
513 course ``box'' (consisting of just a course code) just above a target box.
514 A line (or paragraph) of text may be placed anywhere on the chart.
515
516 A conventional two-dimensional
517 Cartesian coordinate system is used to specify the locations of
518 diagram elements.
519 The
520 origin (where
521 $x = 0$
522 and
523 $y = 0$)
524 is at the lower-left corner of the diagram.
525
526 The diagram height is configurable; the width is determined by
527 the values of the \LaTeX\ length
528 \verb|\textwidth|
529 and
530 an adjustable
531 \verb|\unit|
532 length, which defines the absolute value of a coordinate unit.
533 It is possible to put a coordinate grid with labelled axes
534 in the background of a chart.
535
536 The coordinates of a
537 \emph{box,}
538 \emph{mini},
539 or
540 \emph{text}
541 are those of its centre point.
542 An
543 \emph{arrow}
544 is described by the
545 coordinates of the centre points of its source and target boxes/minis/texts.
546
547 \section{Chart Editing}
548 \label{editor}
549 The source code of \texttt{prerex}, an interactive (command-line) prerequisite-chart editor, is available at
550 CTAN repositories.\footnote{\myurl{http://mirror.ctan.org/graphics/prerex/}}
551 It should build on any \textsc{Unix}-like system with
552 suitable tools and libraries installed; for example, it can be compiled
553 on GNU/Linux, Solaris, the Cygwin\footnote{\myurl{http://www.cygwin.com/}}
554 platform on Windows,
555 and the Fink\footnote{\myurl{http://fink.sourceforge.net/}} platform
556 on OS~X.
557
558 The editor supports add, remove, cut-and-paste, and edit operations
559 on course boxes, minis, texts, and arrows, and shifts of specified diagram elements or an entire diagram.
560 A summary of all
561 commands supported by \texttt{prerex} is given in Table~\ref{help}.
562 %on page~\pageref{help}.
563 Note that if a course box/mini/text is ``cut''
564 and then ``pasted'' elsewhere, the target or source coordinates of arrows into or out of the source and target are
565 adjusted accordingly, and similarly if nodes are shifted or raised. To allow permutations of two or more
566 chart elements, the
567 editor maintains a ``stack'' of elements that have been cut but not yet pasted.
568 The notation
569 $x_0,y_0:x_1,y_1$
570 denotes all the nodes (course boxes, minis, texts) in the rectangle whose northwest and southeast corners are at
571 coordinates
572 $x_0,y_0$ and $x_1,y_1$, respectively.
573 \begin{table}
574 \begin{center}\small
575 \begin{tabular}{|l|l|}
576 \hline
577 \multicolumn{1}{|c|}{\textbf{Command}} & \multicolumn{1}{|c|}{\textbf{Effect}} \\
578 \hline\hline
579
580 \verb\file> box x,y \ & [create and] edit course box at $x,y$\\
581 \verb\file> mini x,y \ & [create and] edit mini course at $x,y$\\
582 \verb\file> text x,y \ & [create and] edit text centered at $x,y$\\
583 \verb\file> arrow x0,y0,x1,y1\ & [create and] edit arrow from $x0,y0$ to $x1,y1$\\
584 \verb\file> cut x,y ... \ & (temporarily) remove box, mini, or text at $x,y$\\
585 \verb\file> paste x,y \ & re-insert removed box, mini, or text at $x,y$\\
586 \verb\file> xchange x0,y0 x1,y1 \ & exchange elements at $x0,y0$ and $x1,y1$\\
587 \verb\file> delete [x,y | x0,y0,x1,y1 | x0,y0:x1,y1] ...\ & remove specified elements/arrows\\
588 \verb\file> shift [-]x x0,y0[:x1,y1] ...\ & move [specified] elements $x$ units right [left]\\
589 \verb\file> raise [-]y x0,y0[:x1,y1] ...\ & move [specified] elements $y$ units up [down]\\
590 \verb\file> undo \ & undo the effect of the previous editing command\\
591 \verb\file> write | ! \ & save to \verb\file\ and process (with \verb\pdflatex)\\\
592 \verb\file> quit | exit | x | ^D\& turn off grid, save to \verb\file\, process, and exit\\
593 \verb\file> !cmd \ & execute shell command \verb\cmd\, then reload\\
594 \verb\file> Backup \ & copy \verb\file\ to \verb\.file\\\
595 \verb\file> Restore \ & restore from \verb\.file\\\
596 \verb\file> grid [y/n] \ & turn on/off coordinate grid background\\
597 \verb\file> help | ? \ & print this summary\\
598 \hline
599 \end{tabular}
600 \end{center}
601 \caption{\texttt{prerex} Command Summary (since version 6.4)}
602 \label{help}
603 \end{table}
604
605 The effects of
606 editing operations may be observed in a PDF
607 viewer. See the manual page \texttt{prerex(1)} for
608 more information. The \texttt{prerex} package at CTAN
609 also has the source files for
610 \texttt{vprerex} (visual \texttt{prerex}), a graphical ``wrapper'' for \texttt{prerex}
611 which incorporates a \texttt{prerex}-enabled PDF viewer.
612
613
614 For initial creation of a prerex-formatted chart
615 or making
616 substantial changes to the boxes and arrows of an existing prerex-formatted chart, it is more convenient
617 to use one of these programs than to edit the source file directly; however,
618 the chart editor has no access to other elements of a source file, such as
619 preamble declarations, headings, notes, logos, and so on. A conventional text editor or
620 \LaTeX\ development environment should be used for these.
621
622 \section{Source Files}
623 \label{source}
624
625 \subsection{Overall Structure}
626
627 A \texttt{.tex} file is essentially text with interspersed
628 \LaTeX\ commands, much as a web-page description has text with Hypertext
629 Mark-up Language (HTML) tags interspersed.
630 Commands for \LaTeX\ can be recognized by the initial backslash character~``\verb|\|''.
631
632 The first several lines make up the ``preamble''
633 of the source file for a chart:
634 \begin{verbatim}
635 \documentclass{article}
636 \usepackage{prerex}
637 :
638 \end{verbatim}
639 This describes the kind of document to be processed (\texttt{article}, as opposed to
640 \texttt{book} or \texttt{report}) and
641 indicates a file of definitions to be used (\texttt{prerex.sty}).
642 The remaining lines of the preamble
643 specify such things as the page layout and the fonts to be used.
644
645 The structure
646 \begin{verbatim}
647 \begin{document}
648 :
649 \end{document}
650 \end{verbatim}
651 contains the content of the document.
652 Typically, the first element of the content is a heading, contained
653 within a
654 formatting structure of the form
655 \begin{verbatim}
656 \begin{center}
657 :
658 \end{center}
659 \end{verbatim}
660 which specifies that each line of the material contained should be centered on the page.
661 The double-backslash command \verb|\\| indicates
662 a line break.
663
664 After the heading comes the description of the chart itself:
665 \begin{verbatim}
666 \begin{chart}
667 :
668 \end{chart}
669 \end{verbatim}
670 Finally, there
671 will typically be some notes to explain the abbreviations and conventions
672 used in the chart.
673
674 \subsection{Chart Instructions}
675
676
677 Table~\ref{instructions}
678 on page~\pageref{instructions}
679 summarizes the formats of
680 the instructions defined by \texttt{prerex.sty}.
681 \begin{table}
682 \begin{center}
683 \renewcommand{\arraystretch}{1.3333}
684 \begin{tabular}{|l|}
685 \hline
686 \multicolumn{1}{|c|}{\textbf{Course Boxes and Text-Lines}} \\
687 \hline
688 \verb|\halfcourse |$x,y$:\verb|{|\emph{course code}\verb|}{|\emph{course title}\verb|}{|\emph{timetable code}\verb|}| \\
689 \verb|\fullcourse |$x,y$:\verb|{|\emph{course code}\verb|}{|\emph{course title}\verb|}{|\emph{timetable code}\verb|}| \\
690 \verb|\reqhalfcourse |$x,y$:\verb|{|\emph{course code}\verb|}{|\emph{course title}\verb|}{|\emph{timetable code}\verb|}| \\
691 \verb|\opthalfcourse |$x,y$:\verb|{|\emph{course code}\verb|}{|\emph{course title}\verb|}{|\emph{timetable code}\verb|}| \\
692 \verb|\reqfullcourse |$x,y$:\verb|{|\emph{course code}\verb|}{|\emph{course title}\verb|}{|\emph{timetable code}\verb|}| \\
693 \verb|\optfullcourse |$x,y$:\verb|{|\emph{course code}\verb|}{|\emph{course title}\verb|}{|\emph{timetable code}\verb|}| \\
694 \verb|\halfcoursec | $x,y$ \verb|:{| \emph{course code} \verb|}{| \emph{course title} \verb|}{| \emph{timetable code} \verb|}| \verb|{| \emph{color} \verb|}| \\
695 \verb|\reqhalfcoursec | $x,y$ \verb|:{| \emph{course code} \verb|}{| \emph{course title} \verb|}{| \emph{timetable code} \verb|}| \verb|{| \emph{color} \verb|}| \\
696 \verb|\opthalfcoursec | $x,y$ \verb|:{| \emph{course code} \verb|}{| \emph{course title} \verb|}{| \emph{timetable code} \verb|}| \verb|{| \emph{color} \verb|}| \\
697 \verb|\fullcoursec | $x,y$ \verb|:{| \emph{course code} \verb|}{| \emph{course title} \verb|}{| \emph{timetable code} \verb|}| \verb|{| \emph{color} \verb|}| \\
698 \verb|\reqfullcoursec | $x,y$ \verb|:{| \emph{course code} \verb|}{| \emph{course title} \verb|}{| \emph{timetable code} \verb|}| \verb|{| \emph{color} \verb|}| \\
699 \verb|\optfullcoursec | $x,y$ \verb|:{| \emph{course code} \verb|}{| \emph{course title} \verb|}{| \emph{timetable code} \verb|}| \verb|{| \emph{color} \verb|}| \\
700 \verb|\mini |$x,y:$\verb|{|\emph{course code}\verb|}| \\
701 \verb|\text |$x,y:$\verb|{|\emph{line of text}\verb|}| \\
702 \hline
703 \multicolumn{1}{|c|}{\textbf{Arrows}} \\
704 \hline
705 \verb|\prereq |$x_0, y_0, x_1, y_1$: \hfil
706 \verb|\prereqc |$x_0, y_0, x_1, y_1$; \emph{c}: \\
707 \verb|\coreq |$x_0, y_0, x_1, y_1$: \hfil
708 \verb|\coreqc |$x_0, y_0, x_1, y_1$; \emph{c}: \\
709 \verb|\recomm |$x_0, y_0, x_1, y_1$: \hfil
710 \verb|\recommc |$x_0, y_0, x_1, y_1$; \emph{c}: \\
711 \hline
712 \multicolumn{1}{|c|}{\textbf{Coordinate Grid}} \\
713 \hline
714 \verb|\grid| \\
715 \hline
716 \multicolumn{1}{|c|}{\textbf{In-Line Instructions}} \\
717 \hline
718 \verb|\solidarrow| \\
719 \verb|\dottedarrow| \\
720 \verb|\dashedarrow| \\
721 \verb|\lightbox| \\
722 \verb|\boldbox| \\
723 \verb|\dottedbox| \\
724 \hline
725 \end{tabular}
726 \renewcommand{\arraystretch}{1.0}
727 \end{center}
728 \caption{Instructions for \texttt{prerex}-Formatted Prerequisite Charts}
729 \label{instructions}
730 \end{table}
731
732 The \verb\grid\ command creates
733 a light gray ``coordinate grid'' in the background of the chart.
734 Figure~\ref{grid}
735 on page~\pageref{grid}
736 shows the example chart of Figure~\ref{chart} with the coordinate
737 grid enabled.
738 \input{introchart2}
739 Note that the ``origin'' of the coordinate system (the point
740 with $x$-coordinate $0$ and $y$-coordinate $0$) is at the lower-left corner of the chart.
741
742 The arrows produced by \verb\prereq\, \verb\coreq\, and \verb\recomm\ instructions
743 by default are slightly curved (except very short ones). It is possible to increase
744 or decrease the degree of curvature of a particular arrow by using instructions
745 \verb\prereqc\, \verb\coreqc\, or \verb\recommc\; the additional argument
746 specifies the degree of curvature: $0$ means no curvature, i.e.,~straight,
747 and to increase the curvature, use a larger number (up to $100$).
748 To change the default curvature for \emph{all} arrows,
749 see Section~\ref{config} on page~\pageref{config} below.
750
751
752 The ``in-line'' instructions create small examples of course boxes and arrows for use
753 in explanatory notes outside of the \verb\chart\ environment:
754 \begin{list}{}{}\item
755 \renewcommand{\arraystretch}{1.25}
756 \begin{tabular}{lc}
757 \verb|\solidarrow| & \solidarrow \\
758 \verb|\dottedarrow| & \dottedarrow \\
759 \verb|\dashedarrow| & \dashedarrow \\
760 \verb|\lightbox| & \sf\small\lightbox \\
761 \verb|\boldbox| & \sf\small\boldbox \\
762 \verb|\dottedbox| & \sf\small\dottedbox
763 \end{tabular}
764 \renewcommand{\arraystretch}{1.0}
765 \end{list}
766
767
768 See the manual pages
769 \texttt{prerex(5)} and \texttt{prerex.sty(7)} and the documentation for
770 \texttt{prerex.sty} for more information.
771
772 \subsection{\LaTeX\ Input Conventions}
773
774 The following are some of the input conventions for \LaTeX\ that you might want to know
775 about while editing
776 the source file for a prerex-formatted prerequisite chart.
777 \begin{itemize}
778 \item The characters \verb|# $ % & _ { } ~ ^ \ | are interpreted in special
779 ways by \LaTeX; to produce any of the first seven of these characters, you will have
780 to ``escape'' them with a backslash, as in, for example, \verb|\&|.
781 The \verb|\\| combination produces a line break; to produce a backslash, use \verb|\backslash|. The remaining two special characters, \verb|~|
782 and \verb|^|, may also be escaped with a backslash but produce accents;
783 for example, \verb|\^{u}| produces~\^{u}.
784
785 \item To produce a space where \LaTeX\ would normally not do so, use \verb|\ |.
786 For example, \LaTeX\ normally interprets a period immediately after a word as the end of
787 a sentence and leaves a larger-than-usual space; to prevent the larger-than-usual space after an abbreviation
788 that finishes with a period, use \verb|\ | instead of a space, as in
789 \verb|Diff.\ Equations|.
790
791 \item An unescaped \verb\%\ character signals the beginning of a comment; any characters following the
792 \verb\%\ to the end of that line are ignored by \LaTeX.
793
794 \item To prevent a line break between two words, use a \verb\~\
795 instead of a space between them, as in \verb\MATH~223\.
796
797 \item To leave a smaller-than-usual space between two words,
798 use \verb|\,| instead of a space between them, as in \verb|MATH\,223|.
799
800 \item To prevent hyphenation of some word, use the word as the argument to
801 an \verb|\mbox| command, as in \verb|\mbox{Robert}|.
802
803
804 \end{itemize}
805
806 \subsection{Configuration}
807 \label{config}
808
809 The following \LaTeX\ definitions are made in
810 \verb|prerex.sty| but may be re-defined by the
811 user in the chart source file:
812 \begin{list}{}{}
813 \item \verb|\newcommand{\DefaultCurvature}{20}|
814 \end{list}
815 where the argument should be in the range $0$--$100$; $0$ means no curvature.
816 \begin{list}{}{}
817 \item \verb|\newcommand{\CourseURL}[3]{#3.html}|
818 \end{list}
819 where the arguments supplied at the call are the $x$ and $y$ coordinates of
820 the box or mini, and the course code.
821 \begin{list}{}{}
822 \item \verb|\newcommand{\background}{yellow!15}|
823 \end{list}
824 which defines the default background color for course nodes.
825 \begin{list}{}{}
826 \item \verb|\setlength{\unit}{5.7816pt}|
827 \end{list}
828 which defines the absolute size of a coordinate unit;
829 this results in exactly 10 pixels per
830 coordinate unit if the chart is converted to an image at 125 dpi.
831 \begin{list}{}{}
832 \item \verb|\newcommand{\dpi}{125}|
833 \item \verb|\newcommand{\PixelsPerUnit}{10}|
834 \end{list}
835 These three commands have to re-defined together if the image-map data are to be correct.
836 \begin{list}{}{}
837 \item \verb|\setcounter{diagheight}{75}|
838 \end{list}
839 which is the
840 $y$-coordinate
841 of the top of the diagram (reduced to $65$ in landscape mode);
842 the nominal diagram width is
843 \verb|\textwidth|~$\div$~\verb|\unit|~$+ 10$.
844
845 The following define the thicknesses of the three kinds of arrows
846 and the thickness of bold boxes:
847 \begin{list}{}{}
848 \item
849 \verb|\newcommand{\solidwidth}{0.5pt}|
850 \item
851 \verb|\newcommand{\dottedwidth}{0.8pt}|
852 \item
853 \verb|\newcommand{\dashedwidth}{0.8pt}|
854 \item
855 \verb|\newcommand{\boldwidth}{1.0pt}|
856 \end{list}
857
858
859 The following command is used to change to a smaller size for course codes,
860 timetable information, and mini-course codes:
861 \begin{list}{}{}
862 \item
863 \verb|\newcommand{\smallersize}{\relsize{-3}}|
864 \end{list}
865
866 The following command defines the baseline adjustment for the stand-alone arrows and boxes;
867 this parameter is font-dependent.
868 \begin{list}{}{}
869 \item
870 \verb|\newcommand{\baselineAdj}{-0.5ex}|
871 \end{list}
872
873 \newpage
874
875
876
877 \section*{Bibliography}
878 \addcontentsline{toc}{section}{Bibliography}
879 \label{bibliography}
880
881 The following \nocite{Kopka,Lamport,Mittelbach} are three recommended books on \LaTeX\@.
882 Many other books and tutorial materials are available; check out the web sites referenced
883 in Section~\ref{installing}.
884 \renewcommand{\refname}{}
885 \vspace*{-6ex}
886 \bibliography{manual}
887 \bibliographystyle{plain}
888
889
890
891 \end{document}