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

Attach does not work as expected #6

Open
eniraa opened this issue Feb 28, 2024 · 6 comments
Open

Attach does not work as expected #6

eniraa opened this issue Feb 28, 2024 · 6 comments

Comments

@eniraa
Copy link

eniraa commented Feb 28, 2024

When rendering the example from Typst documentation, Wypst seems to treat t as tr and b as br. Moreover, nothing else is rendered.

Typst:

attach(
  Pi, t: alpha, b: beta,
  tl: 1, tr: 2+3, bl: 4+5, br: 6,
)

LaTeX:

\underset{\beta}{\overset{\alpha}{\prescript{1}{4+5}{\Pi}^{2+3}_{6}}}

Outputs:
screenshot_20240228T120643-0500 png@2x

@0xpapercut
Copy link
Owner

Hello! As of now, wypst only support b and t. I plan to expand on this on the near future; for now the idea was to implement a minimal working setup for Attach that works in most simple cases.

@0xpapercut
Copy link
Owner

By the way, this on my top list of TODO things, so maybe this week or the next I'll have it fixed.

@eniraa
Copy link
Author

eniraa commented Feb 29, 2024

Sounds good. Good luck on your exams, by the way!

@eniraa
Copy link
Author

eniraa commented Mar 2, 2024

In case you needed it, this command seems to function in the same way as Typst's attach function.

\newcommand{\attach}[7]{
	\prescript{#4}{#5}{\vphantom{#1}}
	\overset{#2}{\underset{#3}{#1}}
	\vphantom{#1}^{#6}_{#7}
}

@0xpapercut
Copy link
Owner

It seems prescript doesn't work in KaTeX; it's probably not possible to fix this without some arcane syntax.

@0xpapercut 0xpapercut closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2024
@eniraa
Copy link
Author

eniraa commented Mar 3, 2024

You can do something like this

\newcommand{\attach}[7]{
	\vphantom{#1}^{#4}_{#5}\underset{#3}{\overset{#2}{#1}}\vphantom{#1}^{#6}_{#7}
}

@0xpapercut 0xpapercut reopened this Mar 3, 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