[OS X TeX] Help with asymptote

Herbert Schulz herbs at wideopenwest.com
Wed Oct 6 18:56:46 CEST 2010


On Oct 6, 2010, at 10:44 AM, Steven Chapin wrote:

> Hi,
> 
> I consider myself pretty fluent in LaTex, but I'm really a novice at UNIX.  I am using MacTeX-2010 and am interested in playing around with asymptote.  I think I've read on this list that MacTeX-2010 "comes with" asymptote.  Anyway, I copied the following and ran it with pdflatex:
> 
> \documentclass[10pt]{article}
> \usepackage{graphicx}
> \usepackage{asymptote}
> \begin{document}
> \begin{figure}
> \centering
> \begin{asy}
> size (3cm);
> draw (unitcircle);
> \end{asy}
> \caption{Embedded Asymptote figures are easy!}
> \label{fig:embedded}
> \end{figure}
> \end{document}
> 
> I got the caption, but not the circle.
> 
> I would be grateful for any assistance.
> 
> I will also paste the log file here.
> ...

Howdy,

I names the file above test.tex. After running pdflatex you'll notice that there is a test-1.asy in the folder. That file needs to be compiled by asy;

asy test-1.asy

in Terminal (after changing to the directory with the file). Then you must compile with pdflatex again.

If you are using TeXShop for your editing there is an engine that will take care of all of that, and more, for you. Move the file ~/Library/TeXShop/Engines/Inactive/Latexmk/asymptotemk.engine (NOTE: ~/Library/ is the Library folder in your HOME folder) two directories up, to ~/Library/TeXShop/Engines/ to activate that engine. Then, after restarting TeXShop, put the line

% !TEX TS-program = asymptotemk

at the top of your file and simply Typeset->Typeset (Cmd-T) the file. This will do all the necessary compilation as well as take care of bibliographies and indexes generation and cross-references, etc.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the macostex-archives mailing list