| 1 |
\documentclass{article} |
| 2 |
\usepackage{a4wide} |
| 3 |
\usepackage[english]{babel} |
| 4 |
\usepackage[latin1]{inputenc} |
| 5 |
\selectlanguage{english} |
| 6 |
\usepackage{amsmath,url,graphics,verbatim} |
| 7 |
\DeclareGraphicsRule{*}{mps}{*}{} |
| 8 |
|
| 9 |
\begin{document} |
| 10 |
|
| 11 |
\title{An example of automaton generated\\with the MetaPost package \url{automata.mp}} |
| 12 |
\author{Gabriele Puppis\\ |
| 13 |
\url{[email protected]}} |
| 14 |
|
| 15 |
\maketitle |
| 16 |
|
| 17 |
This \LaTeX\ document shows how to include a picture generated with MetaPost. |
| 18 |
By default, the extension of a file generated with MetaPost is a number |
| 19 |
(e.g., \url{.0}), so you should use the package \url{graphics} and the command |
| 20 |
\verb \DeclareGraphicsRule{*}{mps}{*}{} to make \LaTeX\ recognize these |
| 21 |
extensions as files in PS format. |
| 22 |
|
| 23 |
The file \url{example.mp} contains the MetaPost source code that was used to generate |
| 24 |
the automaton in Figure \ref{fig:example}. This file should be compiled with MetaPost |
| 25 |
(e.g., run ``\verb mp \verb -tex=latex \verb example.mp '' from the shell command |
| 26 |
line). Such an example uses the package \url{automata.mp} to easily draw the states |
| 27 |
and the transitions of the automaton (you can find some documentation inside the files |
| 28 |
\url{example.mp} and \url{automata.mp}). |
| 29 |
|
| 30 |
\begin{figure}[!!h] |
| 31 |
\centering\includegraphics{example.0} |
| 32 |
\caption{An example of automaton}\label{fig:example} |
| 33 |
\end{figure} |
| 34 |
|
| 35 |
\end{document} |