10

I have problem using the emp package in TeXlive 2010. When I try to use it with empcmds it prints contents to output. If I use emp it parser fails after first character.

Also - how should I import libraries such as MetaUML.

Edit: Code

\documentclass[a4paper,11pt]{article}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{emp}
\author{Maciej~M.~Piechotka}
\title{MetaUML}
\begin{document}

\begin{emp}
input metauml;

beginfig(1);
Class.A("Point")
       ("+x: int",
        "+y: int") ();

Class.B("Circle")
       ("radius: int")
       ("+getRadius(): int",
        "+setRadius(r: int):void");

topToBottom(45)(A, B);

drawObjects(A, B);

clink(aggregationUni)(A, B)
endfig;

end;

\end{emp}

\end{document}

and error:

! Use of \emp@ doesn't match its definition.
<recently read> i

l.10 i
      nput metauml;

Final result:

\documentclass[a4paper,11pt]{article}
\usepackage{emp}
\usepackage[pdftex]{graphicx}
\author{Maciej~M.~Piechotka}
\title{MetaUML}
\begin{document}
\DeclareGraphicsRule{*}{mps}{*}{}

\begin{empfile}
\begin{empcmds}
input metauml;
\end{empcmds}

Hi there:
\begin{emp}[uml1](20,20)
Class.A("Point")
       ("+x: int",
        "+y: int") ();

Class.B("Circle")
       ("radius: int")
       ("+getRadius(): int",
        "+setRadius(r: int):void");

topToBottom(45)(A, B);

drawObjects(A, B);

link(aggregationUni)(A, B);
\end{emp}
\end{empfile}
\immediate\write18{mpost -tex=latex \jobname}
\end{document}
Caramdir
  • 89,023
  • 26
  • 255
  • 291

1 Answers1

10

From the emp documentation: "Required arguments are the width and the height of the figure, in units of \unitlength [...] \begin{emp}[⟨name⟩](⟨width⟩,⟨height⟩)"

So you need to write

\begin{emp}(100,100)

or whatever.