Difference between revisions of "Asymptote: Help"

(Troubleshooting)
Line 19: Line 19:
 
'''What might be going on:''' Either Asymptote is not finding your LaTeX compiler, or you have installed your TeX distribution (such as MikTeX) in a folder that Asymptote cannot find.
 
'''What might be going on:''' Either Asymptote is not finding your LaTeX compiler, or you have installed your TeX distribution (such as MikTeX) in a folder that Asymptote cannot find.
  
'''Solution:''' Let's say you installed miktex in the folder <tt>C:\Program Files</tt> (the default).  Then there should be a subfolder texmf, containing the folder miktex, containing the folder bin, which contains your latex compiler.  In your config.asy file, add the following two lines to the bottom:
+
'''Solution:''' Let's say you installed miktex in the folder <tt>C:\Program Files</tt> (the default).  Then there should be a subfolder texmf, containing the folder miktex, containing the folder bin, which contains your latex compiler.   
 +
When Asymptote is run, it looks for a file called config.asy in the folder
 +
<tt>C:\Documents and Settings\%USERNAME\.asy\</tt>
 +
where <tt>%USERNAME</tt> is your Windows user name.
 +
Double-click on the .asy folder, right click and choose New <math>\rightarrow</math> Text Document. This will create a file called New Text Document.txt. Right-click on this file to rename it as config.asy, then open this file with Notepad or a similar editor. Type or copy-and-paste the following lines into the document:
 +
 
 +
<tt>
 +
import settings;
 
  texpath="C:\Program Files\texmf\miktex\bin";
 
  texpath="C:\Program Files\texmf\miktex\bin";
 
  dvips="C:\Program Files\texmf\miktex\bin\dvips";
 
  dvips="C:\Program Files\texmf\miktex\bin\dvips";
 +
</tt>
  
 +
When you have finished, save the file config.asy.
 
==External Sources==
 
==External Sources==
 
The following are excellent resources on Asymptote for topics not covered in this guide:
 
The following are excellent resources on Asymptote for topics not covered in this guide:

Revision as of 03:44, 10 March 2007

Asymptote (Vector Graphics Language)
Getting Started - Basics - Drawing - Labeling - Filling - Useful functions - Examples - Macros and Packages

Help - Reference - Advanced Asymptote - 3D Graphics - CSE5 Package - How to

Troubleshooting

Problem: You have added the Asymptote tool to TeXnicCenter, but when you hit your hotkey, you get an 'Cannot execute the command' error.

What might be going on: TeXnicCenter doesn't see the Asymptote executable.

Possible Solution: Go back to the Tools -> Customize window (click Tools, then Customize in TeXnicCenter). Then, click the Tools tab, then select Asymptote. Instead of cutting and pasting the text for the Command line, click the ... button after the Command entry box. Then, navigate to the asy.exe executable. You'll probably have to go up several levels to C:, then click Program Files, then Asymptote, then the file asy with the stylized red A next to it.

Problem: I have everything installed and the hotkey doesn't give me an error in TeXnicCenter, but when I hit the hotkey to compile my code, all that happens is that a window flashes briefly then disappears. Nothing else seems to happen.

What might be going on: Your file is saved as a .tex file, not a .asy file. (TeXnicCenter will even make it look like it's an .asy file, but it's really saved as an .asy.tex file.)

Solution: Click file, then Save As, then type your filename with the .asy extension (such as test.asy), the set the 'Save as type' field to 'All files'. This should make it a .asy file.


Problem: You can draw images with Asymptote, but it doesn't compile your file whenever you have a label containing LaTeX code (for example, the line label("$P$",(50,50),S); as in test.asy.)

What might be going on: Either Asymptote is not finding your LaTeX compiler, or you have installed your TeX distribution (such as MikTeX) in a folder that Asymptote cannot find.

Solution: Let's say you installed miktex in the folder C:\Program Files (the default). Then there should be a subfolder texmf, containing the folder miktex, containing the folder bin, which contains your latex compiler. When Asymptote is run, it looks for a file called config.asy in the folder C:\Documents and Settings\%USERNAME\.asy\ where %USERNAME is your Windows user name. Double-click on the .asy folder, right click and choose New $\rightarrow$ Text Document. This will create a file called New Text Document.txt. Right-click on this file to rename it as config.asy, then open this file with Notepad or a similar editor. Type or copy-and-paste the following lines into the document:

import settings;
texpath="C:\Program Files\texmf\miktex\bin";
dvips="C:\Program Files\texmf\miktex\bin\dvips";

When you have finished, save the file config.asy.

External Sources

The following are excellent resources on Asymptote for topics not covered in this guide:

[The Asymptote home page]