touying-typ / touying

Touying is a powerful package for creating presentation slides in Typst.
https://touying-typ.github.io/touying/
MIT License
461 stars 10 forks source link

refactor: remove `padding` and add `full-header`, `full-footer` to support footnote #27

Closed OrangeX4 closed 3 months ago

OrangeX4 commented 3 months ago

(Original page layout ↑)

To support footnote, we need to modify the page layout of the slide from:

page(
  header: header,
  pad(
    body
  ),
  footer: footer,
)

to

set page(
  header: negative-pad(header),
  footer: negative-pad(footer),
)
body

structure.

Where let negative-pad = pad.with(x: -margin.x), which extends the header/footer to occupy the entire width of the page.

As a result, we remove the self.padding parameter and add self.full-header and self.full-footer to control whether this feature is enabled (not enabled for the simple theme, but enabled for all other themes).

This PR is a breaking change, but it enables support for footnote #26 and allows normal usage of set align(horizon) set rule.

cc @sefidel and @fran-miao

OrangeX4 commented 3 months ago

image image image image image