tikz 轉 png 不起作用

tikz 轉 png 不起作用

我正在嘗試將 TikZ 文件轉換為png遵循類似問題的答案:TikZ 到非 PDF

這是一個mwe:

\documentclass[convert={density=300,size=1080x800,outext=.png}]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \draw [step=0.5] (-1.4,-1.4) grid (1.4,1.4);
\end{tikzpicture}
\end{document}

在我的log文件中,我收到以下錯誤訊息:

(Ext.aux)
runsystem(imgconvert -density 300 Ext.pdf -resize 1080x800 -quality 90 
Ext.png)
...executed.



 Class standalone Warning: Conversion unsuccessful!
 (standalone)              There might be something wrong with your
 (standalone)              conversation software or the file permissions!

 ) ) 

我的獨立套件版本:

Document Class: standalone 2015/07/15 v1.2 Class to compile TeX sub-files stand alone

我用以下命令編譯它

pdflatex -shell-escape -synctex=1 -interaction=nonstopmode Ext.tex

我安裝了ImageMagick-7.0.7-Q16,它安裝在:C:\Program Files\ImageMagick-7.0.7-Q16

我是否必須以某種方式設定一些路徑變數?我在網路上找不到任何告訴我必須設定路徑變數的內容。

答案1

就我而言,我必須將 Image Magick 安裝目錄新增到PATH變數中。您可以輕鬆地where imgconvert在 Windows 命令列中檢查該imgconvert程式是否在您的PATH.

如果傳回Image Magick的安裝路徑,則可以呼叫imgconvert。

否則你必須修改PATH變數。這是一個簡短的指南新增一個目錄到PATH變數

相關內容