[FIX] сокращения: вторая колонка с переносом текста

This commit is contained in:
Arseny
2026-07-15 18:39:08 +03:00
parent 0b07fd4048
commit b6f98e529f
+6 -3
View File
@@ -35,11 +35,14 @@ def abbreviations(text: str) -> str:
return text
max_abbr = max(len(r[0]) for r in rows)
abbr_col = max_abbr + 2
tabular_rows = []
for abbr, desc in rows:
pad = max_abbr - len(abbr) + 2
tabular_rows.append(f"{abbr} {' ' * pad}& --- {desc} \\\\")
tabular_rows.append(
f"{abbr} {' ' * pad}& \\hangafter=1\\hangindent=2em ------ {desc} \\\\"
)
col_spec = f"@{{\\hspace{{0pt}}}}p{{{max_abbr + 2}em}}@{{\\hspace{{0pt}}}}l"
col_spec = f"@{{\\hspace{{0pt}}}}p{{{abbr_col}em}}@{{\\hspace{{0pt}}}}p{{\\dimexpr\\linewidth-{abbr_col}em\\relax}}"
body = "\n".join(tabular_rows)
return f"\\begin{{tabular}}{{{col_spec}}}\n{body}\n\\end{{tabular}}"
return f"\\noindent\\begin{{tabular}}{{{col_spec}}}\n{body}\n\\end{{tabular}}"