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