Something went wrong. Try again.
Slides used for my presentation at Black Alpaca 2026
Something went wrong. Try again.
blackalpaca-slides template.typ
13 kB 530 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531#let layouts = ( small: (height: 9cm, space: 1.4cm), medium: (height: 10.5cm, space: 1.6cm), large: (height: 12cm, space: 1.8cm),)
#let slides( content, title: none, subtitle: none, footer-title: none, footer-subtitle: none, date: none, authors: (), affiliations: none, logo: none, corner-logo: none, layout: "medium", ratio: 16 / 9, title-color: none, first-slide: true, last-slide: true, closing-title: [¡Gracias!], bg-color: white, count: "dot", footer: true, toc: true, theme: "normal",) = { assert(title != none, message: "A title is required") assert(layout in layouts, message: "Unknown layout") assert(theme in ("normal", "full"), message: "Unknown theme") assert( count in (none, "number", "dot", "dot-section"), message: "Unknown count", )
let (height, space) = layouts.at(layout) let width = ratio * height let sx = width / 1920 let sy = height / 1080
let red = rgb("#ee4131") let yellow = rgb("#f9fe52") let lilac = rgb("#a685fb") let ice = rgb("#d3eef5") let dark = bg-color == black or bg-color == rgb("#000000") let ink = if dark { white } else { black } let accent = if title-color == none { red } else { title-color } let soft = accent.lighten(90%) let edge = accent.lighten(65%) let rule = accent.lighten(50%)
set document(title: title, author: authors) set heading(numbering: "1.a") set text(fill: ink)
let at(x, y, body) = place(top + left, dx: x * sx, dy: y * sy, body) let frame(body) = block(width: width, height: height, clip: true, body) let panel(x, y, w, h, color) = at(x, y, rect( width: w * sx, height: h * sy, fill: color, stroke: none, ))
let fitted(body, w, h, size, color, single: false) = context { let styled(s) = text(size: s, fill: color, weight: "regular", body) let s = size * sy let available = w * sx let lines(s) = block(width: available, styled(s))
if single { let natural = measure(box(styled(s))).width if natural > available { s *= 0.99 * available / natural } }
while s > 4pt and measure(lines(s)).height > h * sy { s -= 0.5pt } lines(s) }
let progress() = context { let current = here().page() let last = counter(page).final().first()
if count == "number" { [#counter(page).display() / #last] } else if count in ("dot", "dot-section") { let first = 1 let end = last
if count == "dot-section" { let starts = query(heading.where(level: 1)).map(it => it .location() .page()) first = starts.filter(p => p <= current).last(default: 1) let next = starts.find(p => p > current) if next != none { end = next - 1 } }
let r = calc.min(4 * sy, 230 * sx / (3 * calc.max(1, end - first + 1))) let color = if footer { black } else { ink }
for p in range(first, end + 1) { link((page: p, x: 0pt, y: 0pt), circle( radius: r, stroke: 0.45pt + color, fill: if p <= current { color }, )) h(r) } } }
let slide-header = context { let n = here().page() let hd = query(heading.where(level: 2)) .rev() .find(it => it.location().page() <= n)
if hd != none { let from = hd.location().page() let label = if from == n { hd.body } else { [#hd.body #numbering("(i)", n - from + 1)] }
block( width: 100%, height: 0.85 * space, align(left + horizon, text(1.4em, weight: "bold", fill: red, label)), ) } }
let band-height = if footer { 81 * sx } else { 0.32 * space } let band-y = height - band-height let bottom-margin = if footer { band-height + 1.5pt } else { 0.45 * space }
let band-text(x, w, value, color) = place( top + left, dx: x * sx, dy: band-y, block( width: w * sx, height: band-height, align(left + horizon, fitted( value, w, band-height / sy, 30, color, single: true, )), ), )
let slide-frame = frame({ if footer { let icon = if dark { "black-alpaca/alpaca-icon-dark.png" } else { "black-alpaca/alpaca-icon.png" }
// Overlapping solid fills prevent hairlines between footer segments. let field(w, color) = rect( width: w * sx, height: band-height, fill: color, stroke: none, ) place(top + left, dy: band-y, field(1920, yellow)) place(top + left, dy: band-y, field(1020, red)) place(top + left, dy: band-y, field(472, if dark { ice } else { black }))
if dark { // The dark footer contains black lettering. Crop inside the artwork // so its partially transparent outer rows never reach the page. place(top + left, dx: 40 * sx, dy: band-y + 12 * sx, block( width: 300 * sx, height: 57 * sx, clip: true, place(top + left, dx: -40 * sx, dy: -12 * sx, image( "black-alpaca/footer-dark.png", width: width, alt: "Black Alpaca II 2026", )), )) } else { // Place the transparent white wordmark directly on solid black. place(top + left, dx: 48 * sx, dy: band-y + 18 * sx, image( "black-alpaca/wordmark.png", width: 278 * sx, alt: "Black Alpaca II 2026", )) }
let primary = if footer-title == none { title } else { footer-title } let secondary = if footer-subtitle == none { subtitle } else { footer-subtitle } band-text(490, 510, primary, white)
if secondary != none { let available = if count == none { 850 } else if count == "number" { 710 } else { 630 } band-text(1040, available, secondary, black) }
place( top + right, dx: -6 * sx, dy: band-y - 94 * sy, image(icon, height: 90 * sy, alt: none), ) }
if count != none { place(top + right, dx: -20 * sx, dy: band-y, block( width: if count == "number" { 136 * sx } else { 230 * sx }, height: band-height, align(right + horizon, text( 0.7em, fill: if footer { black } else { ink }, progress(), )), )) } })
set page( width: width, height: height, fill: bg-color, margin: (x: 0.5 * space, top: 1.15 * space, bottom: bottom-margin), header: slide-header, // Moves the heading up by 4.5 mm with layout: "large". header-ascent: 0.25 * space, background: slide-frame, )
show heading.where(level: 1): it => { set page(header: none, background: none, margin: 0pt, fill: lilac)
frame({ panel(0, 0, 1920, 256, black) at(72, 38, image("black-alpaca/wordmark.png", width: 1137 * sx))
at(1480, 470, image( "black-alpaca/alpaca-section.png", width: 440 * sx, height: 610 * sy, fit: "stretch", alt: none, ))
panel(72, 900, 164, 180, ice)
at(120, 415, block( width: 1290 * sx, height: 340 * sy, fill: yellow, inset: (x: 54 * sx, y: 28 * sy), align(left + horizon, fitted(it.body, 1182, 284, 86, black)), )) }) }
show heading.where(level: 2): pagebreak(weak: true) show heading: set text(1.1em, fill: if dark { yellow } else { lilac })
show terms.item: it => stack( block( width: 100%, fill: edge, inset: 5pt, radius: (top: 0.2em), strong(it.term), ), block( width: 100%, fill: soft, inset: 5pt, radius: (bottom: 0.2em), it.description, ), )
show raw.where(block: false): it => box( fill: white, inset: (x: 3pt), outset: (y: 3pt), radius: 2pt, baseline: 0pt, text(fill: black, it), )
show raw.where(block: true): it => block( width: 100%, fill: white, inset: (x: 1em, y: 0.85em), radius: 0.4em, stroke: (left: 3pt + rule, rest: 0.6pt + edge), text(fill: black, it), )
show list: set list(marker: ( text(fill: accent)[•], text(fill: accent)[‣], text(fill: accent)[-], )) set enum(numbering: n => text(fill: accent)[*#n.*])
show table: set table(stroke: (x, y) => ( x: none, bottom: 0.8pt + ink, top: if y == 0 { 0.8pt + ink } else if y == 1 { 0.4pt + ink } else { 0pt }, )) show table.cell.where(y: 0): set text(style: "normal", weight: "bold") set table.hline(stroke: 0.4pt + ink) set table.vline(stroke: 0.4pt)
set quote(block: true) show quote.where(block: true): it => { v(-5pt) block( width: 100%, fill: soft, inset: 5pt, radius: 1pt, stroke: (left: 3pt + rule), outset: (x: -5pt, y: 5pt), it, ) v(-5pt) }
show link: it => if type(it.dest) == str { underline(stroke: 0.5pt + accent, it) } else { it }
set outline(indent: auto) show outline: set heading(level: 2) set bibliography(title: none)
show ref: it => { if it.element == none { return it } let el = it.element set text(size: 0.7em, fill: white)
box( fill: rule, outset: (y: 0.2em), radius: 0.8em, height: 0.8em, inset: (x: 0.5em), if el.func() == heading { link(el.location(), if it.supplement == auto { el.body } else { it.supplement }) } else { it }, ) }
if first-slide { set page(header: none, background: none, margin: 0pt, fill: rgb("#2472ee"))
let speaker = if affiliations != none { affiliations } else if type(authors) == array { authors.join(", ", last: " & ") } else { authors }
frame({ place(top + right, image( "black-alpaca/alpaca-cover.png", height: height, alt: none, ))
panel(0, 150, 108, 236, ice) at(140, 268, if logo == none { image("black-alpaca/wordmark.png", width: 746 * sx) } else { box(width: 746 * sx, logo) })
if corner-logo != none { at(1570, 36, box(width: 300 * sx, corner-logo)) }
panel(70, 419, 1287, 179, red) at(136, 452, fitted(title, 1185, 122, 118, white, single: true))
panel(220, 598, 1225, 299, yellow) at(248, 622, fitted( [ #if subtitle != none { block(below: 10 * sy, text(1.24em, subtitle)) } #if date != none { block(below: 12 * sy, date) } #speaker ], 1160, 245, 47, black, )) }) }
if toc { outline() } content
if last-slide { pagebreak(weak: true)
set page( header: none, footer: none, background: none, foreground: none, numbering: none, margin: 0pt, fill: rgb("#2472ee"), )
frame({ // Alpaca y marca del evento. place(top + right, image( "black-alpaca/alpaca-cover.png", height: height, alt: none, ))
panel(0, 150, 108, 236, ice)
at(140, 268, image( "black-alpaca/wordmark.png", width: 746 * sx, alt: "Black Alpaca II 2026", ))
// Franja de agradecimiento. panel(70, 419, 1287, 179, rgb("#ffff00"))
at(136, 435, block( width: 1171 * sx, height: 147 * sy, align(left + horizon, fitted( closing-title, 1171, 147, 128, black, single: true, )), ))
// Panel de patrocinadores. panel(220, 598, 1225, 299, lilac)
let sponsor(x, y, w, h, filename, name) = at( x, y, image( "black-alpaca/sponsors/" + filename, width: w * sx, height: h * sy, fit: "contain", alt: name, ), )
sponsor( 266, 663, 396, 86, "image9.png", "Fluid Attacks", )
sponsor( 681, 672, 394, 65, "image16.png", "Deep Security", )
sponsor( 1064, 631, 314, 140, "image4.png", "Cobalt", )
sponsor( 902, 792, 346, 45, "image11.png", "Veracode", )
at(488, 762, block( width: 346 * sx, height: 105 * sy, clip: true, place( top + left, dx: -29.44 * sx, dy: -55.86 * sy, image( "black-alpaca/sponsors/image13.png", width: 410.34 * sx, height: 214.40 * sy, fit: "stretch", alt: "NTT DATA", ), ), )) }) }}}