Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions content-wf.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(<category-anchor>)
let sub-anchors = query(<subcategory-anchor>)
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)
Binary file added img/logo-usm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions lib/render.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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) = {
Expand Down Expand Up @@ -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%)[
Expand Down Expand Up @@ -142,6 +145,7 @@
#let template-category-title(config, title) = {
current-category.update(title)
current-subcategory.update(none)
[#metadata(title) <category-anchor>]
block(spacing: config.category-spacing)[
#text(weight: "black", size: config.category-size)[#title]
#v(-0.5em)
Expand All @@ -151,7 +155,9 @@

#let template-subcategory-title(config, title) = {
current-subcategory.update(title)
block(spacing: config.subcategory-spacing)[
[#metadata(title) <subcategory-anchor>]
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]
]
}
Expand Down
Binary file modified main-wf.pdf
Binary file not shown.
61 changes: 10 additions & 51 deletions main-wf.typ
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
3 changes: 3 additions & 0 deletions tracker-wf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -119,6 +120,7 @@ content:
- simplex.cpp
- polynomials:
- fft.cpp
- ntt.cpp
- fast-ntt.cpp
- fwht.cpp
- poly-shift.cpp
Expand Down Expand Up @@ -177,6 +179,7 @@ content:
- optimization:
- d&c.cpp
- knuth.cpp
- convex-hull-trick.cpp
- li-chao-tree.cpp
- li-chao-segment.cpp
- misc:
Expand Down