%20%E8%88%87%20Lualatex%20%E5%92%8C%20Texmaker%20%E4%B8%80%E8%B5%B7%E4%BD%BF%E7%94%A8%EF%BC%9F.png)
我對 LaTeX 沒有太多經驗,我想設定 Texmaker,以便 LuaLaTeX 可以使用外部程式。
在這種情況下,我想重現一個圖表(使用 Gnuplot (已新增至我的路徑環境變數:)) 來自 PGFplots 的文檔:
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={0}{90}]
\addplot3[domain=-2:2, domain y=-1.3:1.3, contour gnuplot={number=14}]
{exp(-x^2-y^2)*x};
\end{axis}
\end{tikzpicture}
\end{document}
但我收到錯誤訊息:
! Package pgfplots Error: sorry, plot file{"Test"_contourtmp0.table} could not be opened.
經過一些在網路上的研究,似乎 LuaLaTeX 預設不能使用外部程式。所以我嘗試配置TeXmaker以使其成為可能,但我認為沒有這樣的選項,並且TeXmaker手冊沒有告訴我更多...
用 Texmaker 可以做到這一點嗎?
注意:我不知道這是否重要,但我使用 Miktex 發行版。
更新
答案1
當然,TeXmaker 會呼叫外部程序,因為latex
、lualatex
、xelatex
是編譯原始碼的外部程式。但要使用gnuplot
,編譯器必須呼叫外部程式。它需要獲得授權才能這樣做。為此,請將“-enable-write18”加入編譯命令中。它應該看起來像這樣:"lualatex -interaction=nonstopmode -enable-write18 %.tex"