Should I wait for MacTeX 2012? Can I use TeXShop to run asymptote? I am not good with terminal.
Can you help me?
asymptoteinstallingmac
Should I wait for MacTeX 2012? Can I use TeXShop to run asymptote? I am not good with terminal.
Can you help me?
First, there is a description in the Art of Problem Solving Wiki, Asymptote: Advanced Configuration – Using Asymptote in LaTeX (also linked in the question regarding portable use), we can partly adapt, but in one point I want to strongly discourage you following this: Instead you should install the sty
files in a local texmf tree, about the reasons you can read in Purpose of local texmf trees.
This will be successful (WinEdt users read Harish Kumar’s answer first, please):
Download Asymptote from http://sourceforge.net/projects/asymptote/files/ and install, where you want. I will use here C:\Program Files\Asymptote
.
The binary in TeX Live is newly built from sources, has some dependencies of other TeX Live binaries and find its asy
scripts with the builtin kpsewhich
mechanism. Hence in difference to How to use Xindy with MiKTeX? the installation from TeX Live files is not recommended.
If not already done Create a local texmf tree in MiKTeX.
Create a subfolder <localtexmf>\tex\latex\asymptote
and copy the three sty
files from the Asymptote main directory in it.
Create an empty file in <localtexmf>\bin\
with the name asymptote.bat
(or with extension .cmd
).
Copy the following, paste it into the batch file and adjust the path according to your setting:
@echo off
SETLOCAL
SET AsyPATH=C:\Program Files\Asymptote
SET PATH=%AsyPATH%;%PATH%
asy.exe %*
This will also ensure, that the Asymptote binary finds the preshipped script files. A remark: When you save the file in Notepad or Wordpad, make sure, that there is no automatic appending of TXT extension – save the file name with double quotes: "asymptote.bat"
.
Refresh the file name database (FNDB). BTW I assume here, that you followed the instructions and added <localtexmf>\bin
to the system path. Actually the batch script could be put elsewhere, as long as it was in the system path.
Asymptote needs also Ghostscript. You have 3 specific opportunities to make it known (adjust path, of course):
-gs="<path\to\ghostscript>\bin\gswinc32.exe"
. Adding the environment variable
ASYMPTOTE_GS=<path\to\ghostscript>\bin\gswinc32.exe
.
(Note, that this did actually not work in my computer, but I didn’t restart.)
The preferred variant for frequent users: Create a file config.asy
in Asymptote’s main directory with following content
import settings;
gs="<path\to\ghostscript>\bin\gswinc32.exe";
Now you can execute Asymptote in your actual work folder. Let’s make a test: Copy the file latexusage.tex
from Asymptote’s examples
subfolder into a test folder, I will use c:\test
here. Open the Command Prompt and execute
cd /d c:\test
,
the /d
switch ensures, that you can also change in one step to another drive.
Then compile with your TeX editor or execute
latex latexusage
.
This will create 3 asy
script files. These 3 files must now be executed with
asymptote latexusage-1.asy
(you could also omit the file extension) and so on for the others.
Then again compile with your TeX editor or execute
latex latexusage
.
The result must look as shown below (I cropped it a bit). In Adobe Reader the interactive example works fine as well.
According to post by Dick Koch on the macosx-tex mailing list:
This problem only concerns users who install Sierra on a new disk, rather than updating an existing system to Sierra.
If these users install MacTeX-2016 or BasicTeX-2016, they will discover that they cannot typeset from the command line. To fix this problem, download FixLink from my web site:
http://pages.uoregon.edu/koch/FixLink.pkg
This is a very, very small download package; install the package.
Eventually this fix will be moved to BasicTeX-2016 and MacTeX-2016, but before remaking those packages, I want to make sure this one creates no problems. I certainly tested FixLink on my own machine.
The technical problem is that Sierra does not create the folders /etc/paths.d or /etc/manpaths.d, so our packages have to create them. XQuartz creates the folders as well, so another solution is to install XQuartz before installing BasicTeX or MacTeX.
Fix included in latest MacTeX download
The revised MacTeX download, dated 09 October 2016, includes the fix. See:
Best Answer
TeXShop comes with an 'engine' for Asymptote, so it's easy to run it from TeXShop. To install the engine, go to
~/Library/TeXShop/Engines/
(on Lion, this folder is hidden, so you need to go to the Go menu item in the Finder and enter the path directly) and move theAsymptote.engine
file from theInactive/Asymptote
folder to theEngines
folder. There's also a sample.tex
file in that folder that you can look at.Restart TeXShop, and the new engine should appear in the pulldown menu beside the Typeset button in the document window. When you want to run Asymptote, choose that Engine from the pulldown menu and the hit the Typeset button.