||
马欢曾在一篇博文讲过作法, 但我想最终存为png格式的图片, 所以实验了几种不同的作法.
gnuplot的终端可以直接输出LaTex文件, 其中文字和画图部分是分离的. 有了tex文件后, 可以采用下面的方法转成png图片.
利用latex转成dvi文件, 然后利用dvipng转成png
利用pdflatex转成pdf文件, 再利用下面方法的一种转成png
conbvert
gs
pdftocairo
pdftoppm
pdftoppm|pnmtopng
根据我的测试, 采用第二种方法的最后一个命令, 速度最快.
另外, 利用gnuplot的svg终端, 再利用mathjax也可以实现. 详细的作法可以参考下面的资料.
网络资料How to Include MathJax Equations in SVG With Less Than 100 Lines of JavaScript!
Compile a LaTeX document into a PNG image that’s as short as possible
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-4-29 05:31
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社