From cea3add01d6742a52671868160d3c840f445047b Mon Sep 17 00:00:00 2001 From: Han-Miru Kim Date: Fri, 22 Nov 2024 00:03:43 +0100 Subject: [PATCH] line up baseline for inline-math --- projects/rehype-typst/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rehype-typst/lib/index.js b/projects/rehype-typst/lib/index.js index b81c8a4d..f91955d4 100644 --- a/projects/rehype-typst/lib/index.js +++ b/projects/rehype-typst/lib/index.js @@ -113,7 +113,7 @@ export default function rehypeTypst(options) { const defaultEm = 11; const height = parseFloat(root.children[0].properties['dataHeight']); const width = parseFloat(root.children[0].properties['dataWidth']); - const shift = height - result.baselinePosition; + const shift = height - result.baselinePosition + 2.8; /* line up baselines */ const shiftEm = shift / defaultEm; root.children[0].properties.style = `vertical-align: -${shiftEm}em;`; root.children[0].properties.height = `${height / defaultEm}em`;