astro-typst icon indicating copy to clipboard operation
astro-typst copied to clipboard

Displaying specific page

Open syrkis opened this issue 11 months ago • 4 comments

Suppose one wants to show one page at a time, like a slide show, instead of the entire scrollable document. Would that be an appropriate feature for astro-typst? :)

syrkis avatar Dec 28 '24 20:12 syrkis

Do you mean extracting a specific page, so that you can do

{[...Array(5).keys()].map( i => <Typst code={code} page={i} /> )}

Sadly upstream has not publicly provided this feature; it can only be used in tinymist preview.

OverflowCat avatar Mar 04 '25 16:03 OverflowCat

also looking forward this feature, we can use touying to create slides in typst. so if we have such feature, we can create slide in typst and render it in astro.

jenningsloy318 avatar Apr 24 '25 02:04 jenningsloy318

I did a draft like this: Each page has class typst-page, and the entire typst doc has class typst-doc. Could be done with some JS, setting height of typst-doc to typst-page, and moving them all to the top, showing only one in focus. Two things i was missing:

  1. Would be nice to have handout mode [1] enabled when NOT in slide mode, and disabled when in slide show mode.
  2. Clicking a link as per #11 does NOT navigate to the appropriate page.

[1] https://touying-typ.github.io/docs/dynamic/handout

syrkis avatar May 12 '25 07:05 syrkis

I don't get it as I don't use Touying very much. Are you saying to add .typst-page via html.frame? Also, can [1] be solved by passing different sys.input values?

OverflowCat avatar May 17 '25 15:05 OverflowCat