diff --git a/md2gost/handlers/heading.py b/md2gost/handlers/heading.py index 5563cf1..62aff4a 100644 --- a/md2gost/handlers/heading.py +++ b/md2gost/handlers/heading.py @@ -41,9 +41,13 @@ def heading(r, tok: Token) -> str: prefix = "" if upper in NEWPAGE_BEFORE: prefix = "\\clearpage\n" + toc_entry = "" + if upper in NEWPAGE_BEFORE: + toc_entry = f"\n\\phantomsection\\addcontentsline{{toc}}{{section}}{{{text}}}" return ( f"{prefix}" f"{{\\fontsize{{14pt}}{{18pt}}\\selectfont \\bfseries \\centering {text}\\par}}" + f"{toc_entry}" ) if level == 1: diff --git a/md2gost/handlers/inline.py b/md2gost/handlers/inline.py index 2473545..fbf51c6 100644 --- a/md2gost/handlers/inline.py +++ b/md2gost/handlers/inline.py @@ -59,7 +59,7 @@ def _em_close(tok: Token) -> str: @inline("code_inline") def _code_inline(tok: Token) -> str: - return f"\\verb|{tok.content}|" + return f"\\texttt{{\\small {escape_latex(tok.content)}}}" @inline("link_open")