diff options
author | Karl Berry <karl@freefriends.org> | 2007-07-16 16:30:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-07-16 16:30:43 +0000 |
commit | a139ebaf3bcef1c8ad4177ead9ac6ed426f6b6e0 (patch) | |
tree | 956ca4f0b861b9d488a3d17375953394cab420ec /Master/texmf-dist/doc/metapost | |
parent | f3105f85f6529b65da9843627709258f82d384fa (diff) |
new metapost package automata 0.1 (4jul07)
git-svn-id: svn://tug.org/texlive/trunk@4617 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/metapost')
-rw-r--r-- | Master/texmf-dist/doc/metapost/automata/README | 42 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/automata/example.mp | 67 | ||||
-rw-r--r-- | Master/texmf-dist/doc/metapost/automata/example.pdf | bin | 0 -> 56311 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/metapost/automata/example.tex | 36 |
4 files changed, 145 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/automata/README b/Master/texmf-dist/doc/metapost/automata/README new file mode 100644 index 00000000000..9345ec96569 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/automata/README @@ -0,0 +1,42 @@ +AUTOMATA.MP - version 0.2 + +This package is a collection of macros for METAPOST to +make easier to draw finite-state machines, automata, +labeled graphs, etc. Nodes can be either isolated or +arranged into matrices or trees; edges connect pairs +of nodes through arbitrary paths. Some parameters can +be specified to define different shapes for nodes and/or +different styles for the edges. + +The archive consists of the following files: + +- README This file + +- automata.mp This file defines the macros. It should + be included in a main .mp file by using the directive + input automata; + +- example.mp This is a short example of an .mp file + that produces a finite-state automaton + (it should be compiled with metapost using + mp -tex=latex example.mp + and it should produce a PS file named example.0) + +- example.0 This is the PS file generated from + example.mp + +- example.tex This shows how to include MetaPost + figures in a LaTeX document + +- example.pdf This is the PDF file generated from + example.tex + + +The material is subject to the LaTeX Project Public +License and it can be downloaded from the web page + http://users.dimi.uniud.it/~gabriele.puppis +by following the link "Other links". + + +Gabriele Puppis - gabriele.puppis@dimi.uniud.it +University of Udine - Italy diff --git a/Master/texmf-dist/doc/metapost/automata/example.mp b/Master/texmf-dist/doc/metapost/automata/example.mp new file mode 100644 index 00000000000..88cbc2eca43 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/automata/example.mp @@ -0,0 +1,67 @@ +input automata; + +verbatimtex +% generic layout +\documentclass{article} +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\selectlanguage{english} +% additional packages +\usepackage{amsmath} +\begin{document} +etex + + +% SIMPLE EXAMPLE FOR THE PACKAGE automata.mp + +beginfig(0); + + % settings for some global parameters + size := 15; + incominglength := 25; + loopsize := 22; + + % instead of using `spacing := (36,29)' + % one could use `with spacing((36,29))' to temporarily change the value of the parameter + with spacing((36,29)) matrix.a(7,10); + + % one can use directives btex etex to include LaTeX-compiled labels + node.a[4][0](btex $s_0$ etex); + node.a[4][2](btex $s_1$ etex); + node.a[4][4](btex $s_2$ etex); + node.a[4][6](btex $s_3$ etex); + node.a[4][8](btex $s_4$ etex); + node.a[2][2](btex $s_5$ etex); + node.a[2][5](btex $s_6$ etex); + node.a[1][6](btex $s_7$ etex); + % there are some predefined shorhands for modified styles of nodes and arrows + % (e.g., `node_double ...' is equivalent to `with border(double) node ...') + node_double.a[1][8](btex $s_8$ etex); + + incoming(0, "") (a[4][0]) 120; + loop.bot(.65, btex \small $a$ etex) (a[4][0]) -165; + % paths can be simple expressions (e.g., point..point) ... + arrow_dash.bot(.5, btex \small $b$ etex) (a[4][0],a[4][2]) a[4][0].c..a[4][2].c; + arrow.bot(.5, btex \small $a$ etex) (a[4][2],a[4][4]) a[4][2].c..a[4][4].c; + arrow.bot(.5, btex \small $a$ etex) (a[4][4],a[4][6]) a[4][4].c..a[4][6].c; + arrow.bot(.5, btex \small $a$ etex) (a[4][6],a[4][8]) a[4][6].c..a[4][8].c; + % ...or more complex expressions (e.g., point..point---point...point) + % (BUG: directive `{dir <angle>}' does not work with arrows, but `{up}' does) + arrow.bot(.5, btex \small $c$ etex) (a[4][8],a[4][0]) a[4][8].c..a[5][7].c---a[5][1].c..a[4][0].c; + % one can rotate labels as usual in MetaPost + arrow_dash.rt(.5, btex \small $a$ etex rotated 90) (a[4][2],a[2][2]) a[4][2].c..a[2][2].c; + arrow.bot(.5, btex \small $c$ etex rotated 39) (a[2][2],a[4][0]) a[2][2].c..a[4][0].c; + arrow_dash.bot(.5, btex \small $a$ etex) (a[2][2],a[2][5]) a[2][2].c..a[2][5].c; + arrow_dash.rt(.5, btex \small $a$ etex rotated 90) (a[4][6],a[1][6]) a[4][6].c..a[1][6].c; + arrow.top(.5, btex \small $a$ etex) (a[1][6],a[1][8]) a[1][6].c..a[1][8].c; + % again some complex paths for arrows... + arrow.bot(.38, btex \small $c$ etex) (a[2][5],a[4][0]) + a[2][5].c..a[1][4].c---a[1][2].c shifted(-10,0)..a[2][1].c shifted (-10,0)---a[4][0].c; + arrow_bold.bot(.5, btex \small $c$ etex) (a[1][8],a[4][0]) + a[1][8].c..a[2][9].c---a[5][9].c..a[6][8].c---a[6][1].c..a[5][0].c---a[4][0].c; + arrow_bold.top(.38, btex \small $c$ etex) (a[1][8],a[4][0]) + a[1][8].c..a[0][7].c---a[0][1].c..a[1][0].c---a[4][0].c; + +endfig; + +end.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/metapost/automata/example.pdf b/Master/texmf-dist/doc/metapost/automata/example.pdf Binary files differnew file mode 100644 index 00000000000..0d2ab2d5735 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/automata/example.pdf diff --git a/Master/texmf-dist/doc/metapost/automata/example.tex b/Master/texmf-dist/doc/metapost/automata/example.tex new file mode 100644 index 00000000000..d84c855c67f --- /dev/null +++ b/Master/texmf-dist/doc/metapost/automata/example.tex @@ -0,0 +1,36 @@ +\documentclass{article} +\usepackage{a4wide} +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\selectlanguage{english} +\usepackage{amsmath,url,graphics,verbatim} +\DeclareGraphicsRule{*}{mps}{*}{} + +\begin{document} + +\title{An example of automaton generated\\with the MetaPost package \url{automata.mp}} +\author{Gabriele Puppis\\ + \emph{Dipartimento di Matematica e Informatica, Università di Udine, Italy}\\ + \url{gabriele.puppis@dimi.uniud.it}} + +\maketitle + +This \LaTeX\ document shows how to include a picture generated with MetaPost. +By default, the extension of a file generated with MetaPost is a number +(e.g., \url{.0}), so you should use the package \url{graphics} and the command +\verb \DeclareGraphicsRule{*}{mps}{*}{} to make \LaTeX\ recognize these +extensions as files in PS format. + +The file \url{example.mp} contains the MetaPost source code that was used to generate +the automaton in Figure \ref{fig:example}. This file should be compiled with MetaPost +(e.g., run ``\verb mp \verb -tex=latex \verb example.mp '' from the shell command +line). Such an example uses the package \url{automata.mp} to easily draw the states +and the transitions of the automaton (you can find some documentation inside the files +\url{example.mp} and \url{automata.mp}). + +\begin{figure}[!!h] +\centering\includegraphics{example.0} +\caption{An example pf automaton}\label{fig:example} +\end{figure} + +\end{document}
\ No newline at end of file |