Touying: Why does `set align(horizon)` cause a list with `#pause` to move down?

Consider this minimal presentation with touying:

#import "@preview/touying:0.6.1": *
#import themes.simple: *

#show: simple-theme.with(
  aspect-ratio: "16-9",
  footer: [Simple slides],
)

#set align(horizon)

- item 1 #pause
- item 2 #pause
- item 3 

What happens is that on the third slide all three items move slightly down. Why is that and how can I get rid of it? It happens in all touying themes and also inside more complex constructions.

Hello,

this is a known Touying issue see #136.
A workaround is to set the paragraph spacing explicitly, by default Typst uses 0.65em.

#set par(spacing: 0.65em)
1 Like

The issue is not with explicit par.spacing, but matching par.spacing and list.spacing.

    config-common(
      slide-fn: slide.with(
        setting: body => {
          // Fix moving list items when using pause
          set par(spacing: spacing) if fix-pause
          set list(spacing: spacing) if fix-pause
          body
        },
      ),
    ),
1 Like

This depends on the values of spacing and fix-pause, right? In which context are these defined? I would ideally want to put this in my template, which was derived from university. I want to put it here, but it does not seem to work.

show: touying-slides.with(
  config-page(
    paper: "presentation-" + aspect-ratio,
    header-ascent: 0em,
    footer-descent: 0em,
    margin: (top: 2em, bottom: 1.25em, x: 2em),
  ),
  config-common(
    // slide-fn: slide,
    slide-fn: slide.with(  
         setting: body => {
        // Fix moving list items when using pause
        set par(spacing: 0.65em) 
        set list(spacing: 0.65em)
        body
        },
    ),

P.S. How do I get typst syntax highlighting in this forum?

How to post in the Questions category :

1 Like

Yes.

In a template context?

I don’t know how you define that template function.

It works just fine:

#import "@preview/touying:0.6.1": *
#import themes.metropolis: metropolis-theme, slide, title-slide

#let template(spacing: 0.65em, doc) = {
  show: metropolis-theme.with(
    config-common(slide-fn: slide.with(setting: body => {
      set par(spacing: spacing)
      set list(spacing: spacing)
      body
    })),
  )
  doc
}

#show: template

== Slide
#lorem(10)
- a #pause
- b #pause
- c
1 Like