INNER CODE UNIT · Python

find_tectonic_streamlit_cloud

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

def find_tectonic_streamlit_cloud():
    import streamlit as st
    current_dir = pathlib.Path(st.__file__).parent
    while current_dir.parent != current_dir:
        if (current_dir / "tectonic").exists():
            return str(current_dir / "tectonic")
        if (current_dir / "bin").exists():
            current_bin_dir = current_dir / "bin"
            if (current_bin_dir / "tectonic").exists():
                return str(current_bin_dir / "tectonic")
        current_dir = current_dir.parent
    return "tectonic"

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…