Skip to content

Commit 4be0817

Browse files
committed
refactor(utils.py): remove xelatex compiling
1 parent 5ab0d80 commit 4be0817

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

vrdu/utils.py

100644100755
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,17 @@ def get_main_content(data):
131131
return main_content, main_content_index
132132

133133

134-
def compile_latex(file: str, tex_engine: str = "pdflatex"):
134+
def compile_latex(file: str):
135135
path_name = os.path.dirname(file)
136136
file_name = os.path.basename(file)
137-
if tex_engine == "pdflatex":
138-
script_path = os.path.expanduser("compile_latex.sh")
139-
subprocess.run(
140-
["bash", script_path, path_name, file_name], check=True, timeout=1000
141-
)
142-
elif tex_engine == "xelatex":
143-
subprocess.run(["xelatex", file], check=True)
137+
138+
script_path = os.path.expanduser("compile_latex.sh")
139+
subprocess.call(
140+
["bash", script_path, path_name, file_name],
141+
timeout=1000,
142+
stdout=subprocess.DEVNULL,
143+
stderr=subprocess.DEVNULL,
144+
)
144145

145146

146147
def pdf2jpg(pdf_path: str, output_directory: str) -> None:

0 commit comments

Comments
 (0)