From 7a7227e3097a8772fc0b2afa32cfc4f8ff85d978 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 22 Sep 2019 03:43:36 +1000 Subject: [PATCH] Fix TeX page breaking issues caused by hypertarget --- legalmd/latex_renderer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legalmd/latex_renderer.py b/legalmd/latex_renderer.py index 8b7aed4..c36bb22 100644 --- a/legalmd/latex_renderer.py +++ b/legalmd/latex_renderer.py @@ -96,7 +96,7 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer): if token.full_label(): sha = hashlib.sha256() sha.update(token.full_label().encode('utf-8')) - hyperlink = format(r'\hypertarget{}{}', + hyperlink = format(r'\makebox[0pt]{\hypertarget{}{}}', linkname=sha.hexdigest() ) else: @@ -161,7 +161,7 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer): if token.full_label(): sha = hashlib.sha256() sha.update(token.full_label().encode('utf-8')) - hyperlink = format(r'\hypertarget{}{}', + hyperlink = format(r'\makebox[0pt]{\hypertarget{}{}}', linkname=sha.hexdigest() ) else: