/*** @description:* @author: lyp* @date: 2020/8/21 18:01*/
public class FormulaToPng {public static Image image(String latex) throws Exception {// 样式 符号以最大的尺寸呈现int style = TeXConstants.STYLE_DISPLAY;// 生成公式图片的字体大小float size = 20;// 字体颜色,黑色Color fg = Color.BLACK;// 图片背景色,默认为透明北京Color bg = null;ateBufferedImage(latex, style, size, fg, bg);}public static void main(String[] args) throws Exception {String latex = "(- left| - 2 right|)"BufferedImage image = (BufferedImage) FormulaToPng.image(latex);}
}
可以把latex格式的tex文件一键转换成其他格式的文件 非常方便
官方链接:.html
本文发布于:2024-02-05 02:54:34,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170722355462359.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |