Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate PNG images? #138

Open
kobeis007 opened this issue Aug 31, 2022 · 2 comments
Open

How to generate PNG images? #138

kobeis007 opened this issue Aug 31, 2022 · 2 comments

Comments

@kobeis007
Copy link

How to generate PNG images?

@turing0
Copy link

turing0 commented Mar 27, 2023

I want to know too

@GuoDapeng
Copy link

GuoDapeng commented Mar 24, 2024

我刚刚接触这个有趣的工具,生成 PNG 图片需要在生成 PDF 文件之后,将 PDF 转换成 PNG。下面是在 macOS 上面的办法。

安装 ImageMagick 工具包

brew install imagemagick

修改 tikzmake.sh 脚本

#!/bin/bash


python $1.py 
pdflatex $1.tex

rm *.aux *.log *.vscodeLog
rm *.tex

convert -density 300 $1.pdf $1.png
rm *.pdf

if [[ "$OSTYPE" == "darwin"* ]]; then
    open $1.png
else
    xdg-open $1.png
fi

完成。

解释:

convert -density 300 $1.pdf $1.png

这是将 PDF 转换成 PNG 的命令。-density 300 这个选项,将获得一个解析度更好的 PNG 图片。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants