Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typst math formatting issues #38

Closed
Doublonmousse opened this issue Feb 4, 2024 · 4 comments
Closed

Typst math formatting issues #38

Doublonmousse opened this issue Feb 4, 2024 · 4 comments

Comments

@Doublonmousse
Copy link

  • 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
Copy link
Owner

jgm commented Feb 5, 2024

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
Copy link
Owner

jgm commented Feb 5, 2024

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 jgm changed the title Formatting issues Typst math formatting issues Feb 5, 2024
jgm added a commit to jgm/pandoc that referenced this issue Feb 5, 2024
@jgm
Copy link
Owner

jgm commented Feb 5, 2024

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

jgm added a commit to jgm/pandoc that referenced this issue Feb 5, 2024
@jgm
Copy link
Owner

jgm commented Feb 5, 2024

tilde, dot, ddot fixed in pandoc 3ef74d1fd2fa7937da841f90d3ff3d8dc87488c8

@jgm jgm closed this as completed Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants