This commit is contained in:
team3
2026-07-10 17:56:41 +02:00
parent ab1a28f0e7
commit 14bcf1b8e9
6 changed files with 59 additions and 7 deletions

View File

@@ -169,6 +169,11 @@ def _mathe_auftraege(text: str, wo: str) -> list[str]:
if re.search(r"\\n(?![a-zA-Z])", text): # \neq etc. bleiben unberührt
auftraege.append(f"{wo}: literales „\\n“ im Text — durch echten"
f" Zeilenumbruch bzw. Leerzeile ersetzen.")
lange = [m for m in re.findall(r"\$([^$\n]+?)\$", text) if len(m) > 60]
if lange: # Inline-Formeln brechen nie um — auf schmalen Screens Überlauf
auftraege.append(f"{wo}: {len(lange)} überlange Inline-Formel(n)"
f" (>60 Zeichen, z. B. „{lange[0][:40]}…“): abgesetzt"
f" als $$…$$ setzen.")
formeln = ([{"tex": m, "display": True} for m in re.findall(r"\$\$([\s\S]+?)\$\$", text)]
+ [{"tex": m, "display": False} for m in re.findall(r"\$([^$\n]+?)\$", text)])
for f in _katex_fehler(formeln):