Fix vertical positioning of hyperlinks

This commit is contained in:
RunasSudo 2021-09-09 00:43:08 +10:00
parent 122c18fa69
commit ae62f90bf8
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -109,7 +109,7 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
if token.full_label(): if token.full_label():
sha = hashlib.sha256() sha = hashlib.sha256()
sha.update(token.full_label().encode('utf-8')) sha.update(token.full_label().encode('utf-8'))
hyperlink = format(r'\makebox[0pt]{\hypertarget{<linkname>}{}}', hyperlink = format(r'\makebox[0pt]{\raisebox{1em}{\hypertarget{<linkname>}{}}}',
linkname=sha.hexdigest() linkname=sha.hexdigest()
) )
else: else:
@ -182,7 +182,7 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
if token.full_label(): if token.full_label():
sha = hashlib.sha256() sha = hashlib.sha256()
sha.update(token.full_label().encode('utf-8')) sha.update(token.full_label().encode('utf-8'))
hyperlink = format(r'\makebox[0pt]{\hypertarget{<linkname>}{}}', hyperlink = format(r'\makebox[0pt]{\raisebox{1em}{\hypertarget{<linkname>}{}}}',
linkname=sha.hexdigest() linkname=sha.hexdigest()
) )
else: else: