8

I'm wondering anyone else has experienced compatibility issues between Asymptote and Beamer format, and what the fixes are. For example, I'm able to get a pdf output when I compile the following:

\documentclass{beamer}
\usepackage{amsmath,amssymb,amsthm,asymptote,graphicx}
\mode<presentation>

\begin{document}

\begin{frame}
\frametitle{Outline}
\begin{itemize}
\pause\item Something something something something.
\pause\item Something else something else.
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Diagram}
%\begin{center}
%\begin{asy}
%import graph;
%size(150,150,Aspect);
%scale(true);
%draw((-2,-2)--(2,2),gray);
%dot("$(-2,-2)$",Scale((-2,-2)),S);
%dot("$(2,2)$",Scale((2,2)),N);
%\end{asy}
%\end{center}
\end{frame}

\end{document}

But not when I take out the comments on the Asymptote portion.

I found useful the "Beamer All The Way" presentation, where I noticed near the end of the presentation he included an Asymptote animation of a drawing of a polar graph. I also currently have my version of TeXnicCenter 2 Alpha set up the way described in the Advanced Configuration of the Art of Problem Solving Wiki.

I'd also like to point out that (I think...) the Asymptote compiler in LaTeX needs the \end{asy} argument to not be indented. The error I'm getting has to do with the "scanning error of \next", which is typically some violation of environment rules in compilation. Is it true that the Beamer installation "needs" the \end{frame} to not be indented, and this is where the error is occurring? Thanks ahead of time for your input.

  • Indentation in beamer code follows the same rules as for LaTeX in general: indentation in the source is generally ignored (except for verbatim environments and other similar situations). – egreg Jun 2 '12 at 17:58
  • 1
    Try adding [fragile] option to \begin{frame} – Aditya Jun 2 '12 at 18:04
9

you have to use

\begin{frame}[fragile]


for the asy source code and a pdflatex run with the option -shell-escape if you want to run asy from within the LaTeX source.

  • Wonderful, works like a charm. Thanks, and I'll look at what the [fragile] extension does for a frame. – JAKarpis Jun 2 '12 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.