From 62aa3f42b2d689cede6e68fe9247e9873c0a9dd9 Mon Sep 17 00:00:00 2001 From: Yu Cong Date: Fri, 23 May 2025 19:49:03 +0800 Subject: [PATCH] outline is hard! --- firatheme.typ | 65 ++++++++++++++++++++++++--------------------------- touying.typ | 9 ++++++- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/firatheme.typ b/firatheme.typ index 40ed2aa..1f69bc5 100644 --- a/firatheme.typ +++ b/firatheme.typ @@ -40,9 +40,7 @@ linebreaks: self.store.mini-slides.at("linebreaks", default: true), short-heading: self.store.mini-slides.at("short-heading", default: true), ) - } else if self.store.navigation == "line" { - - } + } else if self.store.navigation == "line" { } } #let fira-footer(self) = { @@ -113,7 +111,7 @@ /// ``` /// /// - config (dictionary): The configuration of the slide. You can use `config-xxx` to set the configuration of the slide. For more several configurations, you can use `utils.merge-dicts` to merge them. -/// +/// /// - extra (string, none): The extra information you want to display on the title slide. #let title-slide( config: (:), @@ -136,16 +134,17 @@ inset: 3em, { block( - fill: self.colors.neutral-light, + // fill: self.colors.neutral-light, inset: 1em, width: 100%, // radius: 0.2em, - text(size: 1.6em, fill: self.colors.primary, text(weight: "bold", info.title, hyphenate: false)) + ( - if info.subtitle != none { - linebreak()*2 - text(size: 1.2em, fill: self.colors.primary, info.subtitle) - } - ), + text(size: 1.44em, fill: self.colors.primary, text(weight: "bold", info.title, hyphenate: false)) + + ( + if info.subtitle != none { + linebreak() * 2 + text(size: 1.1em, fill: self.colors.primary, info.subtitle) + } + ), ) set text(size: 1em) if info.author != none { @@ -162,6 +161,7 @@ if extra != none { block(spacing: 1em, extra) } + linebreak()*2 }, ) } @@ -170,16 +170,14 @@ /// Outline slide for the presentation. -/// +/// /// - config (dictionary): The configuration of the slide. You can use `config-xxx` to set the configuration of the slide. For more several configurations, you can use `utils.merge-dicts` to merge them. -/// +/// /// - title (string): The title of the slide. Default is `utils.i18n-outline-title`. #let outline-slide(config: (:), title: utils.i18n-outline-title, ..args) = touying-slide-wrapper(self => { self = utils.merge-dicts( self, - config-page( - footer: none, - ), + config-page(footer: none), ) touying-slide( self: self, @@ -190,10 +188,11 @@ fill: self.colors.primary, weight: "bold", utils.call-or-display(self, title), - )+linebreak()*2, + ) + + linebreak() * 2, text( fill: self.colors.neutral-darkest, - outline(title: none, indent: 1em, depth: 1, ..args), + outline(title: none, indent: 1em, depth: 2, ..args), ), ), ) @@ -203,7 +202,7 @@ /// New section slide for the presentation. You can update it by updating the `new-section-slide-fn` argument for `config-common` function. /// /// Example: `config-common(new-section-slide-fn: new-section-slide.with(numbered: false))` -/// +/// /// - config (dictionary): The configuration of the slide. You can use `config-xxx` to set the configuration of the slide. For more several configurations, you can use `utils.merge-dicts` to merge them. /// /// - title (string): The title of the slide. Default is `utils.i18n-outline-title`. @@ -212,9 +211,7 @@ #let new-section-slide(config: (:), title: utils.i18n-outline-title, ..args, body) = touying-slide-wrapper(self => { self = utils.merge-dicts( self, - config-page( - footer: none, - ), + config-page(footer: none), ) touying-slide( self: self, @@ -244,7 +241,7 @@ /// Focus on some content. /// /// Example: `#focus-slide[Wake up!]` -/// +/// /// - config (dictionary): The configuration of the slide. You can use `config-xxx` to set the configuration of the slide. For more several configurations, you can use `utils.merge-dicts` to merge them. #let focus-slide(config: (:), body) = touying-slide-wrapper(self => { self = utils.merge-dicts( @@ -330,7 +327,12 @@ primary: rgb("#0c4842"), alpha: 60%, subslide-preamble: self => block( - text(1.2em, weight: "bold", fill: self.colors.primary, utils.display-current-heading(depth: self.slide-level, style: auto)), + text( + 1.2em, + weight: "bold", + fill: self.colors.primary, + utils.display-current-heading(depth: self.slide-level, style: auto), + ), ), ..args, body, @@ -343,16 +345,11 @@ (height: 4em, x: 2em, display-section: false, display-subsection: true, linebreaks: true, short-heading: true), mini-slides, ) - set text(size: 24pt, font: ("FiraGO","Source Han Sans SC"), weight: 400) + set text(size: 24pt, font: ("FiraGO", "Source Han Sans SC"), weight: 400) show math.equation: set text(font: "Fira Math") set strong(delta: 200) set par(justify: true) - set outline.entry(fill: none) - show heading: it => [ - #set text(size: 1.1em) - #it.body - // #underline(it.body,stroke: 4pt, offset: 4pt) -] + show heading.where(level: 2): set text(size: 1.1em) show: touying-slides.with( config-page( @@ -369,10 +366,10 @@ ), config-common( slide-fn: slide, - new-section-slide-fn: none //new-section-slide, + new-section-slide-fn: none, //new-section-slide, ), config-methods( - init: (self: none, body) => { + init: (self: none, body) => { show heading: set text(self.colors.primary) body @@ -400,4 +397,4 @@ ) body -} \ No newline at end of file +} diff --git a/touying.typ b/touying.typ index a2edb24..cd8cf60 100644 --- a/touying.typ +++ b/touying.typ @@ -10,6 +10,7 @@ config-info( title: [Looong LONG lng Long longlonglonglonglonglong TITLE], subtitle: [Subtitle], + short-title: [not-long title], author: [Authors], date: datetime.today(), // institution: [Institution], @@ -22,6 +23,12 @@ #outline-slide() +== title +#slide[ + write something here + $m a t h min sum$ +] + = Section A == General piecewise linear convex function *$bb(R)^b bb(Z)^n $* @@ -29,7 +36,7 @@ $ x_(n+1) = (x_n + a/x_n) / 2 $ -A slide without a title but with *important* infos 测试中文 +A slide without a title but with *important* infos 测试中文 $bb(Z),bb(R)$ $ min sum_(e in E) x_e f_k "such that some fonts"