forked from Michel-Liao/minimal-note
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.typ
More file actions
107 lines (85 loc) · 2.22 KB
/
lib.typ
File metadata and controls
107 lines (85 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// === Algorithmic Logistics ===
#import "@preview/algorithmic:1.0.0"
#import algorithmic: *
// === Codly Logistics ===
#import "@preview/codly:1.3.0": *
#import "@preview/codly-languages:0.1.1": *
#let printer_friendly = false
// === Template ===
#let minimal-note(
title: [Paper Title],
author: [Albert Einstein],
date: datetime.today().display("[month repr:long], [year]"),
show_outline: true,
doc
) = {
// Styling Configurations
set heading(numbering: "1.")
set figure(numbering: "1")
// Color links
show link: it => {
let default-color = rgb("#57B9FF")
let label-color = rgb("#57B94F")
if type(it.dest) == label {
underline(text(fill: label-color)[#it])
} else {
underline(text(fill: default-color)[#it])
}
}
// Packages
show: codly-init.with()
codly(
languages: codly-languages,
)
show: style-algorithm
// Title and Date
align(center, text(18pt)[*#title*])
align(center)[#author \ #date]
// Table of Contents
if show_outline {
outline()
}
// Document
doc
}
// === Prompting Boxes ===
#let color-box(header, body, color: rgb("B8F0D3"), outline: none) = {
set align(center)
box(
fill: color,
inset: 13pt,
radius: 10pt,
width: 100%,
stroke: outline
)[
#set align(left)
#place(top + left)[
*#header*
] \
#body
]
}
// To add additional box colors, follow the below function definitions and replace the color named argument.
#let green-box(header, body) = {
color-box(header, body, color: rgb("B8F0D3"))
}
#let orange-box(header, body) = {
color-box(header, body, color: rgb("FFDAB8"))
}
#let blue-box(header, body) = {
color-box(header, body, color: rgb("B5EAFF"))
}
#let solid-box(header, body) = {
color-box(header, body, color: white, outline:stroke(paint: black, dash: "solid"))
}
#let dashed-box(header, body) = {
color-box(header, body, color: white, outline:stroke(paint: black, dash: "densely-dashed"))
}
#let dotted-box(header, body) = {
color-box(header, body, color: white, outline:stroke(paint: black, dash: "loosely-dotted"))
}
#let (rule, useCase, example) = if printer_friendly == true {
(solid-box, dashed-box, dotted-box)
} else {
(green-box, orange-box, blue-box)
}