我使用 Asymptote 创建 3D 图,并asymptote
在序言中加载了该包
\documentclass[a4paper]{article}
\usepackage[no-math,cm-default]{fontspec}
\usepackage{amsmath}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0,BoldFont={Times New Roman Bold}]{Times New Roman}
\usepackage[inline]{asymptote}
\begin{document}
\begin{center}
\begin{asy}
import graph3;
settings.render=4;
size(7.5cm,0);
currentprojection=orthographic(4,2,3);
currentlight=(5,-2,4);
real f(pair z) {return sin(z.x*z.y);}
draw(surface(f,(-3,-3),(3,3),nx=32,Spline),
rgb(0.7,0,0)+opacity(0.9),black+0.2bp);
\end{asy}
\end{center}
\end{document}
为了完整编译文档,我使用了链XeLaTeX->Asymptote->XeLaTeX
。如下图所示,生成了文件document-1.tex
。document-1+0.tex
一切进展顺利,整个过程顺利进行。但突然第二次编译XeLaTeX
出现以下错误:
Undefined control sequence. ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Missing number, treated as zero. ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Illegal unit of measure (pt inserted). ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Undefined control sequence. ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
You can't use `the letter b' after \advance. ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Missing number, treated as zero. ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Illegal unit of measure (pt inserted). ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Undefined control sequence. ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
Illegal unit of measure (pt inserted). ...-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}
一切都表明文件有问题document-1.tex
。我必须再次提到,一切正常,我没有删除、更改或编辑任何文件,也没有重新安装任何程序。3D 图是文件document-1+0_0.pdf
。
编辑
也许显示domument-1.tex
和document-1+0.tex
内容会有所帮助。这是document-1.tex
\setlength{\unitlength}{1pt}
\makeatletter%
\let\ASYencoding\f@encoding%
\let\ASYfamily\f@family%
\let\ASYseries\f@series%
\let\ASYshape\f@shape%
\makeatother%
\leavevmode\vbox to 151.001880pt{}%
\kern 183.001810pt%
\definecolor{ASYcolor}{gray}{0.000000}\color{ASYcolor}
\fontsize{12.000000}{14.400000}\selectfont
\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%
\ASYalign(-91.500905,75.500940)(-0.500000,-0.500000){\hbox to 0pt{\includegraphics[hiresbb]{\ASYprefix\jobname-1+0_0.pdf}\hss}%
\includemedia[noplaybutton,3Dlights=Headlamp,3Dmenu,3Dtoolbar=false,label=document-1,3Dortho=0.005556462,3Dc2w=0.624695048 -0.780868809 0 -0.232810099 -0.186248079 0.954521404 -0.745355992 -0.596284794 -0.298142397 468.793647676 359.48703512 211.818718139,3Droo=626.926947579,3Dpsob=Max,3Dbg=1 1 1,add3Djscript=asylabels.js]{\phantom{\includegraphics[hiresbb]{\ASYprefix\jobname-1+0_0.pdf}}}{\ASYprefix\jobname-1+0.prc}}%
这是document-1_0.tex
\setlength{\unitlength}{1pt}
\makeatletter%
\let\ASYencoding\f@encoding%
\let\ASYfamily\f@family%
\let\ASYseries\f@series%
\let\ASYshape\f@shape%
\makeatother%
{\catcode`"=12%
\includegraphics{\ASYprefix\jobname-1+0_0.pdf}%
}%