6

On compilation, I just see

enter image description here

Why isn't the class visible? Here is the code:

\documentclass{beamer}
\usepackage[shellescape,latex]{gmp}
\usetheme{Montpellier}
\title{Something}
\date{\today}

\begin{document}

\frame{\titlepage}

\section[Outline]{}
\frame{\tableofcontents}

\section{something}
\subsection{Class Diagram}
\frame
{
\frametitle{Frame 1}
    \begin{figure}
        \centering
        \begin{mpost}[mpsettings=input metauml;]
            Usecase.U("Authenticate user",
            "by name, password");
            drawObject(U);        
        \end{mpost}
        \caption{Something}
    \end{figure}
}
\end{document}
0

2 Answers 2

8

In section 5 of the documentation of gmp you find

\usempxclass [⟨options⟩] {⟨class⟩}
This has the same syntax as \documentclass. Its purpose is to declare the class used for the runs of TeX or LaTeX for preparing the mpx files which METAPOST needs to draw the text labels. It should be not necessary to change it from the default (which is article). But if you are using a non standard class with a non standard type size (i.e., not 10, 11 or 12 point size), then you will need to declare a class, otherwise your labels will be typeset in 10 point type.

I didn't test the package with beamer, actually. But it falls in this category, so you can solve the problem by stating

\usempxclass{article}

in the preamble.

\documentclass{beamer}
\usepackage[shellescape,latex]{gmp}
\usempxclass{article}

\usetheme{Montpellier}
\title{Something}
\date{\today}

\begin{document}

\frame{\titlepage}

\section[Outline]{}
\frame{\tableofcontents}

\section{something}
\subsection{Class Diagram}
\begin{frame}
\frametitle{Frame 1}
\begin{figure}
\centering
\begin{mpost}[mpsettings=input metauml]
  Usecase.U("Authenticate user",
   "by name, password");
   drawObject(U);        
\end{mpost}
\caption{Something}
\end{figure}
\end{frame}
\end{document}

enter image description here

1
  • 1
    +1 for reading the manual (perhaps that should have been -1 for reading a manual) Commented Jun 18, 2013 at 21:39
5

enter image description here

You need to use

pdflatex -shell-escape   yourfile

to allow the mp back end.

Also apparently for beamer you need to set the pointsize:

\documentclass{beamer}
\makeatletter
\def\@ptsize{10}
\makeatother
\usepackage[shellescape,latex]{gmp}
\usetheme{Montpellier}
\title{Something}
\date{\today}

\begin{document}

\frame{\titlepage}

\section[Outline]{}
\frame{\tableofcontents}

\section{something}
\subsection{Class Diagram}
\frame
{
\frametitle{Frame 1}
    \begin{figure}
        \centering
        \begin{mpost}[mpsettings=input metauml;]
            Usecase.U("Authenticate user",
            "by name, password");
            drawObject(U);        
        \end{mpost}
        \caption{Something}
    \end{figure}
}
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .