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

Unable to use square #73

Closed
YDX-2147483647 opened this issue Sep 6, 2024 · 2 comments · Fixed by #75
Closed

Unable to use square #73

YDX-2147483647 opened this issue Sep 6, 2024 · 2 comments · Fixed by #75
Labels
bug Something isn't working

Comments

@YDX-2147483647
Copy link
Contributor

YDX-2147483647 commented Sep 6, 2024

The square Function draws a square with optional content. It might have no body, making touying broken.

#import "@preview/touying:0.5.2": themes
#import themes.simple: simple-theme

#show: simple-theme.with(aspect-ratio: "16-9")

#square()
error: content does not contain field "body"
     ┌─ @preview/touying:0.5.2\src\core.typ:1124:16
     │
1124 │           child.body,
     │                 ^^^^

touying/src/core.typ

Lines 1119 to 1125 in 334f8a2

let (conts, nextrepetitions) = _parse-content-into-results-and-repetitions(
self: self,
need-cover: repetitions <= index,
base: repetitions,
index: index,
child.body,
)

@YDX-2147483647
Copy link
Contributor Author

YDX-2147483647 commented Sep 6, 2024

Workaround

Give an invisible body: #square("").

Caveat: The square shrinks to fit this content, and no longer takes on the default 30pt.

@OrangeX4 OrangeX4 added the bug Something isn't working label Sep 6, 2024
@OrangeX4
Copy link
Member

OrangeX4 commented Sep 6, 2024

Thanks! This is indeed a bug. You can bypass it for now by using #context square()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants