summaryrefslogtreecommitdiff
path: root/graphics/metapost/contrib/macros/automata/example.tex
blob: 4544ebb0325187f1f8bbb88c42b2202aee95134a (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
\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\\
        \url{gabriele.puppis@gmail.com}}

\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 of automaton}\label{fig:example}
\end{figure}

\end{document}