From 679076fc638604e391e3a6b478e42f5da0e70eaf Mon Sep 17 00:00:00 2001 From: Jean-Marie 'Histausse' Mineau Date: Thu, 16 Oct 2025 00:54:26 +0200 Subject: [PATCH] better ghosts --- slides.typ | 13 +++++++--- slides/lib.typ | 14 ++++++++--- slides/sns_polylux_template.typ | 43 +++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/slides.typ b/slides.typ index 91de594..70913c7 100644 --- a/slides.typ +++ b/slides.typ @@ -49,11 +49,18 @@ ) ) -#set page(foreground: ghost-5(dx:-45%, dy: 43%)) -#slide(new-sec: true, title: [Introduction], hide-title: true)[ +#slide( + new-sec: true, + title: [Introduction], + hide-title: true, + foreground: { + ghost-5(dx: 10%, dy: 30pt) + ghost-4(dx: 95%, dy: 80%) + //ghost-4(dx: 45%, dy: 43%) + } +)[ Intro 1 ] -#set page(foreground: []) #slide[ Intro 2 diff --git a/slides/lib.typ b/slides/lib.typ index 7f788ab..39066fa 100644 --- a/slides/lib.typ +++ b/slides/lib.typ @@ -30,10 +30,18 @@ pirat-color.red, } ] -#let ghost(img, ..args,) = { - move( +#let ghost(img, dx: 0pt, dy: 0pt, height: 100pt, ..args,) = context { + let img = image(img, height: height) + let s = measure(img) + let hx = s.width / 2 + let hy = s.height / 2 + + place( + bottom + left, + dx: dx - hx, + dy: -dy + hy, ..args, - image(img, height: 100pt) + img ) } diff --git a/slides/sns_polylux_template.typ b/slides/sns_polylux_template.typ index 160e19a..3ae4ff7 100644 --- a/slides/sns_polylux_template.typ +++ b/slides/sns_polylux_template.typ @@ -162,6 +162,8 @@ cmyk(25%,7%,0%,0%), #let title-slide( body : none, logo : none, + background : [], + foreground : [], ) = context( { let content = align(top + center, context( { let title = sns-polylux-template_title.at(here()) @@ -274,6 +276,7 @@ cmyk(25%,7%,0%,0%), body } )) + set page(background: background, foreground: foreground) pl.slide({ content }) counter("logical-slide").update( n => n - 1 ) @@ -372,6 +375,8 @@ cmyk(25%,7%,0%,0%), page-number : true, hide-section : false, hide-title : false, + background : [], + foreground : [], body ) = context( { let sections_height = 1.5cm @@ -474,6 +479,8 @@ cmyk(25%,7%,0%,0%), margin: (top: top-margin, bottom: 1cm), header: header, footer: footer, + background: background, + foreground: foreground ) pl.slide({ @@ -490,12 +497,16 @@ cmyk(25%,7%,0%,0%), new-sec : none, page-number : true, hide-section : false, + background : [], + foreground : [], body ) = context( { set page( margin: (top: 2.5cm, bottom: 0cm), footer: none, fill: sns-polylux-template_colormap.at(here()).at(1), + background: background, + foreground: foreground ) pl.slide({ @@ -513,6 +524,8 @@ cmyk(25%,7%,0%,0%), } ) #let empty-slide( + background : [], + foreground : [], body ) = context( { // HEADER @@ -529,10 +542,12 @@ cmyk(25%,7%,0%,0%), } )) set page( - margin: (top: 0cm, bottom: 0cm), - foreground: header, + margin: (top: 2.7cm, bottom: 0cm), + header: header, footer: none, fill: sns-polylux-template_colormap.at(here()).at(1), + background: background, + foreground: foreground ) pl.slide({ @@ -548,7 +563,11 @@ cmyk(25%,7%,0%,0%), counter("logical-slide").update( n => n - 1 ) } ) -#let new-section-slide(name) = context( { +#let new-section-slide( + name, + background : [], + foreground : [], +) = context( { // HEADER let header = align(top, context( { let logo = sns-polylux-template_logo-1.at(here()) @@ -563,10 +582,12 @@ cmyk(25%,7%,0%,0%), } )) set page( - margin: (top: 0cm, bottom: 0cm), - foreground: header, + margin: (top: 2.7cm, bottom: 0cm), + header: header, footer: none, fill: sns-polylux-template_colormap.at(here()).at(1), + background: background, + foreground: foreground ) // TOC @@ -608,7 +629,11 @@ cmyk(25%,7%,0%,0%), counter("logical-slide").update( n => n - 1 ) } ) -#let toc-slide(title: none) = context( { +#let toc-slide( + title : none, + background : [], + foreground : [], +) = context( { // HEADER let header = align(top, { let logo = sns-polylux-template_logo-1.at(here()) @@ -623,10 +648,12 @@ cmyk(25%,7%,0%,0%), } ) set page( - margin: (top: 0cm, bottom: 0cm), - foreground: header, + margin: (top: 2.7cm, bottom: 0cm), + header: header, footer: none, fill: sns-polylux-template_colormap.at(here()).at(1), + background: background, + foreground: foreground ) // TOC