run latex twice for cross-referencing

This commit is contained in:
Sina Atalay 2023-11-17 18:50:13 +01:00 committed by Jeffrey Goldberg
parent 87c79b97be
commit 681f582ec8
1 changed files with 15 additions and 13 deletions

View File

@ -500,19 +500,21 @@ def run_latex(latex_file_path: str) -> str:
) )
# Run TinyTeX: # Run TinyTeX:
def run(): with subprocess.Popen(
with subprocess.Popen( [
[ executable,
executable, f"{latex_file_name}",
f"{latex_file_name}", "&&",
], executable,
cwd=os.path.dirname(latex_file_path), f"{latex_file_name}",
stdout=subprocess.PIPE, ],
stdin=subprocess.DEVNULL, # don't allow TinyTeX to ask for user input cwd=os.path.dirname(latex_file_path),
text=True, # stdout=subprocess.PIPE,
encoding="utf-8", stdin=subprocess.DEVNULL, # don't allow TinyTeX to ask for user input
) as latex_process: text=True,
output, error = latex_process.communicate() shell=True,
) as latex_process:
output, error = latex_process.communicate()
if latex_process.returncode != 0: if latex_process.returncode != 0:
# Find the error line: # Find the error line: