Working state (mostly)

This commit is contained in:
2026-08-08 14:38:26 +02:00
parent 137a9a7868
commit f345f8bb4f
7 changed files with 32 additions and 22 deletions
+2 -1
View File
@@ -281,6 +281,7 @@ import PIL.ImageOps
from config import LATEX_ANOT_AFTER, LATEX_ANOT_BEFORE
from string import Template
def render_real_latex_text(text, width_px, bg_color=(255, 255, 255, 255), max_lines=None, fontsize=19):
@@ -289,7 +290,7 @@ def render_real_latex_text(text, width_px, bg_color=(255, 255, 255, 255), max_li
line_spacing = int(fontsize * 1.2)
# Use the 'standalone' class with 'varwidth' to auto-crop height while restricting width
header = LATEX_ANOT_BEFORE.format(
header = LATEX_ANOT_BEFORE.substitute(
width_in=width_in, fontsize=fontsize, line_spacing=line_spacing
)
latex_template = f"{header}{text}{LATEX_ANOT_AFTER}"