diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-25 22:22:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-25 22:22:25 +0000 |
commit | 2c266513a7d7727e1adbcbfca59d5e7dbfdfd2e0 (patch) | |
tree | a8f606660c9f134ae2cc80bc4c74219eb589bd29 /Master/texmf-dist/tex | |
parent | 86e8221f09069b58618c78721f104b3628f8fb16 (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/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/petri-nets/pndraw.sty | 152 | ||||
-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.tex | 1 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/petri-nets/pndraw.sty | 54 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/petri-nets/pnversion.tex | 1 |
9 files changed, 170 insertions, 58 deletions
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} |