Difference between revisions of "Asymptote: Help"
m (→Troubleshooting) |
(next) |
||
Line 58: | Line 58: | ||
* [http://asymptote.sourceforge.net/FAQ/ Asymptote FAQ] | * [http://asymptote.sourceforge.net/FAQ/ Asymptote FAQ] | ||
* [http://sourceforge.net/forum/forum.php?forum_id=409349 Asymptote forum] | * [http://sourceforge.net/forum/forum.php?forum_id=409349 Asymptote forum] | ||
+ | |||
+ | [[Asymptote: Useful functions|Next: Useful functions]] |
Revision as of 21:51, 15 November 2007
Troubleshooting
Problem 1: 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 2: 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.
If this does not work then (for Windows XP) go to My Computer, Tools, Folder Options..., File Types. Click on New and type ASY, then OK. Making sure that the file type ASY is highlighted, click the Change button to the right of "Opens with:". From here go to browse and find the Asymptote executable program file click Open then OK. Now, retry the File, Save As extension change method outlined above.
It would also help to show file extensions so that file.tex, file.asy, file.pdf aren't all listed in Explorer and Save boxes as file.
Show File Extension in Windows XP gives a simple walkthrough to show how to do this.
Problem 3: 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("",(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\MiKTeX 2.5 (the default). Then there should be a subfolder 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. (In Windows Vista, this folder is C:\Users\%USERNAME%\.asy\, where %USERNAME% is your Windows username.)
Double-click on the .asy folder, right click and choose New 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\MiKTeX 2.5\miktex\bin"; dvips="C:\Program Files\MiKTeX 2.5\miktex\bin\dvips";
When you have finished, save the file config.asy.
Problem 4: You run Asymptote and get error: could not load module 'plain'.
What might be going on: Asymptote cannot find the files it needs to run. It may need telling which directory it is installed in.
Solution: You need to create or edit the config.asy file. See the solution to Problem 3 for how to find or create it. Assuming that Asymptote is installed at C:\Program Files\Asymptote then
a) if you already have a config.asy file add the following line somewhere after "import settings;":
dir="C:\Program Files\Asymptote";
or
b) if you have created a new config.asy file then add the following lines:
import settings; dir="C:\Program Files\Asymptote";
External Sources
The following are excellent resources on Asymptote for topics not covered in this guide: