From aae588249a489917bec2be16d31dca275db56e2b Mon Sep 17 00:00:00 2001 From: Enrico Sintoni Date: Fri, 24 Jan 2025 18:54:08 +0100 Subject: [PATCH] FIX: LaTeX rendering not working if % is put at the end of the preamble --- MathjaxToSVG/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MathjaxToSVG/index.ts b/MathjaxToSVG/index.ts index 57686c9..c4ef697 100644 --- a/MathjaxToSVG/index.ts +++ b/MathjaxToSVG/index.ts @@ -69,7 +69,7 @@ export async function tex2dataURL( try { const node = html.convert( - preamble ? `${preamble}${tex}` : tex, + preamble ? `${preamble}\n${tex}` : tex, { display: true, scale } ); const svg = new DOMParser().parseFromString(adaptor.innerHTML(node), "image/svg+xml").firstChild as SVGSVGElement;