如何从 tizk tex 文件(具有独立类)生成 png?

问题描述 投票:0回答:1

我有以下 LaTex 文件:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\node[fill=yellow]{Hello World!};
\end{tikzpicture}
\end{document}

我想从该文件中获取一个 png 文件。我怎样才能做到这一点?

非常感谢!

PD:我使用Ubuntu 22.04

我尝试了命令转换,在线转换,但我需要一些快速的东西。

latex png pdflatex tikz
1个回答
0
投票

在 shell 提示符下使用以下命令:

$ pdflatex example.tex && pdftocairo -png example.pdf -r 300 -singlefile

当然,这也会生成一个 pdf 文件。

© www.soinside.com 2019 - 2024. All rights reserved.