-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_images.py
28 lines (25 loc) · 1.04 KB
/
gen_images.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
def gen_image(formula, filename, path = None):
'''
"List of options:"
b <color> Set the background color."
B <color> Set the border color."
d <dpi> Set the output resolution to the specified dpi."
e <environment> Set the environment with [options] and {arguments}."
f <formula> The LaTeX formula."
F <color> Set the foreground color."
h Print this help message."
H <file> Insert the content of the specified file in the preamble."
l <file> Log file."
m <margin> Set the margin."
o <file> Specify the output file name."
O Optimize the image."
p <packages> A colon separated list of LaTeX package names."
P <padding> Set the padding."
s <size> Set the font size."
S Silent mode: don't print image file name."
v Show version."
'''
if path is None:
path = os.getcwd()
os.system(f'pnglatex -f "{formula}" -o {path}/data/{filename}.png -S')