touying-typ / touying

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

About the font "Fira Sans" and the page layout in theme "metropolis" #62

Open 02hyc opened 1 month ago

02hyc commented 1 month ago

I want to change my beamer sides into typst touying, however there are two main problems that I encounter. The typst slides is compiled in Win11. Figure 1 is the slide page in beamer while figure is the slide page in touying.

Font

It's obvious that the font "Fira Sans" isn't correctly shown in touying while I have correctly set it and install it locally:

#set text(font: "Fira Sans", weight: "regular",  size: 20pt)

I use the web app to compile the same code, and the font is correctly shown.

Layout

It's obvious that the line spacing in the touying slides is too narrow. I have referred to the document but I'm sorry to fail to solve it. Can anybody help me with it?

Thank you!

maucejo commented 3 weeks ago

I think that the answer in the doc - see here :)

02hyc commented 3 weeks ago

Thank you for your help! I read the doc again but I'm sorry for failing to fix the issue. Could you explain me more clearly, thank you very much!

maucejo commented 3 weeks ago

I paste here the code provided in the doc showing how to include the Fira font.

#import "@preview/touying:0.4.2": *

#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let s = (s.methods.info)(
  self: s,
  title: [Title],
  subtitle: [Subtitle],
  author: [Authors],
  date: datetime.today(),
  institution: [Institution],
)
#let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s)
#show: init

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

#let (slide, empty-slide, title-slide, new-section-slide, focus-slide) = utils.slides(s)
#show: slides

Normally, it should work. If it doesn't work locally, it means that the Fira font is probably not installed. You can check this by opening a terminal and type typst fonts.

mohe2015 commented 3 weeks ago

There also were recent changes in the typst font discovery, maybe using the unreleased typst from the main branch helps?

OrangeX4 commented 3 weeks ago

About layout, try

#let nontight(lst) = {
  let fields = lst.fields()
  fields.remove("children")
  fields.tight = false
  return (lst.func())(..fields, ..lst.children)
}

#show list.where(tight: true): nontight
#show enum.where(tight: true): nontight
#show terms.where(tight: true): nontight
02hyc commented 3 weeks ago

Thank you! @OrangeX4 your advise about the layout is very useful!

OrangeX4 commented 1 week ago

I still don't quite understand your first question, does this issue still exist in 0.5.0?