Difference between revisions of "Asymptote: Macintosh"

m (Usage)
(Added Asymptote page template)
Line 1: Line 1:
 +
{| class="wikitable" style="border:1px solid black; background:#CEE0F2;text-align:center;"
 +
|-
 +
|style="background:#B0C4DE;"|'''[[Asymptote (Vector Graphics Language)]]'''
 +
|-
 +
|[[Asymptote: Getting Started|Getting Started]] - [[Asymptote: Basics|Basics]] - [[Asymptote: Reference|Reference]] - [[Asymptote: Useful commands and their Output|Examples]] - [[Asymptote: Macros and Packages|Macros and Packages]] - [[Asymptote: Advanced | Advanced Asymptote]] - [[Asymptote: Help|Help]]
 +
[[Asymptote: Useful functions|Useful functions]] - [[Asymptote: CSE5|CSE5 Package]]
 +
[[Category:Asymptote]]
 +
|}<noinclude>
 +
 
== Installing Asymptote on a Mac ==
 
== Installing Asymptote on a Mac ==
  
Line 59: Line 68:
  
 
[http://www.artofproblemsolving.com/Forum/viewtopic.php?p=1241236#1241236 This post] describes a shell script that automates the compilation process.
 
[http://www.artofproblemsolving.com/Forum/viewtopic.php?p=1241236#1241236 This post] describes a shell script that automates the compilation process.
 
== Troubleshooting ==
 

Revision as of 20:40, 18 January 2009

Asymptote (Vector Graphics Language)
Getting Started - Basics - Reference - Examples - Macros and Packages - Advanced Asymptote - Help

Useful functions - CSE5 Package

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.

  1. Open Terminal (located in /Applications/Utilities/Terminal.app)
  2. Run: cd ~/Desktop
  3. tar -xvzf asymptote-x.xx.src.tgz
  4. cd asymptote-x.xx
  5. curl -O http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz
  6. ./configure
  7. make all
  8. sudo make install

You have finished installing Asymptote.

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.