2

I'm using the beamer class to create a presentation. I'd like to include a gnuplot graph, but inside the frame environment, that seems to be impossible. When running pdflatex, I get the error

! File ended while scanning use of \next.

which I don't understand. Can you tell me how I solve this?

Example:

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[miktex]{gnuplottex}    %I'm using miktex
\usepackage{epstopdf}
\usepackage{graphicx}

\begin{document}

\begin{frame}\frametitle{Gnuplot in Beamer Class}
\begin{figure}[htbp]
\centering
\begin{gnuplot}[terminal=cairolatex]
plot [0:2*pi] sin(x) with lines title 'sine'
\end{gnuplot}
\caption{A plot.}
\end{figure}
\end{frame}

\end{document}
Don
  • 343
  • 2
  • 3
  • 8
  • 1
    Try using \begin{frame}[fragile] – Jake Sep 25 '13 at 15:26
  • Cool, glad it helps! There's been a similar question before (though about pgfplots instead of gnuplottex), so I think it might be best to close this as a duplicate. – Jake Sep 25 '13 at 16:58
  • @Jake I didn't find out whether I have to do anything for this or if you it's enough that you marked it as a duplicate already? – Don Sep 25 '13 at 17:14
  • You don't have to do anything: others will probably add their votes to close this, and once five people have done so, the question will be closed. – Jake Sep 25 '13 at 17:15

0 Answers0