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

View File

@ -132,7 +132,8 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
if token.level == 3: if token.level == 3:
# Section # Section
heading_last, self.heading_last = self.heading_last, False 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, hyperlink=hyperlink,
label=token.label, label=token.label,
content=self.render_inner(token) content=self.render_inner(token)