Refine modern template typography
This commit is contained in:
1 file changed
+34
-20
+34
-20
@@ -7,8 +7,9 @@
|
||||
warning: rgb("#E9724C"),
|
||||
error: rgb("#C5283D"),
|
||||
|
||||
text-font: ("Fira Sans", "Libertinus Serif"),
|
||||
math-font: ("Fira Math", "New Computer Modern Math"),
|
||||
text-font: ("TeX Gyre Termes", "Libertinus Serif"),
|
||||
math-font: ("TeX Gyre Termes Math", "New Computer Modern Math"),
|
||||
sans-font: ("Fira Sans", "Libertinus Serif"),
|
||||
)
|
||||
|
||||
#let theme-state = state("homework-theme", default-theme)
|
||||
@@ -23,15 +24,12 @@
|
||||
#let doc-id = sys.inputs.at("doc-id", default: none)
|
||||
|
||||
|
||||
#let task(
|
||||
points: none,
|
||||
title,
|
||||
body,
|
||||
) = context {
|
||||
#let task(points: none, title, body) = context {
|
||||
subtask-indent.update((0,))
|
||||
|
||||
let theme = theme-state.get()
|
||||
let text-color = theme.primary
|
||||
let header-font = theme.sans-font
|
||||
let border-color = theme.primary
|
||||
let background-color = theme.secondary.transparentize(75%)
|
||||
let task-label = task-label-state.get()
|
||||
@@ -59,7 +57,23 @@
|
||||
above: 0pt,
|
||||
below: 0.05em,
|
||||
{
|
||||
set text(fill: text-color, size: 1em)
|
||||
{
|
||||
show heading: none
|
||||
|
||||
heading(
|
||||
level: 1,
|
||||
numbering: none,
|
||||
outlined: true,
|
||||
bookmarked: true,
|
||||
)[
|
||||
#task-label #task-counter.display()
|
||||
#if title != none and title != [] {
|
||||
[ — #title]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
set text(fill: text-color, size: 1em, font: header-font)
|
||||
|
||||
[*#task-label #task-counter.display()*]
|
||||
|
||||
@@ -90,7 +104,7 @@
|
||||
|
||||
#let subtask(
|
||||
points: 0,
|
||||
tight: false,
|
||||
tight: true,
|
||||
ignore-points: false,
|
||||
markers: ("(i)", "(a)"),
|
||||
show-points: true,
|
||||
@@ -121,7 +135,10 @@
|
||||
numbering(marker, num)
|
||||
},
|
||||
if points != none and points > 0 and show-points {
|
||||
metadata((type: "subtask-points", content: block(width: 7%, [#points P.])))
|
||||
metadata((
|
||||
type: "subtask-points",
|
||||
content: block(width: 7%, text(font: theme-state.get().sans-font)[#points P.]),
|
||||
))
|
||||
|
||||
content
|
||||
} else { content },
|
||||
@@ -137,10 +154,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
#let hint(
|
||||
label: none,
|
||||
body,
|
||||
) = context {
|
||||
#let hint(label: none, body) = context {
|
||||
let theme = theme-state.get()
|
||||
let hint-label = if label != none and label != [] { label } else { hint-label-state.get() }
|
||||
|
||||
@@ -158,7 +172,7 @@
|
||||
inset: (y: 0.75em, left: offset, right: 1em),
|
||||
width: if in-subtask { 100% - 0.25em } else { 100% + offset },
|
||||
[
|
||||
#text(size: 8pt, weight: 600, fill: theme.accent.darken(25%), hint-label) \
|
||||
#text(size: 8pt, weight: 600, fill: theme.accent.darken(25%), text(font: theme.sans-font, hint-label)) \
|
||||
#body
|
||||
],
|
||||
)
|
||||
@@ -210,7 +224,7 @@
|
||||
|
||||
set page(
|
||||
margin: (y: 3.5cm, x: 2.5cm),
|
||||
numbering: (..c) => [*#c.at(0)* / #c.at(-1)],
|
||||
numbering: (..c) => text(font: _theme.sans-font)[*#c.at(0)* / #c.at(-1)],
|
||||
|
||||
foreground: {
|
||||
if show-datamatrix {
|
||||
@@ -278,7 +292,7 @@
|
||||
},
|
||||
|
||||
header: {
|
||||
set text(size: 8pt)
|
||||
set text(size: 8pt, font: _theme.sans-font)
|
||||
|
||||
let _lines = (
|
||||
(professor, assistant).filter(x => x != none and x != []),
|
||||
@@ -317,7 +331,7 @@
|
||||
|
||||
set text(font: _theme.text-font)
|
||||
show math.equation: set text(font: _theme.math-font)
|
||||
show raw: set text(font: "Fira Code", size: 10pt)
|
||||
show raw: set text(font: "Fira Code")
|
||||
|
||||
set footnote(numbering: "[1]")
|
||||
set footnote.entry(
|
||||
@@ -340,8 +354,8 @@
|
||||
it
|
||||
} else { it }
|
||||
|
||||
show title: set text(fill: text-color, size: 1.05em)
|
||||
show heading: set text(fill: text-color)
|
||||
show title: set text(fill: text-color, size: 1.05em, font: _theme.sans-font, weight: 800)
|
||||
show heading: set text(fill: text-color, font: _theme.sans-font)
|
||||
|
||||
v(0.5em)
|
||||
|
||||
|
||||
Reference in new issue
Block a user