[FIX] TOC для введения/заключения/источников и уменьшение шрифта инлайн-кода

This commit is contained in:
Arseny
2026-08-25 16:14:18 +03:00
parent 974d49b056
commit e0c25cc0fe
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -41,9 +41,13 @@ def heading(r, tok: Token) -> str:
prefix = "" prefix = ""
if upper in NEWPAGE_BEFORE: if upper in NEWPAGE_BEFORE:
prefix = "\\clearpage\n" prefix = "\\clearpage\n"
toc_entry = ""
if upper in NEWPAGE_BEFORE:
toc_entry = f"\n\\phantomsection\\addcontentsline{{toc}}{{section}}{{{text}}}"
return ( return (
f"{prefix}" f"{prefix}"
f"{{\\fontsize{{14pt}}{{18pt}}\\selectfont \\bfseries \\centering {text}\\par}}" f"{{\\fontsize{{14pt}}{{18pt}}\\selectfont \\bfseries \\centering {text}\\par}}"
f"{toc_entry}"
) )
if level == 1: if level == 1:
+1 -1
View File
@@ -59,7 +59,7 @@ def _em_close(tok: Token) -> str:
@inline("code_inline") @inline("code_inline")
def _code_inline(tok: Token) -> str: def _code_inline(tok: Token) -> str:
return f"\\verb|{tok.content}|" return f"\\texttt{{\\small {escape_latex(tok.content)}}}"
@inline("link_open") @inline("link_open")