作者fancap (汉子)
看板LaTeX
标题[问题] 请问有关 Asymptote 的安装
时间Tue Jul 16 23:28:16 2013
Windows 7 (64位元), MiKTeX 2.9, Texmaker
----------------------------------------------
目前的状态为
已安装 Gsview 与 Ghostscript
已从 Asymptote 的网站下载 asymptote-2.23-setup 并安装完成
在 Texmaker 中的"设定 Texmaker"内有 Asymptote 的部分, 将路径照安装目录填入
参考了
http://ppt.cc/M~qO 中 Using Asymptote in LaTeX 部分的步骤
(诸如复制 asymptote、asycolors、ocg 等 .sty 档至在 MiKTeX 目录下新建的
asymptote 资料夹, 并在 MiKTeX 的 Settings 中执行 Refresh FNDB )
以及
http://ppt.cc/pw6O 中第二章的第五页
在 C:\Documents and Settings\(使用者名称)\.asy 内建立 config.asy 文件
(其中 dir="d:\asymptote"; 的意义不太明白, 但还是照着做)
接着点击桌面上 Asymptote 图示, 执行以下内容
Welcome to Asymptote version 2.08 (to view the manual, type help)
> size(200);
> import three;
> draw(unitsphere,red);
> erase();
> draw(unitcircle,blue);
>
执行结果均 OK, 红色球与蓝色圆均有出现.
----------------------------------------------
问题部分
参考了
http://ppt.cc/M~qO 中 Using Asymptote in LaTeX 部分
由 Texmaker 建立一文件
\documentclass{article}
\usepackage{graphicx} %我只有 {graphicx}, 无选项 [pdftex]
\usepackage{asymptote}
\begin{document}
Hello.
I like to make pics with Asymptote like this one:
\begin{figure}[h]
\begin{asy}
include graph;
size(1inch);
filldraw(circle((0,0),1),yellow,black);
fill(circle((-.3,.4),.1),black);
fill(circle((.3,.4),.1),black);
draw(arc((0,0),.5,-140,-40));
\end{asy} %已确定前面无空格
\end{figure}
\par It makes me happy,
since I can still type my normal LaTeX stuff around it:
\(\int_0^{\pi}{\sin{x}}\,dx=2\)
\end{document}
其编译出来的结果无法出现如网页上的黄色笑脸图.
请问各位先进, 是否在设置 Asymptote 过程中有哪个环节疏漏了? 感谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.70.165.241
1F:推 yclinpa:\end{asy} 必须独立一行,并且前面不可以有空格 07/17 06:24
感谢这位先进的建议, 但仍无法跑出图形.
而按照网页上使用 \usepackage[pdftex]{graphicx} 後, 就出现了 error
"Package pdftex.def Error: Option `pdftex' requires pdfTeX"
而到 MiKTeX 的 Package Manager 找有关 pdftex 的套件时, 发现所列的所有套件早已
安装好.
这部分上网查询後有人说就是要用 "pdftex" 来编辑文件? (
http://ppt.cc/Fk0~ )
还请各位前辈指点. 谢谢!
※ 编辑: fancap 来自: 61.70.165.241 (07/17 08:58)
※ 编辑: fancap 来自: 61.70.165.241 (07/17 09:48)