From 6ea16a3ef7b22c1777e7f57bcb0eaba7e4d37b79 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 22 Apr 2014 22:24:54 +0000 Subject: prerex (with .5 man page) (22apr14) git-svn-id: svn://tug.org/texlive/trunk@33631 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/prerex/README | 10 +- Master/texmf-dist/doc/latex/prerex/boldbox.png | Bin 488 -> 0 bytes Master/texmf-dist/doc/latex/prerex/chart.dat | 33 ---- Master/texmf-dist/doc/latex/prerex/chart.html | 67 ------- Master/texmf-dist/doc/latex/prerex/chart.map | 18 -- Master/texmf-dist/doc/latex/prerex/chart.png | Bin 23805 -> 0 bytes Master/texmf-dist/doc/latex/prerex/chart.sh | 3 - Master/texmf-dist/doc/latex/prerex/dashed.png | Bin 344 -> 0 bytes Master/texmf-dist/doc/latex/prerex/dotted.png | Bin 359 -> 0 bytes Master/texmf-dist/doc/latex/prerex/intro.pdf | Bin 285602 -> 284162 bytes Master/texmf-dist/doc/latex/prerex/intro.tex | 109 ++++++----- Master/texmf-dist/doc/latex/prerex/lightbox.png | Bin 474 -> 0 bytes Master/texmf-dist/doc/latex/prerex/prerex.pdf | Bin 156356 -> 153211 bytes Master/texmf-dist/doc/latex/prerex/prerex.sty.7 | 65 +------ .../texmf-dist/doc/latex/prerex/prerex.sty.7.pdf | Bin 16953 -> 15339 bytes Master/texmf-dist/doc/latex/prerex/prerex.tex | 109 ++++------- Master/texmf-dist/doc/latex/prerex/solid.png | Bin 335 -> 0 bytes Master/texmf-dist/doc/man/man5/prerex.5 | 201 +++++++++++++++++++++ Master/texmf-dist/doc/man/man5/prerex.man5.pdf | Bin 0 -> 9527 bytes Master/texmf-dist/tex/latex/prerex/prerex.sty | 119 +----------- 20 files changed, 304 insertions(+), 430 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/prerex/boldbox.png delete mode 100644 Master/texmf-dist/doc/latex/prerex/chart.dat delete mode 100644 Master/texmf-dist/doc/latex/prerex/chart.html delete mode 100644 Master/texmf-dist/doc/latex/prerex/chart.map delete mode 100644 Master/texmf-dist/doc/latex/prerex/chart.png delete mode 100644 Master/texmf-dist/doc/latex/prerex/chart.sh delete mode 100644 Master/texmf-dist/doc/latex/prerex/dashed.png delete mode 100644 Master/texmf-dist/doc/latex/prerex/dotted.png delete mode 100644 Master/texmf-dist/doc/latex/prerex/lightbox.png delete mode 100644 Master/texmf-dist/doc/latex/prerex/solid.png create mode 100644 Master/texmf-dist/doc/man/man5/prerex.5 create mode 100644 Master/texmf-dist/doc/man/man5/prerex.man5.pdf (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/prerex/README b/Master/texmf-dist/doc/latex/prerex/README index 3c41586e730..cc6f8a12159 100644 --- a/Master/texmf-dist/doc/latex/prerex/README +++ b/Master/texmf-dist/doc/latex/prerex/README @@ -1,4 +1,4 @@ -prerex, version 2014-03-22. Macros for prerequisite charts, with +prerex, version 2014-04-17. Macros for prerequisite charts, with associated editor and viewer applications. This package consists of @@ -17,7 +17,7 @@ The implementation of prerex.sty is built on pgf, so that it may be used equally happily with latex or pdflatex; prerex is written in C and vprerex is written in C++ using the Qt-4 and poppler libraries. -See chart.{pdf,html,svgz} for a small example of a prerequisite +See chart.{pdf,svgz} for a small example of a prerequisite chart and real-life examples at http://www.cs.queensu.ca/students/undergraduate/prerequisites/ @@ -41,14 +41,12 @@ prerex.sty depends on multido relsize calc - zref-savepos hyperref The use of pgf means that Postscript processing is not required. Either pdflatex or latex -> dvips [ -> ps2pdf ] or latex -> dvipdfmx -(with suitable driver options) will generate charts, but pdflatex -processing is necessary to produce correct pixel coordinates in the -generated map and shell files. +or latex -> dvisvgm (with suitable driver options) will generate +charts. Installation of prerex.sty: diff --git a/Master/texmf-dist/doc/latex/prerex/boldbox.png b/Master/texmf-dist/doc/latex/prerex/boldbox.png deleted file mode 100644 index 32f5772b56a..00000000000 Binary files a/Master/texmf-dist/doc/latex/prerex/boldbox.png and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/prerex/chart.dat b/Master/texmf-dist/doc/latex/prerex/chart.dat deleted file mode 100644 index 77ac2237116..00000000000 --- a/Master/texmf-dist/doc/latex/prerex/chart.dat +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/Master/texmf-dist/doc/latex/prerex/chart.html b/Master/texmf-dist/doc/latex/prerex/chart.html deleted file mode 100644 index 643ea631edf..00000000000 --- a/Master/texmf-dist/doc/latex/prerex/chart.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - -
-

