This one wired trick
This commit is contained in:
23
src/lib/common.typ
Normal file
23
src/lib/common.typ
Normal file
@@ -0,0 +1,23 @@
|
||||
#import "styles.typ": *
|
||||
|
||||
#let sinTable = [
|
||||
#table(
|
||||
inset: 1.5mm,
|
||||
stroke: (thickness: 0.2mm),
|
||||
columns: 4,
|
||||
table.header(
|
||||
[x], [deg], [cos(x)], [sin(x)]
|
||||
),
|
||||
[$0$], [$0°$], hlMath([$1$], color: hlGreen), hlMath([$0$]),
|
||||
[$pi/6$], [$30°$], hlMath([$sqrt(3)/2$], color: hlGreen), hlMath([$1/2$], color: hlGreen),
|
||||
[$pi/4$], [$45°$], hlMath([$sqrt(2)/2$], color: hlGreen), hlMath([$sqrt(2)/2$], color: hlGreen),
|
||||
[$pi/3$], [$60°$], hlMath([$1/2$], color: hlGreen), hlMath([$sqrt(3)/2$], color: hlGreen),
|
||||
[$pi/2$], [$90°$], hlMath([$0$]), hlMath([$1$], color: hlGreen),
|
||||
[$2/3pi$], [$120°$], hlMath([$-1/2$], color: hlRed), hlMath([$sqrt(3)/2$], color: hlGreen),
|
||||
[$3/4pi$], [$135°$], hlMath([$-sqrt(2)/2$], color: hlRed), hlMath([$sqrt(2)/2$], color: hlGreen),
|
||||
[$5/6pi$], [$150°$], hlMath([$-sqrt(3)/2$], color: hlRed), hlMath([$1/2$], color: hlGreen),
|
||||
[$pi$], [$180°$], hlMath([$-1$], color: hlRed), hlMath([$0$]),
|
||||
[$3/2pi$], [$270°$], hlMath([$0$]), hlMath([$-1$], color: hlRed),
|
||||
[$2pi$], [$360°$], hlMath([$1$], color: hlGreen), hlMath([$0$] mm)
|
||||
)
|
||||
]
|
||||
35
src/lib/styles.typ
Normal file
35
src/lib/styles.typ
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
#let stdTemplate(doc) = [
|
||||
#set text(
|
||||
size: 8pt
|
||||
)
|
||||
|
||||
#set page(
|
||||
margin: 5mm
|
||||
)
|
||||
|
||||
#doc
|
||||
]
|
||||
|
||||
#let hlMath(content, color: rgb("#fffe69")) = box(
|
||||
content,
|
||||
outset: 2pt,
|
||||
fill: color,
|
||||
)
|
||||
|
||||
#let hlRed = rgb("#ff6969");
|
||||
#let hlGreen = rgb("#76ff69");
|
||||
|
||||
#let stdBlock(content) = {
|
||||
block(
|
||||
stroke: 0.2mm,
|
||||
spacing: 1mm,
|
||||
inset: 2mm,
|
||||
content
|
||||
)
|
||||
}
|
||||
|
||||
/* Usage examples:
|
||||
#blockm("Hello", top: 10pt, bottom: 10pt)
|
||||
#blockm(#p("Paragraph inside a margin-set block."), left: 12pt, right: 12pt)
|
||||
*/
|
||||
Reference in New Issue
Block a user