INNER CODE UNIT · Python

render_latex

IvanIsCoding/ResuLLMe · src/render/__init__.py:23

def render_latex(latex_command, latex_data):
    src_path = os.path.dirname(os.path.realpath(__file__)) + "/inputs"

    with tempfile.TemporaryDirectory() as tmpdirname:
        # Copy auxiliary files to temporary directory
        shutil.copytree(src_path, tmpdirname, dirs_exist_ok=True)

        # write latex data to a file
        with open(f"{tmpdirname}/resume.tex", "w") as f:
            f.write(latex_data)
        
        latex_command_conda = [c for c in latex_command]

        if "IS_STREAMLIT_CLOUD" in os.environ:
            tectonic_path = find_tectonic_streamlit_cloud()
            print(f"DEBUG: Running in Streamlit Cloud, Tectonic path: {tectonic_path}")
            latex_command_conda = [tectonic_path] + [c for c in latex_command][1:]
            

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…