- -

chart.png

-
-

-

    -
  • A solid arrow solid.png indicates a required prerequisite, a dotted arrow dotted.png indicates - a corequisite (to be taken before or concurrently), and a dashed arrow dashed.png indicates a - recommended prerequisite. Core courses are in boldbox.png boxes; other courses (i.e., options or - prerequisites) are in lightbox.png boxes. -
  • -
  • Timetabling abbreviations: M, T, W, Th, F=Mon, Tue, Wed, Thur, Fri, resp.; eve=7:00–9:50 pm; - no=not offered.
- - -1083 -1303 -2813 -2023 -2513 -1083 -2333 -2013 -2685 -2013 -3323 -3813 -3413 -3013 -3513 -3503 - - - - - - - diff --git a/Master/texmf-dist/doc/latex/prerex/chart.map b/Master/texmf-dist/doc/latex/prerex/chart.map deleted file mode 100644 index 1b045d74de8..00000000000 --- a/Master/texmf-dist/doc/latex/prerex/chart.map +++ /dev/null @@ -1,18 +0,0 @@ - -1083 -1303 -2813 -2023 -2513 -1083 -2333 -2013 -2685 -2013 -3323 -3813 -3413 -3013 -3513 -3503 - diff --git a/Master/texmf-dist/doc/latex/prerex/chart.png b/Master/texmf-dist/doc/latex/prerex/chart.png deleted file mode 100644 index d9968b66a00..00000000000 Binary files a/Master/texmf-dist/doc/latex/prerex/chart.png and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/prerex/chart.sh b/Master/texmf-dist/doc/latex/prerex/chart.sh deleted file mode 100644 index 93480aa374a..00000000000 --- a/Master/texmf-dist/doc/latex/prerex/chart.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -mogrify -crop 1000x666+0+0 chart.png -exit 0 diff --git a/Master/texmf-dist/doc/latex/prerex/dashed.png b/Master/texmf-dist/doc/latex/prerex/dashed.png deleted file mode 100644 index c122a28f0d6..00000000000 Binary files a/Master/texmf-dist/doc/latex/prerex/dashed.png and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/prerex/dotted.png b/Master/texmf-dist/doc/latex/prerex/dotted.png deleted file mode 100644 index 945fdf5c2dc..00000000000 Binary files a/Master/texmf-dist/doc/latex/prerex/dotted.png and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/prerex/intro.pdf b/Master/texmf-dist/doc/latex/prerex/intro.pdf index 2b4e956ad15..51f094cc6d4 100644 Binary files a/Master/texmf-dist/doc/latex/prerex/intro.pdf and b/Master/texmf-dist/doc/latex/prerex/intro.pdf differ diff --git a/Master/texmf-dist/doc/latex/prerex/intro.tex b/Master/texmf-dist/doc/latex/prerex/intro.tex index e89c60dcebe..ecbea31491e 100644 --- a/Master/texmf-dist/doc/latex/prerex/intro.tex +++ b/Master/texmf-dist/doc/latex/prerex/intro.tex @@ -21,6 +21,7 @@ \newcommand{\myurl}[1]{\textcolor{blue}{\underline{\textcolor{black}{\url{#1}}}}} +\newcommand{\myhref}[2]{\href{#1}{\textcolor{blue}{\underline{\textcolor{black}{#2}}}}} \title{Prerex-Formatted Prerequisite Charts\\[1ex]\Large An Introduction} \date{\today} @@ -130,11 +131,6 @@ 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 @@ -142,6 +138,11 @@ text editor or in the \texttt{prerex} interactive editor discussed in Section~\r The format of chart descriptions is documented in Section~\ref{source}. +Charts can be converted to Scalable Vector Graphic (SVG) +format for posting on the web. When compressed, SVG format is relatively compact +and can be rendered directly by all modern web browsers. +It is fairly easy to +convert charts to SVG images. \subsubsection*{What software is needed to produce prerex-formatted prerequisite charts?} @@ -307,7 +308,7 @@ transfer coordinates from the chart to the editor. 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. +output into PDF or other formats. \LaTeX\ is a powerful document processor based on a professional-quality typesetting program called \TeX. The following web sites @@ -325,12 +326,13 @@ MiKTeX.\footnote{% 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{% +\textsc{Unix} and Linux users should install at least the ``basic'' scheme of 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. +to process the description of a prerex-formatted prerequisite chart until +some necessary additional software is installed. \section{Additional \LaTeX\ Software} \label{additional} @@ -340,17 +342,17 @@ 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. +(or in +a \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{hyperref}, \texttt{textcomp}, and \texttt{xcolor}. -If you are using \MikTeX\ or \texttt{texlive}, these can be installed using the -package manager. +If you are using \MikTeX\ or TeXLive, these packages can be installed using their +package managers. All of the packages are also available for download from any CTAN\footnote{% \myurl{http://www.ctan.org/}} repository. @@ -366,19 +368,6 @@ 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 @@ -429,7 +418,7 @@ The Open Sans family\footnote{% 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}} +\myurl{http://www.ctan.org/pkg/opensans}} and in most distributions. The Cabin\footnote{% \myurl{http://www.google.com/webfonts/specimen/Cabin}} @@ -452,45 +441,52 @@ 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/}}. +\myurl{http://www.ctan.org/pkg/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 +Scalable Vector Graphics (SVG) format is an emerging standard for high-quality graphics. +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. +external application, +making it an ideal format for posting charts on the web. +The quality and size of (compressed) SVG images are comparable to PDF\@. +The \texttt{inkview} application in the open-source \texttt{inkscape}\footnote{% +\myurl{http://www.inkscape.org/en/}} +package +is a convenient SVG image viewer. + +One approach is to use \texttt{dvisvgm}\footnote{% +\myurl{http://dvisvgm.sourceforge.net/}; also available from +\myhref{http://mirror.ctan.org/}{CTAN} and in \myhref{https://www.tug.org/texlive/}{\TeX Live}. +} +to convert the output +of \texttt{latex} processing directly into a (compressed) SVG image. +Versions +since 1.3 generate links in the image from \texttt{hyperref} links in the source file. +Use \texttt{dvisvgm} as a global class option and +\texttt{hypertex} as a package option to \texttt{hyperref} +to ensure that the appropriate drivers are used by \texttt{latex}, +and invoke \texttt{dvisvgm} as follows: +\begin{list}{}{}\item + \verb\dvisvgm -n -b dvi -L none -z ... \. +\end{list} +If +\texttt{dvisvgm} reports that it can't find Ghostscript, +see the \texttt{dvisvgm} documentation for configuration options. 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. +the conversion. +From version 0.2.3, \texttt{pdf2svg} adds clickable +links to the image and supports a scaling option. + \section{Terminology and Coordinate System} @@ -584,7 +580,7 @@ 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$. +$x_0,y_0$ and $x_1,y_1$, respectively. \begin{table} \begin{center}\small \begin{tabular}{|l|l|} @@ -598,6 +594,7 @@ $x_0,y_0$ and $x_1,y_1$. \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> xchange x0,y0 x1,y1 \ & exchange elements at $x0,y0$ and $x1,y1$\\ \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]\\ @@ -612,7 +609,7 @@ $x_0,y_0$ and $x_1,y_1$. \hline \end{tabular} \end{center} -\caption{\texttt{prerex} Command Summary (version 6.3)} +\caption{\texttt{prerex} Command Summary (since version 6.4)} \label{help} \end{table} @@ -622,7 +619,7 @@ 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. +which incorporates a \texttt{prerex}-enabled PDF viewer. For initial creation of a prerex-formatted chart diff --git a/Master/texmf-dist/doc/latex/prerex/lightbox.png b/Master/texmf-dist/doc/latex/prerex/lightbox.png deleted file mode 100644 index 1e608f5382b..00000000000 Binary files a/Master/texmf-dist/doc/latex/prerex/lightbox.png and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/prerex/prerex.pdf b/Master/texmf-dist/doc/latex/prerex/prerex.pdf index 15644cd9d0f..30d5d0aa596 100644 Binary files a/Master/texmf-dist/doc/latex/prerex/prerex.pdf and b/Master/texmf-dist/doc/latex/prerex/prerex.pdf differ diff --git a/Master/texmf-dist/doc/latex/prerex/prerex.sty.7 b/Master/texmf-dist/doc/latex/prerex/prerex.sty.7 index acc4b0abe75..47a4dacd2d1 100644 --- a/Master/texmf-dist/doc/latex/prerex/prerex.sty.7 +++ b/Master/texmf-dist/doc/latex/prerex/prerex.sty.7 @@ -1,4 +1,4 @@ -.TH PREREX.STY 7 2014-03-22 "prerex.sty-6.5" "" +.TH PREREX.STY 7 2014-04-11 "prerex.sty-6.6" "" .SH NAME prerex.sty \- a LaTeX document style for prerequisite charts .SH DESCRIPTION @@ -8,12 +8,6 @@ defines macros that can use to draw charts consisting of labelled course boxes linked by arrows that represent pre- and co-requisite requirements. -If -.B pdflatex -is used, -auxiliary files will be generated as follows: image-map data and xlink commands for the -hyperlinked nodes in the diagram and a shell script to crop a PNG image generated from -a Postscript or PDF chart. .P If the source file satisfies the constraints of the @@ -249,17 +243,7 @@ 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". .PP -The -.B prerex -package at -.B http://mirror.ctan.org/graphics/prerex/ -has a patch for -.BR 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 -.BR prerex (1) -prompt). There is also a GUI frontend +There is a GUI frontend .BR vprerex (1) to the .BR prerex (1) @@ -314,7 +298,6 @@ coordinate unit if the chart is converted to an image at 125 dpi. .IP .BI \enewcommand{\ePixelsPerUnit}{ 10 } .LP -These must be re-defined together if the image-map data are to be correct. .IP .BI \esetcounter{diagheight}{ 75 } .LP @@ -358,10 +341,9 @@ with add-on package The following additional packages are used: .B relsize, .B calc, -.B ifpdf, .B multido, .B textcomp, -.B zref-savepos +.B xcolor, and .B hyperref. .I Either @@ -378,29 +360,6 @@ followed by .BR dvipdfmx (1) may be used. .P -To convert a chart to a compact but reasonably high-quality image, it is suggested to use the -.BR convert (1) -tool of -.BR ImageMagick (1) -as follows: -.IP -.B convert -.I -density 125 chart.ps chart.png -.LP -or -.IP -.B convert -.I -density 125 chart.pdf chart.png -.LP -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 -.B prerex.sty -crops the image at the southeast corner. -It is possible to use a PNG compression application such as -.BR optipng (1) -to reduce the file-size of the cropped image (without loss of quality). -.P To convert a PDF chart to SVG (Scaleable Vector Graphic) format, it is recommended to use .BR pdf2svg (1), @@ -438,21 +397,6 @@ 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. -.P -To support HTML versions of charts, -.B prerex.sty -(when processed by -.BR pdflatex (1)) -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 and -xlink data for use with a SVG image. To -obtain absolute page coordinates, the -.B zsavepos, -.B zposx -and -.B zposy -commands are used; the page coordinates are converted into pixel coordinates. .SH LICENSE .B prerex.sty and this document may be distributed and/or modified under the @@ -460,8 +404,6 @@ conditions of the LaTeX Project Public License. .SH AUTHOR R. D. Tennent (rdt@cs.queensu.ca) .SH SEE ALSO -.BR ImageMagick (1), -.BR convert (1). .BR dvipdfmx (1), .BR dvips (1), .BR evince (1), @@ -469,7 +411,6 @@ R. D. Tennent (rdt@cs.queensu.ca) .BR kpdf (1), .BR latex (1), .BR okular (1), -.BR optipng (1), .BR pdf2svg (1), .BR pdflatex (1), .BR prerex (1), diff --git a/Master/texmf-dist/doc/latex/prerex/prerex.sty.7.pdf b/Master/texmf-dist/doc/latex/prerex/prerex.sty.7.pdf index 1d58d2d4b63..863e484b140 100644 Binary files a/Master/texmf-dist/doc/latex/prerex/prerex.sty.7.pdf and b/Master/texmf-dist/doc/latex/prerex/prerex.sty.7.pdf differ diff --git a/Master/texmf-dist/doc/latex/prerex/prerex.tex b/Master/texmf-dist/doc/latex/prerex/prerex.tex index 448ef4e5ef0..48c49ce88dd 100644 --- a/Master/texmf-dist/doc/latex/prerex/prerex.tex +++ b/Master/texmf-dist/doc/latex/prerex/prerex.tex @@ -7,7 +7,7 @@ %\def\LaTeX{\mbox{LaTeX}} \begin{document} -\title{\textsf{prerex.sty}: Prerequisite Charts in \LaTeX\\{\large Version 6.5}} +\title{\textsf{prerex.sty}: Prerequisite Charts in \LaTeX\\{\large Version 6.6}} \author{R. D. Tennent\\\texttt{rdt@cs.queensu.ca}} \date{\today} \maketitle @@ -21,12 +21,6 @@ can use to create charts consisting of labelled course boxes linked by arrows that represent pre- and co-requisite requirements; see the example chart in Figure~\ref{chart} on page~\pageref{chart}. -If pdf\LaTeX\ is used as the processing engine, -three auxiliary files will be generated, as follows: image-map data and SVG commands for the -hyperlinked nodes in the diagram, and a shell script for cropping a PNG image -obtained from the output. pdf\LaTeX\ must be used as the processing engine -to get accurate page coordinates. - If the source file satisfies the constraints of the \textsf{prerex(5)} @@ -280,10 +274,10 @@ so that, in suitable PDF viewers, if the mouse cursor is placed over a box, mini, or midpoint of an arrow, the \emph{coordinates} of the box/mini/text(or the coordinates of the source \emph{and} target of the arrow) will be displayed -as follows: in the +either in the status bar -in \texttt{xpdf} and \texttt{gpdf}, and in a -``tooltip'' in recent versions of \texttt{kpdf}/\texttt{okular}, \texttt{evince}, and the Acrobat Reader. +or in a +``tooltip.'' This coordinate display make it easier to edit chart descriptions. When the grid is on, the mid-point of every arrow is highlighted by a ``bullet''. @@ -374,54 +368,21 @@ The following additional packages are used: \verb|multido|, \verb|relsize|, \verb|calc|, -\verb|ifpdf|, \verb|textcomp|, -\verb|zref-savepos|, +\verb|xcolor|, and \verb|hyperref|. \emph{Either} \verb\pdflatex\ \emph{or} -\verb\latex\ (followed by \verb\dvips\ and, possibly, \verb\ps2pdf\) +\verb\xelatex\ \emph{or} -\verb\latex\ (with suitable driver options, followed by \verb\dvipdfmx\) -may be used; however, cropping shell scripts, -image maps and link data files are only generated if \verb\pdflatex\ -is used. - -\section{Conversion to Portable Network Graphic (PNG) Format} - -To convert a chart (in Postscript or PDF format) to a reasonably high-quality image, it is suggested to use the -\verb|convert| tool of the -\verb|ImageMagick| package as follows: -\begin{verbatim} - convert -density 125 chart.ps chart.png -\end{verbatim} -or -\begin{verbatim} - convert -density 125 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. -By default, the shell script generated by \texttt{prerex.sty} crops the image at the southeast corner. -It is possible to use a PNG compression application such as -\texttt{optipng} to reduce the file-size of the cropped image (without loss of quality). - -If \verb\pdflatex\ is used, an auxiliary file -containing image-map data for the hyperlinked nodes in the chart is also generated; -consult a reference on the HTML language for an explanation of (client-side) image maps. - -\section{Conversion to Scalable Vector Graphic (SVG) Format} - -SVG is an emerging standard for high-quality graphics. The -\texttt{pdf2svg}\footnote{% -\myurl{http://www.cityinthesky.co.uk/opensource/pdf2svg/}} -program uses \texttt{poppler} and \texttt{cairo} libraries -to convert a PDF page to a scalable vector-graphic image. When compressed -by \texttt{gzip} into \texttt{.svgz} format, the image file is comparable in size and quality -to the PDF form. Currently, links in the PDF are not converted by \texttt{poppler} and -\texttt{cairo} to links -in the SVG image. Since Version~6.5, an auxiliary file of suitable commands for inclusion in -a \texttt{.svg} image is generated by pdf\LaTeX\ processing. +\verb\latex\, followed by \verb\dvips\ and, possibly, \verb\ps2pdf\ +\emph{or} +\verb\latex\ (with suitable driver options), followed by either \verb\dvipdfmx\ +or \verb\dvisvgm\ may be used. + +\pagebreak + \section{Installation} @@ -431,16 +392,8 @@ a \texttt{.svg} image is generated by pdf\LaTeX\ processing. \item copy \verb|prerex.sty| to \emph{your-texmf-tree}\verb|/tex/latex/misc| \item copy \verb|doc/prerex.{tex,pdf}| to \emph{your-texmf-tree}\verb|/doc/latex/misc| \item if necessary, refresh the \TeX\ database (e.g., \verb|texhash|) - \item copy \verb|man/prerex.sty.7| to sub-directory \verb|man7| of a \verb|man| directory on your + \item on a \textsc{Unix}-like system, copy \verb|doc/prerex.5| and \verb|doc/prerex.sty.7| to sub-directories of a \verb|man| directory on your \verb|MANPATH| - \item test by doing - -\begin{verbatim} -$ man 7 prerex.sty -$ make chart.pdf -\end{verbatim} - - \end{enumerate} \section{Configuration} @@ -470,7 +423,6 @@ coordinate unit if the chart is converted to an image at 125 dpi. \item \verb|\newcommand{\dpi}{125}| \item \verb|\newcommand{\PixelsPerUnit}{10}| \end{list} -These have to re-defined together if the image-map data are to be correct. \begin{list}{}{} \item \verb|\setcounter{diagheight}{75}| \end{list} @@ -508,6 +460,24 @@ this parameter is font-dependent. \verb|\newcommand{\baselineAdj}{-0.5ex}| \end{list} +\section{Conversion to Scalable Vector Graphic Format} + +Scalable Vector Graphics (SVG) is an emerging standard for high-quality graphics. It is supported +by all modern browsers natively, making it ideal for posting charts on the web. +When compressed +by \texttt{gzip} into \texttt{.svgz} format, an SVG image is comparable in size and quality +to a PDF chart. +The \texttt{dvisvgm}\footnote{% +\myurl{http://dvisvgm.sourceforge.net/}; also available from CTAN and in TeXLive.} +program may be used to produce a (compressed) SVG image directly from \verb\latex\ output. + +Another approach is to use \texttt{pdf2svg}\footnote{% +\myurl{http://www.cityinthesky.co.uk/opensource/pdf2svg/}}, +a small program that uses \texttt{poppler} and \texttt{cairo} libraries +to convert a PDF page to a scalable vector-graphic image. +From version 0.2.3, \verb\pdf2svg\ inserts clickable +links into the SVG image and supports a scaling option. + \section{Implementation Details} \subsection{Boxes} @@ -522,7 +492,7 @@ on, it is hyperlinked and its chart coordinates are encoded in the URI. \subsection{Arrows} Arrows with a small height and arrows whose -source and target points have equal x or y coordinates are always draw straight +source and target points have equal x or y coordinates are always drawn straight (using a specialized and simpler macro) unless an explicit non-zero curvature argument is provided. @@ -542,19 +512,6 @@ two ``anchor'' hyperlinks are inserted at the southwest and northeast corners of the diagram to allow prerex-enabled PDF viewers to compute chart coordinates. -\subsection{Chart Images} - -To support HTML versions of charts, -\texttt{prerex.sty} -(if processed by \verb\pdflatex\) 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, for the clickable links, -it generates image-map data for use with an HTML image map and -\texttt{xlink} commands for embedding into an -SVG image. To -obtain absolute page coordinates for these auxiliary files, the \texttt{zsavepos}, \texttt{zposx} -and \texttt{zposy} commands are used; the page coordinates are converted into pixel -coordinates. - \section{License} \verb|prerex.sty|, \verb|prerex.sty.7|, \verb|README.prerex| and this document may be distributed and/or modified under the conditions of the \LaTeX\ Project Public License. diff --git a/Master/texmf-dist/doc/latex/prerex/solid.png b/Master/texmf-dist/doc/latex/prerex/solid.png deleted file mode 100644 index 2515d712af1..00000000000 Binary files a/Master/texmf-dist/doc/latex/prerex/solid.png and /dev/null differ diff --git a/Master/texmf-dist/doc/man/man5/prerex.5 b/Master/texmf-dist/doc/man/man5/prerex.5 new file mode 100644 index 00000000000..e95e6e2d195 --- /dev/null +++ b/Master/texmf-dist/doc/man/man5/prerex.5 @@ -0,0 +1,201 @@ +.TH PREREX 5 2012-03-21 "prerex_format" "" +.SH NAME +prerex_format -- a format for prerequisite-chart descriptions +.SH DESCRIPTION +This manual describes the format of +prerequisite-chart descriptions that can be processed by +.B [pdf]latex +(normally using +a suitable +.BR prerex.sty (7) +style file) and edited using the +.BR prerex (1) +interactive editor (or by any conventional text editor). +.SH TERMINOLOGY +A prerequisite chart consists of a number of +.I course boxes, +linked by +.I arrows. +Courses are either +.I half +or +.I full, +and may be +.I required +or +.I optional +(or neither). +Each course box can contain a course +.I code +(upper left corner), +a course +.I title +(lower half), +and +.I timetable +information +(upper right corner). +An arrow can be either a +.I prerequisite +(solid), +a +.I corequisite +(dotted), +or +.I recommended +(dashed). +When a conventional arrow would be inappropriate, +a +.I mini +course just above a target box can be used. +.SH STRUCTURE +The file should contain exactly one instance of a LaTeX environment +.P +.BI \ebegin{chart} " instruction ... " \eend{chart} +.P +with at most one +.I instruction +per line. +Note that a program such as +.BR prerex (1) +analyzes prerex-format files +.I without +using TeX; for example, +macro definitions will be ignored and +macro calls will +not be +expanded. +.PP +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 +.I precede +the instruction for the arrow. +The instruction formats are described in the following +sections. +.SH COURSE BOXES +The instructions producing course boxes have the following forms: +.HP +.BI \ehalfcourse " x,y" :{ code }{ title }{ timetable } +.HP +.BI \efullcourse " x,y" :{ code }{ title }{ timetable } +.HP +.BI \ereqhalfcourse " x,y" :{ code }{ title }{ timetable } +.HP +.BI \ereqfullcourse " x,y" :{ code }{ title }{ timetable } +.HP +.BI \eopthalfcourse " x,y" :{ code }{ title }{ timetable } +.HP +.BI \eoptfullcourse " x,y" :{ code }{ title }{ timetable } +.LP +where +.I x,y +are the coordinates of the +.I centerpoint +of the box, relative to the origin +of the coordinate system at the lower-left corner of the diagram. +The +.I code, +.I title, +and +.I 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: +.IP +.BI \ehalfcoursec " x,y" :{ code }{ title }{ timetable }{ color } +.IP +.BI \efullcoursec " x,y" :{ code }{ title }{ timetable }{ color } +.IP +.BI \ereqhalfcoursec " x,y" :{ code }{ title }{ timetable }{ color } +.IP +.BI \ereqfullcoursec " x,y" :{ code }{ title }{ timetable }{ color } +.IP +.BI \eopthalfcoursec " x,y" :{ code }{ title }{ timetable }{ color } +.IP +.BI \eoptfullcoursec " x,y" :{ code }{ title }{ timetable }{ color } +.LP + +.SH MINI COURSE BOXES AND TEXT +A mini course is produced by an instruction of the form +.HP +.BI \emini " x,y" :{ code } +.HP +A text line is inserted into the chart by an instruction of the form +.HP +.BI \etext " x,y" :{ line-of-text } +.HP +The maximum allowed length of a course-code may be smaller that the +maximum allowed for a line of text. +.SH ARROWS +Arrows between course boxes (or from a mini to a course box) are produced +by instructions of the form +.HP +.BI \eprereq " x0,y0,x1,y1" : +.HP +.BI \ecoreq " x0,y0,x1,y1" : +.HP +.BI \erecomm " x0,y0,x1,y1" : +.LP +These produce, respectively, solid, dotted, and dashed arrows from +the course box (or mini) centered at coordinates +.I x0,y0 +to the course box centered at coordinates +.I x1,y1. +.PP +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 +.HP +.BI \eprereqc " x0,y0,x1,y1;c" : +.HP +.BI \ecoreqc " x0,y0,x1,y1;c" : +.HP +.BI \erecommc " x0,y0,x1,y1;c" : +.LP +where +.I c +is an integer in the range 0-100 specifying the desired curvature; for example, +.IR c= 0 +will produce a +.I straight +arrow. To change the default curvature, the user program may redefine the +.B \eDefaultCurvature +command. +.SH COORDINATE GRID +The following instruction produces a coordinate grid, which is +useful for editing a diagram: +.HP +.B \egrid +.LP +This is normally placed before all the other instructions so that +grid lines are in the background, covered by course boxes, minis, and arrows. +.SH WEB LINKS +Course boxes may be linked to web addresses. +The URL for course boxes may be set by the user by redefining the +.B \eCourseURL +command; when called for a course box, it is supplied with three arguments, the +.I x +and +.I y +coordinates of the box, mini, or textline, and +the +.I code +argument +of the course box. For example, +.HP +.B \erenewcommand{\eCourseURL}[3]{http://www.cs.queensu.ca/undergraduate/courses/#3.html} +.LP +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. +.SH AUTHOR +R. D. Tennent (rdt@cs.queensu.ca) +.SH SEE ALSO +.BR prerex (1), +.BR prerex.sty (7). diff --git a/Master/texmf-dist/doc/man/man5/prerex.man5.pdf b/Master/texmf-dist/doc/man/man5/prerex.man5.pdf new file mode 100644 index 00000000000..7295b50c941 Binary files /dev/null and b/Master/texmf-dist/doc/man/man5/prerex.man5.pdf differ diff --git a/Master/texmf-dist/tex/latex/prerex/prerex.sty b/Master/texmf-dist/tex/latex/prerex/prerex.sty index fe101470637..2acc9372e7f 100644 --- a/Master/texmf-dist/tex/latex/prerex/prerex.sty +++ b/Master/texmf-dist/tex/latex/prerex/prerex.sty @@ -13,7 +13,7 @@ %% This work has the LPPL maintenance status "author-maintained". %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{prerex}[2014/03/22 v6.5.0 LaTeX style for prerequisite charts, pgf version] +\ProvidesPackage{prerex}[2014/03/22 v6.6.0 LaTeX style for prerequisite charts, pgf version] % % Changelog is at the end of the file. % @@ -45,22 +45,17 @@ % \newlength{\unit} -\newlength{\ppt} -\setlength{\ppt}{0.0138888888in} % one Postscript point = (1/72) in. \setlength{\unit}{5.7816pt} % 10 pixels per unit at 125dpi; 1pt = (1/72.27) in. \newcommand{\PixelsPerUnit}{10} \newcommand{\dpi}{125} -\newcommand{\ppi}{72} \RequirePackage{relsize} \RequirePackage{calc} \RequirePackage{pgf}[2013/12/18] \RequirePackage{tikz}\usetikzlibrary{arrows.meta} \RequirePackage{textcomp} -\RequirePackage{zref-savepos} \PassOptionsToPackage{urlcolor=black,colorlinks,raiselinks}{hyperref} \RequirePackage{hyperref} -\RequirePackage{ifpdf} \RequirePackage{xcolor} \definecolor{light}{gray}{0.5} @@ -104,48 +99,8 @@ \setcounter{diagheight}{65} \fi -\newcounter{chart} % in case there is more than one chart in the document -\newcounter{xNW}\newcounter{yNW} -\newcounter{xSE}\newcounter{ySE} -\newcounter{xSW}\newcounter{ySW} -\newcounter{xL}\newcounter{yL} -\newcounter{XSE}\newcounter{YSE} - \def\@unitmult{\unit * 5} % used for the grid and as the minimum height of half-course boxes -\def\@outputImapData#1,#2:#3#4#5{% -% #1,#2 coordinates -% #3 URL -% #4 horizontal delta -% #5 vertical delta -% -\ifpdf - \setcounter{xNW}{\dpi * \ratio{\zposx{gridOrigin_\thechart}sp}{1in}}% # of pixels from left edge to origin - \addtocounter{xNW}{(#1-#4)*\PixelsPerUnit}% add # pixels from origin to node (-#4 units) - \setcounter{xSE}{\dpi * \ratio{\zposx{gridOrigin_\thechart}sp}{1in}}% - \addtocounter{xSE}{(#1+#4)*\PixelsPerUnit}% add # pixels from origin to node (+#4 units) - - \setcounter{yNW}{ \dpi * \ratio{\paperheight}{1in}} % # of pixels for the whole page - \addtocounter{yNW}{ 0 - \dpi * \ratio{\zposy{gridOrigin_\thechart}sp}{1in}} % subtract # pixels from bottom edge to origin - \addtocounter{yNW}{0 - (#2 - #5) * \PixelsPerUnit } % subtract # of pixels from origin to node (-#5) - \setcounter{ySE}{ \dpi * \ratio{\paperheight}{1in}} - \addtocounter{ySE}{0 - \dpi * \ratio{\zposy{gridOrigin_\thechart}sp}{1in}} - \addtocounter{ySE}{0 - (#2 + #5) * \PixelsPerUnit } % subtract # of pixels from origin to node (+#5) - - \immediate\write\@imapfile{#3}% - - \immediate\write\@linkfile{ } -\fi -} - \pgfsetlayers{} \def\solidarrow{% @@ -196,7 +151,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{2}% \end{pgfonlayer}% } @@ -212,7 +166,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{2}% \end{pgfonlayer}% } @@ -228,7 +181,6 @@ \\ #4% \end{tabular}% }};% -\@outputImapData#1,#2:{#3}{4}{2}% \end{pgfonlayer}% } @@ -244,7 +196,6 @@ \\ #4% \end{tabular}% }};% -\@outputImapData#1,#2:{#3}{4}{2}% \end{pgfonlayer}% } @@ -261,7 +212,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{2}% \end{pgfonlayer}% } @@ -277,7 +227,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{2}% \end{pgfonlayer}% } @@ -293,7 +242,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{5}% \end{pgfonlayer}% } @@ -310,7 +258,6 @@ \end{tabular}}% };% \end{pgfonlayer}% -\@outputImapData#1,#2:{#3}{4}{5}% } \def\@reqfullcourse#1,#2:#3#4#5{% @@ -325,7 +272,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{5}% \end{pgfonlayer}% } @@ -341,7 +287,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{5}% \end{pgfonlayer}% } @@ -357,7 +302,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{5}% \end{pgfonlayer}% } @@ -373,7 +317,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{5}% \end{pgfonlayer}% } @@ -390,7 +333,6 @@ \\ #4% \end{tabular}}% };% -\@outputImapData#1,#2:{#3}{4}{5}% \end{pgfonlayer}% } @@ -407,7 +349,6 @@ \href{\CourseURL{#1}{#2}{#3}}{% {\smallersize\mdseries#3}}};% \fi -\@outputImapData#1,#2:{#3}{2}{1}% \end{pgfonlayer}% } @@ -624,21 +565,6 @@ \newenvironment{chart} { \setcounter{@diagwidth}{10 + 1 * \ratio{\textwidth}{\unit}} - \ifpdf - \newwrite\@imapfile % image-map data - \newwrite\@scriptfile % shell script to crop PNG image - \newwrite\@linkfile % link data for SVG - \ifnum\value{chart}=0 - \immediate\openout\@imapfile=\jobname.map - \immediate\write\@imapfile{} - \immediate\openout\@linkfile=\jobname.dat - \else - \immediate\openout\@imapfile=\jobname_\thechart.map - \immediate\write\@imapfile{} - \immediate\openout\@linkfile=\jobname_\thechart.dat - \fi - \fi - \let\halfcourse=\@halfcourse \let\halfcoursec=\@halfcoursec \let\reqhalfcourse=\@reqhalfcourse @@ -667,47 +593,22 @@ \setcounter{@gridheight}{\thediagheight / 10} \setcounter{@gridtop}{10 * \value{@gridheight} } \useasboundingbox (0,-2) rectangle (\value{@gridright},\value{@gridtop}); - node at (0,0) {\kern1sp\zsavepos{gridOrigin_\thechart}}; - % access absolute page coordinates of the origin using \zposx and \zposy } { \end{tikzpicture} - \ifpdf - \write\@imapfile{} - \write\@linkfile{} - \closeout\@imapfile - \closeout\@linkfile - \zsavepos{EndOfChart_\thechart} % determine cropping coordinates - \ifdim\paperwidth<\paperheight - % portrait mode - \setcounter{XSE}{\dpi * \ratio{\zposx{EndOfChart_\thechart}sp}{1in}}% - \setcounter{YSE}{ \dpi * \ratio{\paperheight}{1in}} - \addtocounter{YSE}{0 - \dpi * \ratio{\zposy{EndOfChart_\thechart}sp}{1in}} - \addtocounter{YSE}{0 + 2 * \PixelsPerUnit } % bottom margin - \else - % landscape mode - \setcounter{XSE}{ \dpi * \ratio{\paperwidth}{1in}} - \addtocounter{XSE}{0 - \dpi * \ratio{\zposx{EndOfChart_\thechart}sp}{1in}}% - \addtocounter{xSE}{0 + 2 * \PixelsPerUnit } % bottom margin - \setcounter{YSE}{ \dpi * \ratio{\paperheight}{1in}} - \addtocounter{YSE}{ 0 - \dpi * \ratio{\zposy{EndOfChart_\thechart}sp}{1in}} - \fi - \edef\HasH{\expandafter\@gobble\string\#} - \ifnum\value{chart}=0 - % generate a script to crop a chart image - \immediate\openout\@scriptfile=\jobname.sh - \immediate\write\@scriptfile{\HasH!/bin/sh} - % defer remaining output till cropping coordinates are available - \write\@scriptfile{mogrify -crop \theXSE x\theYSE +0+0 \jobname.png} - \write\@scriptfile{exit 0} - \closeout\@scriptfile - \fi % more than one chart? unlikely a cropping script would be usable - \fi - \stepcounter{chart} } % % Changelog: % +% Version 6.6.0 +% +% remove code to generate \jobname.map and \jobname.sh files +% +% Version 6.5.1 +% +% undid generation of \jobname.dat file: SVG images (with clickable links) +% can be generated by latest versions of pdf2svg (0.2.3) or dvisvgm (1.5.3) +% % Version 6.5.0 % % pdflatex processing now generates an auxiliary file \jobname.dat of link data -- cgit v1.2.3