From 681f582ec834525b741109558d7268d85c3b9e39 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Fri, 17 Nov 2023 18:50:13 +0100 Subject: [PATCH] run latex twice for cross-referencing --- rendercv/rendering.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/rendercv/rendering.py b/rendercv/rendering.py index 8faa25e..c3290d1 100644 --- a/rendercv/rendering.py +++ b/rendercv/rendering.py @@ -500,19 +500,21 @@ def run_latex(latex_file_path: str) -> str: ) # Run TinyTeX: - def run(): - with subprocess.Popen( - [ - executable, - f"{latex_file_name}", - ], - cwd=os.path.dirname(latex_file_path), - stdout=subprocess.PIPE, - stdin=subprocess.DEVNULL, # don't allow TinyTeX to ask for user input - text=True, - encoding="utf-8", - ) as latex_process: - output, error = latex_process.communicate() + with subprocess.Popen( + [ + executable, + f"{latex_file_name}", + "&&", + executable, + f"{latex_file_name}", + ], + cwd=os.path.dirname(latex_file_path), + # stdout=subprocess.PIPE, + stdin=subprocess.DEVNULL, # don't allow TinyTeX to ask for user input + text=True, + shell=True, + ) as latex_process: + output, error = latex_process.communicate() if latex_process.returncode != 0: # Find the error line: