TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:



\pause\item Something something something something.
\pause\item Something else something else.

%import graph;


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.

share|improve this question
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
Try adding [fragile] option to \begin{frame} – Aditya Jun 2 '12 at 18:04
up vote 8 down vote accepted

you have to use


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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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