Skip to content

Commit

Permalink
line up baseline for inline-math
Browse files Browse the repository at this point in the history
  • Loading branch information
kimhanm authored and Enter-tainer committed Dec 10, 2024
1 parent fbfcb2e commit cea3add
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/rehype-typst/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit cea3add

Please sign in to comment.