jgm/typst-hs

Typst math formatting issues

Closed this issue · 4 comments

  • for double dots, uses \overset{¨}{x} instead of \ddot{x} from the amsmath package
  • for simple dot, uses \overset{\cdot}{x} instead of \dot{x} from the amsmath package
  • for overline, \underset{¯}{...} is used instead of \overline
  • for norm, the bars are rendered with \left.\parallel and there is actually no scaling of the delimiters. \left\| and \right\| should be used instead
  • tilde(x) translated to \overset{\sim}{x} instead of \tilde{x}

Reproduction : https://github.com/Doublonmousse/pandoc-typst-reproducer/tree/main/formatting

jgm commented

On overline, see jgm/pandoc#9294. This is already fixed, I think (but not in a release).

The others seem valid. For easy reference:

$dot.double(x)$
->
$\overset{¨}{x}$
SHOULD BE:
$\ddot{x}$
$dot(x)$
->
$(\overset{\cdot}{x}$
SHOULD BE:
$dot(x)$
$norm(x)$
->
$\left. \parallel x \right.\parallel$
SHOULD BE:
$\left\| x \right\|$
$tilde(x)$
->
$\overset{\sim{x}}$
SHOULD BE:
$\tilde{x}$
jgm commented

Pandoc's typst reader turns norm(...) into

EDelimited "\8741" "\8741" ...

which it passes to texmath. So, this one may require changes in jgm/texmath.

dot(x) is processed by typst-hs and turned into

math.accent(accent: ⋅, 
                                                 base: text(body: [x])), 

Pandoc's typst reader changes this to an EOver element, which it passes to jgm/texmath. Need to look into where the change must happen. Similar story for the others.

jgm commented

The norm issue has now been fixed in pandoc: commit 1e05f32ead3da5bf8c81f78f2c7ccb2971e69044

jgm commented

tilde, dot, ddot fixed in pandoc 3ef74d1fd2fa7937da841f90d3ff3d8dc87488c8