Skip to content

How to render responsively? #574

Answered by Myriad-Dreamin
OverflowCat asked this question in Q&A
Discussion options

You must be logged in to vote

I've tried setting the width of #page, but neither auto nor specified values have been successful.

For a responsive layout, you should prepare a vector artifact containing multiple layout first. Currently, it only supports a "width variable" for layout, though you can change height as well according to the x-page-width:

inputs: Some({
let mut dict = TypstDict::new();
dict.insert("x-page-width".into(), current_width.into_value());
dict.insert("x-target".into(), self.target.clone().into_value());
Arc::new(Prehashed::new(dict))
}),

To get it work at typst s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Myriad-Dreamin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants