polylux icon indicating copy to clipboard operation
polylux copied to clipboard

Weak pagebreak in polylux-slide can break custom page setup

Open TLouf opened this issue 1 year ago • 9 comments

Issue

When a custom page setting is used in slides, adding a "hidden" (see MRE below) heading in-between slides completely disables this page setting.

Context

I'm trying to create a theme for myself, largely inspired by metropolis, in which the slides' headers can get directly filled with the current headings.

Source

I must say that I really don't understand what's going on, but apparently, it's linked to the fact that page breaks are weak between slides, as set in:

https://github.com/andreasKroepelin/polylux/blob/453101923c3338d2b61c6944d03c45513b20138b/logic.typ#L273-L278

because setting it to false fixes it for me.

Possible fix

Either set weak to false directly, or, if weak pagebreaks are needed in some contexts, provide the option to disable them.

MRE

#import "@preview/polylux:0.3.1": *
#import themes.metropolis: *

#show: metropolis-theme
#show heading.where(level: 1): it => {}


= Hidden heading


#slide(title: "Ignored slide title")[
  == My slide title
  Hello, world!
]


#slide(title: "Working slide title")[
  == A quiz

  What is the capital of the Republic of Benin?

]

TLouf avatar Nov 12 '23 17:11 TLouf

@dherse Do you happen to recognise if that's the same issue that you caught recently? It looks similar at least.

andreasKroepelin avatar Nov 12 '23 19:11 andreasKroepelin

Yes indeed that does appear to be the same issue

Dherse avatar Nov 12 '23 21:11 Dherse

But in the end you solved it, right?

andreasKroepelin avatar Nov 12 '23 22:11 andreasKroepelin

I mean the way I solved it was by manually adding a weak pagebreak before the first slide which somehow fixed it, but I am not sure why :(

Dherse avatar Nov 12 '23 23:11 Dherse

But is there a reason page breaks are set as weak? I couldn't figure it out.

TLouf avatar Nov 17 '23 12:11 TLouf

I surely had a reason when I implemented that :D It might very well be that Typst's pagebreak behaviour changed since then.

andreasKroepelin avatar Nov 17 '23 14:11 andreasKroepelin

I surely had a reason when I implemented that :D It might very well be that Typst's pagebreak behaviour changed since then.

I do think some things changed since there were some changes to the behaviour of breaking on """empty""" page (triple quote because place blocks used to count as empty pages). Perhaps it's something to do with that?

Dherse avatar Nov 17 '23 16:11 Dherse

Probably also regarding state updates. I actually don't know if that's empty content or not currently. 🤔

andreasKroepelin avatar Nov 17 '23 17:11 andreasKroepelin

I think that currently it counts as empty content 🤔

Dherse avatar Nov 17 '23 17:11 Dherse