LaTeX only: Prefer clean page breaks

This commit is contained in:
RunasSudo 2019-09-24 03:05:02 +10:00
parent 2b21860dd0
commit 2bf8cbb8d7
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
1 changed files with 2 additions and 1 deletions

View File

@ -132,7 +132,8 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
if token.level == 3:
# Section
heading_last, self.heading_last = self.heading_last, False
return format(r'{\par<hyperlink>\leftskip=\quotemargin\bfseries\makebox[<lmarg>][l]{<label>}<content>\phantomsection\addcontentsline{toc}{subsubsection}{\protect\numberline{<label>} <content>}\nopagebreak\par}',
return format(r'{<pagebreak>\par<hyperlink>\leftskip=\quotemargin\bfseries\makebox[<lmarg>][l]{<label>}<content>\phantomsection\addcontentsline{toc}{subsubsection}{\protect\numberline{<label>} <content>}\nopagebreak\par}',
pagebreak=r'\pagebreak[3]' if not self.heading_last else '',
hyperlink=hyperlink,
label=token.label,
content=self.render_inner(token)