將 Asymptote 與 Miktek、Texmaker、Windows7、ASYalign 結合使用未定義

將 Asymptote 與 Miktek、Texmaker、Windows7、ASYalign 結合使用未定義

我是 Latex 和 Texmaker 的新手,並且很喜歡它。我在 Windows 7 上使用 MikTek 發行版。

現在我想將漸近線圖形整合到我的文件中。我從這裡安裝了 Asymptote:漸近線下載(請記住我已經安裝了 MikTek 和 Texmaker)。我還安裝了 Ghostscript,因為 Asymptote 一直要求這樣做。

我第一次嘗試在 Latex 檔案中嵌入 Asy 命令是這樣的:

\documentclass[12pt]{article}

\usepackage{asymptote}

\begin{document}

\begin{asydef}
// Global Asymptote definitions can be put here.
import three;

usepackage("bm");
texpreamble("\def\V#1{\bm{#1}}");
// One can globally override the default toolbar settings here:
// settings.toolbar=true;
\end{asydef}

\begin{asy}
draw((0,0)--(50,0),BeginArrow);
draw((0,-10)--(50,-10),MidArrow);
draw((0,-20)--(50,-20),EndArrow);
draw((0,-30)--(50,-30),Arrows);
\end{asy}


\end{document}

當我第一次運行它時,MikTek 獲取了許多軟體包並即時安裝它們。但是我陷入了這個錯誤:

testAsymptote-1.tex ! Undefined control sequence \ASYalign

我瀏覽網頁發現這個問題以前也出現過。有些帖子已經過時了,並且對於問題從何而來或如何解決沒有一致的觀點。地圖上到處都是建議,但我還是不明白其中的大部分。有任何想法嗎?

答案1

最新版本的 Asymptote 2.37 需要 asymptote.sty 版本 1.30(透過在 asy-latex.dtx 上執行 pdflatex 自動產生)。

相關內容