Compare commits

..

3 Commits

Author SHA1 Message Date
5a290913a2 Feat: add code function 2025-04-14 10:15:25 +08:00
9315fd36fd Feat: add header and page number 2025-04-14 09:20:30 +08:00
2d79994f43 Feat: add background color for code blocks 2025-04-14 09:12:44 +08:00
2 changed files with 17 additions and 3 deletions

1
functions/code.typ Normal file
View File

@@ -0,0 +1 @@
#let code = raw.with(block: true)

View File

@@ -1,4 +1,6 @@
#let document(
#import "functions/code.typ": code
#let default(
title: "This is a title",
authors: ((
name: "Yi-Ting Shih",
@@ -11,6 +13,8 @@
set page(
paper: "a4",
margin: (x: 1.8cm, y: 1.5cm),
header: align(right, title),
numbering: "1",
)
set text(
font: "Libertinus serif",
@@ -30,11 +34,20 @@
numbering: "1."
)
// Code section default
// Raw default
show raw: set text(
font: "Consolas",
size: 8pt
size: 8pt,
)
// Code section default
show raw.where(block: true): self => {
block(
fill: luma(240),
inset: 8pt,
radius: 2pt,
self
)
}
{ // Title
set align(center)