summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-25 22:22:25 +0000
committerKarl Berry <karl@freefriends.org>2011-09-25 22:22:25 +0000
commit2c266513a7d7727e1adbcbfca59d5e7dbfdfd2e0 (patch)
treea8f606660c9f134ae2cc80bc4c74219eb589bd29 /Master
parent86e8221f09069b58618c78721f104b3628f8fb16 (diff)
petri-nets non-update to generic
git-svn-id: svn://tug.org/texlive/trunk@24088 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/petri-nets/COPYING (renamed from Master/texmf-dist/source/latex/petri-nets/COPYING)0
-rw-r--r--Master/texmf-dist/doc/generic/petri-nets/ChangeLog88
-rw-r--r--Master/texmf-dist/doc/generic/petri-nets/README (renamed from Master/texmf-dist/doc/latex/petri-nets/README)2
-rw-r--r--Master/texmf-dist/doc/generic/petri-nets/pn2pdf211
-rw-r--r--Master/texmf-dist/doc/generic/petri-nets/pndoc.pdfbin0 -> 207808 bytes
-rw-r--r--Master/texmf-dist/doc/generic/petri-nets/pndoc.tex (renamed from Master/texmf-dist/doc/latex/petri-nets/pndoc.tex)561
-rw-r--r--Master/texmf-dist/doc/latex/petri-nets/pndoc.pdfbin201924 -> 0 bytes
-rw-r--r--Master/texmf-dist/source/latex/petri-nets/pn2pdf102
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pndraw.sty152
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pndraw.tex (renamed from Master/texmf-dist/tex/latex/petri-nets/pndraw.tex)20
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pnets.sty (renamed from Master/texmf-dist/tex/latex/petri-nets/pnets.sty)0
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pnets.tex (renamed from Master/texmf-dist/tex/latex/petri-nets/pnets.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pntext.sty (renamed from Master/texmf-dist/tex/latex/petri-nets/pntext.sty)0
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pntext.tex (renamed from Master/texmf-dist/tex/latex/petri-nets/pntext.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/petri-nets/pnversion.tex1
-rw-r--r--Master/texmf-dist/tex/latex/petri-nets/pndraw.sty54
-rw-r--r--Master/texmf-dist/tex/latex/petri-nets/pnversion.tex1
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check4
18 files changed, 796 insertions, 400 deletions
diff --git a/Master/texmf-dist/source/latex/petri-nets/COPYING b/Master/texmf-dist/doc/generic/petri-nets/COPYING
index 60549be514a..60549be514a 100644
--- a/Master/texmf-dist/source/latex/petri-nets/COPYING
+++ b/Master/texmf-dist/doc/generic/petri-nets/COPYING
diff --git a/Master/texmf-dist/doc/generic/petri-nets/ChangeLog b/Master/texmf-dist/doc/generic/petri-nets/ChangeLog
new file mode 100644
index 00000000000..556338e519b
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/petri-nets/ChangeLog
@@ -0,0 +1,88 @@
+2006-03-02 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndraw.sty: fixed the detection of pdfLaTeX using ifpdf.sty, as
+ suggested by Jesús Cerquides <cerquide@maia.ub.es>
+
+2002-12-06 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndraw.tex: changed the default size of arrowheads.
+ Added macros to save/show nets.
+
+ * pndraw.sty: improved pdfLaTeX support.
+
+ * pn2pdf, pndoc.tex: updated w.r.t. the changes in pndraw.sty
+
+2002-10-14 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndoc.tex: corrected some typos.
+
+2002-10-12 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndoc.tex: updated
+
+ * pndraw.tex: added macro \pst to prefix PSTricks's commands
+
+ * pndraw.sty: included support for pdfLaTeX
+
+2001-11-26 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * the position of round nodes labels now uses the \labelsep
+ parameter.
+
+2001-08-28 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * changed the definition of \choice so it draws a square.
+
+ * added reference pages to the documentation.
+
+2001-06-11 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndraw.tex: ficed a bug on stores when changing \placesize
+ (thanks to André Steenveld).
+
+2001-06-07 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndraw.tex: moved the expansion of \everynet just before the
+ first net commands.
+
+ * pndraw.tex: changed option $ for links to / since $ causes
+ problems.
+
+2001-06-05 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndoc.tex: added a remark about DVI viewers.
+
+ * pndoc.tex: corrected a few typos.
+
+2001-06-04 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndraw.tex: added more options to nodes.
+
+ * pndoc.tex: updated for the new features.
+
+2001-06-02 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * pndraw.tex: added macros \link (\arc becomes a shortcut)
+ \store, \module and \source asked by André Steenveld.
+
+ * pndraw.tex: added macro \nodessize.
+
+2001-06-02 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * bug fixed: pndraw.aux
+ (thanks to Denis Girou)
+
+ * pndoc.tex: added some words about the compatibility with
+ graphics and graphicx packages, corrected some typos.
+ (thanks to Denis Girou)
+
+2001-05-28 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * Released on CTAN
+
+2001-04-01 Franck Pommereau <pommereau@univ-paris12.fr>
+
+ * Added forgotten \Rscope and \Lscope to pntext.sty
+
+2001-03-16 Franck Pommereau <pommereau@univ-paris12.fr>
+ * First release
diff --git a/Master/texmf-dist/doc/latex/petri-nets/README b/Master/texmf-dist/doc/generic/petri-nets/README
index 5d6d6481037..c7750398630 100644
--- a/Master/texmf-dist/doc/latex/petri-nets/README
+++ b/Master/texmf-dist/doc/generic/petri-nets/README
@@ -1,5 +1,5 @@
This is Petri-nets: a set of (La)TeX packages for works about Petri nets
-and related models. Read pndoc.ps for installation and usage.
+and related models. Read pndoc.pdf for installation and usage.
petrinets (C) 1999-2000 Franck Pommereau (pommereau@univ-paris12.fr).
diff --git a/Master/texmf-dist/doc/generic/petri-nets/pn2pdf b/Master/texmf-dist/doc/generic/petri-nets/pn2pdf
new file mode 100644
index 00000000000..c42f9c38f30
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/petri-nets/pn2pdf
@@ -0,0 +1,211 @@
+#!/usr/bin/perl
+
+## This file is part of the Petri-nets packages. See file README for
+## copyright notice.
+
+use strict;
+use Digest::MD5 qw(md5_hex);
+use Getopt::Long;
+
+##
+## read options
+##
+
+Getopt::Long::Configure ("bundling");
+
+my $keep = 0;
+my $force = 0;
+my $verbose = 0;
+
+GetOptions ("k|keep" => \$keep,
+ "f|force" => \$force,
+ "v|verbose" => \$verbose,
+ "t|test" => \&Test,
+ "d|delete" => \&Delete,
+ "b|batch" => \&Batch,
+ "h|help" => \&Help);
+
+&Help if scalar @ARGV > 1;
+
+##
+## Global variables
+##
+
+my $figure = shift @ARGV;
+my $basename = $figure; $basename =~ s/\.pn$//;
+my $jobname = $basename; $jobname =~ s/-fig\d+$//;
+my $data = "";
+my %sum;
+
+##
+## Load checksums
+##
+
+if (-f "$jobname.sum") {
+ open SUM, "$jobname.sum"
+ or &Error ("could not open $jobname.sum -- $!");
+ while (<SUM>) {
+ next unless /^(.+)\s+(.+)$/;
+ $sum{$1} = $2;
+ }
+ close SUM;
+}
+
+##
+## Get preamble
+##
+
+if (-f "$jobname.pre") {
+ # read the existing preamble
+ my @lines;
+ open PRE, "$jobname.pre"
+ or &Error ("could not open $jobname.sum -- $!");
+ @lines = <PRE>;
+ close PRE;
+ $data .= join "", @lines;
+} else {
+ # create a new preamble
+ open TEX, "$jobname.tex"
+ or &Error ("could not open $jobname.tex -- $!");
+ while (<TEX>) {
+ $data .= $_;
+ last if /\\begin\{document\}/;
+ }
+ close TEX;
+ $data =~ s/(\\begin\{document\}).*$/$1\n/;
+ $data .= "\\pagestyle\{empty\}\n";
+ # save it
+ open PRE, ">$jobname.pre"
+ or &Error ("could not create $jobname.sum -- $!");
+ print PRE $data;
+ close PRE;
+}
+
+##
+## Read the figure
+##
+
+{
+ my $pre = 1;
+ open TEX, $figure or &Error ("could not open $figure -- $!");
+ open PRE, ">>$jobname.pre"
+ or &Error ("could not append $jobname.pre -- $!");
+ while (<TEX>) {
+ $pre = 0 if /^\\begin\{petrinet\}/;
+ print PRE if $pre;
+ $data .= $_;
+ }
+ close TEX;
+ close PRE;
+}
+
+##
+## Generate the EPDF
+##
+
+if (&SumChanged ($figure, "$data") or $force or (! -f "$basename.pdf")) {
+ open TEX, ">$basename.tex"
+ or &Error ("could not create file $basename.tex -- $!\n");
+ print TEX "$data\\end\{document\}\n";
+ close TEX;
+ system "latex", "$basename.tex";
+ system "dvips", "-E", "-Ppdf", "-o", "$basename.eps", "$basename";
+ system "epstopdf", "$basename.eps";
+}
+
+unlink ("$basename.tex", "$basename.log", "$basename.aux",
+ "$basename.dvi", "$basename.eps", "$basename.pn") unless $keep;
+
+##
+## Save checksums
+##
+
+open SUM, ">$jobname.sum"
+ or die "pn2pdf: could not create file $jobname.sum -- $!\n";
+foreach my $file (sort keys %sum) {
+ print SUM "$file $sum{$file}\n";
+}
+close SUM;
+
+exit 0;
+
+##
+## Sub programs
+##
+
+sub Help {
+ print <<"EOF";
+Usage: pn2pdf [OPTIONS]
+Create EPDF files for Petri net figures.
+
+ FIGURE process FIGURE
+ -b, --batch FILE process the commands in FILE
+ -k, --keep keep temporary files
+ -f, --force force the rendering of all pictures
+ -t, --test FILES create FILES for test purpose
+ -d, --delete FILES delete FILES (may be patterns)
+ -h, --help display this help and exit
+
+Report bugs to <pommereau\@univ-paris12.fr>
+EOF
+ exit 0; }
+
+sub Error {
+ foreach my $line (@_) {
+ warn "pn2pdf: $line\n";
+ }
+ exit 1;
+}
+
+sub Verbose {
+ return unless $verbose;
+ foreach my $line (@_) {
+ warn "[pn2pdf] $line\n";
+ }
+}
+
+sub SumChanged {
+ my ($file, $lines) = @_;
+ my $md5 = md5_hex ($lines);
+ if ($md5 eq $sum{$file}) {
+ return 0;
+ } else {
+ $sum{$file} = $md5;
+ return 1;
+ }
+}
+
+sub Test {
+ foreach my $file (@ARGV) {
+ open FILE, ">$file" or &Error ("could not create $file -- $!");
+ close FILE;
+ }
+ exit 0;
+}
+
+sub Delete {
+ foreach my $pattern (@ARGV) {
+ unlink glob $pattern unless $keep;
+ }
+ exit 0;
+}
+
+sub Batch {
+ my @lines;
+ foreach my $file (@ARGV) {
+ $file =~ s/(\.[a-z]{3})?$/.bpn/i;
+ open FILE, $file or &Error ("could not open $file -- $!");
+ while (<FILE>) {
+ next unless /^pn2pdf\s/;
+ s/^pn2pdf\s/pn2pdf --keep / if $keep;
+ s/^pn2pdf\s/pn2pdf --force / if $force;
+ s/^pn2pdf\s/pn2pdf --verbose / if $verbose;
+ push @lines, $_;
+ }
+ close FILE;
+ }
+ foreach (@lines) {
+ system $_;
+ }
+ exit 0;
+}
diff --git a/Master/texmf-dist/doc/generic/petri-nets/pndoc.pdf b/Master/texmf-dist/doc/generic/petri-nets/pndoc.pdf
new file mode 100644
index 00000000000..c5c05bc6e48
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/petri-nets/pndoc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/petri-nets/pndoc.tex b/Master/texmf-dist/doc/generic/petri-nets/pndoc.tex
index 17692ae8674..eb75ee734e7 100644
--- a/Master/texmf-dist/doc/latex/petri-nets/pndoc.tex
+++ b/Master/texmf-dist/doc/generic/petri-nets/pndoc.tex
@@ -35,39 +35,36 @@ the two previous.
\section{Introduction}
-Petri-nets is a set of packages I use to write my papers about Petri
-nets and related models (essentially: PBC, M-nets and \bpn). It
+Petri-nets is a set of packages which I use to write my papers about
+Petri nets and related models (essentially: PBC, M-nets and \bpn). It
features three packages: one for drawing net, one other which defines
-additional macros for textual purpose (like \bpn's logo) and a last
-one for both possibilities. The first package as been designed with a
+additional macros for textual purpose (like the name ``\bpn'') and a
+last one for both purposes. The first package has been designed with a
precise goal: saving me a lot of work when I have to draw nets. This
goal explains some choices I did: typesetting labels in math mode by
default, ending commands with the line, etc. I feel this results in an
intuitive and high-level way to define Petri nets, but if you have
ideas to improve this, don't hesitate to contact me. The text command
package is more classical and if it saves also a lot of typing, its
-main goal is to ensure uniformity in the notations.
+main goal is to ensure uniform notations.
All these packages may evolve and grow up and if you (or I) feel that
a feature is missing, you can send me an e-mail explaining your needs
-(\TeX{} code is welcome too). Notice I don't pretend being a
+(\TeX{} code is welcome too). Notice that I don't pretend being a
specialist in Petri nets and I'm only used to work on three or four
models; so I may ignore particular things in particular models. This
may explain some missing features.
-If you wish to be notified of the updates of these packages, just send
-me an email with your request at {\it pommereau@univ-paris12.fr}.
-
%%
%%
\subsection{Installation}
-The last version of the package may be downloaded at {\it http:/\slash
-www.univ-paris12.fr\slash lacl\slash pommereau\slash
-petrinets.tar.gz\/}, a copy should be available on {\it CTAN\slash
-macros\slash generic\slash petri-nets}; the distribution contains the
-following files:
+The last version of the package may be downloaded on the web at the
+URL {\it http:/\slash www.univ-paris12.fr\slash lacl\slash
+pommereau\slash petrinets.tar.gz\/}, a copy should be available on
+{\it CTAN\slash macros\slash generic\slash petri-nets}; the
+distribution contains the following files:
\begin{itemize}
\item |pnets.tex| is the main \TeX{} package;
@@ -77,24 +74,26 @@ following files:
\item |pntext.tex| and |pntext.sty| are the \TeX{} and \LaTeX{}
sub-packages for text commands;
\item |pnversion.tex| defines macro |\pnversion|;
-\item |pndoc.ps| and |pndoc.tex| are the present paper and its source;
+\item |pndoc.ps|, |pndoc.pdf| and |pndoc.tex| are the present paper
+ and its source;
\item |COPYING| is the text of the GNU GPL;
-\item |Changelog| collects all changes done to Petri-nets;
+\item |ChangeLog| collects all changes done to Petri-nets;
\item |README| is a short introduction text;
-\item |pn2pdf| a Perl script used to produce PDF files with pdf\LaTeX.
+\item |pn2pdf| is a Perl script used to produce PDF files with
+ pdf\LaTeX.
\end{itemize}
In order to have Petri-nets working, you need to copy files |pnets.*|,
-|pndraw.*| and |pntext.*| in a place where \TeX{} will be able to find
-them. This can be somewhere in the default search path (see your local
-\TeX{} documentation) or in a directory included in your |TEXINPUT|
-environment variable.
+|pndraw.*|, |pntext.*| and |pnversion.tex| in a place where \TeX{}
+will be able to find them. This can be somewhere in the default search
+path (see your local \TeX{} documentation) or in a directory included
+in your |TEXINPUT| environment variable.
Packages from Petri-nets have been developed and tested with
-te\TeX-0.9 for Linux. \TeX{} packages should work with any \TeX{}
-version greater than or equal to 3 (my version is 3.14159). \LaTeX{}
-packages have been designed for \LaTeX$2_\varepsilon$ so you may
-experiment troubles with an older version.
+te\TeX-1.0.2 for Linux. \TeX{} packages should work with any \TeX{}
+version greater than or equal to 3 (my version is 3.14159, Web2C
+7.3.7). \LaTeX{} packages have been designed for \LaTeX$2_\varepsilon$
+so you may experiment troubles with an older version.
In order to typeset symbols for classical sets of numbers (\setN,
\setR, etc.) Petri-nets uses fonts from AMS. So you must have package
@@ -109,14 +108,14 @@ Using PSTricks has an important consequence: actual drawings are done
in PostScript, so, you may not see them directly from the DVI viewer
(at least not correctly); additionally, you must use a PostScript
driver in order to produce your final document (for example, dvips
-works well). Support for producing PDF documents with pdf{\LaTeX} is
+works well). Some support to produce PDF documents with pdf{\LaTeX} is
provided (see section~\ref{sec:pdf}).
-PSTricks conflicts with packages |graphics| and |graphicx|, Petri-nets
-thus inherits this conflict. If you wish to use them together, you
-should first load package |pstcol|, then Petri-nets and at last,
-|graphics| or |graphicx|. The following is quoted from PSTricks'
-|README|:
+PSTricks conflicts with packages |color|, |graphics| and |graphicx|,
+Petri-nets thus inherits this conflict. If you wish to use them
+together, you should first load package |pstcol|, then Petri-nets and
+at last, |color|, |graphics| or |graphicx|. The following is quoted
+from PSTricks' |README|:
\begin{quote}
To use the standard `|color|' package (which is available both for
@@ -134,17 +133,23 @@ required in place of the `|pstricks|' one if the `|graphics|' or
If you wish to produce PDF files using pdf{\LaTeX}, you also need to
copy the script |pn2pdf| in a directory from which it can be executed.
-This script requires a working Perl with the package |Digest::MD5|
-installed. Moreover, the script calls the following programs: |latex|,
-|dvips| and |epstopdf| which must be installed on your system (there
-should be not problem for the first two).
+This script requires a working Perl with the packages |Digest::MD5|
+and |Getopt::Long| installed. Moreover, the script calls the following
+programs: |latex|, |dvips| and |epstopdf| which must be installed on
+your system (there should be not problem for the first two). In order
+to include the PDF pictures, the package |graphicx| is used (in this
+case, it does not lead to any conflict since PSTricks is not loaded
+when running pdf\LaTeX). Finally, the package |ifpdf| is used to
+detect whether a document is compiled using \LaTeX{} or pdf\LaTeX.
+This package should be thus installed.
You can test your installation by recompiling the present manual which
-is written in \LaTeX. If it compiles successfully, this means
-Petri-nets and also PSTricks have been found by \TeX. If one file is
-not found, \TeX{} will complain, giving the file name. Then, running
-dvips will ensure that the PostScript headers of PSTricks can be
-found.
+is written in \LaTeX. If it compiles successfully, this means that
+Petri-nets and PSTricks have been found by \TeX. If one file is not
+found, \TeX{} will complain, giving the file name. Then, running dvips
+will ensure that the PostScript headers of PSTricks can be found. You
+may also test the PDF support by producing the PDF version of this
+manual, see section~\ref{sec:pdf} for the way to proceed.
If you successfully use Petri-nets under another configuration, feel
free to send me an e-mail at {\it pommereau@univ-paris12.fr}. You may
@@ -156,11 +161,11 @@ fixes are welcome too.
\subsection{Loading the packages}
-From \TeX, you load the package with |\input pnets|, from \LaTeX, you
-should put |\usepackage{pnets}| in your document preamble. Since you
-may want to use only the drawing macros, you can use |\input pndraw|
-or from \LaTeX: |\usepackage{pndraw}|. Similarly, in order to load
-only text commands, you can use |\input pntext| or
+From \TeX, you can load the package with |\input pnets|, from \LaTeX,
+you should put |\usepackage{pnets}| in the preamble of your document.
+Since you may want to use only the drawing macros, you can use
+|\input pndraw| or from \LaTeX: |\usepackage{pndraw}|. Similarly, in
+order to load only text commands, you can use |\input pntext| or
|\usepackage{pntext}|.
Both packages define a macro |\pnversion| which gives the date of the
@@ -186,19 +191,26 @@ I also could add looping arcs. This is useless for Petri nets but it
would allow one to use the packages for other purposes, like drawing
automata.
-The script |pn2pdf| does not handle documents spread over multiple
-files: if a picture is created in a file which is included, it will be
-ignored.
+The PDf pictures are clipped to the bounding box of the corresponding
+net. I've seen on the newsgroups that there exists a solution, but it
+was written in German which I can't read.
+
+When one looks at a PDF document using Acrobat Reader, small blur
+points appear at the top-right and bottom-left corners of the Petri
+nets. This comes from two white points added in order to force dvips
+to produce the right bounding box when a net is generated alone in an
+EPS file. So, this is a bug of Acrobat Reader rather than one of
+Petri-nets.
In a late future, I'd like to make the package independent of
-PSTricks, so it would be more portable (but less powerful).
+PSTricks, so it would be more portable (but maybe less powerful).
%%
%%
\subsection{Legal stuff}
-Petri-nets is \copyright{}opyright 1999--2001 Franck Pommereau ({\it
+Petri-nets is {\copyright} 2002 Franck Pommereau ({\it
pommereau@univ-paris12.fr\/}).
This program is free software; you can redistribute it and/or modify
@@ -236,7 +248,7 @@ Andr\'e Steenveld.
\section{Text commands: package {\tt pntext}}
This section lists the commands defined in package |pntext|, they are
-all available from \TeX{} as from \LaTeX.
+all available from \TeX{} as well as from \LaTeX.
\paragraph{Math sets.}
%
@@ -297,13 +309,13 @@ adjust their spacing in math mode: compare ``$Var$'' with ``$\Var$''.
\subsection{Some words about PSTricks}
-Reading PSTricks manual could be a good idea, but if you don't want,
-you should know a few things about it in order to use Petri-nets
+Reading PSTricks manual could be a good idea, but if you don't want
+to, you should know a few things about it in order to use Petri-nets
successfully.
In PSTricks, any point is designated by two coordinates in a grid,
-centered on a reference point which has coordinates $(0,0)$.
-Figure~\ref{axis} shows an example.
+centered on a reference point which has coordinates $(0,0)$. The
+figure~\ref{axis} shows an example.
\begin{figure}[t]
\begin{center}
@@ -341,10 +353,10 @@ Since coordinates are formed as a comma separated couple of numbers,
you {\it must not\/} use comma as decimal separator here: |(4.5,2.3)|
is correct but |(4,5,2,3)| is not.
-Sometime you'll be asked to give an angle value as a macro
-parameter. In Petri-nets, angles are measured in degrees; they can be
-given as a numerical value or with a one/two letter(s) code as shown
-on figure~\ref{angles}. Of course, when you specify an angle by its
+Sometime you'll be asked to give an angle value as a macro parameter.
+In Petri-nets, angles are measured in degrees; they can be given as a
+numerical value or with a one/two letter(s) code as shown in the
+figure~\ref{angles}. Of course, when you specify an angle by its
numerical value, you can use any number, even negative, and not only
one of the eight values shown on figure~\ref{angles}.
@@ -374,9 +386,10 @@ bottom}.}
\end{center}
\end{figure}
-Macro |\psset| is the way to change PSTricks default parameters, it
+The macro |\psset| is used to change PSTricks default parameters, it
takes one argument which is a comma-separated list of |name=value|
pairs. For example, |pndraw.tex| itself uses:
+%
\begin{verbatim}
\psset{linewidth=.5pt,
doublesep=.5pt,
@@ -403,7 +416,7 @@ Petri-nets:
\end{itemize}
PSTricks recognizes many other parameters and you should refer to its
-manual for all details.
+manual for all the details.
%%
%%
@@ -412,51 +425,52 @@ manual for all details.
To begin a net, just type |\beginnet| for \TeX{} or |\begin{petrinet}|
under \LaTeX; both this commands are expecting two pairs of
-coordinates to give the bottom-left and upper-right extrema of the
-net.
+coordinates to give the bottom-left and up-right extrema of the net.
For example, |\begin{petrinet}(-1,-2)(5,3)| starts a net which should
extend in the rectangular area, which we call the {\it bounding box},
delimited by $(-1,-2)$ at the lower left corner and $(5,3)$ at the
-upper right. These coordinates are sensible to current |unit|, |xunit|
-and |yunit| values.
+upper right. These coordinates are sensitive to current values of
+|unit|, |xunit| and |yunit|.
The real effect of these two pairs is to fix the size of the bounding
-box which carry the drawn net (it is actually a |\hbox| in horizontal
-mode but who cares?). If some stuff in the net extends outside of the
-declared bounding box, it will be outside and that's all. In other
-words, the bounding box announced just reserves room for the net and
-the drawing itself is invisible to \TeX. This allows you to lies on
-the real dimension of your drawings: you can declare a bigger or a
-smaller bounding box, if you want more or less white space around your
-nets.
-
-Before to give bounding box coordinates for a net, you can give
-optional parameters inside square brackets. These parameters are
+box which carry the net drawn (it is actually a |\hbox| set in
+horizontal mode but who cares?). If some parts of the net extends
+outside of the declared bounding box, it will be drawn outside and
+that's all. In other words, the bounding box announced just reserves
+room for the net and the drawing itself is invisible to \TeX. This
+allows you to lies about the real dimension of your drawings: you can
+declare a bigger or a smaller bounding box, if you want more or less
+white space around your nets. This behaviour is different when running
+pdf\LaTeX, see the section~\ref{sec:pdf} for details.
+
+Before to give the coordinates of the bounding box for a net, you can
+give optional parameters inside square brackets. These parameters are
interpreted as PSTricks options which are applied to the following net
and stay local to it. For example, if we have |unit=1cm| before
starting a net, command |\begin{petrinet}[unit=2cm](0,0)(1,1)| starts
a net with |unit=2cm| for its bounding box and any coordinate given
-inside the net. But as the net ends, the old value |unit=1cm| is
+inside the net. But as the net ends, the previous value of |unit| is
restored.
In order to have bounding boxes drawn in your nets: you may use
-command |\showbb|, optionally followed by bracketed options. For
+command |\showbb|, optionally followed by bracketed options. For the
figure~\ref{fig:nodes example}, I added |\showbb| at the beginning of
-the net. The starred version of |\showbb| fills its background and so,
+the net. The starred version of |\showbb| fills the background and so,
command |\showbb*[fillcolor=red]| draws a filled red rectangle over
the bounding box.
To end the drawing, you should use |\endnet| or |\end{petrinet}| (did
you guess?). All macros between these two ones are interpreted as
-PSTricks or Petri-nets commands. From now, we call a {\it net\/} all
-the stuff inclosed between |\begin{petrinet}| and |\end{petrinet}| (if
-you use \LaTeX). One point has to be remembered: inside a net, the end
-of line has a special meaning because it is used to end most
-Petri-nets drawing commands. So if you want to use commands on several
-lines, you have to end every line but the last with a comment
-(|%|). Also notice that if you call |\psset| command inside a net, its
-effect will remain local to this particular net.
+PSTricks or Petri-nets commands. In the following, we call a {\it
+net\/} all the stuff inclosed between |\begin{petrinet}| and
+|\end{petrinet}| (if you use \LaTeX). One point has to be remembered:
+inside a net, the end of line has a special meaning because it is used
+to end most Petri-nets drawing commands. So if you want to use
+commands spread over several lines, you have to end every line but the
+last with a comment (|%|). Also notice that if you call the |\psset|
+command inside a net, its effect will remain local to this particular
+net.
If you wish something to be done every time a net begins, you may set
token list |\everynet| to what you want to be inserted between command
@@ -464,8 +478,8 @@ token list |\everynet| to what you want to be inserted between command
|\everynet={\small}|, all the following nets will be set in small
types.
-Except for beginning and ending nets, all the macros in the following
-are the same under \TeX{} or \LaTeX.
+Except for beginning and ending nets, all the macros are the same
+under \TeX{} or \LaTeX.
%%
%%
@@ -473,13 +487,13 @@ are the same under \TeX{} or \LaTeX.
\subsection{Drawing nodes}
The available node shapes are places, transitions, modules, sources
-and stores, see figure~\ref{fig:nodes} for their looking. They are
-produced from macros |\place|, |\trans|, |\module|, |\source| and
-|\store| respectively. Their size is controlled with dimensions
+and stores, which are drawn in figure~\ref{fig:nodes}. They are
+produced with the macros |\place|, |\trans|, |\module|, |\source| and
+|\store| respectively. Their size is controlled with the dimensions
|\placesize|, |\transsize|, |\modulesize|, |\sourcesize| and
|\storesize| respectively. For instance, |\transsize=8mm| sets the
-size of transitions to |8mm|, |\nodessize{5mm}| sets the size of {\it
-all\/} nodes to |5mm|.
+size of transitions to |8mm|; |\nodessize{5mm}| sets the size of {\it
+all\/} the nodes to |5mm|.
\begin{figure}
\begin{center}
@@ -500,22 +514,22 @@ all\/} nodes to |5mm|.
\label{fig:nodes}
\end{figure}
-Adding a node is made using command ``node\{name\}$(x,y)$label''
-where:
+Creating a node is possible using the command
+``node\{name\}$(x,y)$label'' where:
%
\begin{itemize}
\item ``node'' is one of the above node commands;
-\item ``name'' is the name of this node which must be unique for a
+\item ``name'' is the name of this node which should be unique for a
given net (if not, the new node overwrites the old one). This
name is case sensitive and should not contain any special
characters (as |$|, |\|, etc.); %$
\item ``$(x,y)$'' are the coordinates of the node's center;
\item ``label'' is the text to typeset inside the node, it
extends until the end of the line. This label is silently
- discarded for sources.
+ discarded for stores.
\end{itemize}
-For instance, the nodes in figure~\ref{fig:nodes} where set with
+For instance, the nodes in figure~\ref{fig:nodes} where drawn with the
commands:
%
\begin{verbatim}
@@ -537,22 +551,21 @@ options may be given between square brackets, for instance adding
|[linecolor=red,linewidth=1pt]| leads to a red node with 1pt lines.
For transitions, an additional option |*| may be used in order to have
-the boundaries of the transition fitted to the label typeset
-inside. By default, the size of the nodes is fixed and the label
-overlaps outside if too long, for transitions, with option |*|, the
-size is just fine.
+the boundaries of the transition adjusted to the label typeset inside.
+By default, the size of a node is fixed and the label overlaps outside
+if too long, for transitions with option |*|, the size is just fine.
\subsubsection{Additional labels}
-You can add additional labels to a node. Each label is typeset using
-macro |\label|%
+You can give additional outer labels to a node. Each label is typeset
+using the macro%
%
\footnote{For \LaTeX, this means that the well known cross-referencing
-{\tt\string\label} macro is not available inside a {\tt petrinet}
+macro {\tt\string\label} is not available inside a {\tt petrinet}
environment. But outside, it works as usual.}
%
-which has two arguments: the first is an angle indication and the
-second, which extends until the end of the line, is the text to
+|\label| which has two arguments: the first is an angle indication and
+the second, which extends until the end of the line, is the text to
typeset. The angle indication is a numeric value or a code as
explained earlier. Option |"| explained above is also available for
additional labels (and should be given just after |\label|).
@@ -560,24 +573,24 @@ additional labels (and should be given just after |\label|).
Before I give an example, let me explain a useful parameter for
typesetting label: the token list |\everylabel| is expanded before any
label is typeset. For example, command |\everylabel={\scriptstyle}|
-leads to typeset all labels in script style. This works for really any
-label, not only for nodes labels. If |\everylabel| is set inside a
-net, its effect will remain local to this net.
+leads to typeset all the following labels in script style. This works
+for really any label, not only for nodes labels. If |\everylabel| is
+set inside a net, its effect will remain local to this net.
The figure~\ref{fig:nodes example} has been typeset using the
following commands:
%
\begin{verbatim}
-\begin {petrinet}[xunit=2cm](-.5,-.5)(2.5,.5)
+\begin{petrinet}[xunit=2cm](-.5,-.5)(2.5,.5)
\showbb
\place{p1}(0,0) \bullet
-\trans*"{t}(1,0)~transition~
+\trans*="{t}(1,0)~transition~
\label"{70}more text
-\place!{p2}(2,0) i
- \label{r} \iplace.\left\{ % I can type multi-line
+\place!{p2}(2,0)
+ \label{r} \left\{ % I can type multi-line
{\textstyle 1, 2, 3 \atop % labels, thanks to comments.
\textstyle 4, 5, 6} \right\}
-\end {petrinet}
+\end{petrinet}
\end{verbatim}
\begin{figure}
@@ -585,37 +598,36 @@ following commands:
\begin{petrinet}[xunit=2cm](-.5,-.5)(2.5,.5)
\showbb
\place{p1}(0,0) \bullet
-\trans*"{t}(1,0)~transition~
+\trans*="{t}(1,0)~transition~
\label"{70}more text
-\place!{p2}(2,0) i
- \label{r} \iplace.\left\{ % I can type multi-line
+\place!{p2}(2,0)
+ \label{r} \left\{ % I can type multi-line
{\textstyle 1, 2, 3 \atop % labels, thanks to comments.
\textstyle 4, 5, 6} \right\}
\end{petrinet}
-\caption{Nodes example. (In the PDF, the outside of the bounding box
- is cropped, see section~\ref{sec:pdf}.) }
+\caption{Example of nodes. In the PDF, nets is clipped to its bounding
+ box, see section~\ref{sec:pdf}. }
\label{fig:nodes example}
\end{center}
\end{figure}
You may notice that the net is not well centered, it extends more on
-the right (compare with the caption, which is correctly
-centered). This is because I declared a bounding box of $(-.5,-.5)$ to
-$(2.5,.5)$ while in fact, the label on place $i$ extends on the right,
-outside the bounding box (macro |\showbb| make it visible).
+the right. This is because I declared a bounding box of $(-.5,-.5)$ to
+$(2.5,.5)$ while in fact, the label of the right-most place extends on
+the right, outside of the bounding box (which is made visible by the
+macro |\showbb|).
%%
%%
\subsubsection{Free text}
-Another kind of node is unboxed text. Macro |\text| is similar to
-places and transitions macros but it just typesets the given text,
-centered on the given coordinates. Like for other nodes, the text is
-typeset in math mode and it can be added labels around with macro
-|\label| (which takes care of text's bounding box).
+Another kind of node is unboxed text. The macro |\text| is similar to
+|\trans*| but without border. Like for other nodes, the text is
+typeset in math mode and it can be added outer labels with the macro
+|\label|.
-This macro knows only option |"| which has the usual meaning.
+This macro knows only the option |"| which has the usual meaning.
%%
%%
@@ -623,32 +635,34 @@ This macro knows only option |"| which has the usual meaning.
\subsection{Linking nodes}
You can draw links between two arbitrary nodes. The package won't
-check if requested links are valid from Petri nets point of
-view. Basically, macro |\link| has three parameters: the name of the
-starting node, that of the ending node and then text to typeset on the
-link (which extends until the end of the line). You can add optional
-parameters, before the first node name:
+check if requested links are valid from Petri nets point of view, so
+you can draw an arc between two places for instance. Basically, macro
+|\link| has three parameters: the name of the starting node, that of
+the ending node, and the text to typeset on the link (which extends
+until the end of the line). You can add optional parameters, before
+the first node name:
%
\begin{itemize}
\item options inside square brackets are PSTricks options, as usual;
\item a real number, between 0 and 1, enclosed in angle brackets ({\it
e.g.}, |<.3>|) can be used to specify the position of the label,
between starting and ending nodes. Value 0 stands for ``on
- starting node'' while 1 means ``on ending node''; the default
- value is $.5$ ({\it i.e.}, at the middle of the link);
-\item characters |^|, |_| or |*| may be used to specify the side of
+ the starting node'' while 1 means ``on the ending node''; the
+ default value is $.5$ ({\it i.e.}, on the middle of the link);
+\item the characters |^|, |_| or |*| may be used to specify the side of
the link where the label is typeset. For an link which extends
from the left to the right, |^| means ``above'', |_| means
- ``below'' and |*| is for ``over''. If nothing is specified, the
+ ``below'' and |*| means ``over''. If nothing is specified, the
label is placed above the link;
-\item options |"|, |=| and |!| have their usual meanings;
-\item arrowheads and such can be specified between two |/| signs.
- The available values are shown in figure~\ref{fig:arrows},
+\item the options |"|, |=| and |!| have their usual meanings;
+\item arrowheads and such can be specified between two signs |/|.
+ The available values are shown in the figure~\ref{fig:arrows},
default is no arrow.
\end{itemize}
\begin{figure}
\begin{center}
+\catcode`\|=12
\begin{petrinet}[yunit=6mm](-.6,-.3)(8,15.3)
\pst\catcode`\|=12
\text{caption}(3,15)\rlap{none (default)}
@@ -739,41 +753,41 @@ mixed.}
\end{figure}
The order in which you use these options has no importance, provided
-all options are given before the starting node. Additionally, if you
-use contradicting options, the last used overrides any previous. For
-instance, the two following lines are equivalent:
+that all options are given before the starting node. Additionally, if
+you use contradicting options, only the last used is taken into
+account. For instance, the two following lines are equivalent:
|\link_[linecolor=gray,linewidth=5pt]*<.2>^[linewidth=1pt]|
|\link^<.2>[linecolor=gray,linewidth=1pt]|.
To draw curved links, you should use PSTricks' |arcangle| option which
-is an angle in degrees, measuring the deviation from a straight line
-between nodes, at the start and at the end of the link. Try, it's
-easy.
+is an angle in degrees (you cannot use a letter code here), measuring
+the deviation from a straight line between nodes, at the starting and
+at the ending of the link. Try, it's easy.
-To change the arrowhead appearance, you must change PSTricks'
+To change the appearance of the arrowhead, you must change PSTricks'
parameters |arrowsize|, |arrowlength| and |arrowinset|. Petri-nets
uses the following:
%
\begin{verbatim}
-\psset{arrowsize=3pt 3,
- arrowlength=1.4,
- arrowinset=.4}
+\psset{arrowlength=1.4,
+ arrowinset=0,
+ arrowsize=2pt 2}
\end{verbatim}
%
-I wont explain how it works, just try, it's easy too. (Or read
-PSTricks manual, all details are given.)
+I wont explain how it works, just try, it's easy too. (Or read the
+manual of PSTricks where all the details are given.)
%%
%%
\subsubsection{Additional labels}
-Like for nodes, links can be added more labels. As usual, this is made
-with macro |\label|, but here, its syntax is like for macro |\link|,
-except you must not specify starting and ending nodes (but links
-options are available).
+Like for nodes, links can be added more labels. This is also made with
+the macro |\label|, but here, its syntax is like for the macro
+|\link|, except that you must not specify the starting and ending
+nodes (but the options of |\link| are available).
%%
%%
@@ -781,14 +795,59 @@ options are available).
\subsubsection{Arcs}
Since links are almost always draw with a single arrowhead at the end
-(and then called {\it arcs\/}), a shortcut is provided: macro |\arc|
-may be used instead of |\link/->/|.
+(and then called {\it arcs\/}), a shortcut is provided: the macro
+|\arc| may be used instead of |\link/->/|.
%%
%%
\section{Tips, tricks and troubleshooting}
+\paragraph{Nets as macro arguments.}
+%
+If you try to define a net inside the argument of a macro, you will
+have an error. For instance, the code
+%
+\begin{verbatim}
+\centerline{\begin{petrinet}(0,0)(1,1)
+\place{p}(0,0) p
+\trans{t}(1,1) t
+\arc{p}{t}
+\arc{t}{p}
+\end{petrinet}}
+\end{verbatim}
+%
+produces an error such as:
+%
+\begin{verbatim}
+! Argument of \net:place:draw has an extra }.
+<inserted text>
+ \par
+l.11 \end{petrinet}}
+\end{verbatim}
+
+The reason is that the macro |\centerline| reads all the net and treat
+the end of lines as spaces. Similar things occur with the other
+characters which are considered in a special way inside nets. The
+right way to produce the desired effect is to use the macro
+|\savenet|:
+%
+\begin{verbatim}
+\savenet
+\begin{petrinet}(0,0)(1,1)
+\place{p}(0,0) p
+\trans{t}(1,1) t
+\arc{p}{t}
+\arc{t}{p}
+\end{petrinet}
+\centerline{\shownet}
+\end{verbatim}
+%
+the form |\savenet\begin{petrinet}| works as well and from plain
+{\TeX} you should use the form |\savenet\beginnet|. After one
+|\savenet| you may even use |\shownet| several times in order to
+duplicate the saved net.
+
\paragraph{Error messages.}
%
Sometimes, you'll get an error message such as:
@@ -819,15 +878,15 @@ l.794 \arc[rcangle=30]
?
\end{verbatim}
-This is because on line 794, you misspelled word ``arcangle'', giving
-``rcangle'' instead. This error is detected by PSTricks since
-bracketed arguments are sent verbatim to its macros.
+This is because on line 794, you misspelled the word ``arcangle'',
+giving ``rcangle'' instead. This error is detected by PSTricks since
+bracketed arguments are sent verbatim to it.
-In general, since package |pndraw| uses a lot of tricks in order to
-read arguments of commands, you should not trust too much error
-messages: just look at the line indicated in the message and seek for
-a mistake in the lines before this one. (Actually, this advice can be
-used for almost any error message issued by \LaTeX\dots)
+In general, since the package |pndraw| uses a lot of tricks in order
+to read the arguments of the commands, you should not trust too much
+the error messages: just look at the line indicated in the message and
+seek for a mistake in it or in the lines before. (Actually, this
+advice can be used for almost any error message issued by \LaTeX\dots)
\paragraph{Drawing commands on multiple lines.}
%
@@ -838,15 +897,15 @@ each line but the last with a comment~|%|.
\paragraph{Empty node.}
%
If you want to draw ``floating'' arcs, {\it i.e.}, arcs wich are not
-attached to a place or a transition, you just have to anchor them on
-empty texts: the following net is depicted in figure~\ref{empty text}.
+attached to a place or a transition, you just can anchor them on empty
+texts: the following net is depicted in the figure~\ref{empty text}.
\begin{verbatim}
-\begin {petrinet}(0,0)(2,0)
+\begin{petrinet}(0,0)(2,0)
\text{from}(0,0)
\text{to}(2,0)
\arc{from}{to}
-\end {petrinet}
+\end{petrinet}
\end{verbatim}
\begin{figure}[t]
@@ -863,21 +922,21 @@ empty texts: the following net is depicted in figure~\ref{empty text}.
\paragraph{Text mode labels.}
%
-Take care of the interactions between |\everylabel| and option |"|
-which asks a label to be typset in text mode. For example, setting
+Take care of the interaction between |\everylabel| and the option |"|
+which typesets a label in text mode. For example, setting
|\everylabel{\scriptstyle}| leads to an error every time a text mode
label is typeset because |\scriptstyle| is a math command. So you
-should prefer the long but safe form:
-|\everylabel{\ifmmode\scriptstyle\fi}| which switches to script-style
-only if math mode is set.
+should prefer the longer but safer form: |\everylabel{\ifmmode|\hskip
+0pt|\scriptstyle|\hskip 0pt|\else|\hskip 0pt|\scriptsize|\hskip
+0pt|\fi}|.
\paragraph{Labels at the wrong position.}
%
-If the additional labels you add to a node appear centered on it
-instead of outside, this may come from the way you visualize your
-document. DVI viewers usually do not interpret correctly all of the
-PostScript commands used by PSTricks. Trying a PostScript viewer
-(GhostView is certainly a good choice) may solve your problem.
+If the additional labels of a node appear centered on it instead of
+outside, this may come from the way you visualize your document. DVI
+viewers usually do not interpret correctly all of the PostScript
+commands used by PSTricks. Trying a PostScript viewer (GhostView is
+certainly a good choice) may solve your problem.
\paragraph{To be continued\dots}
@@ -887,61 +946,79 @@ PostScript commands used by PSTricks. Trying a PostScript viewer
\section{Producing PDF documents}
\label{sec:pdf}
-The LaTeX version of |pndraw| provides support for pdf{\LaTeX} through
-the Perl script pn2pdf included in the archive. The usage is quite
-automated, even completely if you run |pdflatex| with the option
-|--shell|. If you don't want to enable this option, run first
-``|pn2pdf document|'' (assuming your file is called |document.tex|)
-and then run |pdflatex|. Using option |--shell| simply allows
-|pdflatex| to run |pn2pdf| for you.
-
-\relax|pn2pdf| produces a file named |document-fig|$i$|.pdf| for each
-environment |petrinet| found in |document.tex|, where $i$ is 1 for the
-first found, 2 for the second one, and so on. These files are
-automatically included during the compilation. A file |document.sum|
-is also produced in order to remember some information which is used
-to avoid recreating |-fig|$i$|.pdf| files if not necessary.
+The {\LaTeX} version of |pndraw| provides some support for pdf{\LaTeX}
+through the Perl script |pn2pdf| included in the archive. The usage is
+quite automated, even completely if you run |pdflatex| with the option
+|--shell|. If you don't want to enable this option, run first
+|pdflatex|, then run |pn2pdf| |-b| |document| (assuming your file is
+called |document.tex|) and finally run |pdflatex| again.\footnote{This
+process was different in the previous version of the package!} Using
+the option |--shell| simply allows |pdflatex| to run |pn2pdf| for you.
+
+Several files are produced by these different runs. You may never see
+most of them since they are deleted when the become useless. {\it Take
+care that none of your files uses one of these names otherwise it will
+be overwrote or deleted!}
+%
+\begin{itemize}
+\item |document.sum| is used to remember some information in order
+ to avoid recreating pictures if not necessary.
+\item |document.|$d$ is created and deleted for test purpose when the
+ option |--shell| has been used, $d$ is the date when |pdflatex|
+ was started, as produced by the macros
+ |\the\year\the\month\the\day\the\time| (in the current document,
+ it leads to \the\year\the\month\the\day\the\time).
+\item |document.bpn| is created when |pdflatex| is run without the
+ option |--shell|, it contains the directives for producing the
+ figures with |pn2pdf -b|.
+\item |document.pre| is used by |pn2pdf| in order to remember the
+ commands (like |\psset|) issued outside of |petrinets|
+ environments.
+\item |document-fig|$n$|.pn|, |document-fig|$n$|.tex|,
+ |document-fig|$n$|.aux|,\\ |document-fig|$n$|.dvi|,
+ |document-fig|$n$|.log|, |document-fig|$n$|.eps| are created
+ during the generation of |document-fig|$n$|.pdf| which contains
+ the rendering of the $n$th net of the document.
+\end{itemize}
+%
+The files |document-fig|$n$|.pdf| should not be deleted before the
+final document is produced since they are included from |pdflatex|. If
+they are not found, a warning is issued during the compilation.
There is several important things you should notice:
%
\begin{enumerate}
-\item Everything outside of the bounding box of a Petri nets is
- cropped during the creation of the PDF figure. So, take care to
+\item Everything outside of the bounding box of a net is
+ cropped during the creation of the PDF picture. So, take care to
check how your picture is rendered (using |\showbb| for
instance).
-\item If you want to use PSTricks commands, you should prefix them
- with |\pst| so they will be properly handled by pdf\LaTeX. If
- you don't use |\pst|, a helpless error message will be issued.
-\item Since each picture is rendered separately, all what you define
- in the document has no effect on the figure (except for the
- material given before |\begin{document}| which is always used).
- You must consider that each picture is a separate document.
\item Only one pass of {\LaTeX} is made on each figure. If you need to
- several passes, use |pn2pdf| with options |-f| and |-k|.
-\item The script |pn2pdf| will generate a picture for each |petrinet|
- environment found in the document, even if it is included, for
- instance in a |verbatim| environment. This is why, in this
- document, examples are typeset |\begin {petrinet}| $\cdots$
- |\end {petrinet}| in order to avoid the creation of a picture.
-\item Notice that {\LaTeX} and {pdf\LaTeX} do not produce identical
+ several passes, you may run |pn2pdf| manually, with the options
+ |-f| and |-k| (see below).
+\item {\LaTeX} and {pdf\LaTeX} do not always produce identical
rendering of the same document. However, Petri-nets pictures
- should be the same since they are always made by \LaTeX.
+ should be the same since they are always typeset by \LaTeX.
\end{enumerate}
-To conclude, here is a summary of the options accepted by |pn2pdf| if
-you have to run it yourself:
-%
-\begin{description}
-\item{{\tt -k}, {\tt --keep}} don't delete the temporary files.
-\item{{\tt -c}, {\tt --clean}} delete these files.
-\item{{\tt -f}, {\tt --force}} recreate pictures even if their source
-did not change.
-\item{{\tt -h}, {\tt --help}} print this help.
-\end{description}
+To conclude, here is a summary of the ways to run |pn2pdf|:
%
-You may produce pictures for several documents, in this case, each
-option applies to all the document given subsequently (in this case,
-|-c| may be useful to override the use of |-k|).
+\begin{itemize}
+\item |pn2pdf document-fig|$n$|.pn|\\
+ generate |pn2pdf document-fig|$n$|.pdf|
+\item the option |-f| or |--force| may be used to force the creation
+ of PDF files even if their source did not change.
+\item |pn2pdf -t FILES| or |pn2pdf --test FILES|\\
+ used by {pdf\LaTeX} in order to check is the option |--shell|
+ was used or not.
+\item |pn2pdf -b document| or |pn2pdf --batch document|\\
+ reads the file |document.bpn| in order to produce the figures.
+\item |pn2pdf -d FILES| or |pn2pdf --delete FILES|\\
+ deletes |FILES| (which may be patterns like |*.aux|), this is
+ use by |pdflatex| in order to remove some temporary files.
+\item the option |-k| or |--keep| prevents |pn2pdf| from deleting the
+ temporary files.
+\item the option |-h| or |--help| prints a short help and exit.
+\end{itemize}
%%
%%
@@ -991,16 +1068,17 @@ option applies to all the document given subsequently (in this case,
\def\>{$\displaystyle\big\rangle$}
\newenvironment{options}{\\[5pt]\begin{tabular}{@{\qquad}ll}}{\end{tabular}}
-The parts placed between \<angle brackets\> are the optional ones, the
-others are mandatory. Symbol \n{} denotes the end of the line.
+The parts placed between angle brackets \<$\cdots$\> are the optional
+ones, the others are mandatory. Symbol \n{} denotes the end of the
+line.
\begin{itemize}
\item |\arc|\<|^_*"=![|options|]<|pos|>|\>|{|node1|}{|node2|}|\<label\>\n\\
Draws a labelled arc between node1 and node2.
\begin{options}
-|^| & label above the arc \\
+|^| & label above the arc (default)\\
|_| & label below the arc \\
-|*| & label on the arc \\
+|*| & label over the arc \\
|"| & label in text mode \\
|=| & double line \\
|!| & thick line \\
@@ -1027,25 +1105,28 @@ Expands tokens each time a label is typeset.
Expands tokens each time a net is started.
%
\item |\label|\<|"{|pos|}|label\>\n\\
-Draws an additional node label.
+ |\label|\<|"<|pos|>|label\>\n\\
+Draws an additional label for a node (first line) or a link (second
+line).
\begin{options}
|"| & label in text mode \\
|{|pos|}| & position of the label, an angle (in degrees) \\
& or a corner code (t,l,b,r,tl,tr,bl,br) \\
+|<|pos|>| & position of the label ($0 \leq$ pos $\leq 1$)\\
\end{options}
%
\item |\link|\<|^_*"=![|options|]<|pos|>/|arrow|/|\>|{|node1|}{|node2|}|\<label\>\n\\
Draws a labelled link between node1 and node2.
\begin{options}
-|^| & label above the arc \\
+|^| & label above the arc (default) \\
|_| & label below the arc \\
-|*| & label on the arc \\
+|*| & label over the arc \\
|"| & label in text mode \\
|=| & double line \\
|!| & thick line \\
|[|options|]| & PSTricks options \\
|<|pos|>| & position of the label ($0 \leq {}$pos${}\leq 1$) \\
-|/|arrow|/| & arrows specifications \\
+|/|arrow|/| & arrows specifications (see the figure~\ref{fig:arrows} \\
\end{options}
%
\item |\module|\<|"=![|options|]|\>|{|name|}|$(x,y)$\<label\>\n\\
@@ -1093,6 +1174,9 @@ Sets PSTricks options.
|yunit=|dim & vertical scale\\
\end{options}
%
+\item |\savenet|\\
+Just before the beginning of a net: saves it without displaying it.
+%
\item |\showbb|\<|*[|options|]|\>\n\\
Draws the bounding box of a net.
\begin{options}
@@ -1100,6 +1184,9 @@ Draws the bounding box of a net.
|[|options|]| & PSTricks options \\
\end{options}
%
+\item |\shownet|\\
+Displays the last net saved by |\savenet|.
+%
\item |\source|\<|"=![|options|]|\>|{|name|}|$(x,y)$\<label\>\n\\
Draws a labelled source centered on $(x,y)$.
\begin{options}
@@ -1112,8 +1199,8 @@ Draws a labelled source centered on $(x,y)$.
\item |\sourcesize=|dimen\\
Sets the size of sources.
%
-\item |\store|\<|"=![|options|]|\>|{|name|}|$(x,y)$\<label\>\n\\
-Draws a labelled store centered on $(x,y)$.
+\item |\store|\<|"=![|options|]|\>|{|name|}|$(x,y)$\n\\
+Draws a store centered on $(x,y)$.
\begin{options}
|"| & label in text mode \\
|=| & double line \\
diff --git a/Master/texmf-dist/doc/latex/petri-nets/pndoc.pdf b/Master/texmf-dist/doc/latex/petri-nets/pndoc.pdf
deleted file mode 100644
index 87cfa9642a3..00000000000
--- a/Master/texmf-dist/doc/latex/petri-nets/pndoc.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/source/latex/petri-nets/pn2pdf b/Master/texmf-dist/source/latex/petri-nets/pn2pdf
deleted file mode 100644
index 38f2deda1eb..00000000000
--- a/Master/texmf-dist/source/latex/petri-nets/pn2pdf
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/perl
-
-## This file is part of the Petri-nets packages. See file README for
-## copyright notice.
-
-use strict;
-use Digest::MD5 qw(md5_hex);
-
-my $keep = 0;
-
-foreach my $job (@ARGV) {
- ##
- ## check argument
- ##
- if ($job =~ /^(-k|--keep)$/) {
- $keep = 1;
- next;
- } elsif ($job =~ /^(-c|--clean)$/) {
- $keep = 0;
- next;
- } elsif ($job =~ /^(-f|--force)$/) {
- unlink "$job.sum" if -f "$job.sum";
- next;
- } elsif ($job =~ /^(-h|--help)$/) {
- print "Usage: pn2pdf [OPTION]... DOC...\n";
- print "Create Petri net figures from DOC.\n\n";
- print " -k, --keep keep temporary files\n";
- print " -c, --clean delete temporary files\n";
- print " -f, --force force the rendering of all pictures\n";
- print " -h, --help display this help and exit\n\n";
- print "Report bugs to <pommereau\@univ-paris12.fr>\n";
- exit 0;
- }
- ##
- ## load MD5 sums if available
- ##
- my %sum = ();
- if (-f "$job.sum") {
- open SUM, "$job.sum"
- or die "pn2pdf: unable to open $job.sum -- $!\n";
- while (<SUM>) {
- if (/(\d+)\s+(.*)/) {
- $sum{$1} = $2;
- } else {
- warn "pn2pdf: invalid checksum in $job.sum\n";
- }
- }
- close SUM;
- }
- ##
- ## process file
- ##
- my $preamble = "";
- open TEX, "$job.tex"
- or die "pn2pdf: unable to open $job.tex -- $!\n";
- open SUM, ">$job.sum"
- or die "pn2pdf: unable to open $job.sum -- $!\n";
- while (<TEX>) {
- $preamble .= $_;
- last if /\\begin\{document\}/;
- $preamble =~ s/(\\begin\{document\}).*$/$1/;
- }
- $preamble .= "\\thispagestyle\{empty\}\n";
- my $count = 0;
- my $petrinet;
- while (<TEX>) {
- last if /^\\end\{document\}$/;
- if (/(\\begin\{petrinet\}.*)/) {
- $count++;
- $petrinet = "$1\n";
- while (<TEX>) {
- $petrinet .= $_;
- last if /\\end\{petrinet\}/;
- }
- $petrinet =~ s/(\\end\{petrinet\}).*$/$1\n/;
- ##
- ## create fig-file
- ##
- my $md5 = md5_hex ("$preamble$petrinet");
- print SUM "$count $md5\n";
- next if ($md5 eq $sum{$count}) && (-f "$job-fig$count.pdf");
- open FIG, ">$job-fig$count.tex"
- or die "pn2pdf: unable to open $job-fig$count.tex -- $!\n";
- print FIG "$preamble$petrinet\\end\{document\}\n";
- close FIG;
- ##
- ## process fig-file
- ##
- system "latex", "$job-fig$count";
- system "dvips", ("-E", "-Pcmz", "-Pamz",
- "-o", "$job-fig$count.eps",
- "$job-fig$count");
- system "epstopdf", "$job-fig$count.eps";
- unlink ("$job-fig$count.tex", "$job-fig$count.log",
- "$job-fig$count.aux", "$job-fig$count.dvi",
- "$job-fig$count.eps") unless $keep;
- }
- }
- close TEX;
- close SUM;
-}
-
diff --git a/Master/texmf-dist/tex/generic/petri-nets/pndraw.sty b/Master/texmf-dist/tex/generic/petri-nets/pndraw.sty
new file mode 100644
index 00000000000..5d9c82585fa
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/petri-nets/pndraw.sty
@@ -0,0 +1,152 @@
+% This file is part of the Petri-nets packages. See file README for
+% copyright notice.
+
+\ProvidesPackage{pndraw}
+
+\newenvironment{petrinet}{\beginnet}{\endnet}
+
+%%
+%% running standard LaTeX
+%%
+
+\usepackage{ifpdf}
+
+\ifpdf
+ \relax
+\else
+ \input pndraw.tex
+ \endinput
+\fi
+
+%%
+%% running pdfLaTeX
+%%
+
+\message{ ** Petri-nets / draw commands ** }
+
+\input pnversion
+
+\usepackage{graphicx}
+
+\newcounter{pncount}
+\setcounter{pncount}{1}
+
+\catcode`\:=11
+
+%%
+%% check for write18
+%%
+
+\begingroup
+ \edef\test{\jobname.\the\year\the\month\the\day\the\time}
+ \immediate\write18{pn2pdf --test \test}
+ \IfFileExists\test{
+ \global\def\pnpdf:run ##1{\immediate\write18{pn2pdf ##1}}
+ \pnpdf:run{--delete \test}
+ }{
+ \newwrite\pnpdf:batch
+ \immediate\openout\pnpdf:batch=\jobname.bpn
+ \global\def\pnpdf:run ##1{\immediate\write\pnpdf:batch{pn2pdf ##1}}
+ \AtEndDocument{\pnpdf:run{--delete \jobname.bpn}}
+ }
+\endgroup
+
+\let\pnpdf:warn=\relax
+
+\newwrite\pnpdf:stream
+
+\def\pnpdf:open:always{%
+ \edef\pnpdf:file{\jobname-fig\thepncount.pn}%
+ \immediate\openout\pnpdf:stream=\pnpdf:file
+ \global\let\pnpdf:open=\relax}
+\global\let\pnpdf:open=\pnpdf:open:always
+
+\def\pnpdf:write #1{\pnpdf:open
+ \immediate\write\pnpdf:stream{#1}}
+
+\begingroup
+ \catcode`|=0
+ \catcode`[=1
+ \catcode`]=2
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\\=12
+ |long|gdef|pnpdf:read #1\end{petrinet}[|pnpdf:write[#1]|end[petrinet]]
+|endgroup
+
+{\catcode`\^^M=\active %
+\gdef\pnpdf:catcodes{\bgroup %
+ \catcode`\{=12 \catcode`\}=12 \catcode`\$=12 %
+ \catcode`\&=12 \catcode`\#=12 \catcode`\^=12 %
+ \catcode`\%=12 \catcode`\ =12 \catcode`\_=12 %
+ \catcode`\~=12 \catcode`\\=12 \catcode`\^^M=\active \def^^M{^^J}}}
+
+{\catcode`\%=12 \catcode`\!=14 \catcode`\^^M=\active !
+ \gdef\beginnet{\pnpdf:write{\string\begin{petrinet}\string%}!
+ \catcode`\^^M=\active\let^^M=\relax !
+ \pnpdf:catcodes\pnpdf:read}}
+
+\def\show:net:always{%
+ \IfFileExists{\jobname-fig\thepncount.pdf}%
+ {\includegraphics{\jobname-fig\thepncount.pdf}}%
+ {\message{<missing \jobname-fig\thepncount.pdf>}%
+ \global\def\pnpdf:warn{\typeout{^^J*** Run "pn2pdf
+ --batch \jobname.bpn" in order to build the
+ figures^^J}}}}
+
+\def\endnet{\egroup
+ \pnpdf:write{\string\end{petrinet}}%
+ \immediate\closeout\pnpdf:stream
+ \global\let\pnpdf:open=\pnpdf:open:always
+ \pnpdf:run{\jobname-fig\thepncount.pn}%
+ \show:net\addtocounter{pncount}{1}}
+
+\let\show:net=\show:net:always
+\def\savenet{\global\def\show:net{\global\let\show:net\show:net:always}}
+
+\def\shownet{\addtocounter{pncount}{-1}\show:net:always
+ \addtocounter{pncount}{1}}
+
+\def\everynet{\begingroup\afterassignment\endgroup\toks0}
+\def\everylabel{\begingroup\afterassignment\endgroup\toks0}
+\def\psset #1{}
+\def\nodessize #1{}
+\def\placesize{\begingroup\afterassignment\endgroup\dimen0}
+\def\transsize{\begingroup\afterassignment\endgroup\dimen0}
+\def\storesize{\begingroup\afterassignment\endgroup\dimen0}
+\def\modulesize{\begingroup\afterassignment\endgroup\dimen0}
+\def\sourcesize{\begingroup\afterassignment\endgroup\dimen0}
+
+\AtBeginDocument{
+ \def\everynet{\bgroup\afterassignment\everynet:next\toks0}
+ \def\everynet:next{\pnpdf:write{\string\everynet{\expandafter
+ \noexpand\the\toks0}}\egroup}
+ \def\everylabel{\bgroup\afterassignment\everylabel:next\toks0}
+ \def\everylabel:next{\pnpdf:write{\string\everylabel{\expandafter
+ \noexpand\the\toks0}}\egroup}
+ \def\psset{\bgroup\afterassignment\psset:next\toks0}
+ \def\psset:next{\pnpdf:write{\string\psset{\expandafter
+ \noexpand\the\toks0}}\egroup}
+ \def\nodessize{\bgroup\afterassignment\nodessize:next\toks0}
+ \def\nodessize:next{\pnpdf:write{\string\nodessize{\expandafter
+ \noexpand\the\toks0}}\egroup}
+ \def\placesize{\bgroup\afterassignment\placesize:next\dim0}
+ \def\placesize:next{\edef\command{{\string\placesize=\the\dim0}}%
+ \expandafter\pnpdf:write\command}
+ \def\transsize{\bgroup\afterassignment\transsize:next\dim0}
+ \def\transsize:next{\edef\command{{\string\transsize=\the\dim0}}%
+ \expandafter\pnpdf:write\command}
+ \def\storesize{\bgroup\afterassignment\storesize:next\dim0}
+ \def\storesize:next{\edef\command{{\string\storesize=\the\dim0}}%
+ \expandafter\pnpdf:write\command}
+ \def\modulesize{\bgroup\afterassignment\modulesize:next\dim0}
+ \def\modulesize:next{\edef\command{{\string\modulesize=\the\dim0}}%
+ \expandafter\pnpdf:write\command}
+ \def\sourcesize{\bgroup\afterassignment\sourcesize:next\dim0}
+ \def\sourcesize:next{\edef\command{{\string\sourcesize=\the\dim0}}%
+ \expandafter\pnpdf:write\command}}
+
+\AtEndDocument{\pnpdf:run{--delete \jobname.pre}
+ \pnpdf:warn}
+
+\catcode`\:=12
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pndraw.tex b/Master/texmf-dist/tex/generic/petri-nets/pndraw.tex
index 92de5fcc321..9433a4b7190 100644
--- a/Master/texmf-dist/tex/latex/petri-nets/pndraw.tex
+++ b/Master/texmf-dist/tex/generic/petri-nets/pndraw.tex
@@ -68,7 +68,9 @@
dimen=iner,
labelsep=2pt,
arcangle=0,
- arrowsize=3pt 3}
+ arrowlength=1.4,
+ arrowinset=0,
+ arrowsize=2pt 2}
% nodes sizes
\newdimen\placesize
@@ -102,7 +104,8 @@
\def\net:bottom:left{#1}\def\net:top:right{#2}%
% adds white points in order to setup bounding box for a possible
% `dvips -E'
- \rput(#1){{\white.}}\rput(#2){{\white.}}%
+ \rput(#1){{\white\vrule width 1sp height 1sp depth 0sp}}%
+ \rput(#2){{\white\vrule width 1sp height 1sp depth 0sp}}%
\the\everynet}
{\catcode`\^^M=\active \let^^M=\relax %
@@ -121,7 +124,18 @@
\catcode`\^^M=\active\let^^M=\relax%
\getopt{net}\relax}}
-\def\endnet{\endpspicture\endopt\egroup}
+\let\begin:net=\beginnet
+
+\def\endnet{\endpspicture\endopt\egroup
+ \global\let\beginnet=\begin:net}
+
+\newbox\net:box
+
+\def\save:net\leavevmode{\global\setbox\net:box}
+
+\def\savenet{\def\beginnet{\expandafter\save:net\begin:net}}
+
+\def\shownet{{\setbox0\copy\net:box\unhbox0}}
%%
%% globally used for labels
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pnets.sty b/Master/texmf-dist/tex/generic/petri-nets/pnets.sty
index 5949538e4d7..5949538e4d7 100644
--- a/Master/texmf-dist/tex/latex/petri-nets/pnets.sty
+++ b/Master/texmf-dist/tex/generic/petri-nets/pnets.sty
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pnets.tex b/Master/texmf-dist/tex/generic/petri-nets/pnets.tex
index 7e5e26203ed..7e5e26203ed 100644
--- a/Master/texmf-dist/tex/latex/petri-nets/pnets.tex
+++ b/Master/texmf-dist/tex/generic/petri-nets/pnets.tex
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pntext.sty b/Master/texmf-dist/tex/generic/petri-nets/pntext.sty
index 1f337cfe5d7..1f337cfe5d7 100644
--- a/Master/texmf-dist/tex/latex/petri-nets/pntext.sty
+++ b/Master/texmf-dist/tex/generic/petri-nets/pntext.sty
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pntext.tex b/Master/texmf-dist/tex/generic/petri-nets/pntext.tex
index 17e477c00de..17e477c00de 100644
--- a/Master/texmf-dist/tex/latex/petri-nets/pntext.tex
+++ b/Master/texmf-dist/tex/generic/petri-nets/pntext.tex
diff --git a/Master/texmf-dist/tex/generic/petri-nets/pnversion.tex b/Master/texmf-dist/tex/generic/petri-nets/pnversion.tex
new file mode 100644
index 00000000000..70a068282d8
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/petri-nets/pnversion.tex
@@ -0,0 +1 @@
+\def\pnversion{2006-03-02}
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pndraw.sty b/Master/texmf-dist/tex/latex/petri-nets/pndraw.sty
deleted file mode 100644
index f3f460fdaea..00000000000
--- a/Master/texmf-dist/tex/latex/petri-nets/pndraw.sty
+++ /dev/null
@@ -1,54 +0,0 @@
-% This file is part of the Petri-nets packages. See file README for
-% copyright notice.
-
-\ProvidesPackage{pndraw}
-
-\newenvironment{petrinet}{\beginnet}{\endnet}
-
-%%
-%% running standard LaTeX
-%%
-
-\begingroup
- \catcode`\:=11
- \gdef\input:pndraw{\input pndraw.tex
- \endinput}
- \expandafter\ifx\csname pdfoutput\endcsname\relax
- \aftergroup\input:pndraw
- \fi
-\endgroup
-
-%%
-%% running pdfLaTeX
-%%
-
-\input pnversion
-
-\usepackage{graphicx}
-
-\newcounter{pncount}
-\setcounter{pncount}{0}
-
-\catcode`\:=11
-{\catcode`\^^M=\active \let^^M=\relax %
- \global\def\net:drop #1^^M{}%
- \global\def\beginnet #1(#2)(#3){\bgroup%
- \let\pst=\net:drop%
- \let\place=\net:drop%
- \let\trans=\net:drop%
- \let\store=\net:drop%
- \let\module=\net:drop%
- \let\source=\net:drop%
- \let\text=\net:drop%
- \let\link=\net:drop%
- \let\arc=\net:drop%
- \let\label=\net:drop%
- \let\showbb=\net:drop%
- \catcode`\^^M=\active\let^^M=\relax}}
-\catcode`\:=12
-
-\def\endnet{\egroup
- \addtocounter{pncount}{1}%
- \includegraphics{\jobname-fig\thepncount.pdf}}
-
-\immediate\write18{pn2pdf \jobname}
diff --git a/Master/texmf-dist/tex/latex/petri-nets/pnversion.tex b/Master/texmf-dist/tex/latex/petri-nets/pnversion.tex
deleted file mode 100644
index 14177fe6023..00000000000
--- a/Master/texmf-dist/tex/latex/petri-nets/pnversion.tex
+++ /dev/null
@@ -1 +0,0 @@
-\def\pnversion{2002-10-13}
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 75b2bb1486e..cd8ca4bf7ac 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -285,7 +285,7 @@ my @TLP_working = qw(
pdf-trans pdfcomment pdfcprot pdfcrop pdfjam pdfmarginpar
pdfpages pdfscreen pdfslide pdfsync pdftex-def pdftricks pdfx
pecha perception perltex
- permute persian-bib persian-modern petiteannonce
+ permute persian-bib persian-modern petiteannonce petri-nets
pgf pgf-soroban pgf-umlsd pgfgantt pgfmolbio pgfopts pgfplots
phaistos philex philosophersimprint
phonetic photo physymb piano picinpar pict2e pictex pictex2 piff pigpen
@@ -382,7 +382,7 @@ my @TLP_working = qw(
tokenizer toolbox tools topfloat totcount totpages toptesi
trajan
translation-arsclassica-de translation-chemsym-de
- translation-europecv-de translation-evc-de
+ translation-europecv-de translation-ecv-de
translation-filecontents-de translation-moreverb-de
tree-dvips trfsigns trimspaces trivfloat trsym truncate
tsemlines