一个简单的命令行工具,用于将tex公式转换为svg。
pytex2svg的Python项目详细描述
Pytex2svg
一个用Python编写的简单命令行工具,用于将TeX公式转换为SVG输入可以从stdin
读取,直接作为命令行参数提供,也可以从文件读取。
安装
pip install pytex2svg
依赖关系
matplotlib
用法
usage: pytex2svg [-h] [-o OUTFILE] [-v] [input]
converts a TeX string to an SVG file
positional arguments:
input The TeX equation or file to be converted to svg,
defaults to stdin
optional arguments:
-h, --help show this help message and exit
-o OUTFILE, --outfile OUTFILE
Path or name of the output file, defaults to
"equation.svg". If more than one equation is provided,
the output files are numbered.
-v, --verbose Enable verbose output
示例:
# from stdinecho"\log_{2}10 \approx 3.322"| pytex2svg -o whybinary.svg # as command line argument pytex2svg "\log_{2}10 \approx 3.322" -o whybinary.svg # from a file pytex2svg examples/integral.tex -o whybinary.svg