diff --git a/content-wf.typ b/content-wf.typ index 7897a9f..08449f7 100644 --- a/content-wf.typ +++ b/content-wf.typ @@ -16,6 +16,8 @@ category-line-stroke: 1pt, pagebreak-between-topics: false, breakable: true, + code-above: 1.5em, + subcategory-spacing-below: 1.2em, ) #set page( @@ -51,4 +53,47 @@ #set columns(gutter: 0.2cm) #set text(font: "New Computer Modern", size: 6.5pt) +// Index: only folders and subfolders +#text(weight: "bold", size: 9pt)[Index] +#v(0.2em) +#line(length: 100%, stroke: 0.6pt) +#v(0.3em) +#let idx-data = yaml("tracker-wf.yaml") +#context { + let cat-anchors = query() + let sub-anchors = query() + let get-page(anchors, title) = { + let m = anchors.filter(a => a.value == title) + if m.len() > 0 { str(counter(page).at(m.first().location()).first()) } else { "" } + } + for x in idx-data { + let content-list = x.at(1) + for topic-entry in content-list { + for (topic-name, items) in topic-entry { + let cat = title-case(topic-name.split("-").join(" ")) + let cat-page = get-page(cat-anchors, cat) + let subtopics = items.filter(i => type(i) == dictionary).map(i => { + let (name, _) = i.pairs().first() + let sub-name = title-case(name.split("-").join(" ")) + (name: sub-name, page: get-page(sub-anchors, sub-name)) + }) + grid(columns: (1fr, auto), gutter: 0pt, + text(weight: "bold")[#cat], + text(weight: "bold")[#cat-page] + ) + for sub in subtopics { + grid(columns: (auto, 1fr, auto), gutter: 0pt, + h(0.8em), + text(fill: rgb("#555"))[#sub.name], + text(fill: rgb("#555"))[#sub.page] + ) + } + } + } + } +} +#v(0.3em) +#line(length: 100%, stroke: 0.6pt) +#v(0.8em) + #render-from-tracker("tracker-wf.yaml", wf-config) diff --git a/img/logo-usm.png b/img/logo-usm.png new file mode 100644 index 0000000..d6a1a52 Binary files /dev/null and b/img/logo-usm.png differ diff --git a/lib/render.typ b/lib/render.typ index a06ba47..e5652bf 100644 --- a/lib/render.typ +++ b/lib/render.typ @@ -16,6 +16,8 @@ category-line-stroke: 1.5pt, pagebreak-between-topics: true, breakable: false, + code-above: 0.6em, + subcategory-spacing-below: none, ) #let title-case(string) = { @@ -79,7 +81,8 @@ breakable: true, inset: 0pt, stroke: (left: 0.9pt, right: 0.9pt), - above: 0.6em, + above: config.code-above, + below: config.code-above, width: 100% )[ #block(breakable: false, width: 100%)[ @@ -142,6 +145,7 @@ #let template-category-title(config, title) = { current-category.update(title) current-subcategory.update(none) + [#metadata(title) ] block(spacing: config.category-spacing)[ #text(weight: "black", size: config.category-size)[#title] #v(-0.5em) @@ -151,7 +155,9 @@ #let template-subcategory-title(config, title) = { current-subcategory.update(title) - block(spacing: config.subcategory-spacing)[ + [#metadata(title) ] + let below = if config.subcategory-spacing-below != none { config.subcategory-spacing-below } else { config.subcategory-spacing } + block(above: config.subcategory-spacing, below: below)[ #text(weight: "bold", size: config.subcategory-size, fill: rgb("#444"))[#sym.triangle.filled.r #title] ] } diff --git a/main-wf.pdf b/main-wf.pdf index 5ca42f8..a16a818 100644 Binary files a/main-wf.pdf and b/main-wf.pdf differ diff --git a/main-wf.typ b/main-wf.typ index 624d7c3..3a3ccec 100644 --- a/main-wf.typ +++ b/main-wf.typ @@ -1,57 +1,16 @@ #set page(paper: "a4", flipped: true, margin: 1.5cm) #set text(font: "New Computer Modern", size: 11pt) -#grid( - columns: (1fr, 1.5fr), - column-gutter: 1.5cm, - align(center + horizon)[ - #image(width: 90%, "img/utfsm_cp.png") - #v(0.5em) - #text(size: 1.8em, weight: "bold")[Handbook USM] - #v(0.2em) - #text(size: 1.2em)[World Finals] - #v(1em) - #set text(size: 10pt) - #table( - columns: 2, - stroke: none, - align: (left, left), - [*Team:*], [La CASneta], - [*University:*], [UTFSM], - ) - ], - [ - #text(size: 1.2em, weight: "bold")[Contents] - #v(0.5em) - #set text(size: 8pt) - #let data = yaml("tracker-wf.yaml") - #for x in data { - let content-list = x.at(1) - for topic-entry in content-list { - for (topic-name, items) in topic-entry { - let cat = topic-name.split("-").join(" ") - let cat = upper(cat.first()) + cat.slice(1) - [*#cat:* ] - let all-files = () - for item in items { - if type(item) == str { - all-files.push(item.split(".").at(0).split("-").join(" ")) - } else if type(item) == dictionary { - for (_, files) in item { - for f in files { - all-files.push(f.split(".").at(0).split("-").join(" ")) - } - } - } - } - [#all-files.join(", ")] - linebreak() - v(0.3em) - } - } - } - ], -) +// Cover page +#align(center + horizon)[ + #image(width: 65%, "img/logo-usm.png") + #v(1.5em) + #text(size: 2em, weight: "bold")[La CASneta] + #v(0.8em) + #text(size: 1.2em)[Abner Vidal · Carlos Lagos · Sebastián Torrealba] +] + +#pagebreak() // Content #let content-file = read("content-wf.typ") diff --git a/tracker-wf.yaml b/tracker-wf.yaml index 4b3ae4a..81baf68 100644 --- a/tracker-wf.yaml +++ b/tracker-wf.yaml @@ -103,6 +103,7 @@ content: - euler-phi-sieve.cpp - mobius-sieve.cpp - miller-rabin.cpp + - non-deterministic-miller-rabin.cpp - pollard-rho.cpp - fast-prime-factorization.cpp - mod-sqrt.cpp @@ -119,6 +120,7 @@ content: - simplex.cpp - polynomials: - fft.cpp + - ntt.cpp - fast-ntt.cpp - fwht.cpp - poly-shift.cpp @@ -177,6 +179,7 @@ content: - optimization: - d&c.cpp - knuth.cpp + - convex-hull-trick.cpp - li-chao-tree.cpp - li-chao-segment.cpp - misc: