summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/petri-nets/pndraw.sty
blob: f3f460fdaea78579a6650eb62835f17d23f343e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% 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}