Automatically adjust size of subsection numbers using adjustbox

This commit is contained in:
RunasSudo 2019-12-15 14:08:45 +11:00
parent 4ccf1db4b2
commit da6a35b0d6
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -185,7 +185,7 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
else:
hyperlink = '{}'
return format(r'\N{\par<hyperlink>\leftskip=\dimexpr\quotemargin+<lmarg>+<level>cm\relax\hangindent=1cm\parskip=<parskip>\makebox[<lmarg>][l]{<label>}<content><pagebreak>\par}\N',
return format(r'\N{\par<hyperlink>\leftskip=\dimexpr\quotemargin+<lmarg>+<level>cm\relax\hangindent=1cm\parskip=<parskip>\makebox[<lmarg>][l]{\maxsizebox{\dimexpr<lmarg>-1mm\relax}{!}{<label>}}<content><pagebreak>\par}\N',
hyperlink=hyperlink,
parskip=r'\parskip',# if token.level <= 1 else '0cm',
label=token.label,
@ -279,6 +279,7 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
\setlength{\emergencystretch}{3em}
\usepackage{microtype}
\usepackage{longtable}\usepackage{tabu}\usepackage{booktabs}
\usepackage{adjustbox}
\newlength\quotemargin
\newlength\notetaglength
% TOC format