代码拉取完成,页面将自动刷新
#!/bin/bash
if [ -e "$1.tex" ]; then
name=$1
else
name="poster"
fi
echo "generating $name.pdf ..."
xelatex $name.tex >/dev/null
echo "deleting template file ..."
rm -r *.aux *.bbl *.blg *.log *.out *.toc *.bcf *.xml *.synctex *.nlo &>/dev/null
rm -r *.ind *.idx *.ilg *.lof *.lot *.ent-x *.tmp *.ltx *.los *.lol *.loc &>/dev/null
rm -r *.listing *.nls *.bak *.gz *.userbak *.nav *.snm *.vrb *.synctex.gz &>/dev/null
echo "converting $name.pdf to $name.png ..."
if [ ! -d "out" ]; then
mkdir out
fi
if [ "$(uname)" == "Darwin" ]; then
# MacOS
magick convert -density 400 $name.pdf -quality 90 out/$name.png
else
# Linux (Ubuntu)
convert -density 400 $name.pdf -quality 90 out/$name.png
fi
echo "moving $name.pdf to directory pdf ... "
if [ ! -d "pdf" ]; then
mkdir pdf
fi
mv $name.pdf ./pdf/$name.pdf
echo "done!"
exit 0;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。