touying-typ / touying

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

Title slide has a different format when using `pdfpc` and metropolis theme #88

Closed nicolasfara closed 1 month ago

nicolasfara commented 1 month ago

When pdfc configuration is set in the .typ file, the title slide changes format (A4 I suppose).

The following code for reproducing the result:

#import "@preview/touying:0.5.2": *
#import themes.metropolis: *
#import "@preview/fontawesome:0.1.0": *
#import "@preview/ctheorems:1.1.2": *
#import "@preview/numbly:0.1.0": numbly

// Pdfpc configuration
// typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc
#pdfpc.config(
  duration-minutes: 30,
  start-time: datetime(hour: 14, minute: 10, second: 0),
  end-time: datetime(hour: 14, minute: 40, second: 0),
  last-minutes: 5,
  note-font-size: 12,
  disable-markdown: false,
  default-transition: (
    type: "push",
    duration-seconds: 2,
    angle: ltr,
    alignment: "vertical",
    direction: "inward",
  ),
)

// Theorems configuration by ctheorems
#show: thmrules.with(qed-symbol: $square$)
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
#let corollary = thmplain(
  "corollary",
  "Corollary",
  base: "theorem",
  titlefmt: strong
)
#let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmproof("proof", "Proof")

#show: metropolis-theme.with(
  aspect-ratio: "16-9",
  footer: self => self.info.institution,
  // config-common(handout: true),
  config-info(
    title: [Title],
    subtitle: [Subtitle],
    author: [Authors],
    date: datetime.today(),
    institution: [Institution],
    // logo: emoji.school,
  ),
)

#set text(font: "Fira Sans", weight: "light", size: 20pt)
#show math.equation: set text(font: "Fira Math")

#title-slide()

= Animation

== Simple Animation

#pdfpc.speaker-note("This is a note that only the speaker will see.")

Is there a misconfiguration on my side or a problem with the metropolis theme? If I comment out the pdfpc configuration, the title slide is ok.

image

OrangeX4 commented 1 month ago

Using the code you gave, I can't reproduce your results with typst 0.11.1 and touying 0.5.2, what is the typst version you are using?

Also, maybe you might consider placing pdfpc.config() in config-common(preamble: {pdfpc.config()}).

nicolasfara commented 1 month ago

Hi @OrangeX4 thanks for your prompt response!

I'm on Typst 0.11.1 and touying 0.5.2. However, your suggestion of putting in config-common(preamble {pdfpc.config()}) the configuration makes it work!

I cannot find the preamble description in the documentation, have I missed something? Documenting it in the doc could be useful.

Closed as resolved