Difference between revisions of "Asymptote: Macintosh"
(→Installing Asymptote on a Mac) |
m (→Usage: fixed line breaks in tex code) |
||
Line 36: | Line 36: | ||
Here is a sample file: | Here is a sample file: | ||
− | |||
\documentclass[letterpaper,12pt]{article} | \documentclass[letterpaper,12pt]{article} | ||
\usepackage{amsmath} | \usepackage{amsmath} | ||
Line 47: | Line 46: | ||
draw((0,0)--(1,1),blue); | draw((0,0)--(1,1),blue); | ||
\end{asy} | \end{asy} | ||
− | \end{document} | + | \end{document} |
Use whatever LaTeX editor to compile the file. It will return a warning that looks something like this: | Use whatever LaTeX editor to compile the file. It will return a warning that looks something like this: | ||
− | |||
Package asymptote Warning: file asyfile_1.pdf does not exist on input line 17. | Package asymptote Warning: file asyfile_1.pdf does not exist on input line 17. | ||
− | |||
Terminal again. | Terminal again. | ||
− | |||
cd ~/Desktop | cd ~/Desktop | ||
asy asyfile | asy asyfile | ||
− | |||
That will run asymptote on the file '''asyfile.asy,''' (created when the tex file was compiled) producing '''asyfile_1.pdf.''' | That will run asymptote on the file '''asyfile.asy,''' (created when the tex file was compiled) producing '''asyfile_1.pdf.''' |
Revision as of 00:03, 13 October 2012
Asymptote (Vector Graphics Language) |
Getting Started - Basics - Reference - Examples - Macros and Packages - Advanced Asymptote - Help |
Installing Asymptote on a Mac
This tutorial was tested on Mac OS 10.5 "Leopard," but should work for most older systems.
Download the Asymptote source here (at the time of writing, it is version 1.44).
Follow directions in the INSTALL file. The process is summarized here. "x.xx" represents the Asymptote version number (e.g., 1.44), and terminal commands are italicized.
- Open Terminal (located in /Applications/Utilities/Terminal.app)
- Run: cd ~/Desktop
- tar -xvzf asymptote-x.xx.src.tgz
- cd asymptote-x.xx
- curl -O http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz
- ./configure
- make all
- sudo make install
You have finished installing Asymptote.
Unfortunately, this does not work on Mac OS 10.6 "Snow Leopard", at least not as of 5 April 2011. There are some suggestions for patches one can do to the source code at http://sourceforge.net/projects/asymptote/forums/forum/409349/topic/3387231 but these did not work completely.
Usage
Suppose that on the Desktop, you have a file named asyfile.tex
Here is a sample file:
\documentclass[letterpaper,12pt]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{asymptote} \begin{document} \begin{asy} size(300); draw((0,0)--(1,1),blue); \end{asy} \end{document}
Use whatever LaTeX editor to compile the file. It will return a warning that looks something like this:
Package asymptote Warning: file asyfile_1.pdf does not exist on input line 17.
Terminal again.
cd ~/Desktop asy asyfile
That will run asymptote on the file asyfile.asy, (created when the tex file was compiled) producing asyfile_1.pdf.
Now run latex on asyfile.tex again, and with any luck, it should compile with no errors. (The image produces a diagonal blue line.)
Automation
This post describes a shell script that automates the compilation process.