Initial support for _F output file

This commit is contained in:
2026-04-25 09:17:48 +02:00
parent 95e944f983
commit d7a8e03d2c
4 changed files with 106 additions and 15 deletions
+5 -2
View File
@@ -8,17 +8,20 @@ import subprocess
import tempfile
import shutil
def compile_to_pdf(text, output_pdf_path):
def compile_to_pdf(text, output_pdf_path): # 21 cm + 3.8 (dimension de la marge de gauche)
"""Wraps text in a standalone template and compiles it to PDF."""
latex_template = f"""\\documentclass[varwidth=21cm,margin=0.2cm]{{standalone}}
latex_template = f"""\\documentclass[varwidth=24.8cm,margin=0.4cm]{{standalone}}
\\usepackage[utf8]{{inputenc}}
\\usepackage[T1]{{fontenc}}
\\usepackage{{lmodern}}
\\usepackage{{amsmath, amssymb}}
\\usepackage{{commands}}
\\usepackage{{graphicx}}
\\usepackage{{enumitem}}
\\begin{{document}}
\\begin{{minipage}}{{24.8cm}}
{text}
\\end{{minipage}}
\\end{{document}}
"""
with tempfile.TemporaryDirectory() as temp_dir: